Connectors Conditions and Rules

If you have more than one output connector from a step, you must either add conditions to all the connectors except the one you want to use as a default connector, or you must start parallel branch for the non-default connectors. There is always should be a default connector to make sure the process doesn't get stuck.

Conditions

Click on connector (1) and expand "Conditions" section (2).

Click on "add" link (3) to open Connection conditions popup.

Conditions can have different types:

  • Formula - logical expression that should return result of boolean type (4):
  • Query - the value from specified object field (5). If more then one record matches query conditions, the first value will be taken.

Query can be in Standard and Advanced modes. The difference between them is that the Standard option allows you to enter conditions based on the Data Source of this process, while the Advanced option allows you to select ANY available Data Source Object.

If there are more than one condition, user can configure their logic using the Index number of the conditions. E.g., if set {1} AND ({2} OR {3}) to make this rule work, condition 1 and one of conditions 2 or 3 must be true.

  • Flow Step Status (6) - it simply checks defined step(s) for one or several statuses. User can select any step from any process:
  • Call Apex (7) -  executes specified Apex Class with given parameters and returns the result. Result should have boolean type.

Apex class should implement WR_BPM.WorkflowCallApexRuleInterface. See an example in Step Rules article - they are the same.

If the configuration in the Apex conditions return true, system will allow the process proceed through this connector.

Conditions will be shown in the proper section (8). To change (edit, remove) them user should click "Edit" link (9) and he will go to Connection conditions popup again. If there are more than one conditional expression have been created, their logic will be shown below (10):

Conditions can be removed by clicking "Clear" button (11) on the Connection conditions popup.

Note: "Clear" action saves connector automatically and can't be undone.

Conditions are executed in the order they are specified. The system will go to the first path that matches conditions. See proper article.

The system will evaluate all conditional connectors first (and you can sequence how you want them evaluated) and if none match then it does the default connector. If a conditional one is executed the default one doesn’t (unless the conditional is also parallel, in which case it might still run the default connector)

Rules

Rules are special conditions that prevent connector from being proceeded on.

Click on connector (12) and expand "Rules" (13).

Click on "add" link (14) to open popup (15).

General configurations of connector rule are:

  • Name - used just for comfort and does not affect rule execution
  • Status - rules can be active (working) or inactive (e.g., temporary disabled).  
  • Error Message - user must enter the error message. It will be shown if the rule matches defined conditions.

Rule, if added, must have conditions configured and they must return boolean result (true or false).

Note: rule prevents connector from further going on - an error message will be shown and no proceeding will be when rule is matched (conditions return true).

Rules can have the same different types as conditions:

  • Formula:
  • Query:

The rule with type "Query" has a "Rule "settings (16) that allow user to manage if connector should be blocked when rule returns true or false.

  • Flow Step Status:
  • Call Apex:

Apex class should implement WR_BPM.WorkflowCallApexRuleInterface. See an example in Step Rules article - they are the same.

Save configured rule.

Rules will be shown in connector properties. They can be deleted (17),  added to library (18), or edited by clicking rule name (19).

"Clone" button (20) will appear when the rule is being edited. After clicking it system will ask for cloned rule name. After clicking "Apply" button an edit form for cloned rule will be shown.

6 Comments

Harry

I am trying to create a conditional connector of type "Flow Step Status." I fill in all menu items in the "Flow Step Status Config" area except 'filter'. When I try to save there is an error: "You should create at least one condition." In the conditions section it says "* Here you must provide a conditions to search a data source records for the process version."

Work-Relay Administrator

Harry - you need to select conditions to identify which datasource record you want the Flow Step Status to check. Since Flow Step Status can check objects other than the context object datasource, you need to narrow down the record or records you want to check the Step status on by providing the appropriate conditions.

Andrew

I am trying to create a parallel connector that will execute if a decision is not received within x amount of hours. I have a manual step which proceeds to a decision step. Where do I put the additional step to 'check' if a response isnt received then follow that path. Should this be off the original manual step with conditions like if Decision process is pending or in progress?

Work-Relay Administrator

If "A" is your Manual step, which is followed by Decision step "B", then you can start a parallel branch after A and put a System step "S" there. On this System step, put a Before step rule, that will activate this step after the wait period. Ex. if the wait period is 3 days, the expression may look like
{$System.Date} < {$Cursor.StartDate} + 3
On this System step, you may have before step action(s) that will do what you need. System step will activate anyway - no matter decision step was completed or not - so when completing the Decision step, you may update some variable in the process, and on those before step actions of a System Step, define condition to look at whether Decision step (B) was completed or not.

Andrew

Thank you. So for a delay in minutes the syntax is?

{$System.Date} < {$Cursor.StartDate} + MINUTES(3)

Work-Relay Administrator

I think the correct option is
{$System.DateTime} < {$Cursor.StartDate} + MINUTES(3)

Add your comment

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