IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Developing business processes > Building human tasks > Create human tasks
Replacement variables and context variables
While working with templates, you might want to refer to a variable that will not be resolved until the instance has been started in the runtime environment. This variable is known as a context variable, because its value is dependent upon the task context in which it is exists (or the process context for inline tasks). If you want to refer to such a context variable in a template, use a replacement variable.
Context variables can come from many sources.
For example, they can originate from previous staff resolutions, input/output messages, custom properties and, in the case of inline tasks, from the surrounding BPEL process. They can be used in many places, including the following:
- staff queries of tasks
- staff queries of escalations
- in the description and documentation of tasks
- in the description and documentation of escalations
- in notification e-mails sent by escalations.
- durations of tasks
- priority of tasks
- the type property (business category) of tasks
- custom properties of tasks
- durations of escalations
- custom properties of escalations
Use of replacement variables
Context variables might only be available during specific periods of an instance's lifecycle (a task owner is only defined once the task has been claimed) and can resolve either to single or multiple values. Multiple values are returned in a string array (which is represented as a comma separated list when used in an email) .
In cases when you can use a replacement variable, you will simply be able to click the associated Insert Variable button and choose something appropriate from the Replacement Variable Selection window. However, you can also enter a replacement variable into a template directly by encapsulating it in "%" signs, for example, %htm:task.originator%.
- Using percent signs within variable names is not allowed.
- If you want to use a percent sign in a string within the replacement variable, then you will need to use two percent signs ("%%") instead of one.
- Variables can contain XPath expressions. If an XPath expression contains a "%" sign, it must be escaped as specified by XML (using %).
The categories shown below contain specific details on which expressions can be used and when.
- Replacement variables in process and activity descriptions
When used in descriptions for processes and activities, replacement expressions can be used to represent context variables that will be fully resolved at run time.- Replacement variables in people assignment criteria and task descriptions
When used in descriptions for people assignment criteria and human tasks, replacement variables can be used to represent context variables that will be fully resolved in the runtime environment.- Replacement variables in staff e-mails
When used in escalation-based staff emails, replacement variables can be used to represent context variables that will be fully resolved in the runtime environment.- Replacement variables for escalation duration expressions
The Escalate within value can also be represented by a replacement variable that refers to a variable that will get resolved at run time.
Adding an activity to a BPEL process
Related concepts:
Use Java methods in process snippets
Use custom properties for human tasks
Use event handlers
Related tasks:
Modify the properties of an activity
Modify the type of an activity
Work with basic activities
Work with structured activities
Modeling human workflows
Refactoring and business state machines
Related reference:
Description tab: business state machine editor
Assign people tab: Human Task editor