class AsyncTaskLifeCycleEventProducer extends PersistableEventListener implements TaskLifeCycleEventListener {

    @Override
    public void afterTaskOutputVariableChangedEvent(TaskEvent event, Map<String, Object> variables) {
        String userId = event.getTaskContext().getUserId();
        Task task = event.getTask();        

        if (variables == null || variables.isEmpty()) {
            return;
        }
        
        List<TaskVariableImpl> taskVariables = indexVariables(task, variables, VariableType.OUTPUT);
        String message = "Task output data updated";
        TaskEventImpl taskEvent = new TaskEventImpl(task.getId(), 
                                                     org.kie.internal.task.api.model.TaskEvent.TaskEventType.UPDATED, 
                                                     task.getTaskData().getProcessInstanceId(), 
                                                     task.getTaskData().getWorkItemId(), 
                                                     userId, message);
        AuditTaskImpl auditTaskImpl = createAuditTask(task, event.getEventDate());
        auditTaskImpl.setLastModificationDate(event.getEventDate());
        
        sendMessage(new AuditTaskData(auditTaskImpl, Collections.singletonList(taskEvent), null, taskVariables), 2);
    }

    public  AsyncTaskLifeCycleEventProducer();

}