public interface ExecutionControlManager
| Modifier and Type | Method and Description |
|---|---|
boolean |
abortActivity(SessionToken session,
EBPInstanceReference activity,
long timeToRespond,
boolean propagate)
Instructs the runtime client to abort the specified activity and propagate the abortion if
appropriate, e. g. to subprocess instances.
|
void |
finishActivity(SessionToken session,
EBPInstanceReference activity)
Instructs the execution control manager to stop the specified activity.
|
java.util.Map<EBPInstanceReference,ActivityState> |
getActivities(SessionToken session,
ActivityState.State[] states)
Gets all activities of the agent identified by the designated session token
and their corresponding state.
|
RemoteIterator<java.util.List<SerialisablePair<EBPInstanceReference,ActivityState>>> |
getActivitiesIterator(SessionToken session,
ActivityState.State[] states)
The same as
#getActivities(SessionToken, State[]) but with
partial retrieval of the activities and their state. |
ActivityState |
getActivityState(SessionToken session,
EBPInstanceReference activity)
Gets the current state of the designated activity or
null in
case the activity is not yet known or not known any more. |
java.util.Map<EBPInstanceReference,ActivityState> |
getAllActivities(SessionToken session,
ActivityState.State[] states)
Gets all activities and their corresponding state.
|
RemoteIterator<java.util.List<SerialisablePair<EBPInstanceReference,ActivityState>>> |
getAllActivitiesIterator(SessionToken session,
ActivityState.State[] states)
The same as
#getAllActivities(SessionToken, State[]) but with partial retrieval of the
activities and their state. |
ExecutionControlProperties |
getExecutionControlProperties(SessionToken session,
EBPInstanceReference activity)
Gets the
ExecutionControlProperties for the designated
activity. |
void |
resetActivity(SessionToken session,
EBPInstanceReference activity)
Instructs the execution control manager to reset the specified activity.
|
void |
sendSignalToActivity(SessionToken session,
EBPInstanceReference activity,
int signal)
Instructs the runtime manager to signal the specified event to the
specified activity.
|
void |
suspendActivity(SessionToken session,
EBPInstanceReference activity,
boolean propagate)
Instructs the execution control manager to suspend the specified activity and propagate the
suspension if appropriate, e. g. to subprocess instances.
|
ActivityState |
waitForTermination(SessionToken session,
EBPInstanceReference activity,
long timeToRespond)
Waits for the designated time for the designated activity to terminate and
returns the last state when leaving this method.
|
ExecutionControlProperties getExecutionControlProperties(SessionToken session, EBPInstanceReference activity)
ExecutionControlProperties for the designated
activity. These specify which interactions controlling the execution of a
component are supported, for instance suspending or resetting.session - The session which is used to check for access rights on this
method.activity - The activity to get the execution control properties of.ExecutionControlProperties of the activity or
null in case the activity is not known by the
runtime manager yet or any more.void suspendActivity(SessionToken session, EBPInstanceReference activity, boolean propagate)
session - The session which is used to check for access rights on this method.activity - The identification of the activity to be suspended.propagate - Whether to propagate the suspension if appropriate, e. g. to subprocess
instances.java.lang.IllegalArgumentException - If the activity is not suspensible (see
ExecutionControlProperties.isSuspensible())
or not running (any more), an IllegalArgumentException will be thrown.void finishActivity(SessionToken session, EBPInstanceReference activity)
session - The session which is used to check for access rights on this
method.activity - The identification of the activity to be finished.java.lang.IllegalArgumentException - If the activity is not closable (see
ExecutionControlProperties.isClosable())
or not running (any more), an
IllegalArgumentException will be thrown.void resetActivity(SessionToken session, EBPInstanceReference activity)
session - The session which is used to check for access rights on this
method.activity - The identification of the activity to be reset.java.lang.IllegalArgumentException - If the activity is not resettable (see
ExecutionControlProperties.isResettable())
or not running (any more), an
IllegalArgumentException will be thrown.boolean abortActivity(SessionToken session, EBPInstanceReference activity, long timeToRespond, boolean propagate)
session - The session which is used to check for access rights on this method.activity - The identification of the activity to be aborted.timeToRespond - The time in milliseconds to wait for the activity to terminate/abort. If
the activity has not terminated after this time, it will be killed (the thread will be
stopped). 0 as timeout kills instantly, a timeout less than 0 just sends the abort
notification.propagate - Whether to propagate the abortion if appropriate, e. g. to subprocess
instances.false will be returned.java.lang.IllegalArgumentException - If the activity is not running (any more) in the corresponding
runtime manager, an IllegalArgumentException will be thrown.void sendSignalToActivity(SessionToken session, EBPInstanceReference activity, int signal)
session - The session which is used to check for access rights on this
method.activity - The identification of the activity to send a signal to.signal - The control signal that should be forwarded to the affected
activity.ActivityState getActivityState(SessionToken session, EBPInstanceReference activity)
null in
case the activity is not yet known or not known any more.session - The session which is used to check for access rights on this
method.activity - The identification of the activity to get the state of.null in case the activity is not yet known or not
known any more .java.util.Map<EBPInstanceReference,ActivityState> getActivities(SessionToken session, ActivityState.State[] states)
session - The session which is used to check for access rights on this
method and to identify the agent of whom to return the running
activities.states - The states to filter all activities of the agent identified
by the designated session token. This must not be
null but may be an empty array (which will return an
empty map).ServiceAccessControlException - If
the designated session token has no integrity, a
ServiceAccessControlException will be thrown.RemoteIterator<java.util.List<SerialisablePair<EBPInstanceReference,ActivityState>>> getActivitiesIterator(SessionToken session, ActivityState.State[] states)
#getActivities(SessionToken, State[]) but with
partial retrieval of the activities and their state.session - The session which is used to check for access rights on this
method and to identify the agent of whom to return the running
activities.states - The states to filter all activities of the agent identified
by the designated session token. This must not be
null but may be an empty array (which will return an
empty map).ServiceAccessControlException - If
the designated session token has no integrity, a
ServiceAccessControlException will be thrown.java.util.Map<EBPInstanceReference,ActivityState> getAllActivities(SessionToken session, ActivityState.State[] states)
session - The session which is used to check for access rights, requiring the
supervisor role.states - The states to filter all activities. This must not be null but may
be an empty array (which will return an empty map).ServiceAccessControlException - If the designated
session token has no integrity or not the supervisor role, a
ServiceAccessControlException will be thrown.RemoteIterator<java.util.List<SerialisablePair<EBPInstanceReference,ActivityState>>> getAllActivitiesIterator(SessionToken session, ActivityState.State[] states)
#getAllActivities(SessionToken, State[]) but with partial retrieval of the
activities and their state.session - The session which is used to check for access rights, requiring the
supervisor role.states - The states to filter all activities. This must not be null but may
be an empty array (which will return an empty map).ServiceAccessControlException - If the designated
session token has no integrity or not the supervisor role, a
ServiceAccessControlException will be thrown.ActivityState waitForTermination(SessionToken session, EBPInstanceReference activity, long timeToRespond) throws java.lang.InterruptedException
TerminatedActivityState. If it has not terminated, e.g. the timeout
elapsed, this will be the corresponding
ActivityState. If the activity is not known (any more), null
will be returned.session - The session which is used to check for access rights on this
method.activity - The identification of the activity to wait for its
termination.timeToRespond - The time span in milliseconds to wait for the activity
to terminate.null in case it is
not known (any more).java.lang.InterruptedException - If the current thread is interrupted while
waiting for the activity (or tries to wait with the interrupt
flag set), an InterruptedException will be thrown.