WebSphere Lombardi Edition 7.2 > Modeling processes > Basic modeling tasks


Add process variables to a BPD

For each BPD that you create, 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 we're building in this section, you need to capture the ID, amount, and status of each expense that is filed for approval. With variables, the end 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 our sample BPD cannot determine whether to approve an expense without knowing the amount.

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

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. See Manage and mapping variables to learn variable implementation details like the following:

You can add the following variables to your BPDs:

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 end users to set or alter values while an instance of a process is running. EPVs allow end 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 Designer.

To declare variables for the sample Expense Reimbursement BPD:

  1. Click the Variables tab in the Designer as shown in the following example:

    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 Variable Type dialog, enter EmployeeReimbursement in the Name field and click the Finish button.

    Name variable types so that each word is capitalized like so: MyType. This naming convention enables you to easily distinguish between the variable types that you create and the variables that you declare. Names of variable types are case sensitive. See Create custom variable types for more information.

  6. In the Variable Type 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 as shown in the following image:

  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 variable type as shown in the following image:

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

Parent topic: Basic modeling tasks

+

Search Tips   |   Advanced Search