IBM BPM, V8.0.1, All platforms > Create processes in IBM Process Designer > Modeling processes > Building services > Building a Decision service
Adding and modifying Decision service variables
Each IBM BPM Decision service has a set of input, output, and private variables that are declared for that service. The business terms and phrases that you define as variables are available for you to use when you are writing rules.
For example, the variable appear in the Content Assist menu in the rule editor.
A Decision service might require input or output variables, or both. A service can also include private variables for processing that occurs only within the service. For more information about variables in a Decision service, refer to the related topic "Declaring variables for a service."
Procedure
To add or modify variables for a Decision service, complete the following steps:
- Make sure you have selected the Decision service where you want to add or modify variables.
- Click the Variables tab.
- Existing variables are organized into three sections: Input, Output, and Private. Click the plus sign next to a section to see the variables in that section.
- You can add a variable to the Decision service by completing one of the following steps:
- Click Add Input to add a variable that you can use for input into a rule.
- Click Add Output to add a variable that you can use for output from the rule.
- Click Add Private to add a variable that applied only to the current Decision service.
The following information applies to variables:
- Variables are mapped to the IN, OUT or IN-OUT parameter directions automatically, depending on how the variable is used in the rule.
For example, a variable that is referenced in a rule but is not updated at run time is identified as an IN variable. For more information about parameters, refer to the related topic "Adding variable types and business objects to a Decision service."
- The input or output designation for variables might affect the way the Decision service runs, but the designation is not significant when you are authoring BAL rules because input, output and private variables are all referenced identically in a BAL rule.
- If you create an input and an output variable that have the same name, only one variable is actually created. The variable is used for both input and output at the Decision service level.
- Exposed Process Variables (EPVs) are managed at the process application level, and allow the IBM BPM administrator to specify designated users who can set or alter variable values using the Process Admin Console while instances of a process are running. The Decision service can pick up an EPV variable that has been created in a process application and use the variable in a rule to affect the way that the Decision service runs. For more information about EPVs, refer to the related topic "Creating exposed process values."
- You can modify or view the properties of an existing variable. Click to highlight the variable name, then modify the variable properties under the Details section, or view the Default Value of the variable if a default value has been defined:
- Select an existing Variable Type, or define a new variable type.
- Click Select to set or modify the current variable type.
- Click New to define a new variable type. For more information about defining a new variable type using the Business Object editor, refer to the related topic "Adding variable types and business objects to a Decision service."
What to do next
You must initialize private variables before running the Decision service. In IBM BPM, all private variables must be initialized before you use them in a business process definition or Decision service. If you do not initialize a variable, you may receive runtime errors or notice that the controls to which the variable is bound do not behave as expected. For more information, refer to the related topic, "Initializing complex variables and lists."
- Default rule variables and parameters
Pre-defined variables and variable types are deployed from the System Data toolkit when IBM BPM is installed.- Adding variable types and business objects to a Decision service
In IBM BPM, you can create a custom business object (variable type) for the Decision service. The variable type becomes part of the data for the process application, and is available for all business process definitions (BPDs) and services included in the process application.- Variable types
You can define a Decision service variable by first specifying the name of the variable, then setting the variable type. The variable value can be a simple data type such as a string, integer, or date.
You can also define a complex variable type using a business object that contains parameters.
Related tasks:
Scenario: Creating a Decision service in a Personalized Notification process
Adding variable types and business objects to a Decision service
Create exposed process values