Skip to main content

Data structure of Kafka events

In this example, when a task is transitioned to the Resolved state, a history event is sent to the data-history topic and tracked by a Kafka consumer.

This history event provides general information about everything related to the change in the task status including the user and task identifications, the transaction identification and the update details listed under detail. In order to track specific actions, you need to filter on such information when configuring the Kafka Java consumer.

Below is an example of the data structure in the history event about a task transitioned to Resolved state:

{
	"id": null,
	"timestamp": 1546524809436,
	"resourceType": "org.talend.datasteward.tasks.model.Task",
	"resourceId": "5c26474248f8a60001270599",
	"type": "UPDATE",
	"userId": "3836ef07-e6f6-4b13-9579-85afcce18328",
	"transaction": "dac7ab47-687e-43df-b20f-a30ae5a13f62",
	"action": "transition",
	"actionParameters": {
		"system_campaignId": "5c26474148f8a60001270595",
		"system_state": "To validate",
		"transitionName": "Accept"
	},
	"detail": [{
		"path": "assignee",
		"type": "DELETE",
		"previousValue": "3836ef07-e6f6-4b13-9579-85afcce18328",
		"newValue": null
	}, {
		"path": "completed",
		"type": "UPDATE",
		"previousValue": false,
		"newValue": true
	}, {
		"path": "currentState",
		"type": "UPDATE",
		"previousValue": "To validate",
		"newValue": "Resolved"
	}, {
		"path": "targetState",
		"type": "DELETE",
		"previousValue": "Resolved",
		"newValue": null
	}, {
		"path": "targetTransition",
		"type": "DELETE",
		"previousValue": "Accept",
		"newValue": null
	}]
}

Below is another example of the data structure in the history event when a task priority is updated:

 {
        "id": null,
        "timestamp": 1546598273434,
        "resourceType": "org.talend.datasteward.tasks.model.Task",
        "resourceId": "task1",
        "type": "UPDATE",
        "userId": "user1",
        "transaction": "91440277-ea7f-4803-9f39-c7c2969e4714",
        "action": "editPriority",
        "actionParameters": {
            "system_campaignId": "c1",
            "system_state": "Inprogress",
            "priority": 3
        },
        "detail": [
            {
                "path": "priority",
                "type": "UPDATE",
                "previousValue": 1,
                "newValue": 3
            }
        ]
    }

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!