eventtype.java

来自「用JGraph编的软件」· Java 代码 · 共 63 行

JAVA
63
字号
package org.jgpd.io.jbpm.definition;

import java.io.*;
import java.util.*;

/**
 * is the enum class for all runtime process execution events.
 * @author Tom Baeyens
 */
public final class EventType implements Serializable {

  private static List eventsById = new ArrayList();
  private static Map eventsByText = new HashMap();

  public static final EventType PROCESS_INSTANCE_START  = new EventType( "process-instance-start" );
  public static final EventType PROCESS_INSTANCE_END    = new EventType( "process-instance-end" );
  public static final EventType PROCESS_INSTANCE_CANCEL = new EventType( "process-instance-cancel" );

  public static final EventType FLOW_START  = new EventType( "flow-start" );
  public static final EventType FLOW_END    = new EventType( "flow-end" );
  public static final EventType FLOW_CANCEL = new EventType( "subflow-cancel" );

  public static final EventType FORK            = new EventType( "fork" );
  public static final EventType JOIN            = new EventType( "join" );
  public static final EventType TRANSITION      = new EventType( "transition" );
  public static final EventType BEFORE_DECISION = new EventType( "before-decision" );
  public static final EventType AFTER_DECISION  = new EventType( "after-decision" );

  public static final EventType ACTIVITYSTATE_ASSIGNMENT        = new EventType( "activitystate-assignment" );
  public static final EventType PERFORM_OF_ACTIVITY             = new EventType( "perform-of-activity" );
  public static final EventType SUB_PROCESS_INSTANCE_START      = new EventType( "sub-process-instance-start" );
  public static final EventType SUB_PROCESS_INSTANCE_COMPLETION = new EventType( "sub-process-instance-completion" );

  public static final EventType ACTION               = new EventType( "action" );
  public static final EventType DELEGATION_EXCEPTION = new EventType( "delegation-exception" );

  private EventType( String text ) {
    this.id = eventsById.size();
    this.text = text;
    eventsById.add( id, this );
    eventsByText.put( text, this );
  }

  public static final EventType fromInt( int id ) {
    return (EventType) eventsById.get( id );
  }

  public static final EventType fromText( String text ) {
    return (EventType) eventsByText.get( text );
  }

  public int toInt() {
    return id;
  }

  public String toString() {
    return text;
  }

  private int id = -1;
  private String text = null;
}

⌨️ 快捷键说明

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