Rules and Actions Execution Sequence and Mechanics

Sequence of execution rules

The sequence of execution is the following:

  1. Step Validation Rules - if any rule isn't met then an error is shown and you can't move forward.
  2. Step Actions - Actions that are placed inside a Step are executed regardless which way/connector a flow will go by.
  3. Connector Validation Rules - These rules are evaluated to decide which connector a flow use (i.e. which path to take). If multiple connectors rules are met then the one with a higher order will be used (as defined in the Connector tab of the Step properties).
  4. Connector Actions - Once system decided which connector to use, this connectors actions will be executed before the next step becomes active.

Step Actions: Before and After Proceed

When an action is placed into Step, you can specify when you want an action to be executed when that step becomes active:

  • before step = the action will be executed as soon as the step becomes active
  • after step = the action will be executed after the step has been proceeded and all validation rules have passed successfully.

Execution Mechanics

After step actions/rules, connector actions/rules, and next step's before step actions are put in the same transaction. If the transaction appears to be not enough to proceed, one more transaction will be added.

For example, there are two steps A and B connected. There are two main cases of execution:

No "before step" rules on Step B (1)

  1. Step's A After step rules and connector rules. If met,
  2. Step's A After step actions and connector actions
  3. Step's B Before step actions

There are "before step" rules on Step B (2).

First request:

  1. Step's A After step rules and connector rules. If met,
  2. Step's A After step actions and connector actions
  3. Step B moved to Pending status.

Second request:

  1. Closest scheduled Pending tasks job processes the rules.
  2. If rules are not satisfied, Step B will remain Pending, the previous operation (d) will be reiterated with next Pending tasks job. If rules are satisfied, Step's B before step actions are executed and Step is activated.

Within one request, if any rules are not satisfied, or there was a problem with executing of an action, data is rolled back.

Best practices for using After/Before step actions and rules.

  • Only use Before step actions and rules where necessary (e.g. Start Subprocess action, or specific business cases for rules). After step actions/rules cause less load to the system.
  • Mind the difference between connector actions and after step actions. After step actions are executed always. Connector action are only executed if their connector was the path the Process instance went.

2 Comments

Harry

Is it correct that a step should only enter the pending status if there is a before-step rule? It seems that having only a before-step action also makes the step pending until the 'Pending Tasks' job executes.

Work-Relay Administrator

A before-step action makes the step pending if it's the first step in a process, otherwise it will process upon completion of the prior step. Other scenarios that put a step into pending status are 1) step uses a Start Date Config setting to delay activation until a specified time event, 2) if one or more constraints are on a step and the process is waiting for other branches to complete.

Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.