Prev Next

Initialize Variables and Conditions

For a BPMN simulation model, you can initialize your variables in an Execution Analyzer script. You can also initialize these variables in the Tagged Values of the first Activity element of the process, which gives you greater flexibility in adding and changing variables as the simulation proceeds. Similarly, you can define the conditions and values to apply at the various decision points (Gateways) in the process, in the Tagged Values of the Sequence Flow connectors.

If you want to incorporate a user-interface into your simulation process, using Win32, you again use Tagged Values to identify the dialog or prompt to display, in the Activity element just prior to the point at which the value or decision is processed.

For the simulation of UML diagrams, variables inside the 'sim' object and 'this' object are displayed in the Local Variables window.

Access

Display the Tagged Values window, using one of the methods outlined here.

Ribbon

Start > Explore > Properties > Tagged Values

Show > Portals > Window > Properties > Tagged Values

Keyboard Shortcuts

Ctrl+Shift+6

Initialize Variables

  1. On the diagram, click on the first Activity element in the process.
  2. In the Tagged Values window, click on the drop-down arrow of the taskType 'value' field, and select 'Script'.
  3. In the script 'value' field, type in the appropriate JavaScript code, such as:

    sim.loan=true; sim.status="undefined';

Define Conditions

  1. On the diagram, click on a Sequence Flow connector that issues from a Gateway element.
  2. In the Tagged Values window, click on the drop-down arrow of the conditionType 'Value' field, and select 'Expression'.
  3. In the conditionExpression 'Value' field (<memo>*) click on the button to display the Tagged Value Note window. Type in the appropriate JavaScript code, such as:
         sim.status=="Hold"
  4. Click on the OK button. The statement text displays as a label of the connector.

Incorporate Win32 User Interface

  1. On the diagram, click on the Activity element that represents where the decision is made.
  2. In the Tagged Values window, click on the drop-down arrow of the 'taskType value' field, and select 'Script'.
  3. In the 'script value' field, type in the appropriate JavaScript code, such as:
         dialog.Screen1.Show=True;
    (This statement displays the dialog Screen1. You can temporarily hide the dialog by changing 'Show' to False.)

Learn more