Raw decision event formats

Raw events in the context of Operational Decision Manager decisions are JSON objects with attributes.

Notation and example

The dot notation indicates nested fields. For example, source.type means the type field within the source JSON object.

Table 1. Common attributes of decisions raw events
Event part Description Optional or required Type
business-events-envelope-version The event format version Required String

Example: "1.0.1"

business-events-extension-version The version of the event format extension Required String

Example: odm/1.0.0"

id The event identifier. It contains the decision identifier of the ruleset execution. The decision identifier must be unique. See Adding a decision identifier External link opens a new window or tab. Required String
timestamp The timestamp of the event Required A string that contains an ISO8601 date
category The category of the event Required String - Always "odm:Execution"
type The type of the event Required String - One of:"odm:Execution:EXECUTION_SUCCESS""odm:Execution:EXECUTION_FAILURE" "odm:Execution:TRACE_GENERATION_ERROR"
Table 2. source attributes of raw decision events
Event part Description Optional or required Type
source Information about the source that generated this event Required JSON object
source.id The identifier of the source that emitted the event: the canonical ruleset path.

Format: <ruleAppName>/<ruleAppVersion>/<rulesetName>/<rulesetVersion>

Required String

Example: "/loanvalidation/1.0/loanvalidationrules/1.0"

source.type The type of source that emitted the event Required String - Always "ruleset"
Table 3. data attributes of raw decisions events
Event part Description Optional or required Type
data The business data Optional JSON object
data.odm Operational Decision Manager specific information about business data Required JSON object
data.odm.total_duration-ms The total duration of the ruleset execution, in milliseconds Required Integer
data.odm.input-parameters The ruleset input parameters Optional JSON array object

The elements are the Jackson JSON serialization of the input parameters according to the Java™ Execution Object Model (XOM).

Present in the raw event only if the ruleset property bai.emitter.input is set to true (default: false)

data.odm.output-parameters The ruleset output parameters Optional JSON array object

The elements are the Jackson JSON serialization of the output parameters according to the Java Execution Object Model (XOM).

Present in the raw event only if the ruleset property bai.emitter.output is set to true (default: false).

data.odm.decision-events The executed rules and tasks Optional JSON array object

The elements are the JSON serialization of the decision events: names of executed rules and tasks.

Present in the raw event by default. Can be excluded by setting the ruleset property bai.emitter.trace to false (default: true).

Example of attributes for raw decision events

{  
  "business-events-envelope-version":"1.0.1",
  "business-events-extension-version":"odm/1.0.0",
  "id":"D052B561-0000-C0F4-B5AE-26C293E11327",
  "timestamp":"2018-07-16T17:25:59.178Z",
  "type":"odm:Execution:EXECUTION_SUCCESS",
  "category":"odm:Execution",
  "source":{  
    "id":"/loanvalidation/1.0/loanvalidationrules/1.0",
    "type":"ruleset"
  },
  "data":{  
    "odm":{  
      "total-duration-ms":725,
      "input-parameters":{  
        "borrower":{  
          "firstName":"John",
          "lastName":"Doe",
          "yearlyIncome":100000,
          "zipCode":"91320",
          "creditScore":3,
          "spouse":{  
            "firstName":"Maria",
            "lastName":"Doe",
            "yearlyIncome":0,
            "zipCode":null,
            "creditScore":0,
            "spouse":null,
            "ssn":{  
              "areaNumber":"987",
              "groupCode":"6",
              "serialNumber":""
            }
          },
          "ssn":{  
            "areaNumber":"123",
            "groupCode":"45",
            "serialNumber":"6789"
          }
        },
        "loan":{  
          "numberOfMonthlyPayments":72,
          "startDate":1117576800000,
          "amount":100000,
          "loanToValue":0.7
        }
      },
      "output-parameters":{  
        "report":{  
          "borrower":{  
            "firstName":"John",
            "lastName":"Doe",
            "yearlyIncome":100000,
            "zipCode":"91320",
            "creditScore":3,
            "spouse":{  
              "firstName":"Maria",
              "lastName":"Doe",
              "yearlyIncome":0,
              "zipCode":null,
              "creditScore":0,
              "spouse":null,
              "ssn":{  
                "areaNumber":"987",
                "groupCode":"6",
                "serialNumber":""
              }
            },
            "ssn":{  
              "areaNumber":"123",
              "groupCode":"45",
              "serialNumber":"6789"
            }
          },
          "loan":{  
            "numberOfMonthlyPayments":72,
            "startDate":1117576800000,
            "amount":100000,
            "loanToValue":0.7
          },
          "validData":true,
          "insuranceRequired":false,
          "insuranceRate":0.0,
          "approved":false,
          "messages":[  
            " The loan amount is under the maximum authorized",
            "Credit score below 200",
            "We are sorry. Your loan has not been approved"
          ],
          "yearlyInterestRate":0.057,
          "monthlyRepayment":1643.16421407779,
          "message":" The loan amount is under the maximum authorized\\nCredit score below 200\\nWe are sorry. Your loan has not been approved",
          "insurance":"none",
          "yearlyRepayment":19717.97056893348
        },
        "score":"3",
        "grade":"null"
      },
      "decision-events":[  
        {  
          "type":"task",
          "decision-events":[  
            {  
              "type":"task",
              "end-date":1544747956523,
              "start-date":1544747956523,
              "name":"loanvalidation#initResult"
            },
            {  
              "type":"task",
              "decision-events":[  
                {  
                  "type":"rule",
                  "name":"validation.borrower.checkSSNareanumber"
                },
                {  
                  "type":"rule",
                  "name":"validation.borrower.checkSSNdigits"
                },
                {  
                  "type":"rule",
                  "name":"validation.borrower.checkZipcode"
                },
                {  
                  "type":"rule",
                  "name":"validation.borrower.checkName"
                },
                {  
                  "type":"rule",
                  "name":"validation.borrower.checkAge"
                },
                {  
                  "type":"rule",
                  "name":"validation.loan.checkAmount"
                },
                {  
                  "type":"rule",
                  "name":"validation.test.checkTest"
                }
              ],
              "end-date":1544747956561,
              "start-date":1544747956529,
              "name":"loanvalidation#validation"
            },
            {  
              "type":"task",
              "decision-events":[  
                {  
                  "type":"rule",
                  "name":"computation.initialCorporateScore"
                },
                {  
                  "type":"rule",
                  "name":"computation.bankruptcyScore_0"
                },
                {  
                  "type":"rule",
                  "name":"computation.salary2score_5"
                },
                {  
                  "type":"rule",
                  "name":"computation.rate_5"
                },
                {  
                  "type":"rule",
                  "name":"computation.repayment"
                }
              ],
              "end-date":1544747956578,
              "start-date":1544747956563,
              "name":"loanvalidation#computation"
            },
            {  
              "type":"task",
              "decision-events":[  
                {  
                  "type":"rule",
                  "name":"eligibility.checkCreditScore"
                },
                {  
                  "type":"rule",
                  "name":"eligibility.approval"
                }
              ],
              "end-date":1544747956588,
              "start-date":1544747956583,
              "name":"loanvalidation#eligibility"
            }
          ],
          "end-date":1544747956591,
          "start-date":1544747956516,
          "name":"loanvalidation"
        }
      ]
    }
  }
}