executionlogimpl.java

来自「一个java工作流引擎」· Java 代码 · 共 58 行

JAVA
58
字号
package org.jbpm.model.log.impl;

import java.util.*;

import org.jbpm.*;
import org.jbpm.model.execution.impl.*;
import org.jbpm.model.log.*;

public abstract class ExecutionLogImpl implements ExecutionLog, Comparable {

  protected Long id = null;
  protected InvocationLog invocationLog = null;
  protected Integer index = null;
  
  public Long getId() { return this.id; }
  public void setId(Long id) { this.id = id; }

  public InvocationLog getInvocationLog() { return this.invocationLog; }
  public void setInvocationLog(InvocationLog invocationLog) { this.invocationLog = invocationLog; }
  
  public Integer getIndex() { return this.index; }
  public void setIndex(Integer index) { this.index = index; }

  /**
   * compares one LogImpl with another LogImpl within the
   * same event based upon the index.  If the 2 logs are not from the same event,
   * the log comparison will be based on the dates of the events.
   * Note : this comparison does not specify a natural ordering for
   * logs that events do not both have events.
   */
	public int compareTo(Object o) {
    int comparison = -1;
    ExecutionLogImpl other = (ExecutionLogImpl)o;

    if ( this.equals( other ) ) {
      comparison = 0;
    } else {
      if ( ( invocationLog != null ) 
           && ( other.invocationLog != null ) ) {
        if ( invocationLog.equals( other.invocationLog ) ) {
          comparison = index.compareTo( other.getIndex() );
        } else {
          Date eventDate = invocationLog.getDate();
          Date otherEventDate = other.invocationLog.getDate();
          if ( ( eventDate != null )
               && ( otherEventDate != null ) ) {
            comparison = eventDate.compareTo( otherEventDate );
          }
        }
      }
    }

    return comparison;
	}
  
	public abstract void undo(ExecutionContextImpl executionContext) throws ExecutionException;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?