public interface ActivityEventManager extends EventManager
ActivityEventManager provides a subset of the
methods of a RuntimeService. This includes starting and resuming the activity as well as
the appropriate runtime environment and progress monitor. These methods
should not be used from other services but are merely for more generic
implementations of event handler plugins. activity event handler need to have the special plugin type
"ActivityEventHandler".| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ACT_CONF_EVENT_TYPE
The configuration key for an activity configuration providing the ID of an
event type for which to create an event source for the activity.
|
static java.lang.String |
ACT_CONF_RETRY_COUNT
The configuration key for an activity configuration for the number of
retries when adding an event source for the corresponding activity.
|
static java.lang.String |
ACT_CONF_RETRY_DELAY
The configuration key for an activity configuration for the delay (in
milliseconds) between retries for adding an event source for the
corresponding activity.
|
static java.lang.String |
ACT_CONF_SOURCE_ID
The configuration key for an activity configuration providing the ID of a
source in case one source should be used for several activities.
|
static java.lang.String |
ACT_CONF_SOURCE_TYPE
The configuration key for an activity configuration providing the ID of a
source type for which to create an event source for the activity.
|
static java.lang.String |
PLUGIN_TYPE_ACTIVITY_EVENT_HANDLER
The plug-in type ID for activity event handler.
|
PLUGIN_TYPE_EVENT_HANDLER| Modifier and Type | Method and Description |
|---|---|
void |
deselectActivity(EBPInstanceReference activity)
Deselects the designated activity and thus makes it available for
reassigning.
|
RemoteProgressMonitor |
getProgressMonitor()
Gets the interface for remotely using
ProgressMonitor. |
RemoteRuntimeEnvironment |
getRuntimeEnvironment()
Gets the interface for remotely using
RuntimeEnvironment. |
SimpleSessionContext |
getSimpleSessionContext(EBPInstanceReference activity,
ProcessConstants.ExecutionMode executionMode)
Gets an uncomplete simple session context for the designated activity.
|
SimpleSessionContext |
selectActivity(EBPInstanceReference activity)
Selects the designated activity and thus assigns it to this event manager.
|
Pair<SessionToken,SimpleSessionContext> |
startActivity(EBPInstanceReference activity,
ProcessConstants.ExecutionMode executionMode)
Starts the designated activity if it is appropriate for a
RuntimeService and provides its process context. |
addEventHandler, addEventHandler, addEventSource, getEventHandler, getEventSources, getSupportedEventTypes, removeEventHandler, removeEventSourcegetLocalUris, getRelease, getRuntimeRequiredServices, getServiceInstanceName, getStartupRequiredServices, getURIs, init, ping, preShutdown, shutdown, startstatic final java.lang.String PLUGIN_TYPE_ACTIVITY_EVENT_HANDLER
static final java.lang.String ACT_CONF_EVENT_TYPE
static final java.lang.String ACT_CONF_SOURCE_TYPE
static final java.lang.String ACT_CONF_SOURCE_ID
static final java.lang.String ACT_CONF_RETRY_COUNT
static final java.lang.String ACT_CONF_RETRY_DELAY
SimpleSessionContext selectActivity(EBPInstanceReference activity) throws InvalidActivityStateException, InvalidInstanceStateException
ProcessConstants.ExecutionMode.PRODUCTION. activity - The activity to select for which an event source exists or
is about to be created.InvalidActivityStateException - If the activity (process step) is not
activated, an InvalidActivityStateException will be
raised.InvalidInstanceStateException - If the instance is not running but
stopped, aborted, finished or changed, an
InvalidInstanceStateException will be thrown.ActivityStarting.selectActivity(SessionToken, EBPInstanceReference)void deselectActivity(EBPInstanceReference activity) throws InvalidActivityStateException, InvalidInstanceStateException
activity - The activity to deselect.InvalidActivityStateException - If the activity (process step) is not
selected by the designated user, an
InvalidActivityStateException will be raised.InvalidInstanceStateException - If the instance is not running but
stopped, aborted, finished or changed, an
InvalidInstanceStateException will be thrown.ActivityStarting.deselectActivity(SessionToken,
EBPInstanceReference)SimpleSessionContext getSimpleSessionContext(EBPInstanceReference activity, ProcessConstants.ExecutionMode executionMode) throws InvalidActivityStateException, InvalidInstanceStateException
selectActivity(EBPInstanceReference).
The SimpleSessionContext.getSessionID() of the returned context
will be null and the flag
SimpleSessionContext.isResumed() will be unset since they cannot be
determined.
activity - The activity for which to retrieve the simple session
context.executionMode - The execution mode which to apply, which may have
consequences on the configuration.InvalidActivityStateException - If the activity (process step) is not
selected, running or suspended this event manager, an
InvalidActivityStateException will be raised.InvalidInstanceStateException - If the instance is not running but
stopped, aborted, finished or changed, an
InvalidInstanceStateException is thrown.ActivityStarting.getExecutionContext(SessionToken,
EBPInstanceReference)Pair<SessionToken,SimpleSessionContext> startActivity(EBPInstanceReference activity, ProcessConstants.ExecutionMode executionMode) throws InvalidActivityStateException, InvalidInstanceStateException
RuntimeService and provides its process context. This activity
event manager registers as ExecutionMessageListener and
forwards the messages to the appropriate event handler. Since starting the
activity is internally asynchronous, a timeout is required. If this timeout
elapses the start will be aborted and null will be returned.activity - The unique ID of the activity to start.executionMode - The execution mode in which to start the activity, for
instance, a test mode.SimpleSessionContext providing the process context
(e.g. the input parameter values) of the started activity.InvalidActivityStateException - If the activity (process step) is not
activated or selected by the designated user, an
InvalidActivityStateException will be raised.InvalidInstanceStateException - If the instance is not running but
stopped, aborted, finished or changed, an
InvalidInstanceStateException is thrown.java.lang.IllegalArgumentException - If the designated activity does not fulfil
the constraints for running in the runtime service, an
IllegalArgumentException will be thrown.de.aristaflow.adept2.core.runtimeservice.RemoteActivityStarting#startActivity(SessionToken,
EBPInstanceReference, ExecutionMode, java.net.URI[])RemoteRuntimeEnvironment getRuntimeEnvironment()
RuntimeEnvironment.
Since we do not have an ExecutableComponent, the interaction
with the RuntimeEnvironment needs to be done via a service.RuntimeEnvironment
clients executing activities proprietarily not using
ExecutableComponent.RuntimeService.getRuntimeEnvironment()RemoteProgressMonitor getProgressMonitor()
ProgressMonitor.
Since we do not have an ExecutableComponent, the interaction
with the ProgressMonitor needs to be done via a service.ProgressMonitor
clients executing activities proprietarily not using
ExecutableComponent.RuntimeService.getProgressMonitor()