Mastek Blog

Test the Multiple Decision Criteria With Process Builder

25-May-2023 14:19:57 / by MST Admin

Salesforce introduced a new feature that involves multiple decision criteria in single Process Builder. Before summer 16, Process Builder can have only one criteria with true or false condition. If the first criterion is not satisfied, it will move to the second criteria

Introduction: 

Salesforce introduced a new feature that involves multiple decision criteria in single Process Builder. Before summer 16, Process Builder can have only one criteria with true or false condition. If the first criterion is not satisfied, it will move to the second criteria. There is no way to perform both the first and second criteria validation at a same time

Before beginning with process builder, we need to know about some basics of conditional coverage and decision coverage.

Multiple Condition Decision Coverage: 

To perform multiple decision criteria, we should have to cover every combination of test cases with true or false values. So, as a white box tester, we should follow the conditional coverage and decision coverage to cover all the possible output. Let us take a simple Boolean expression as an example for covering the conditional coverage and decision coverage.

Example: If {(A and B) or C}

To satisfy conditional coverage, each Boolean expression in the above statement should be evaluated as true or false values at least one time.

Test cases for conditional coverage should be followed as below,

Test case 1: A- True, B-True, C-True

Test case 2: A- False, B- False, C- False

To satisfy the decision coverage, each decision statement evaluates to true or false values at least once and also each Boolean variable should be evaluated to true or false values at least once.

Test cases for decision coverage should be followed as below,

Test case 1: A- True, B-True, C-True (111)

Test case 2: A- False, B- False, C- False (000)

Test case 3: A- False, B-False, C-True (001)

Test case 4: A- False, B- True, C- False (010)

Test case 5: A- True, B- False, C- False (100)

Test case 6: A- True, B- True, C- False (110),

Test case 7: A-False, B-True, C-True (011),

Test case 8: A-True, B-False, C-True (101)

In Salesforce, we can cover the multiple decision criteria in the single process builder. Before Summer release of 16, we can either perform one action like if case origin is email or case origin is email with priority high. There is no way to add new criteria along with previous criteria. The Process builder shown as below,

process builder

For the above issues, the white box tester was not able to validate the multiple condition statement at a time to execute the process builder action.

To overcome these type of challenges, Salesforce introduced multiple decision criteria by following these steps: 

  1. Clicking Stop button in first criteria. It opens “specify what happens after evaluating this criteria page” opens on the right side.
process builder
  1. Click “Evaluate the next criteria” which will call the second process after execution of first criteria weather it is true or false.
process builder

3.Now, we can test both actions. If the case origin is Email, it would send an email to the staff and if the case origin is email with priority high, it would create a task.

process builder

Conclusion: 

The Process Builder with Multiple decision criteria helps to test both true and false conditions at the same period of time.

Reference Link: 

https://www.tutorialspoint.com/software_testing_dictionary/decision_coverage_testing.htm
https://releasenotes.docs.salesforce.com/en-us/summer16/release-notes/rn_forcecom_process_multiple_actions.htm

Topics: Salesforce

MST Admin

Written by MST Admin

Subscribe to Email Updates

Lists by Topic

see all

Posts by Topic

see all

Recent Posts