Example: Accessing data in rules

     SpringboardThis topic is related to Springboard.   |     Form Builder |    23.10This feature was updated in 23.10 

This Decision Framework example demonstrates how to access txn, data model, and parameters for use in rules.

{
  "destinations": [
    {
      "id": "approved",
      "isDefault": true
    },
    {
      "id": "waiting"
    },
    {
      "id": "declined"
    }
  ],
  "paths": [
    {
      "id": "Joint Applicant Declined",
      "destination": "declined",
      "condition": {
        "==": [ { "var": ["txn.propertyMap.alloy\\.joint\\.person\\.outcome"] }, "Denied" ]
      }
    },
    {
      "id": "Signature Document Generated",
      "destination": "approved",
      "condition": {
        "and" : [
          {
            "!=": [ { "var": [ "data.application.documentSigningURL" ] }, "unavailable" ]
          },
          {
            "==": [ { "var": [ "params.decisionType" ] }, "esign" ]
          }
        ]
      }
    },    
    {
      "id": "Signature Document Not Generated",
      "destination": "waiting",
      "condition": {
        "and" : [
          {
            "==": [ { "var": [ "data.application.documentSigningURL" ] }, "unavailable" ]
          },
          {
            "==": [ { "var": [ "params.decisionType" ] }, "esign" ]
          }
        ]
      }
    }
  ]
}

The Narrative syntax to pass params to the Decide service is as follows:

{
  "name": "Decide",
  "version": "${decision-framework-version}",
  "condition": "true",
  "params": {
    "decisionType": "esign"
  },
  "alwaysProcess": true
}