Using Activity Implementor ProcessStartActivity

This activity is the standard process start activity.

How to Start a Process

There are many ways to start a process. Here is a list of them:
  1. Started by an external event handler, especially the start process event handler, in response to receiving a message from external systems.
  2. Started by a parent process.
  3. Started by a pre-flow task (see Custom Web for an introduction)
  4. Started by a remote process (a process running in a different MDW application)
  5. Started by a Scheduled Job
  6. Started by a rules engine as result of constraint propagation (not yet implemented)
  7. Started directly via REST message - this is for testing purpose only and can be triggered from the MDW Studio and/or MDWHub.
The first two forms are the most common ways to start a process.

How to Initialize Variables in a Process

For processes started by another process or by a remote process, the variables are initialized through the variable binding mechanism described in the Subprocess Variable Bindings.

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.

Configure This Activity

If you do want to initialize variables from data received from external systems, you can configure the attribute "Variable Initialization" of this activity.

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_1xpath:/OrderHeader/OrderNumber
my_var_2a 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_3a Static Value

The Java value expression is applied to the request variable which is created with input mode under the process.

Subclassing This Implementor

You can subclass this implementor to perform additional tasks at the process start, although in general you may want to use a separate activity instead.