Decision Framework: Rules logic

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

The core logic engine behind the Decision Framework is a Groovy implementation of JsonLogic. All operations supported by JsonLogic are supported by default in the Decision Engine.

There are many examples of using JsonLogic operations in the JsonLogic documentation. The examples below focus on configurations that are likely to be used in the Decision Framework.

Retrieving data

JsonLogic uses the var operator to retrieve data at runtime, using dot notation to access properties. The specific data available to your rules is governed by the data passed into the Decision Framework. To learn more, see Decision Framework: Data.

  • Example: Hard Fail Txn Property
    {
      "var": [ "txn.propertyMap.hardFail" ]
    }
  • Example: Qualifile Account Action Text
    {
      "var": [ "txn.propertyMap.FisQualiFile\\.PrimaryApplicant\\.accountActionTxt1" ]
    }
  • Example: Qualifile Account Acceptance Text
    {
      "var": [ "txn.propertyMap.FisQualiFile\\.PrimaryApplicant\\.accountAcceptanceTxt" ]
    }
  • Example: Application data value for LMS Document Signing URL
    {
      "var": [ "data.application.documentSigningURL" ]
    }
  • Example: Service parameter defined in Narrative to control rule usage
    {
      "var": [ "params.decisionType" ]
    }
  • Example: Accessing data model and parameters
    {
      "id": "Signature Document Generated",
      "destination": "approved",
      "condition": {
        "and" : [
          {
            "!=": [ { "var": [ "data.application.documentSigningURL" ] }, "unavailable" ]
          },
          {
            "==": [ { "var": [ "params.decisionType" ] }, "esign" ]
          }
        ]
      }
    }

Logic operators

JsonLogic uses logic operators to return a result. The logic needs to result in true or false.

Following are some example statements in plain English, and JsonLogic that implements them.

  • Example: Check if a value has been set by LMS signature processing
    {
      "and" : [
        {
          "!=": [
            { "var": ["data.application.documentSigningURL"] }, // Contains LMS URL, returned when ready
            "unavailable"
          ]
        },
        {
          "==": [
            { "var": ["params.decisionType"] }, // Decision service call includes "decisionType" parameter
            "esign"
          ]
        }
      ]
    }
  • Example: If the user's credit score is less than 800
    {
      "if" : [
        {
          "<": [
            { "var": "txn.propertyMap.creditScore" }, // user's credit score
            800
          ]
        }
      ]
    }
  • Example: If the user's credit score is greater than 700, and less than 800
    {
      "and": [
        {
          ">": [ { "var": "txn.propertyMap.creditScore" }, 700 ]
        }
        {
          "<": [ { "var": "txn.propertyMap.creditScore" }, 800 ]
        }
      ]
    }

    This example builds on the previous rule. The "and" operator is used to combine the two rules. If both of the logic operations inside "and" are true, then "and" is true. If either of the logic operations inside "and" are false, then "and" is false.

Next, let's look at an example that approves applications by default.