HowTo: Defining conditions or events that determine the path(s) to follow in a BPD

Official Content
This documentation is valid for:

Introduction

To define conditions we have the following process symbols:

<fck:meta content="text&#47;html&#59; charset&#61;utf&#45;8" http&#45;equiv="Content&#45;Type"><fck:meta content="Word&#46;Document" name="ProgId"><fck:meta content="Microsoft Word 12" name="Generator"><fck:meta content="Microsoft Word 12" name="Originator"> </fck:meta></fck:meta></fck:meta></fck:meta>inclusive_gateway_icon<fck:meta content="text&#47;html&#59; charset&#61;utf&#45;8" http&#45;equiv="Content&#45;Type"><fck:meta content="Word&#46;Document" name="ProgId"><fck:meta content="Microsoft Word 12" name="Generator"><fck:meta content="Microsoft Word 12" name="Originator"> Inclusive Gateway: This type of Gateway supports situations in which more than one decision may be possible. When a signal reaches this Gateway, a complete evaluation is performed of all the conditions considered in the control. Each condition evaluated as true will result in a signal towards that outflow. There will always have to be at least one true condition.</fck:meta></fck:meta></fck:meta></fck:meta>

event_gateway_icon Event Gateway: It makes it possible to establish a forking of different paths where the decision is based on two or more events that may happen, instead of conditions.

exclusive_gateway_icon Exclusive Gateway: This type of Gateway divides the flow in two or more paths but the process flow will follow only one of these paths. The choice of the path to follow will be based on the evaluation of the conditions imposed on each path. If no condition is true, the process will be stuck in the Gateway, and for this reason the use of 'default' paths is suggested.

 

Inclusive Gateway

In this case, the condition can be defined in three different ways based on the complexity of the evaluation to perform.

These options are described below:

  1. Define an evaluation rule of each edge
  2. Define a procedure to evaluate all edges
  3. Define a procedure for each edge

Define an evaluation rule of each edge

When we are positioned on an edge we can see that it has the following properties:

eval_rule_inclusive_gateway

In this case the condition type is Rule and it is an arithmetic expression, which can be defined using attributes of the transactions included in the diagrams and relevant data together with the following operations: <,>,=,+,*, <>, -.

Example:

There is a car rental process that is started with a Rental task in which the rental details are entered in a transaction. Some of these details are: person, number of days, make of the car to be rented, etc. Next, the selected make is evaluated using the rule RentalMake = 2; what’s being evaluated here is a secondary attribute of the Rental transaction. And if the person effectively chose Chevrolet, the flow will continue through the Chevrolet subprocess.

rental_process_eval_1

Define a procedure to evaluate all edges

When we're positioned on a Gateway we see the following properties:

inclusive_gateway_properties

This is the place to define the procedure that will be executed when deciding which path to take. Once a procedure has been defined, the edges will have different properties from those we saw in the previous case, as in this case what has to be defined in each one is their value (condition code), and if it matches the value returned by the procedure it will continue through this path.

inclusive_gateway_connector_props

The procedure to evaluate the condition must have the following parameter rule and it can have a maximum of 100 characters:

Parm(in:&WorkflowProcessDefinition,in:&WorkflowProcessInstance, in: &WorkflowWorkitem, out: &conditionCode);

Where:

  • &WorkflowProcessDefinition is of WorkflowProcessDefinition type
  • &WorkflowProcessInstance is of Workflow ProcessInstance type
  • &WorkflowWorkitem is of WorkflowWorkitem type
  • &conditionCode is of Numeric(4) type

Note: The user is responsible for defining that the procedure returns a valid value, that is to say, that it matches any one of the edges.

Example:

Given the car rental process defined above we will create a procedure to evaluate the condition that has the following code:

For each
  Where RentalId = &WorkflowProcessInstance.GetApplicationDataByName('RentalId').NumericValue
    if RentalMake = 1
        &conditionCode = 1
    Else
        If RentalMake = 2
            &conditionCode = 2
        Endif
    Endif
Endfor

In addition, the parameter rule will have to be defined as explained above.

Once the procedure has been defined, it has to be associated with the Gateway through its properties, and the conditional codes corresponding to each one of them have to be defined in the edges.

condition_procedure_img

Define a procedure for each edge

When we’re positioned on an edge just like in the case of defining a rule as condition, we can see that it has the following properties:

conditional_procedure_props

In this case the type of condition is Procedure. Next, we define the procedure and each edge will be evaluated according to the associated procedure. The associated procedure must have the format defined in the previous case.

The result of the procedure must be 1 if the condition is met and the flow must go on; otherwise, it must be 0.

 

Event Gateway

In this case the condition must be evaluated in terms of intermediate events, such as:

  • Timer
  • Signal
  • Conditional

event_gateway

For the timer, the process will continue when the time specified in the event has elapsed.
On the other hand, for the signal it will continue when a signal event of throw type has been defined in an execution thread that is parallel to this one.