For processes started by pre-flow tasks and external event handlers, the owner ID of the process instance is the document ID containing the external message (in case of pre-flow tasks, this message is a form data document). So there is no general need to extract the data into variables.
If you do want to extract some data into process variables, you can either configure this activity to achieve that, or subclass this activity, as described below.
An older approach, not recommended any more, is to extract the data in a custom external event handler and pass them to the process. Only variables in input mode or input/output mode can be passed.
For general topics on listeners and external event handling, please follow this link.
The attribute specifies how variables should be initialized when the process is started via an external event, including a pre-flow task (owner type is DOCUMENT). It is a map. The value of each variable can be a MDW XPath expression (identified by starting with "xpath:") or constants.
Here are examples of variable initialization specification:
my_var_1 | xpath:/OrderHeader/OrderNumber |
my_var_2 | a Static Value |
You do not need to initialize every variable. Variables that are not specifically initialized will have null values. The XPath expression is applied to the external message that triggered the process instance. In mdw6, xpath expressions are replaced with java value expressions.
Here are examples of variable initialization through java expression:
my_var_1 | ${request['OrderHeader/OrderNumber']} |
my_var_2 | ${request.OrderNumber} |
my_var_3 | a Static Value |
The Java value expression is applied to the request variable which is created with input mode under the process.