Example 1: Processing and writing business data or common data

This example shows how to process common data and business data separately.

About this task

In this example, you customize the default decision management (Operational Decision Manager or Decision Intelligence) processing configuration for the following purposes.
  • To process only common data and write it to a new, dedicated index.
  • To process only business data and write it to the existing index.
Such customization involves the following steps.
  • Step 1: Define a new OpenSearch egress that processes and writes only common data to the new index.
  • Step 2: Update the existing OpenSearch egress to process and write only business data to the existing index.
  • Step 3: Declare a monitoring source to monitor data from the index through Business Performance Center.
In the default processing configuration, the transformation is defined in each egress by a transformer.
"transformer": {
  "type": "jslt-file",
  "filename": "transformation.jslt"
}
The logic of the transformation lies in the transformation.jslt file, where raw events are transformed into time series documents. As a convenience and example, the default Operational Decision Manager or Decision Intelligence configurations contains two files that are not used by the default processing-conf.json configuration.
  • The transformation-data.jslt transformer processes only business data (input and output parameters).
  • The transformation-common.jslt transformer processes only common data (decision events).

Procedure

  1. Define a new OpenSearch egress for the common data by duplicating the default OpenSearch egress and updating it.
    1. Update the unique identifier (UID) by running the uuidgen command to generate a new identifier.
    2. Update the index name.
    3. Update the transformer file name to refer to transformation-common.jslt.

    The definition of the OpenSearch egress now looks like this.

    For Operational Decision Manager:
      	{
      	    "uid": "<new generated uuid>",
      	    "type": "elasticsearch",
      	    "index": {
      	        "name": "icp4ba-bai-odm-common",
      	        "docId": {
      	            "type": "jslt-inline",
      	            "expression": ".id"
      	        },
      	        "mapping": {
      	            "filename": "elasticsearch-mapping.json"
      	        }
      	    },
      	    "transformer": {
      	        "type": "jslt-file",
      	        "filename": "transformation-common.jslt"
      	    }
      	}
    For Decision Intelligence:
    
      	{
      	    "uid": "<new generated uuid>",
      	    "type": "elasticsearch",
      	    "index": {
      	        "name": "icp4ba-bai-ads-common",
      	        "docId": {
      	            "type": "jslt-inline",
      	            "expression": ".id"
      	        },
      	        "mapping": {
      	            "filename": "elasticsearch-mapping.json"
      	        }
      	    },
      	    "transformer": {
      	        "type": "jslt-file",
      	        "filename": "transformation-common.jslt"
      	    }
      	}
      	
  2. Update the existing OpenSearch egress to process only business data.
    1. Identify the default OpenSearch egress.

      For Operational Decision Manager, UID is 46D2CB58-2978-4DF5-909A-80583719A0A3 and its index name is cp4ba-bai-odm-timeseries.

      For Decision Intelligence, UID is 4E4262B0-E426-4346-ADEB-32D57603019A and its index name is icp4ba-bai-ads-timeseries.

    2. Update the transformer file name to refer to transformation-data.jslt.

      The egress now looks like this.

      For Operational Decision Manager:
      	{
      	   "uid": "46D2CB58-2978-4DF5-909A-80583719A0A3",
      	   "type": "elasticsearch",
      	   "index": {
      		 "name": "icp4ba-bai-odm-timeseries",
      		 "docId": {
      		   "type": "jslt-inline",
      		   "expression": ".id"
      		 },
      		 "mapping": {
      		   "filename": "elasticsearch-mapping.json"
      		 }
      	   },
      	   "transformer": {
      		 "type": "jslt-file",
      		 "filename": "transformation-data.jslt"
      	   }
      	}
      For Decision Intelligence:
        {
          "uid": "4E4262B0-E426-4346-ADEB-32D57603019A",
          "type": "elasticsearch",
          "index": {
        	"name": "icp4ba-bai-ads-timeseries",
        	"docId": {
        	  "type": "jslt-inline",
        	  "expression": ".id"
        	},
        	"mapping": {
        	  "filename": "elasticsearch-mapping.json"
        	}
          },
          "transformer": {
        	"type": "jslt-file",
        	"filename": "transformation-data.jslt"
          }
        }
  3. Create a dedicated monitoring source to monitor the common data from the new index.

    For instructions, see Configuring a monitoring source for Operational Decision Manager events. You can follow the same instructions forDecision Intelligence.

    For Operational Decision Manager:
       - monitoring_source_type: 'Decisions (ODM) Common data'
         elasticsearch_index: icp4ba-bai-odm-common-ibm-bai
         monitoring_source_fields:
       	- field: rulesetPath

    For Decision Intelligence:

       - monitoring_source_type: 'Decisions (DICMS) Common data'
         elasticsearch_index: icp4ba-bai-ads-common-ibm-bai
         monitoring_source_fields:
             - decision.serviceId
             - decision.serviceVersion

What to do next

  1. Before you apply the changes, you might be interested in further customizing your processing configuration, as explained in these examples.
  2. To apply your changes, follow instructions in Updating the processing configuration.
  3. You can then send events to the Kafka ingress topic.