Emitting decision execution events

Apache Kafka is an event framework to connect data systems and transmit data in an efficient and reliable way.
Because Kafka is an open source event framework, it can consume events by using various technologies for different purposes, such as:
  • Real time technical or business monitoring
  • Alerts
  • Logging and auditing
  • Data analytics

You can configure the decision runtime to send an event that contains technical and business information for each decision to a Kafka topic.

Examples of technical information:
  • Decision identification
  • Execution date
  • Execution duration
Examples of business information:
  • Input of the decision
  • Output of the decision

For more information about the configuration, see Configuring the event emitter for an external Kafka instance.

Event data as JSON objects

The decision execution events are JSON objects with attributes:
Table 1. Events
Field Description Type
data.inputParameters Input parameters of the decision. JSONObject
data.outputParameters Output parameters of the decision. JSONObject
decisionId Identifier for the decision. String
decisionOperation Name of the decision operation. String
decisionRepositoryId The identifier of the decision automation (contains the organization ID). String
decisionRepositoryName The display name of the decision automation. String
decisionRepositoryURL URL of the GIT repository. The value is blank when there is no git repository. String
decisionServiceId Business identifier of the decision service. String
decisionServiceName Business name of the decision service. String
decisionServiceVersion Version of the decision service. String
deploymentSpaceId Identifier of the deployment space of the decision. String
engineApiVersion Version of the decision engine API that is used by the decision runtime. String
executionId Unique identifier for this execution of the decision. String
executionMillis Duration of the decision execution in milliseconds, Long
executedRules List of rules that were executed. Array of strings
executionSuccess Specifies whether the execution of the decision was successful. Boolean
incidentCategory Type of incident that occurred during the execution of the decision String
incidentStackTrace Stack trace for the incident (if available). String
nonExecutedRules List of rules that were not executed. Array of strings
runtimeNodeName Hostname of the decision runtime. String
timestamp Start time of the decision execution request. Long

Example of an emitted event

See the following example of a business event for a decision execution:
{
   "decisionId":"/samples/LoanValidation/LoanValidationDecisionService/3.1.2/LoanValidationDecisionService-3.1.2.jar",
   "decisionOperation":"LoanValidation",
   "decisionServiceId":"samples.LoanValidation",
   "decisionServiceName":"LoanValidation",
   "decisionServiceVersion":"3.1.2",
   "deploymentSpaceId":"test_environment",
   "engineApiVersion":"<decision_engine_api_version_number>",
   "data":{
      "inputParameters":{
         "customer":{
            "age":1,
            "name":"<name>"
         },
         "ageLimit":1
      },
      "outputParameters":"PASSED(mySimple02CustomerDecision)"
   },
   "executedRules":[
      "/LoanValidation/Duration/duration",
      "/LoanValidation/Bankruptcy Score/bankruptcy score",
      "/LoanValidation/Salary Score/salary score",
      "/LoanValidation/Yearly interest rate/yearly interest rate",
      "/LoanValidation/Corporate Score/corporate score",
      "/LoanValidation/Repayment/repayment",
      "/LoanValidation/Grade/grade",
      "/LoanValidation/Insurance/insurance"
   ],
   "executionId":"b4707973-ee80-45cc-bff4-86e3f2b79432",
   "executionMillis":3,
   "executionSuccess":true,
   "incidentCategory":null,
   "incidentId":null,
   "incidentStackTrace":null,
   "nonExecutedRules":[
      "/LoanValidation/Approval/bad score",
      "/LoanValidation/Approval/risky grade",
      "/LoanValidation/Approval/too big Debt to Income ratio",
      "/LoanValidation/Approval/age not valid",
      "/LoanValidation/Approval/no name",
      "/LoanValidation/Approval/wrong SSN",
      "/LoanValidation/Approval/wrong SSN format",
      "/LoanValidation/Approval/wrong zip format",
      "/LoanValidation/Approval/max amount exceeded"
   ],
   "runtimeNodeName":"worker0.mycluster.mycompany.com",
   "timestamp":1605602384767
}

Metadata

Metadata that are associated with decision service archives:
Table 2. Metadata
Name Description Default Value
businessEventInputEnabled Controls the emission of input parameters in the business data. true
businessEventOutputEnabled Controls the emission of output parameters in the business data. true
businessMonitoringEnabled Controls the emission of business monitoring events. true

Emitting events to Business Automation Insights

For information about how to process events based on a customizable configuration, see Decision management event walk-through External link opens a new window or tab.

For information about event formats, see Business Automation Insights reference.