Creating the Process Variable

You can store data about the instance in process variables. We will define a process variable of type ExpenseReport to store the expense report data in each instance.

Process variables can be of any type, such as a string or a decimal. A process variable does not have to be a BPM object. We use a BPM object here to keep things simple, so we only need to keep track of one variable and thus handle all of our information in one place. Depending on your particular situation, you may or may not find this to be the best strategy.

Note that while BPM object definitions are a part of the project, process variables are defined for each process. If you had another process where you wanted to use the ExpenseReport object, you would need to define a process variable in it.

To create the process variable:

  1. In the Project Navigator, expand Processes, then select Expense Report.
  2. Make sure the Variables window is visible. It is usually on the far right side of the screen. If it is not visible, click Window > Show View > Variables (Variables icon 
				). The Variables window has two sections: Project, for project variables, and Instance, for process variables.
  3. In the Instance section of the Variables window, click the Add (Add icon 
				) icon . A variable entry is added to the process variable list. This variable has a default name and properties that you edit in the following steps.
  4. Change the Name property to report.
  5. Click on the Type property, and click the Browse button (...). The Type dialog box appears.
  6. In the Type list, select <Component>. The Component section of the Type dialog appears.
  7. Expand ExpenseManagement, then Catalog, and then ExpenseComponents.
  8. Select ExpenseReport, and click OK. The variable type is changed to ExpenseReport.
  9. Still in the Variables window, right-click on the report process variable, and click Map as process incoming argument (Map as Incoming Argument icon 
				). The Argument Mapping dialog appears. An argument set called BeginIn has been defined with one argument called reportArg. The Create Expense Report global creation activity will pass an ExpenseReport object through this argument, and thus into the report process variable that is mapped to it.
  10. You can map arguments manually in the Argument Mapping dialog. However, for the purposes of this tutorial, the only required mapping happened automatically by the Map as process incoming argument command you executed in step 8.
  11. In the Attribute Mapping dialog, click OK, and save your changes.

After completing this task, the Variables window should look like this:

Figure 1. Variables window with report process variable

In the following task you will define a presentation to expose the BPM object to the users who will input the expense report.