@ConfigurationDescription(properties={@Property(name="LibDirectory",defaultValue="${arflow:arflow.libdir}",description="The name of the directory providing the JDBC libraries. This is actually the directory containing a directory named \'jdbc4\' which in turn contains the JDBC drivers."),,,,,,,,,,,,,,}) public class AbstractEventManager extends AbstractNonPrivilegedService implements ActivityEventManager, InstanceStartEventManager
This event service also listens at the worklist for activities that need to wait for an event. These activities will be started activities to retrieve their configuration and the data context. Afterwards the corresponding event source will be created and the activity will be suspended or reset. Resuming or starting of the activity is then up to the corresponding event handler.
Besides simple polling sources, this event manager also supports shared event sources that poll for several sharing event sources. Occurred events are distributed among the registered sharing event sources. For instance, in case of an SQL database a sharing event sources may wait for specific using an SQL statement. Event sources having SQL statements that differ only in some values may be combined using one SQL statement. The result of the SQL statements, that are the rows of the result set, are distributed appropriately among the sharing event sources so that every event source gets the results it waits for.
AbstractADEPT2Service.ActiveSessions| Modifier and Type | Field and Description |
|---|---|
protected ActivityStarting |
activitySelecting
The interface for selecting an activity.
|
protected int |
addEventSourceRetryCount
The number of retries for adding an event source.
|
protected long |
addEventSourceRetryDelay
The time in milliseconds to wait before retrying to add an event source.
|
protected static java.lang.String |
CONF_ADD_EVENT_SOURCE_RETRY_COUNT
Configuration key: The number of retries for adding an event source.
|
protected static java.lang.String |
CONF_ADD_EVENT_SOURCE_RETRY_DELAY
Configuration key: The time in milliseconds to wait before retrying to add
an event source.
|
protected static java.lang.String |
CONF_CREATE_WORKLIST_RETRY_DELAY
Configuration key: The time in milliseconds to wait before retrying to
create (retrieve) a client worklist.
|
protected static java.lang.String |
CONF_CREATE_WORKLIST_SILENT_COUNT
Configuration key: The number of retries for creating (retrieving) a client
worklist before logging the exception as critical.
|
protected static java.lang.String |
CONF_HANDLER_MIN_POOL_SIZE
Configuration key: The minimal number of executor threads for handling
events by various sources.
|
protected static java.lang.String |
CONF_HANDLER_PRIORITY
Configuration key: The priority of the event handling threads used by
various sources.
|
protected static java.lang.String |
CONF_HANDLER_QUEUE_LIMIT
Configuration key: The number of tasks in the executor queue that are
allowed before warnings will be logged.
|
protected static java.lang.String |
CONF_LIB_DIRECTORY
Configuration key for the name of the directory providing the JDBC libraries (actually one
level above the directory 'jdbc4' containing the drivers).
|
protected static java.lang.String |
CONF_MIN_POOL_SIZE
Configuration key: The minimal number of executor threads for polling
events.
|
protected static java.lang.String |
CONF_POLLER_PRIORITY
Configuration key: The priority of the polling threads.
|
protected long |
createWorklistRetryDelay
The time in milliseconds to wait before retrying to create (retrieve) a
client worklist.
|
protected int |
createWorklistSilentCount
The number of retries for creating (retrieving) a client worklist before
logging the exception as critical.
|
protected java.util.concurrent.locks.ReadWriteLock |
dataLock
The lock protecting the data structures containing the handler and
sources.
|
protected ExecutionFactory |
exmFactory
The factory for creating the execution context for starting instances.
|
protected FilterFactory |
filterFactory
The filter factory required for retrieving the "latest" template
of a specific process type.
|
protected java.util.Map<PollingSource<?>,java.util.concurrent.ScheduledFuture<?>> |
futures
/**
All the event sources mapped to the corresponding futures from the poll
service.
|
protected java.util.Map<Pair<java.lang.String,java.lang.String>,java.util.List<EventHandler>> |
handler
All known event handler indexed by the event and source type they are
registered for.
|
protected int |
handlerMinPoolSize
Minimal number of executor threads for handling events.
|
protected int |
handlerPriority
The priority of the event handling threads used by various sources.
|
protected int |
handlerQueueLimit
The number of tasks in the executor queue that are allowed before executor
warnings will be logged.
|
protected java.util.concurrent.ExecutorService |
handlerService
The service that is shared among sources for asynchronous event handling.
|
protected java.util.Map<EventHandler,java.util.Collection<EventSource<?>>> |
handlerSource
All handler and the sources they are registered for.
|
protected InstanceControl |
instanceControl
The control interface for starting instances.
|
protected java.lang.String |
libDirectory
The name of the directory providing the JDBC libraries (actually one level above the directory
'jdbc4' containing the drivers).
|
protected static long |
MINIMAL_DELAY
The minimal delay for the first poll of polling sources.
|
protected int |
minPoolSize
Minimal number of executor threads for polling events.
|
protected OrgModelManager |
omm
The org model manager for checking the starter rule.
|
protected long |
pingWLMInterval
The time interval in milliseconds which to regularly check whether the
worklist manager is still available or available again.
|
protected ProcessManager |
pm
The process manager for retrieving templates to be started.
|
protected int |
pollerPriority
The priority of the polling threads.
|
protected LoggingScheduledThreadPoolExecutor |
pollService
The service that executes the pollers that cause the events.
|
protected static java.lang.String |
PREREGISTERED_EVENT_HANDLER
The configuration key for the pre-registered event handler per source.
|
protected java.util.logging.Level |
reconnectLogLevel
The log level that will be used to log that no push update was received
yet.
|
protected long |
reconnectWLMInterval
The time interval in milliseconds which to regularly reconnect to the
worklist manager if no push update was received yet.
|
protected boolean |
resumeOnly
Flag to indicate whether to resume items and not to start new ones.
|
protected RuntimeService |
runtimeService
The runtime service for starting and terminating activities that wait for
an event.
|
protected java.util.Collection<SharedPollingSource<?>> |
sharedSources
All shared polling sources.
|
protected ObjectCounting<Triple<java.lang.String,java.lang.String,java.lang.String>> |
sourceCount
The amount of sources per source ID.
|
protected java.util.Map<Pair<java.lang.String,java.lang.String>,java.util.Map<java.lang.String,EventSource<?>>> |
sources
All existing event sources indexed by event type and source type mapped
to source ID and source.
|
protected java.util.Map<java.lang.String,java.lang.Class<? extends Event>> |
supportedEventTypes
All event types that are supported by this event manager.
|
protected long |
updateInterval
Interval (in ms) for pushed updates.
|
protected de.aristaflow.adept2.core.automaticclient.AbstractWorklistHandler |
worklistHandler
The worklist handler creating event sources depending on the contents of
the worklist.
|
CONF_CSV_LOGGING, configuration, logger, registry, runtimeRequiredServices, startupRequiredServicesACT_CONF_EVENT_TYPE, ACT_CONF_RETRY_COUNT, ACT_CONF_RETRY_DELAY, ACT_CONF_SOURCE_ID, ACT_CONF_SOURCE_TYPE, PLUGIN_TYPE_ACTIVITY_EVENT_HANDLERPLUGIN_TYPE_EVENT_HANDLER| Modifier | Constructor and Description |
|---|---|
protected |
AbstractEventManager(Configuration conf,
Registry registry,
java.lang.String[] startupRequiredServices,
java.lang.String[] runtimeRequiredServices,
java.util.Map<java.lang.String,java.lang.Class<? extends Event>> supportedEvents)
Creates an event manager creating event sources and combining them with the appropriate event
handlers.
|
| Modifier and Type | Method and Description |
|---|---|
EventHandler |
addEventHandler(SessionToken session,
java.lang.String eventType,
java.lang.String sourceType,
EventHandler current,
int index)
Adds the designated event handler to the designated event type and event
source at the designated position.
|
protected EventHandler |
addEventHandler(SessionToken session,
java.lang.String eventType,
java.lang.String sourceType,
java.lang.String handlerID,
EventHandler current,
int index)
Adds the designated event handler to the designated event type and source
type.
|
EventHandler |
addEventHandler(SessionToken session,
java.lang.String eventType,
java.lang.String sourceType,
java.lang.String handlerID,
int index)
Adds an event handler having the designated ID to the designated event type
and event source at the designated position.
|
EventSource<?> |
addEventSource(SessionToken session,
java.lang.String eventType,
java.lang.String sourceType,
java.lang.String sourceID,
Configuration conf)
Adds an event source having the designated ID to the designated event type
and event source.
|
protected void |
addPreregistered(Configuration conf)
Reads the event handler and sources from the configuration based on the supported event types,
registers and starts them initially and adds them afterwards.
|
protected void |
addPreregistered(Configuration conf,
java.util.Iterator<java.lang.String> sourceTypes)
Reads the event handler and sources for the designated source types from the configuration,
registers and starts them initially and adds them afterwards.
|
java.util.UUID |
createAndStartInstance(SessionToken session,
java.util.UUID templateID,
InstanceDataContainer dataContainer)
Creates a new instance of the designated process template, starts the
instance and logs the designated user as initiator of the process instance.
|
InstanceDataContainer |
createInstanceDataContainer(SessionToken session,
java.util.UUID templateID)
Creates an instance data container for the input (and output) parameters of
the designated template.
|
SessionToken |
createSession()
Creates a new session token using the client session factory assigned to
this service.
|
void |
deselectActivity(EBPInstanceReference activity)
Deselects the designated activity and thus makes it available for
reassigning.
|
java.util.List<java.lang.String> |
getEventHandler(SessionToken session,
java.lang.String eventType,
java.lang.String sourceType)
Gets the event handler that are registered for the designated event type
and source type.
|
java.util.Collection<java.lang.String> |
getEventSources(SessionToken session,
java.lang.String eventType,
java.lang.String sourceType)
Gets the event sources that exist for the designated event type and source
type.
|
java.util.concurrent.ExecutorService |
getHandlerExecutorService()
Gets an executor service for event handling by arbitrary event sources.
|
InstanceControl |
getInstanceControl()
Gets the instance control of the execution manager of this event manager
for starting a new instance based on an occurred database event.
|
TemplateReference |
getLatestTemplateReference(SessionToken session,
java.lang.String processType,
boolean checkStarterRule)
Gets the lightweight representation of the "latest" process
template of the designated process type.
|
RemoteProgressMonitor |
getProgressMonitor()
Gets the interface for remotely using
ProgressMonitor. |
RemoteRuntimeEnvironment |
getRuntimeEnvironment()
Gets the interface for remotely using
RuntimeEnvironment. |
protected LoggingScheduledThreadPoolExecutor |
getScheduledExecutorService()
Gets the scheduled executor service for usage by worklist handler and event
source management.
|
SimpleSessionContext |
getSimpleSessionContext(EBPInstanceReference activity,
ProcessConstants.ExecutionMode executionMode)
Gets an uncomplete simple session context for the designated activity.
|
java.util.Map<java.lang.String,java.lang.Class<? extends Event>> |
getSupportedEventTypes(SessionToken session)
Gets all the event types this event manager supports, that is, it can
create event sources for these event types.
|
TemplateReference |
getTemplateReference(SessionToken session,
java.util.UUID templateID)
Gets the lightweight representation of the designated process template.
|
void |
init(java.net.URI[] localExportedUris,
java.net.URI[] globalExportedUris)
Copies the designated URI array and stores it internally and authenticates
to the system and sets the session factory.
|
protected void |
removeAllSources()
Removes all currently active data sources and stops their polling.
|
EventHandler |
removeEventHandler(SessionToken session,
java.lang.String eventType,
java.lang.String sourceType,
java.lang.String handlerID)
Removes the event handler having the designated ID and being registered for
the designated event type and event source.
|
EventSource<?> |
removeEventSource(SessionToken session,
java.lang.String eventType,
java.lang.String sourceType,
java.lang.String sourceID)
Removes the event source having the designated event type, event source and
ID.
|
SimpleSessionContext |
selectActivity(EBPInstanceReference activity)
Selects the designated activity and thus assigns it to this event manager.
|
void |
shutdown(boolean emergency)
Awaits the termination of the active sessions and nulls the session factory.
|
void |
start()
Method setting the status to the current time.
|
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. |
authenticateService, awaitActiveSessions, getSecurityManager, getSessionFactory, simpleInit_sessionActive, _sessionFinished, activeOrInvalidServiceStateException, changeLogContext, changeLogContext, changeLogContext, consoleLog, csvLoggingEnabled, getClassSpecificJulLogger, getDependencyRegistry, getLocalUris, getLogger, getRelease, getRuntimeRequiredServices, getServiceInstanceName, getStartupRequiredServices, getURIs, getUserCredentials, isActive, isSessionActive, isShutdown, logMethodEntry, logMethodEntry, logMethodEntry, logMethodExit, logMethodExit, ping, preShutdown, privilegeSession, privilegeThread, revertLogContextChanges, sessionActive, sessionActive, sessionActive, sessionActive, sessionFinished, sessionFinished, signalShutdown, signalStart, unprivilegeThreadclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLocalUris, getRelease, getRuntimeRequiredServices, getServiceInstanceName, getStartupRequiredServices, getURIs, ping, preShutdownprotected static final java.lang.String PREREGISTERED_EVENT_HANDLER
protected static final java.lang.String CONF_LIB_DIRECTORY
protected final java.lang.String libDirectory
protected static final java.lang.String CONF_ADD_EVENT_SOURCE_RETRY_COUNT
protected final int addEventSourceRetryCount
protected static final java.lang.String CONF_ADD_EVENT_SOURCE_RETRY_DELAY
protected final long addEventSourceRetryDelay
protected static final java.lang.String CONF_MIN_POOL_SIZE
protected final int minPoolSize
protected final long pingWLMInterval
protected final long reconnectWLMInterval
protected final java.util.logging.Level reconnectLogLevel
protected static final java.lang.String CONF_CREATE_WORKLIST_SILENT_COUNT
protected final int createWorklistSilentCount
protected static final java.lang.String CONF_CREATE_WORKLIST_RETRY_DELAY
protected final long createWorklistRetryDelay
protected static final java.lang.String CONF_POLLER_PRIORITY
protected final int pollerPriority
protected static final java.lang.String CONF_HANDLER_MIN_POOL_SIZE
protected final int handlerMinPoolSize
protected static final java.lang.String CONF_HANDLER_PRIORITY
protected final int handlerPriority
protected static final java.lang.String CONF_HANDLER_QUEUE_LIMIT
protected final int handlerQueueLimit
protected final boolean resumeOnly
protected final long updateInterval
protected static final long MINIMAL_DELAY
protected ExecutionFactory exmFactory
protected FilterFactory filterFactory
protected RuntimeService runtimeService
protected ProcessManager pm
protected InstanceControl instanceControl
protected ActivityStarting activitySelecting
protected OrgModelManager omm
protected LoggingScheduledThreadPoolExecutor pollService
protected java.util.concurrent.ExecutorService handlerService
protected de.aristaflow.adept2.core.automaticclient.AbstractWorklistHandler worklistHandler
protected final java.util.concurrent.locks.ReadWriteLock dataLock
protected final java.util.Map<Pair<java.lang.String,java.lang.String>,java.util.Map<java.lang.String,EventSource<?>>> sources
protected final ObjectCounting<Triple<java.lang.String,java.lang.String,java.lang.String>> sourceCount
protected final java.util.Map<PollingSource<?>,java.util.concurrent.ScheduledFuture<?>> futures
protected final java.util.Collection<SharedPollingSource<?>> sharedSources
protected final java.util.Map<Pair<java.lang.String,java.lang.String>,java.util.List<EventHandler>> handler
protected final java.util.Map<EventHandler,java.util.Collection<EventSource<?>>> handlerSource
protected final java.util.Map<java.lang.String,java.lang.Class<? extends Event>> supportedEventTypes
protected AbstractEventManager(Configuration conf, Registry registry, java.lang.String[] startupRequiredServices, java.lang.String[] runtimeRequiredServices, java.util.Map<java.lang.String,java.lang.Class<? extends Event>> supportedEvents) throws ConfigurationException
conf - The configuration of this service.registry - The registry for retrieving the services required by this
service.startupRequiredServices - The services required by subclasses for starting and shutting
down the event manager. This must neither be null nor contain
null values.runtimeRequiredServices - The services required at runtime of the event manager. This must
neither be null nor contain null values.supportedEvents - The events supported by subclasses. This may be null. The
keys of this map will be used to preregister event sources and handlers.ConfigurationException - If the password for this authenticated
service cannot be parsed from the configuration, a
ConfigurationException will be thrown.public void init(java.net.URI[] localExportedUris,
java.net.URI[] globalExportedUris)
throws AbortServiceException
AbstractNonPrivilegedServiceinit in interface ADEPT2Serviceinit in class AbstractNonPrivilegedServicelocalExportedUris - The URIs with which this service is exported
locally or a local URI or an empty array for internal services.globalExportedUris - The URIs with which this service is published
globally or null in case the service is not
published.AbortServiceException - If authenticating at the security manager
fails, an AbortServiceException will be thrown.public void start()
throws AbortServiceException
AbstractADEPT2Servicestart in interface ADEPT2Servicestart in class AbstractADEPT2ServiceAbortServiceException - If this service cannot be started due to
a severe problem, an AbortServiceException will be
thrown. ADEPT2Service.shutdown(boolean) will not be called when aborting; the
service has to shut down itself/clean up before throwing the
exception.public void shutdown(boolean emergency)
AbstractNonPrivilegedServiceshutdown in interface ADEPT2Serviceshutdown in class AbstractNonPrivilegedServiceemergency - Whether the shutdown will be an emergency shutdown.protected void addPreregistered(Configuration conf) throws ServiceNotKnownException, ConfigurationException
conf - The configuration from which to retrieve the event handler and event sources to be
registered when initialising/starting this event manager.ServiceNotKnownException - If there are problems with the plugin configuration or no
plugin configured at all for the pre-registered event handler or event sources, a
ServiceNotKnownException will be thrown.ConfigurationException - If there are problems with the configuration of an event source,
a ConfigurationException will be thrown.protected void addPreregistered(Configuration conf, java.util.Iterator<java.lang.String> sourceTypes) throws ServiceNotKnownException, ConfigurationException
conf - The configuration from which to retrieve the event handler and event sources to be
registered when initialising/starting this event manager.sourceTypes - The source types for which to retrieve the event handler and event sources
to be registered when initialising/starting this event manager.ServiceNotKnownException - If there are problems with the plugin configuration or no
plugin configured at all for the pre-registered event handler or event sources, a
ServiceNotKnownException will be thrown.ConfigurationException - If there are problems with the configuration of an event source,
a ConfigurationException will be thrown.public SessionToken createSession()
Overridden to make it accessible within this package.
createSession in class AbstractNonPrivilegedServiceprotected LoggingScheduledThreadPoolExecutor getScheduledExecutorService()
public java.util.concurrent.ExecutorService getHandlerExecutorService()
protected void removeAllSources()
public java.util.Map<java.lang.String,java.lang.Class<? extends Event>> getSupportedEventTypes(SessionToken session)
EventManagergetSupportedEventTypes in interface EventManagersession - The session which is used to check for access rights on this
method.public java.util.Collection<java.lang.String> getEventSources(SessionToken session, java.lang.String eventType, java.lang.String sourceType)
EventManagergetEventSources in interface EventManagersession - The session which is used to check for access rights on this
method.eventType - The event type for which to get the event sources.sourceType - The source type for which to get the event sources.public EventSource<?> addEventSource(SessionToken session, java.lang.String eventType, java.lang.String sourceType, java.lang.String sourceID, Configuration conf) throws ConfigurationException, ServiceNotKnownException
EventManageraddEventSource in interface EventManagersession - The session which is used to check for access rights on this
method.eventType - The type of which the source creates events.sourceType - The type of the source to add.sourceID - The unique (with respect to the event type and source type)
ID of the source to add.conf - The configuration of the source which complements the
plugin configuration.ConfigurationException - If there are problems with the designated
configuration, a ConfigurationException will be
thrown.ServiceNotKnownException - If there are problems with the plugin
configuration or no plugin configured at all for the designated
source a ServiceNotKnownException will be thrown.public EventSource<?> removeEventSource(SessionToken session, java.lang.String eventType, java.lang.String sourceType, java.lang.String sourceID)
EventManagernull will be returned. All handler will be removed from the
designated event source.removeEventSource in interface EventManagersession - The session which is used to check for access rights on this
method.eventType - The event type of which to remove a source.sourceType - The type of which to remove a source.sourceID - The ID of the source to remove.null in case there
is already an event source of the designated source ID.public java.util.List<java.lang.String> getEventHandler(SessionToken session, java.lang.String eventType, java.lang.String sourceType)
EventManagergetEventHandler in interface EventManagersession - The session which is used to check for access rights on this
method.eventType - The event type for which to get the event handler.sourceType - The source type for which to get the event handler.public EventHandler addEventHandler(SessionToken session, java.lang.String eventType, java.lang.String sourceType, java.lang.String handlerID, int index) throws ServiceNotKnownException
EventManageraddEventHandler in interface EventManagersession - The session which is used to check for access rights on this
method.eventType - The event type for which to register the event handler.sourceType - The source type for which to register the event handler.handlerID - The unique (with respect to the event type and source
type) ID of the handler to add.index - The (0-based) position in the handler list for the designated
event type and source type.ServiceNotKnownException - If there are problems with the plugin
configuration or no plugin configured at all for the designated
source a ServiceNotKnownException will be thrown.public EventHandler addEventHandler(SessionToken session, java.lang.String eventType, java.lang.String sourceType, EventHandler current, int index)
EventManageraddEventHandler in interface EventManagersession - The session which is used to check for access rights on this
method.eventType - The event type for which to register the event handler.sourceType - The source type for which to register the event handler.current - The handler which to add.index - The (0-based) position in the handler list for the designated
event type and source type.protected EventHandler addEventHandler(SessionToken session, java.lang.String eventType, java.lang.String sourceType, java.lang.String handlerID, EventHandler current, int index) throws ServiceNotKnownException
session - The session which is used to check for access rights on this
method.eventType - The event type for which to add an event handler.sourceType - The source type for which to add an event handler.handlerID - The ID of the handler. This refers to the corresponding
plugin ID. If this is null, a valid handler needs to
be provided as current.current - The handler to add to the designated event type and source
type. If this is null, a valid handler ID (the
instance name of the corresponding plugin) needs to be provided.index - The position where to add the designated handler in the
handler list of the designated event type and source type. If the
handler is already part of the list, it will be moved in case the
new position differs from its current position.ServiceNotKnownException - If a handler ID is provided and this does
not refer to a valid plugin instance for an activity event
handler, a ServiceNotKnownException will be thrown.public EventHandler removeEventHandler(SessionToken session, java.lang.String eventType, java.lang.String sourceType, java.lang.String handlerID)
EventManagernull will be
returned. The handler will be removed from the corresponding event sources.removeEventHandler in interface EventManagersession - The session which is used to check for access rights on this
method.eventType - The event type of which to remove an event handler.sourceType - The source type of which to remove an event handler.handlerID - The ID of the handler to remove.null in case there is
already an event source of the designated source ID.public SimpleSessionContext selectActivity(EBPInstanceReference activity) throws InvalidActivityStateException, InvalidInstanceStateException
ActivityEventManagerProcessConstants.ExecutionMode.PRODUCTION. selectActivity in interface ActivityEventManageractivity - 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)public void deselectActivity(EBPInstanceReference activity) throws InvalidActivityStateException, InvalidInstanceStateException
ActivityEventManagerdeselectActivity in interface ActivityEventManageractivity - 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)public SimpleSessionContext getSimpleSessionContext(EBPInstanceReference activity, ProcessConstants.ExecutionMode executionMode) throws InvalidActivityStateException, InvalidInstanceStateException
ActivityEventManagerActivityEventManager.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.
getSimpleSessionContext in interface ActivityEventManageractivity - 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)public Pair<SessionToken,SimpleSessionContext> startActivity(EBPInstanceReference activity, ProcessConstants.ExecutionMode executionMode) throws InvalidActivityStateException, InvalidInstanceStateException
ActivityEventManagerRuntimeService 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.startActivity in interface ActivityEventManageractivity - 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.de.aristaflow.adept2.core.runtimeservice.RemoteActivityStarting#startActivity(SessionToken,
EBPInstanceReference, ExecutionMode, java.net.URI[])public RemoteRuntimeEnvironment getRuntimeEnvironment()
ActivityEventManagerRuntimeEnvironment.
Since we do not have an ExecutableComponent, the interaction
with the RuntimeEnvironment needs to be done via a service.getRuntimeEnvironment in interface ActivityEventManagerRuntimeEnvironment
clients executing activities proprietarily not using
ExecutableComponent.RuntimeService.getRuntimeEnvironment()public RemoteProgressMonitor getProgressMonitor()
ActivityEventManagerProgressMonitor.
Since we do not have an ExecutableComponent, the interaction
with the ProgressMonitor needs to be done via a service.getProgressMonitor in interface ActivityEventManagerProgressMonitor
clients executing activities proprietarily not using
ExecutableComponent.RuntimeService.getProgressMonitor()public InstanceControl getInstanceControl()
public TemplateReference getTemplateReference(SessionToken session, java.util.UUID templateID)
InstanceStartEventManagergetTemplateReference in interface InstanceStartEventManagersession - The session which is used to check for access rights on this
method.templateID - The ID of the process template to retrieve the
lightweight representation of.TemplateManager.getTemplateReference(SessionToken, UUID)public TemplateReference getLatestTemplateReference(SessionToken session, java.lang.String processType, boolean checkStarterRule)
InstanceStartEventManagergetLatestTemplateReference in interface InstanceStartEventManagersession - The session which is used to check for access rights on this
method.processType - The name of the process type of which to get the
"latest" template.checkStarterRule - Whether the starter rule should be checked. If
true, the starter rule of the template will be resolved and it
will be checked, whether the EventManager is allowed
to start the process from one of its
InstanceStartEventHandlers.null will be
returned.ProcessManagerTools.getLatestTemplateVersion(SessionToken,
String, de.aristaflow.adept2.core.processmanager.TemplateManager,
de.aristaflow.adept2.model.filter.FilterFactory)public InstanceDataContainer createInstanceDataContainer(SessionToken session, java.util.UUID templateID)
InstanceStartEventManagercreateInstanceDataContainer in interface InstanceStartEventManagersession - The session which is used to check for access rights on this
method.templateID - The template for which to create a data container
having the corresponding input and output parameters.InstanceDataContainer having all input and output
parameters of the designated template which allows to set input
parameters and retrieve the values of the output parameters.InstanceControl.createInstanceDataContainer(SessionToken, UUID)public java.util.UUID createAndStartInstance(SessionToken session, java.util.UUID templateID, InstanceDataContainer dataContainer) throws InvalidTemplateStateException, InvalidDataContainerException
InstanceStartEventManagercreateAndStartInstance in interface InstanceStartEventManagersession - The session which is used to check for access rights on this
method. The starting agent and the corresponding organisational
position is retrieved from the execution context!templateID - The template which is to be instantiated. The template
has to be in state INSTANTIABLE for top-level usage.dataContainer - The data container providing the input data and
output data of the instance. This can be null in case
the process does not have mandatory input parameters.InvalidTemplateStateException - If the process template is not
instantiable for top-level usage, an
InvalidTemplateStateException will be raised.InvalidDataContainerException - If the designated process has
mandatory input or output parameters that are not incorporated in
the designated data container, an
InvalidDataContainerException will be raised.InstanceControl.createAndStartInstance(SessionToken, UUID, de.aristaflow.adept2.model.execution.ExecutionContext, java.net.URI[], java.net.URI[])