Extensible Checks
Introduction
Extensible checks enable users to expand the available verification checks using a Cloud Function. For example, users may want to include address verification data as part of the check results.
Any additional check added can be viewed within the Process Instance details page where a full map of all checks performed by the Finalizer can be found.
This document will demonstrate how to configure a Cloud Function that initializes an extensible check, configure the Process Definition to include the Cloud Function and Simple Decider, and finally review the results within the Process Instance detail page.
Step One - Configure the Cloud Function
- Navigate to the Cloud Function page found on the left-side navigation bar of the Backoffice application.
- Click the 'New Cloud Function' button at the top of the Cloud Function page.
- A pop-up window will appear where a Cloud Function can be created from scratch or from a predefined template. In this example, a Cloud Function will be created from without a template.
- The example below demonstrates a generic implementation of an extensible check called
newCheck
.
Example:
import json
from cfresults import Outcome, Result, OverallResult, OverallResultEncoder
results["textField"] = "this is text from CF"
overallResult = OverallResult(Outcome.APPROVE, {})
cfResults = json.loads(OverallResultEncoder().encode(overallResult))
results["cfResults"] = cfResults
# Get the _checks table and store inside the checks variable.
checks = params["vars"].get("_checks", {})
# Add a new entry to checks titled 'newCheck'
checks["newCheck"] = {
"check1" : { # Add a new object inside the newCheck
"outcome": "PASS", # Set outcome to pass
"valid" : True,
"metaData": { # Define metaData
"additionalData": "Additional data and information"
},
"exampleResult": {
"score": 0,
"quality": 0,
"probability": 0
},
"exampleField": True
}
}
pvars = {"_checks": checks}
results["executionVariables"] = pvars

The example above demonstrates the basic structure when defining extensible checks within a Cloud Function.
- The
_checks
table containing all checks is stored in a new variable namedchecks
. checks.update()
will allow users to update the table of checks and define a new, JSON formatted map of check values.- A new extensible check is defined called
newCheck
. - Inside the
newCheck
is acheck1
object. This object can be populated with an outcome and additional objects such as theexampleResult
object. - The
outcome
will define the status of the check that will be passed to the overall outcome of the Process Instance. Only the firstoutcome
will be used for each object that is provided inside a check, and this value must be defined outside any other object . metaData
can be used to define additional information about the check. This object is used for informational purposes and will not validate any outcomes contained within.
Example:
import json
from cfresults import Outcome, Result, OverallResult, OverallResultEncoder
results["textField"] = "this is text from CF"
overallResult = OverallResult(Outcome.APPROVE, {})
cfResults = json.loads(OverallResultEncoder().encode(overallResult))
results["cfResults"] = cfResults
checks = params["vars"]["_checks"]
checks["newKey"] = {
"key1" : {
"outcome": "PASS",
"valid" : True,
"key2": {
"outcome": "PASS"
},
"exampleField": True
}
}
pvars = {"_checks": checks}
results["executionVariables"] = pvars
In the example above, the outcome
will be "PASS". The outcome
contained within the metaData
will be considered metaData and not an outcome
object. The outcome contained within the nested key2
object comes after the outcome of key1
. Only the first outcome
will be read when calculating the overall outcome.
Alternatively, multiple objects can be defined within a check, each with their own outcome
. In the example below, both key1
and key2
outcomes will be passed to the overall outcome. Note that key2
is not nested within key1
.
Example:
import json
from cfresults import Outcome, Result, OverallResult, OverallResultEncoder
results["textField"] = "this is text from CF"
overallResult = OverallResult(Outcome.APPROVE, {})
cfResults = json.loads(OverallResultEncoder().encode(overallResult))
results["cfResults"] = cfResults
checks = params["vars"]["_checks"]
checks["newKey"] = {
"key1" : {
"outcome": "PASS",
"valid" : True,
"exampleResult": {
"score": 0,
"quality": 0,
"probability": 0
},
"exampleField": True
},
"key2" : {
"outcome": "FAIL",
"valid" : True,
"exampleResult": {
"score": 0,
"quality": 0,
"probability": 0
},
"exampleField": True
}
}
pvars = {"_checks": checks}
results["executionVariables"] = pvars
As _checks
has been defined in the list of process variables (pvars), this variable will need to be defined inside the input parameters of the Cloud Function activity. This will be covered as part of step two.
Step Two - Create Process Definition
Once the details of the extensible checks have been defined inside the Cloud Function, a new Process Definition can be created that includes the new Cloud Function. This Process Definition will also require a Simple Decider activity to provide an overall outcome, including the extensible checks defined within the Cloud Function.
- In the Backoffice application, navigate to the Process Definitions page found in the left-side navigation bar.
- Create or edit an existing Process Definition. To create a new Process Definition, click the 'New Process Definition' button at the top of the Process Definitions page.
- The example in this document demonstrates a face and document capture flow that includes extensible checks and a Simple Decider.
- At the end of the Process Definition, after the 'Switch to Desktop' activity, add a new 'Execute Cloud Function' activity to the Process Designer and connect the activity to the 'Device switch' gateway.

- Click the 'Execute Cloud Function' activity to open the right-side contextual menu. Expand the input parameters menu and set the 'Function name' parameter to the Cloud Function containing the extensible check.

Expand the Process Variables input parameter and add the _checks
variable to list of values.

- Add a Simple Decider activity to the Process Designer and connect it to the 'Execute Cloud Function' activity using a sequence arrow. This activity is required to calculate an overall outcome for the Process Instance. Finally, connect the Simple Decider activity to the 'Write Summary Report V2' activity.

- The overall outcome of the Process Instance can be configured from the Simple Decider input parameters.

Once the Process Definition has been configured, click the Save & Deploy or Save buttons to finalize the creation of the new Process Definition.
Step Three - Viewing Results
Extensible check results can be viewed from the Process Instance details page.
- Navigate to the Process Instances page found in the left-side navigation bar.
- From the table of Process Instances, select the individual Process Instance and click the magnifying glass to enter the detail page.
- Scroll down to find the list of checks executed as part of the Process Instance.

Results can also be found in the summary.json
file that is provided in the exported Process Instance details.
- Navigate to the Process Instance details page.
- Click the export button found on the right-side of the Overview panel to export details of the Process Instance.

Details will be found under the processResults
inside the summary.json
file.