public interface ActivityEventHandler extends EventHandler
ActivityEventHandler extends an event handler by the means to
combine event handling and activity execution. That is, an activity waits for
a specific event. As soon as the event occurs, arbitrary data from the event
is provided to the data context of the activity and the activity terminates
and thus the corresponding process instance continues. SimpleSessionContext of an activity. The activity handler
fetches all information from the session context it needs. This incorporates
the mapping of the corresponding event to the activity (the handler usually
waits for several events for different activities). Additionally, the
activity usually has some output parameters that have to be taken over from
the event. How to map data of the event to the output parameters is usually
provided by the configuration of an activity. ExecutableComponent an activity handler has a very similar interface. Besides
the registration of an activity (init(String, SimpleSessionContext)),
an activity handler has the signalling interface that allows to control the
activity execution from the outside. However, since event handling is usually
rather fast, most activity event handler do not need to react on signals.| Modifier and Type | Method and Description |
|---|---|
boolean |
close(java.lang.String sessionID)
Instructs the activity handler to close the activity that is currently
running with the designated session ID.
|
void |
init(java.lang.String sourceID,
SimpleSessionContext sessionContext)
Initialises the handling of an event for the activity identified by the
designated session context.
|
boolean |
kill(java.lang.String sessionID)
Instructs the activity handler to kill the activity that is currently
running with the designated session ID.
|
void |
remove(java.lang.String sourceID)
Removes a registered source from this activity event handler.
|
boolean |
reset(java.lang.String sessionID)
Instructs the activity handler to reset the activity that is currently
running with the designated session ID.
|
boolean |
signal(java.lang.String sessionID,
int signal)
Signals the designated signal to the activity that is currently running
with the designated session ID.
|
boolean |
suspend(java.lang.String sessionID)
Instructs the activity handler to suspend the activity that is currently
running with the designated session ID.
|
getID, handleEvent, isConsuming, isExclusive, isInterruptiblevoid init(java.lang.String sourceID,
SimpleSessionContext sessionContext)
sourceID - The ID of the source that waits for an event of the
activity of the designated session context.sessionContext - The session context for the activity that is to be
executed and terminated as soon as the appropriate event is
handled.ExecutableComponent.init(de.aristaflow.adept2.model.runtimeenvironment.SessionContext)void remove(java.lang.String sourceID)
init(String, SimpleSessionContext). sourceID - The ID of the source for a registered activity that is to
be removed and no event for it should be handled.boolean close(java.lang.String sessionID)
ExecutableComponent the activity handler does not need to close the
activity but can react arbitrarily to this request. However, unlike
ExecutableComponent, activity event handlers need to be
synchronised appropriately since this method is called asynchronously.sessionID - The ID of the execution session which to close.ExecutableComponent.close()boolean reset(java.lang.String sessionID)
ExecutableComponent the activity handler does not need to reset the
activity but can react arbitrarily to this request. However, unlike
ExecutableComponent, activity event handlers need to be
synchronised appropriately since this method is called asynchronously.sessionID - The ID of the execution session which to close.ExecutableComponent.reset()boolean signal(java.lang.String sessionID,
int signal)
ExecutableComponent the activity handler does not need to signal the
activity but can react arbitrarily to this request. However, unlike
ExecutableComponent, activity event handlers need to be
synchronised appropriately since this method is called asynchronously.sessionID - The ID of the execution session which to signal.signal - The code that specifies the type of the signaled event.ExecutableComponent.signal(int)boolean suspend(java.lang.String sessionID)
ExecutableComponent the activity handler does not need to suspend the
activity but can react arbitrarily to this request. However, unlike
ExecutableComponent, activity event handlers need to be
synchronised appropriately since this method is called asynchronously.sessionID - The ID of the execution session which to close.ExecutableComponent.suspend()boolean kill(java.lang.String sessionID)
ExecutableComponent the activity handler does not need to kill the
activity but can react arbitrarily to this request. However, unlike
ExecutableComponent, activity event handlers need to be
synchronised appropriately since this method is called asynchronously.sessionID - The ID of the execution session which to close.ExecutableComponent.kill()