Replacement expressions in descriptions and staff assignments

Template descriptions for human tasks, activities and processes can contain replacement expressions that are evaluated when this instance is started.

This means that each task, staff assignments, or process or activity instance of the same model can have different descriptions and replacement expressions. These descriptions will depend on the contents of process variables or the input or output message of the human task.

Replacement expressions in process and activity descriptions

The replacement expressions in process and activity descriptions must match the following syntax:
%[<variableName>]\[<partName>][\<xpath>]%

The name of the variable is optional in cases where a default message is defined. For example, the description of an invoke activity uses the invoke's input message as the default variable.

Table 1. A list of all the default messages that are defined for process entities
Entity Default Message
Process The input message of the process
Invoke The input message of the invoke.
Human task (embedded inline in the process) The input message of the human task.
Receive The message received
Pick (Receive choice) The message received
Reply The reply message

For a process instance description, the default variable for the replacement is the actual input message that started the process. For processes with multiple creating activities the replacement string must be applicable for all the different types of input message, and the variables of the process are not initialized when the process description is resolved. Thus, the input message of the process is the only source that can be used in the replacement strings.

Note: The part name of the expression can only be specified for interface typed variables.
A description can contain multiple replacement expressions. For example, the description of an activity can be the following:
Waiting for '%user\name%' to return '%book\title%'
Here, the replacement expressions refer to the data object variables inside the process that are named book and user, so no part name is specified. The replacement expressions just contain the variable name and the XPath expression, which select the top-level elements name and title, respectively. For example, the expression can be resolved during runtime to:
Waiting for 'Anke' to return 'Computer Networks'

Replacement expressions in staff assignments and task descriptions

Replacement expressions for staff assignments and descriptions in human tasks can contain the contents of variables and messages. In addition resolved staff assignments of sibling inline tasks can be used from other inline tasks.

Stand-alone human tasks

The following table lists all expressions, that are available for stand-alone human tasks (i.e. tasks that are not embedded inline in a process). When these expressions are used inside descriptions as well as staff assignments, they must be enclosed in '%' characters.

Table 2. A list of all expressions that can be used in stand-alone human tasks.
Type of variable Expression Description
Staff Variables htm:task.originator task originator name
  htm:task.owner task owner name
  htm:task.starter task starter name
  htm:task.administrators list of task administrators
  htm:task.potentialOwners list of potential task owners
  htm:task.editors list of task editors
  htm:task.readers list of task readers
  htm:task.potentialStarters list of potential task starters
     
Task variables htm:property.CustomProp value of task's custom property 'CustomProp'
  htm:task.displayName default task display name
  htm:task.description default task description
  htm:task.instanceID task instance id
  htm:task.Business Process Choreographer ExplorerURL Business Process Choreographer Explorer URL to task/escalation details
  htm:input.[part][\XPath]

(or htm:input.part[\XPath])

data from task's input message

(Process Server messages usually have a single part, in which case the part name does not have to be specified. When using messages with multiple parts then the syntax in parenthesis has to be used. Also see the notes below.)

  htm:output.[part][\XPath]

(or htm:output.part[\XPath])

data from task's output message

(Process Server messages usually have a single part, in which case the part name does not have to be specified. When using messages with multiple parts then the syntax in parenthesis has to be used. Also see the notes below.)

  Note that task instances have no default message.  
     
Escalation variables htm:escalation.description default escalation description
  htm:escalation.expectedTaskState escalation's expected task state
  htm:escalation.instanceID escalation instance id
  htm:escalation(escalationName).receivers escalation receivers
Note: You can use either %htm:input.\XPath% or %htm:output.\XPath% to refer to input or output parameters of the operation defined for a task interface.
For example, the WSDL code shown below defines a task interface comprising of an operation with one input parameter (input1) and one output parameter (output1). In this case, the expressions %htm:input.\input1%, %htm:output.\output1% can be used to reference the defined parameters.
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:tns="http://variables/variablesInterface" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="variablesInterface" targetNamespace="http://variables/variablesInterface">
  <wsdl:types>
    <xsd:schema targetNamespace="http://variables/variablesInterface" xmlns:tns="http://variables/variablesInterface" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <xsd:element name="operation1">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="input1" nillable="true" type="xsd:string"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="operation1Response">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="output1" nillable="true" type="xsd:string"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:schema>
  </wsdl:types>
  <wsdl:message name="operation1RequestMsg">
    <wsdl:part element="tns:operation1" name="operation1Parameters"/>
  </wsdl:message>
  <wsdl:message name="operation1ResponseMsg">
    <wsdl:part element="tns:operation1Response" name="operation1Result"/>
  </wsdl:message>
  <wsdl:portType name="variablesInterface">
    <wsdl:operation name="operation1">
      <wsdl:input message="tns:operation1RequestMsg" name="operation1Request"/>
      <wsdl:output message="tns:operation1ResponseMsg" name="operation1Response"/>
    </wsdl:operation>
  </wsdl:portType>
</wsdl:definitions>
Note: In addition, expressions like %htm:input.part[\XPath]%, and %htm:input.part[\XPath]% can be used to refer to input and output parameters associated with the different WSDL message parts defined for a task operation. Currently, only single-part messages are generated, so it can only be used on expressions that exclude message part names.

For example, the expressions %htm:input.operation1Parameters\input1%, %htm:output.operation1Result\output1% are valid and equivalent to %htm:input.\input1%, %htm:output.\output1% .

Inline human tasks

In addition to the expressions in the previous table, a human task that is embedded inline in a process can also use the expressions listed in the following table for staff resolution. Note, that the description of an inline human task is resolved by the Business Flow Manager (BFM) and must therefore be modeled to use the syntax described in the previous section.

Table 3. A list of the expressions that can be use with inline human tasks.
Type of variable Expression Description
Process variables wf:variable.VariableName\[part][\XPath] 'VariableName\[part][\XPath]' is passed to BFM to resolve the variable/expression.
  wf:property.customPropertyName The 'customPropertyName' is passed to the BFM to resolve the custom property.
     
Inline staff variables wf:process.starter The starter of the process.
  wf:process.administrators The administrators of the process.
  wf:process.readers The readers of the process.
  wf:activity(activityName).potentialOwners The potential owners of either the current activity or the activity named in brackets
  wf:activity(activityName).owner The owner of either the activity named in brackets
  wf:activity(activityName).editors The editors of either the current activity or the activity named in brackets
  wf:activity(activityName).readers The readers of either the current activity or the activity named in brackets

Note that inline staff variables which refer to sibling activities can only be resolved if the referred activity is also an inline human task and is already started at the point in time when the staff resolution happens.

Related tasks
Adding a human task to a business process

Related information

Assigning human tasks
Human task editor

Feedback
(C) Copyright IBM Corporation 2005, 2006. All Rights Reserved.