Directing a percentage of work to a specified processing path
In Pega Platform™, you can use a condition in a Fork connector to direct a percentage of total throughput — based on random selection — along a specific processing path. The system makes the decision by comparing the percentage setting you define for each connector with a randomly generated number; a case's properties or transaction data are not factors in the decision.
This article describes how to take advantage of Fork connector percentage conditions in a typical implementation.
Use case
Management wants to re-configure an expense report approval process so a small sampling (about 5%) of the total are audited before they are finalized and paid. The process must be automated to enforce the quantity and randomness of the sample.
Currently, a manager manually directs cases to auditing at their discretion by invoking a flow action on the user form. Although the flow action has a Likelihood setting of 5%, the system cannot control whether the manager selected the cases at random, or confirm the actual percentage.
Here is the diagram of the current process:
Add a Fork shape that will conditionalize the process so the system diverts 5% of reports to the auditing assignment before the reports are approved for payment. Using fork connectors that rely on decision logic such as when conditions, map values, or decision trees are not applicable.
Adding the percentage connectors
To add the connectors:
- Open the process in the Process Outline view.
- Disconnect the "Approve" and "Audit" connectors from the "Manager Approval" Assignment shape.
Currently, the Approve connector has a likelihood of 85% and the Audit connector likelihood is 5% for a combined likelihood of 90% (the Reject likelihood is 10%). - Select the "Select a Decision" shape from the Shape palette.
- Place the Select a Decision shape to the right of the assignment.
- Select the Decision shape and open its properties panel.
- Enter Finalize or Auditin the Step Name field.
- SelectFork in the Type field.
- Click OK to close the panel.
- Reattach the connectors to the Decision shape. By default, they employ a Result condition; [Status] labels appear on the connectors.
- Select the Approve (top) connector and open its Properties panel.
- Select Percentage in the Condition type field
- Enter 95 in the Percentage field
- ClickOK to close the dialog.
- Select the Audit connector (bottom) connector and open its Properties panel.
- Select Percentage in the Condition type field
- Enter 5 in the Percentage field
- Click OK to close the dialog.
The connectors use the percentage values as the default connector labels as shown here: - Add an Approve flow action connector between the Manager Approval assignment and the Decision shape. Assign a likelihood of 90% to the flow action.
When finished, the process looks like this: - Save the flow.
As a result of your reconfiguration, the probability is that of 100 approved reports, 5% of them will be audited, and the rest will go directly to the Finalize utility.
Behind the scenes
When you specify percentages, the system creates numerically-sequential "buckets" that are based on increments of 1.
- For instance, if you specify percentages of 80% and 20%, the system creates two buckets; one for 1 to 80, and another for 81 to 100.
- If the percentages are 50% each, the buckets are 1 through 50, and 51 through 100.
- In designs where there are For 10%/10%/80%, the system creates three buckets - 1 through 80, 81 through 90, and 91 through 100.
During processing, when a case reaches the fork, the system randomly generates a number of between 1 and 100, evaluates it against the conditions, and advances the flow to the appropriate action.
What's the difference between likelihood percentages and Percentage conditions?
In general, likelihood percentages available on some connector condition properties panels are informational labels based on historical or projected throughput patterns, and are commonly used for estimating resource requirements. In contrast, Percentage fork connector conditions actively control the case's direction when the system performs the decision at the Fork shape.
Things to remember
When using fork connector Percentage conditions, keep in mind:
- You can only use them in combination with other Percentage conditions or an Else condition.
- The sum of percentages cannot be greater than 100.
- If the sum is less than 100, always include a connector with an Else condition. Otherwise, the flow might become stuck.