Simple Decider and Cloud Functions

Introduction

The result of a Process Instance can be configured by setting the Execution Variables from a Cloud Function.This can be useful for users who wish to set the decision and overall result of a Process Instance from within a Cloud Function.

Users can also set the status of a Process Instance to 'review' from the Cloud Function. For more information on the 'review" status and manual review process, see the Manual Review Guide.

Using the Simple Decider

The Simple Decider activity can be used to review all checks within an ID&V flow and provide an overall result of "PASS" or "FAIL" to be sent to the Summary Report. A "PASS" value is returned when all checks within the flow pass. Otherwise, a "FAIL" result will be returned. The "Review" status indicates that a manual review is required for a decision is ultimately made as to whether the Process Instance will pass or fail.

It is recommended that when including the Simple Decider activity in the Process Definition, it should be placed after all Cloud Function, Document Capture and Face Capture activities, and before the Write Summary Report activity.

The results of a Simple Decider are accessed from the overallOutcome session data found inside the _checks results. For more information, see the _checks session data tables .The result will return the "PASS" or "FAIL" value. For example, the result can be sent from a webhook.

Example:

JSON
Copy

Setting Execution Variables

The overall result of a Process Instance can be configured from within a Cloud Function. This will override the overall outcome and is passed to the Simple Decider in the 'Derive Decision From' input parameter.

To change the outcome of a Process Instance successfully, the Simple Decider is required as this activity provides the $decision variable that will be altered by the Cloud Function. Without the Simple Decider activity, any changes made to the overall outcome within the Cloud Function will be ignored when writing to the summary report.

The Process Definition above demonstrates a correct configuration where the Execute Cloud Function activity is connected to the Simple Decider. The Simple Decider is then connected to the Write Summary Report activity.

The example below shows how to set an execution variable in a cloud function to define the status of a process instance. However, execution variables may be used for many other reasons such as setting variables to be picked up by other activities or to control the execution flow based on (logic) gateways.

Step 1 - Configure the Cloud Function

To configure the Cloud Function. The code sample below describes how to set the overall result to 'approve' and the Simple Decider decision to "FAIL".

For example:

Python
Copy

Possible values for the decision variable include:

  • "PASS" - Set the overall decision to pass.
  • "FAIL" - Set the overall decision to fail.
  • "REVIEW" - Set the overall result to review. For more information, see the Manual Review Guide.

Step 2 - Configure the Simple Decider Activity

To ensure that the execution variable configured above influences the Simple Decider activity in the Process Definition, the 'Derive Decision From' property must be set. In this case, the decision variable will be used, which has been configured to return a "FAIL" result.

From the Process Designer, click the Simple Decider activity and expand the 'Input Parameters' dropdown item from the right-side contextual menu.

The Simple Decider activity must be placed after the Cloud Function activity to ensure the execution variable is found.

Expand the 'Derive Decision From' parameter and enter the ${decision} to use the decision variable as the overall result.

This will ensure that regardless of the outcome, the overall result will match the value defined in the decision variable defined in the code sample above as "FAIL".

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard