org.jbpm.delegation
Interface ExecutionContext

All Known Subinterfaces:
AssignmentContext, ForkContext, JoinContext, ProcessInvocationContext

public interface ExecutionContext

is the interface that provides access to the process execution context information for the delegation implementations.


Method Summary
 void cancelEvent(java.lang.String reference)
          cancels all scheduled events with the given reference.
 void createVariable(java.lang.String name, Token token, DefaultType defaultType)
          creates a local variable for the token.
 void createVariable(java.lang.String name, Token token, Type type)
          creates a local variable for the token.
 Type findTypeByJavaType(java.lang.String javaType)
          searches for the type in the current process definition that matches the given java-type for creating token-local variables with createVariable(String, Token, Type).
 java.lang.String getActorId()
          gets the actorId in which this delegation is executed.
 Definition getDefinition()
          gets the Definition.
 ExecutionService getExecutionService()
          retrieves the execution service.
 ExecutionService getExecutionService(java.lang.String actorId)
          retrieves the execution service for a given actor.
 Node getNode()
          gets the Node in which this delegation is executed.
 java.lang.String getPreviousActorId()
          gets the previous actorId.
 ProcessInstance getProcessInstance()
          gets the ProcessInstance.
 SchedulerService getSchedulerService()
          provides access to the jbpm job scheduler service.
 Token getToken()
          gets the Flow in which this delegation is executed.
 java.lang.Object getVariable(java.lang.String name)
          gets the value of a variable.
 void log(org.jbpm.util.log.Level level, java.lang.String msg)
          allows the delegate-implementations to log events to the database.
 void log(java.lang.String msg)
          allows the delegate-implementations to log events to the database.
 void milestoneReached(java.lang.String milestoneName)
          signals that a milestone has been reached.
 void setVariable(java.lang.String name, java.lang.Object value)
          sets the variable with the specified name to the specified value.
 

Method Detail

getDefinition

public Definition getDefinition()
gets the Definition.


getProcessInstance

public ProcessInstance getProcessInstance()
gets the ProcessInstance.


getToken

public Token getToken()
gets the Flow in which this delegation is executed.


getActorId

public java.lang.String getActorId()
gets the actorId in which this delegation is executed. this is the actor of the current state. note that this method will return null once the token has left the state. then the actor will be the previous actor.


getPreviousActorId

public java.lang.String getPreviousActorId()
gets the previous actorId. From the moment the token leaves the state, the actor is renamed to previous actor.


getNode

public Node getNode()
gets the Node in which this delegation is executed.


getVariable

public java.lang.Object getVariable(java.lang.String name)
gets the value of a variable. The variable is searched recursively from the current token to the root token of the process instance.


setVariable

public void setVariable(java.lang.String name,
                        java.lang.Object value)
sets the variable with the specified name to the specified value.


findTypeByJavaType

public Type findTypeByJavaType(java.lang.String javaType)
searches for the type in the current process definition that matches the given java-type for creating token-local variables with createVariable(String, Token, Type).


createVariable

public void createVariable(java.lang.String name,
                           Token token,
                           Type type)
creates a local variable for the token. See findTypeByJavaType(String) to find the type.


createVariable

public void createVariable(java.lang.String name,
                           Token token,
                           DefaultType defaultType)
creates a local variable for the token.


log

public void log(java.lang.String msg)
allows the delegate-implementations to log events to the database.


log

public void log(org.jbpm.util.log.Level level,
                java.lang.String msg)
allows the delegate-implementations to log events to the database.


cancelEvent

public void cancelEvent(java.lang.String reference)
cancels all scheduled events with the given reference.


milestoneReached

public void milestoneReached(java.lang.String milestoneName)
                      throws ExecutionException
signals that a milestone has been reached. this might trigger all tokens that are waiting for this milestone to move out of the milestone state.

Throws:
ExecutionException

getExecutionService

public ExecutionService getExecutionService()
retrieves the execution service.


getExecutionService

public ExecutionService getExecutionService(java.lang.String actorId)
retrieves the execution service for a given actor.


getSchedulerService

public SchedulerService getSchedulerService()
provides access to the jbpm job scheduler service.



Version : jbpm-2.0