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

org.activiti.engine.impl.cmd.GetEventLogEntriesCmd Maven / Gradle / Ivy

The newest version!
package org.activiti.engine.impl.cmd;

import java.util.List;

import org.activiti.engine.event.EventLogEntry;
import org.activiti.engine.impl.interceptor.Command;
import org.activiti.engine.impl.interceptor.CommandContext;

/**
 * @author Joram Barrez
 */
public class GetEventLogEntriesCmd implements Command> {
	
  protected String processInstanceId = null;
	protected Long startLogNr = null;
	protected Long pageSize = null;
	
	public GetEventLogEntriesCmd() {
		
	}
	
	public GetEventLogEntriesCmd(String processInstanceId) {
    this.processInstanceId = processInstanceId;
	}
	
	public GetEventLogEntriesCmd(Long startLogNr, Long pageSize) {
		this.startLogNr = startLogNr;
		this.pageSize = pageSize;
	}
	
	@Override
	public List execute(CommandContext commandContext) {
	  if (processInstanceId != null) {
	    return commandContext.getEventLogEntryEntityManager().findEventLogEntriesByProcessInstanceId(processInstanceId);
	  
	  } else if (startLogNr != null) {
	    return commandContext.getEventLogEntryEntityManager().findEventLogEntries(
          startLogNr,
          pageSize != null ? pageSize : -1);
		
	  } else {
	    return commandContext.getEventLogEntryEntityManager().findAllEventLogEntries();
	  }
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy