All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.activiti.engine.impl.event.logger.handler.ActivityMessageEventHandler Maven / Gradle / Ivy

There is a newer version: 3.0.Beta
Show newest version
package org.activiti.engine.impl.event.logger.handler;

import org.activiti.engine.delegate.event.ActivitiMessageEvent;
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 ActivityMessageEventHandler extends AbstractDatabaseEventLoggerEventHandler {

  @Override
  public EventLogEntryEntity generateEventLogEntry(CommandContext commandContext) {
    ActivitiMessageEvent messageEvent = (ActivitiMessageEvent) event;

    Map data = new HashMap();
    putInMapIfNotNull(data, Fields.ACTIVITY_ID, messageEvent.getActivityId());
    putInMapIfNotNull(data, Fields.ACTIVITY_NAME, messageEvent.getActivityName());
    putInMapIfNotNull(data, Fields.PROCESS_DEFINITION_ID, messageEvent.getProcessDefinitionId());
    putInMapIfNotNull(data, Fields.PROCESS_INSTANCE_ID, messageEvent.getProcessInstanceId());
    putInMapIfNotNull(data, Fields.EXECUTION_ID, messageEvent.getExecutionId());
    putInMapIfNotNull(data, Fields.ACTIVITY_TYPE, messageEvent.getActivityType());
    
    putInMapIfNotNull(data, Fields.MESSAGE_NAME, messageEvent.getMessageName());
    putInMapIfNotNull(data, Fields.MESSAGE_DATA, messageEvent.getMessageData());

    return createEventLogEntry(messageEvent.getProcessDefinitionId(), messageEvent.getProcessInstanceId(), messageEvent.getExecutionId(), null, data);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy