Declaring and passing variables
Variables capture the business data that is passed from step to step in a process.
The variables are local to a business process definition (BPD)
or service. You cannot reference a variable from another business
process definition or service. Variables contain the values or references
to business data. To propagate the business data values and references,
you must properly declare the variables and pass them to the linked
processes, services, and message events.
Note: When you use the Activity
Wizard to create a service to implement an activity, you can pick
the variables from the main BPD to use as input and output. When you
do, the Activity Wizard automatically declares the variables for the
resulting service and completes the data mapping for the activity.
You can use the Activity Wizard to create Human, Rule, and General
System services.
The general procedure for passing variables is:
- Declare variables at the BPD level.
- For each linked process and service, declare variables and business objects to receive the values of the variables of the main BPD.
- Pass those variables as inputs to the linked processes and services that require them for their implementation.
- Pass the variables from the linked processes and services back up to the main BPD as outputs when you want the main BPD to be aware of changes made to the variables in the linked processes or services.
When passing variables from a process to a linked process, their types should be compatible. For example, a string variable in a process can only be passed to a linked process if this linked process has a string variable declared as an input variable.