org.ow2.bonita.pvm
Interface Execution

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
ActivityExecution, ClientExecution, ClientProcessInstance, EventListenerExecution, OpenExecution
All Known Implementing Classes:
ExecutionImpl

public interface Execution
extends java.io.Serializable

a runtime path of execution.

State of an execution

The state of an execution is either active or locked. An active execution is either executing or waiting for an external trigger. If an execution is not in STATE_ACTIVE, then it is locked. A locked execution is read only.

When a new execution is created, it is in STATE_ACTIVE. To change the state to a locked state, use #lock(String). Some STATE_* constants are provided that represent the most commonly used locked states. But the state '...' in the picture indicates that any string can be provided as the state in the lock method.

If an execution is locked, methods that change the execution will throw a PvmException and the message will reference the actual locking state. Firing events, updating variables, updating priority and adding comments are not considered to change an execution. Also creation and removal of child executions are unchecked, which means that those methods can be invoked by external API clients and node behaviour methods, even while the execution is in a locked state.

Make sure that comparisons between getState() and the STATE_* constants are done with .equals and not with '==' because if executions are loaded from persistent storage, a new string is created instead of the constants.

Comments

Author:
Tom Baeyens

Field Summary
static java.lang.String STATE_ACTIVE
          either executing or in a wait state waiting for a signal.
static java.lang.String STATE_ASYNC
          indicates that this execution is doing an asynchronous continuation.
static java.lang.String STATE_CANCELLED
          this execution was cancelled with the #cancel() method before normal execution ended.
static java.lang.String STATE_CREATED
          between creation of a new process instance and the start of that process instance.
static java.lang.String STATE_ENDED
          this execution has ended normally.
static java.lang.String STATE_INACTIVE
          parents with concurrent child executions are inactive.
static java.lang.String STATE_SUSPENDED
          indicates that this execution is temporary suspended with the #suspend() method.
 
Method Summary
 long getDbid()
           
 java.lang.String getId()
          a globally unique identifier for this execution.
 java.lang.String getKey()
          the optional user provided business key that is unique within one process definition.
 java.lang.String getName()
          the externally given name or id of this execution.
 java.lang.String getNodeName()
          represents the current position in the process by indicating the name of the current node.
 int getPriority()
          indicates low priorities with negative values and high priorities with positive values.
 java.lang.String getState()
          the state of this execution.
 boolean isActive()
          is this execution active ? This is the inverse of isLocked().
 boolean isEnded()
          is this execution ended normally ?
 boolean isFinished()
          is this execution ended or cancelled ?
 boolean isLocked()
          is this execution locked ? This is the inverse of isActive().
 boolean isSuspended()
          is this execution suspended ?
 

Field Detail

STATE_CREATED

static final java.lang.String STATE_CREATED
between creation of a new process instance and the start of that process instance. The motivation of this state is that variables can be set programmatically on the process instance so that they can be used during initializations of variables and timers

See Also:
Constant Field Values

STATE_ACTIVE

static final java.lang.String STATE_ACTIVE
either executing or in a wait state waiting for a signal. This is the normal state of an execution and the initial state when creating a new execution. Make sure that comparisons are done with .equals and not with '==' because if executions are loaded from persistent storage, a new string is created instead of the constants.

See Also:
Constant Field Values

STATE_INACTIVE

static final java.lang.String STATE_INACTIVE
parents with concurrent child executions are inactive. When an execution has concurrent child executions, it implies that this execution can't be active. For example, at a fork, the parent execution can wait inactively in the fork being till all the child executions are joined. Only leaves of the execution tree can be active. Make sure that comparisons are done with .equals and not with '==' because if executions are loaded from persistent storage, a new string is created instead of the constants.

See Also:
Constant Field Values

STATE_ENDED

static final java.lang.String STATE_ENDED
this execution has ended normally. Make sure that comparisons are done with .equals and not with '==' because if executions are loaded from persistent storage, a new string is created instead of the constants.

See Also:
Constant Field Values

STATE_CANCELLED

static final java.lang.String STATE_CANCELLED
this execution was cancelled with the #cancel() method before normal execution ended. Make sure that comparisons are done with .equals and not with '==' because if executions are loaded from persistent storage, a new string is created instead of the constants.

See Also:
Constant Field Values

STATE_SUSPENDED

static final java.lang.String STATE_SUSPENDED
indicates that this execution is temporary suspended with the #suspend() method. Human tasks of a suspended execution shouldn't show up in people's task list and timers of suspended executions shouldn't fire and the execution is locked. Make sure that comparisons are done with .equals and not with '==' because if executions are loaded from persistent storage, a new string is created instead of the constants.

See Also:
Constant Field Values

STATE_ASYNC

static final java.lang.String STATE_ASYNC
indicates that this execution is doing an asynchronous continuation.

See Also:
Constant Field Values
Method Detail

getDbid

long getDbid()

getName

java.lang.String getName()
the externally given name or id of this execution. The id of a main path of execution is null. Can be used to differentiate concurrent paths of execution e.g. the shipping and billing paths.


getKey

java.lang.String getKey()
the optional user provided business key that is unique within one process definition. This could be for instance the order number. It's a user defined identifier for one execution within the scope of a single process definition.


getId

java.lang.String getId()
a globally unique identifier for this execution.


getNodeName

java.lang.String getNodeName()
represents the current position in the process by indicating the name of the current node.


getState

java.lang.String getState()
the state of this execution.


isActive

boolean isActive()
is this execution active ? This is the inverse of isLocked().


isLocked

boolean isLocked()
is this execution locked ? This is the inverse of isActive().


isFinished

boolean isFinished()
is this execution ended or cancelled ?


isEnded

boolean isEnded()
is this execution ended normally ?


isSuspended

boolean isSuspended()
is this execution suspended ?


getPriority

int getPriority()
indicates low priorities with negative values and high priorities with positive values. The default priority is 0, which means NORMAL. Other recognized named priorities are HIGHEST (2), HIGH (1), LOW (-1) and LOWEST (-2). For the rest, the user can set any other priority integer value, but then, the UI will have to display it as an integer and not the named value.



Copyright © 2009 OW2 Consortium. All Rights Reserved.