org.activiti.engine.impl.event.logger.handler.ActivityCompletedEventHandler Maven / Gradle / Ivy
package org.activiti.engine.impl.event.logger.handler;
import org.activiti.engine.delegate.event.ActivitiActivityEvent;
import org.activiti.engine.impl.interceptor.CommandContext;
import org.activiti.engine.impl.persistence.entity.EventLogEntryEntity;
import java.util.HashMap;
import java.util.Map;
/**
*/
public class ActivityCompletedEventHandler extends AbstractDatabaseEventLoggerEventHandler {
@Override
public EventLogEntryEntity generateEventLogEntry(CommandContext commandContext) {
ActivitiActivityEvent activityEvent = (ActivitiActivityEvent) event;
Map data = new HashMap();
putInMapIfNotNull(data, Fields.ACTIVITY_ID, activityEvent.getActivityId());
putInMapIfNotNull(data, Fields.ACTIVITY_NAME, activityEvent.getActivityName());
putInMapIfNotNull(data, Fields.PROCESS_DEFINITION_ID, activityEvent.getProcessDefinitionId());
putInMapIfNotNull(data, Fields.PROCESS_INSTANCE_ID, activityEvent.getProcessInstanceId());
putInMapIfNotNull(data, Fields.EXECUTION_ID, activityEvent.getExecutionId());
putInMapIfNotNull(data, Fields.ACTIVITY_TYPE, activityEvent.getActivityType());
putInMapIfNotNull(data, Fields.BEHAVIOR_CLASS, activityEvent.getBehaviorClass());
return createEventLogEntry(activityEvent.getProcessDefinitionId(), activityEvent.getProcessInstanceId(), activityEvent.getExecutionId(), null, data);
}
}