For each process or service flow that you create, you must declare variables to capture
the data that activities in the process or service flow use.
About this task
You can add the following variables to your process or service
flow:
Table 1. Variables available for addition to processes and service
flows
Variable |
Description |
Private |
Local variables that are used only within the process. |
Input |
Variable that represents input data passed to the current process or
service. |
Output |
Variable that represents output data that the current process or service
returns to its caller. |
Exposed process variable (EPV) |
Special type of variables that you can create to set or alter values while
instances of a process are running. |
Only process variables that are marked
as process instance identifiers can be used for instance-based correlation of intermediate message
events that use the SCA triggering mechanism. A process instance identifier variable can be a
private, input, or output variable, and can be a simple or complex variable type.
Procedure
If you want to add an exposed process variable, click Exposed Process
Variables, and then select the EPV from the list. If you want to add a private, input,
or output variable, complete the following steps:
- Open your process or service diagram.
- In the Variables tab, click Add
Private, Add Input, or Add
Output to create the corresponding variable.
Note: If an input variable is a complex
type and you are passing it from a process to a service, it will be
passed as a value. If you want the updated value to be returned, also
declare it as an output variable. If the complex type is a shared
business object, you do not need to return it as an output because
the updates that are made in a service will become visible to everyone
who uses the shared business object.
- In the Details section:
- Type a variable name in the Name field.
Note: Variable names start with a lowercase letter, with subsequent
words capitalized, for example: myVar. Do not use
underscores or spaces in variable names. Variable names are case-sensitive.
- Click Select next to the Variable
Type field to select the type of the variable.
Custom
business objects that you created are also listed.
- Optional: Type a description of the variable
in the Documentation field.
- Optional: If you want your variable to be
an array, select Is List.
- Optional:
To set a default value for the variable, in the Default Value section,
select Has default and enter the value in the corresponding field.
Note: For complex business objects, the default value script must declare a variable and return it
by specifying the last line as the variable name. For
example:
var autoObject = <new_instance>;
...
autoObject
- Optional: To include a process variable in the business data that users can
view and search in Workplace, select Expose in work environments, and type an alias in
the Alias field.
Tip: The search alias must be unique to the variable type throughout the workflow server
on which the process runs. If a variable is used in parent and nested processes, use the same search
alias if you want search results to include all related processes.
- Optional: To include the variable values in
the data that is collected and used to create reports, in the Performance
Tracking section, select Track this variable.
-
To declare a variable as a secondary process identifier, select Process Instance
Identifier.
While it is possible to mark any variable as process instance
identifier, it is advisable to use a variable for this purpose that is not too complex.
Important: The value that is written to the variable must be unique for each instance of the
process. Because variables that are selected as process instance identifiers can be written to only
once, be careful during initialization, data mapping, pre-assignments, and post-assignments to avoid
it ever being written to twice for an instance. Writing any value to such a variable more than once
causes an error.
Tip: If you clear the selection for a variable that is already
used for correlation, the variable is marked with an error icon on the Data
Mapping tab.
Variables that are marked as process instance
identifiers can be selected to be used for correlation, and are indicated in variable selection
dialogs by the text [Identifier]
.
- Click Save or Finish Editing.
What to do next
The process or service includes variables that can be passed
to activities or services, by mapping input and output variables.
If you have a coach in the diagram, the variables are directly available
inside the diagram, and can be dragged in the layout window.