IBM BPM, V8.0.1, All platforms > Create processes in IBM Process Designer > Modeling processes > Business objects and variables

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.

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:

  1. Declare variables at the BPD level.

  2. For each linked process and service, declare variables and business objects to receive the values of the variables of the main BPD.
  3. Pass those variables as inputs to the linked processes and services that require them for their implementation.
  4. 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.
An alternative form of propagation is to define the variable type as a shared object when you create or edit your business object; that is, select the Shared Object check box. The values of a variable designated as a shared object are persisted to a data store. At each process, service or message event boundary, the local variables with the same shared object key are refreshed from the data store. See Create business objects for information about shared objects.

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.

Business objects and variables


Related tasks:
Adding a Decision service to a process
Adding a JRules Decision Service component to a service
Visualize variables