Change Tracking

This page describes how the system tracks changes made during a CMT import Process. When enabled, this feature tracks all changes made as a result of the import.

Enable Tracking

The system tracks changes within the context of an import process. The user enables this by including the attribute enableAuditTrail in the import request, with the value set to TRUE. If a request does not include this attribute, or if it is set to FALSE, the changes are not tracked.

The link to the change log is made available through the response on a POST operation on the datasetprocesses API. For example:

POST http://host:port/api/generic/audittraildetails/search

{
  "resource": {
    "q": "auditTrail.dataSetProcess.id.eq(123)"
  }
}

Purging

The change logs created by this feature are linked to the import activity. If the import process record is purged, then so is its change log.

Structure

The change logs follow the structure below:

{
   "EntityName":{
      "added":[
         {
            "id":123
         }
      ],
      "removed":[
         {
            "id":122
         }
      ],
      "updated":[
         {
            "attributeName":{
               "newValue":"new",
               "oldValue":"old"
            },
            "id":121
         }
      ]
   }
}

Changes are listed per entity name. For added and removed entities only the identifier is logged. For updated entities the log includes the old and the new value of the updated attribute.

Examples

In the following scenario a premium schedule with code 'BASE_PREMIUM' and id 123 is imported. Suppose the following changes occur:

  • Update - numberOfDays attribute on BASE_PREMIUM (from 7 days to 30 days)

  • Create - A new premium schedule line (with id 178764)

  • Remove - An existing premium schedule line (with id 178763)

  • Update - The amount on an existing premium schedule line (with id 178762) from $100 to $102

  • Update - The amount on an existing premium schedule line (with id 178761) from $55 to $57

The changes listed above would result in the following log entry:

{
   "PremiumScheduleLine":{
      "added":[
         {
            "id":178764
         }
      ],
      "removed":[
         {
            "id":178763
         }
      ],
      "updated":[
         {
            "amount":{
               "newValue":102,
               "oldValue":100
            },
            "id":178762
         },
         {
            "amount":{
               "newValue":57,
               "oldValue":55
            },
            "id":178761
         }
      ]
   },
   "PremiumSchedule":{
      "updated":[
         {
            "numberOfDays":{
               "newValue":30,
               "oldValue":7
            },
            "id":123
         }
      ]
   }
}