Adding process variables to a BPD

For each business process definition (BPD) created, you need to declare variables to capture the business data that is passed from step to step in your process.

In a BPD like the sample that you can build using the instructions in this section, you need to capture the ID, amount, and status of each expense that is filed for approval. With variables, the users or systems involved in each activity have the information required to complete the step so that the process can move on to the next activity.

For example, the managers involved in the Approval activity in the sample BPD cannot determine whether to approve an expense without knowing the amount.

At this stage, you can add variables that you know the overall process requires to function. When you are ready to fully implement the steps of your process, the members of your development team need to have a complete understanding of the entire data model that is required.

You can add the following variables to your BPDs:

Variables that can be added to business process definitions
Variable Description
Private Private variables are local variables that are only used within the process.
Input Input variables are mapped to values that you can pass into the current process.
Output Output variables are mapped to values that you can pass out from the current process to a parent process.
Exposed process values (EPVs) are a special type of variable that you can create to enable users to set or alter values while an instance of a process is running. EPVs allow users to adjust specific variable values as constants, thereby affecting the flow of a process, task assignments, and so on. If EPVs have been created, you can link them to multiple processes and services from the Variables tab in the Process Designer.

You can also use environment variables in JavaScripts and other implementations in your BPDs.


Procedure

To declare variables for the sample Expense Reimbursement BPD:

  1. Click the Variables tab in the Process Designer. The Expense Reimbursement process does not require inputs from another process and will not provide outputs to any parent processes, which means that a private local variable is needed.

  2. Click the Add Private button to create a new variable named request that includes a parameter for each aspect of the expense request ( id , date , amount , and status).

  3. In the details for the variable, enter request in the Name field. All variable names should start with a lowercase letter, with subsequent words capitalized like so: myVar . Do not use underscores or spaces in variable names.

  4. Select the New button next to Variable Type. Because each step of the process requires all the information about each submitted expense request, we can create a variable that is a complex structure so that we can include a parameter for each aspect of the request. A complex structure is simply a way of grouping business data that is related to the same subject, in this case the expense request that is routed by our process. Complex structures must be initialized.

  5. In the New Business Object window, enter EmployeeReimbursement in the Name field and click the Finish button. Name business objects so that each word is capitalized like so: MyType. This naming convention enables you to easily distinguish between the business objects (variable types) created and the variables that you declare. Names of business objects are case sensitive.

  6. In the Business Object editor (in the Behavior section) select Complex Structure Type from the Definition Type drop-down list.

  7. In the Parameters section, click the Add button.

  8. In the Parameter Properties section, replace Untitled1 in the Name field with id .
  9. Leave the variable type set to String.
  10. Repeat steps 7 through 9 to add parameters for type , amount , and status . Set the type and status parameters to the String variable type. Set the amount parameter to the Decimal variable type.

  11. Click Save in the main toolbar.

  12. Go back to the Expense Reimbursement BPD and click the Variables tab.

    You can see the request variable and all of the parameters established for the EmployeeReimbursement business object as shown in the following image:


What to do next

To learn more about declaring and passing variables, see Declaring and passing variables.

For an example of how to pass the request variable as input to a Rule service, see Adding a Decision service to a process. For an example of how to use the request variable as output from a Human service, see Building a Human service.

See the following topic, Adding events to a BPD, to continue to build the Expense Reimbursement sample BPD.


Related concepts:
Business objects