org.apache.ode.bpel.common
Class ProcessState

java.lang.Object
  extended by org.apache.ode.bpel.common.ProcessState

public class ProcessState
extends java.lang.Object

Convenience class for working with process states.


Field Summary
static short[] ALL_STATES
          An array containing the possible states.
static short STATE_ACTIVE
          ACTIVE state: instance has received a <receive> or <pick> with createInstance="true"
static short STATE_COMPLETED_OK
          COMPLETED state: instance has reached the end of its execution (normally).
static short STATE_COMPLETED_WITH_FAULT
          COMPLETED WITH FAULT state: instance has reached the end of its execution due to an uncaught fault.
static short STATE_NEW
          NEW state: instance has not been reduced.
static short STATE_READY
          READY state: instance is waiting for a <receive> or <pick> with createInstance="true".
static short STATE_SUSPENDED
          SUSPENDED state: instance was suspended via a breakpoint or user intervention.
static short STATE_TERMINATED
          TERMINATED state: instance was terminated, either via the <terminate> or through manual intervention.
 
Method Summary
static boolean canExecute(short state)
          Test whether a process state is one where the process can execute, i.e., not STATE_SUSPENDED and not one of the completed or terminated states.
static boolean isFinished(short state)
          Test whether a process state is one of the completed states, e.g., STATE_COMPLETED_OK or STATE_COMPLETED_WITH_FAULT.
static java.lang.String stateToString(short state)
          Change short state representation to human-readable form.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATE_NEW

public static final short STATE_NEW
NEW state: instance has not been reduced.

See Also:
Constant Field Values

STATE_READY

public static final short STATE_READY
READY state: instance is waiting for a <receive> or <pick> with createInstance="true".

See Also:
Constant Field Values

STATE_ACTIVE

public static final short STATE_ACTIVE
ACTIVE state: instance has received a <receive> or <pick> with createInstance="true"

See Also:
Constant Field Values

STATE_COMPLETED_OK

public static final short STATE_COMPLETED_OK
COMPLETED state: instance has reached the end of its execution (normally).

See Also:
Constant Field Values

STATE_COMPLETED_WITH_FAULT

public static final short STATE_COMPLETED_WITH_FAULT
COMPLETED WITH FAULT state: instance has reached the end of its execution due to an uncaught fault.

See Also:
Constant Field Values

STATE_SUSPENDED

public static final short STATE_SUSPENDED
SUSPENDED state: instance was suspended via a breakpoint or user intervention.

See Also:
Constant Field Values

STATE_TERMINATED

public static final short STATE_TERMINATED
TERMINATED state: instance was terminated, either via the <terminate> or through manual intervention.

See Also:
org.apache.ode.bpel.bdi.InstanceReference#terminate(), Constant Field Values

ALL_STATES

public static final short[] ALL_STATES
An array containing the possible states.

Method Detail

canExecute

public static boolean canExecute(short state)
Test whether a process state is one where the process can execute, i.e., not STATE_SUSPENDED and not one of the completed or terminated states.

Parameters:
state - the state of the process
Returns:
true if the process can execute

isFinished

public static boolean isFinished(short state)
Test whether a process state is one of the completed states, e.g., STATE_COMPLETED_OK or STATE_COMPLETED_WITH_FAULT.

Parameters:
state - the state of the process
Returns:
true if the process is finished.

stateToString

public static java.lang.String stateToString(short state)
Change short state representation to human-readable form.

Parameters:
state - the state of the process
Returns:
human-readable state as a String