Version: 22.04
Actions
Actions are how you control which Transact Functions need to run throughout an application. As with Pages, Actions have a number of properties, defined in their JSON definition, to control the Narrative behavior.
Actions can be placed inside Pages as preActions
or postActions
, or inside the Narrative as initializeActions
.
Properties
The following properties can be set on any action in the Narrative.
Property | Description |
---|---|
simpleName | String The simple name of the Transact Function that you want to run (only used by invokeFormAction() ). |
name | String The service name of the Transact Function you want to run. |
version | String The version of the Transact Function you want to run. |
condition | Boolean (Default: true )Whether an action should be executed. If the value of this property is false or an expression that evaluates to false , this action is skipped. |
alwaysProcess | Boolean (Default: false )Whether an action should be executed every time it is encountered. By default, Actions are executed successfully once only, meaning that if the user navigates back, then forward, the action isn't executed again. If this property is true or an expression that evaluates to true , the action runs regardless of whether it was previously run successfully. This can be useful to ensure actions are only re-run when certain data has changed. |
params | Map<String, String> (Default: [:] )Bind arbitrary data into an action as input parameters. Using parameters allows you to decouple your Form and Functions. |
milestone | String The name of a Journey Analytics Milestone to record whenever this action completes successfully. |
segments | List<InsightsSegment> A list of Journey Analytics Segments (name/value) to record whenever this action completes successfully. |
Example
{
"name": "FIS - IDV",
"version": "1.0.0",
"condition": "${ !data.get('primaryApplicant').isExistingCustomer() }",
"alwaysProcess": true,
"params": {
"firstName": "${ !data.get('primaryApplicant').firstName }",
"lastName": "${ !data.get('primaryApplicant').lastName }",
"dob": "${ !data.get('primaryApplicant').dateOfBirth }"
},
"segments": [
{
"name": "Segment Name",
"value": "Segment value"
},
{
"name": "Dynamic Segment",
"value": "Segment - ${txn.trackingCode}"
}
]
}