Class AbstractEventManager

  • All Implemented Interfaces:
    ADEPT2Service, LogService, ServiceThreadHandling, ActivityEventManager, EventManager, InstanceStartEventManager
    Direct Known Subclasses:
    DefaultEventManager

    @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
    The event manager creates event handler and event sources. Polling event sources are regularly (depending on their configuration) executed. Event handlers may be preregistered for specific event sources in the configuration of this event manager. This allows for generic event handling without knowing the sources. Additionally, event sources can be started together with this event manager. Together with an appropriate event handler this can be used, for instance to start process instances as soon as the corresponding event occurs.

    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.

    • Field Detail

      • PREREGISTERED_EVENT_HANDLER

        public static final String PREREGISTERED_EVENT_HANDLER
        The configuration key for the pre-registered event handler per source.
        See Also:
        Constant Field Values
      • CONF_LIB_DIRECTORY

        public static final 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).
        See Also:
        Constant Field Values
      • libDirectory

        protected final String libDirectory
        The name of the directory providing the JDBC libraries (actually one level above the directory 'jdbc4' containing the drivers).
      • CONF_SERVICE_TYPES_FOR_EVENTS

        public static final String CONF_SERVICE_TYPES_FOR_EVENTS
        Configuration key for the names of service types that are required for event sources and/or event handlers.
        See Also:
        Constant Field Values
      • CONF_ADD_EVENT_SOURCE_RETRY_COUNT

        public static final String CONF_ADD_EVENT_SOURCE_RETRY_COUNT
        Configuration key: The number of retries for adding an event source.
        See Also:
        Constant Field Values
      • addEventSourceRetryCount

        protected final int addEventSourceRetryCount
        The number of retries for adding an event source.
      • CONF_ADD_EVENT_SOURCE_RETRY_DELAY

        public static final String CONF_ADD_EVENT_SOURCE_RETRY_DELAY
        Configuration key: The time in milliseconds to wait before retrying to add an event source.
        See Also:
        Constant Field Values
      • addEventSourceRetryDelay

        protected final long addEventSourceRetryDelay
        The time in milliseconds to wait before retrying to add an event source.
      • CONF_MIN_POOL_SIZE

        public static final String CONF_MIN_POOL_SIZE
        Configuration key: The minimal number of executor threads for polling events.
        See Also:
        Constant Field Values
      • minPoolSize

        protected final int minPoolSize
        Minimal number of executor threads for polling events. These are at least 2.
      • CONF_USE_ONE_WORK_EXECUTOR

        public static final String CONF_USE_ONE_WORK_EXECUTOR
        Configuration key: Whether to use the one-work executor which prevents duplicate worklist item handling.
        See Also:
        Constant Field Values
      • useOneWorkExecutor

        protected final boolean useOneWorkExecutor
        Whether to use the one-work executor which prevents duplicate worklist item handling.
      • CONF_QUEUE_LIMIT_POOL_STATISTICS

        protected static final String CONF_QUEUE_LIMIT_POOL_STATISTICS
        Configuration key: The total amount of tasks being the threshold for logging pool statistics.
        See Also:
        Constant Field Values
      • queueLimitPoolStatistics

        protected final int queueLimitPoolStatistics
        The total amount of tasks being the threshold for logging pool statistics.
      • CONF_MIN_LOG_LEVEL_POOL_STATISTICS

        public static final String CONF_MIN_LOG_LEVEL_POOL_STATISTICS
        Configuration key: The log level which need to be reached for logging pool statistics. Pool statistics logs with a lower log level will be ignored.
        See Also:
        Constant Field Values
      • minLogLevelPoolStatistics

        protected final Level minLogLevelPoolStatistics
        The log level which need to be reached for logging pool statistics. Pool statistics logs with a lower log level will be ignored.
      • pingWLMInterval

        protected final long pingWLMInterval
        The time interval in milliseconds which to regularly check whether the worklist manager is still available or available again.
      • reconnectWLMInterval

        protected final long reconnectWLMInterval
        The time interval in milliseconds which to regularly reconnect to the worklist manager if no push update was received yet.
      • reconnectLogLevel

        protected final Level reconnectLogLevel
        The log level that will be used to log that no push update was received yet.
      • CONF_CREATE_WORKLIST_SILENT_COUNT

        public static final String CONF_CREATE_WORKLIST_SILENT_COUNT
        Configuration key: The number of retries for creating (retrieving) a client worklist before logging the exception as critical.
        See Also:
        Constant Field Values
      • createWorklistSilentCount

        protected final int createWorklistSilentCount
        The number of retries for creating (retrieving) a client worklist before logging the exception as critical.
      • CONF_CREATE_WORKLIST_RETRY_DELAY

        public static final String CONF_CREATE_WORKLIST_RETRY_DELAY
        Configuration key: The time in milliseconds to wait before retrying to create (retrieve) a client worklist.
        See Also:
        Constant Field Values
      • createWorklistRetryDelay

        protected final long createWorklistRetryDelay
        The time in milliseconds to wait before retrying to create (retrieve) a client worklist.
      • CONF_POLLER_PRIORITY

        public static final String CONF_POLLER_PRIORITY
        Configuration key: The priority of the polling threads.
        See Also:
        Constant Field Values
      • pollerPriority

        protected final int pollerPriority
        The priority of the polling threads.
      • CONF_HANDLER_MIN_POOL_SIZE

        public static final String CONF_HANDLER_MIN_POOL_SIZE
        Configuration key: The minimal number of executor threads for handling events by various sources.
        See Also:
        Constant Field Values
      • handlerMinPoolSize

        protected final int handlerMinPoolSize
        Minimal number of executor threads for handling events.
      • CONF_HANDLER_PRIORITY

        public static final String CONF_HANDLER_PRIORITY
        Configuration key: The priority of the event handling threads used by various sources.
        See Also:
        Constant Field Values
      • handlerPriority

        protected final int handlerPriority
        The priority of the event handling threads used by various sources.
      • CONF_HANDLER_QUEUE_LIMIT

        public static final String CONF_HANDLER_QUEUE_LIMIT
        Configuration key: The number of tasks in the executor queue that are allowed before warnings will be logged.
        See Also:
        Constant Field Values
      • handlerQueueLimit

        protected final int handlerQueueLimit
        The number of tasks in the executor queue that are allowed before executor warnings will be logged.
      • resumeOnly

        protected final boolean resumeOnly
        Flag to indicate whether to resume items and not to start new ones.
      • updateInterval

        protected final long updateInterval
        Interval (in ms) for pushed updates.
      • MINIMAL_DELAY

        protected static final long MINIMAL_DELAY
        The minimal delay for the first poll of polling sources. Polling should not start earlier to allow for the corresponding handlers to be registered appropriately at the new source.
        See Also:
        Constant Field Values
      • exmFactory

        protected ExecutionFactory exmFactory
        The factory for creating the execution context for starting instances.
      • filterFactory

        protected FilterFactory filterFactory
        The filter factory required for retrieving the "latest" template of a specific process type.
      • runtimeService

        protected RuntimeService runtimeService
        The runtime service for starting and terminating activities that wait for an event.
      • pm

        protected ProcessManager pm
        The process manager for retrieving templates to be started.
      • instanceControl

        protected InstanceControl instanceControl
        The control interface for starting instances.
      • activitySelecting

        protected ActivityStarting activitySelecting
        The interface for selecting an activity.
      • omm

        protected OrgModelManager omm
        The org model manager for checking the starter rule.
      • handlerService

        protected ExecutorService handlerService
        The service that is shared among sources for asynchronous event handling.
      • worklistHandler

        protected de.aristaflow.adept2.core.automaticclient.AbstractWorklistHandler worklistHandler
        The worklist handler creating event sources depending on the contents of the worklist.
      • dataLock

        protected final ReadWriteLock dataLock
        The lock protecting the data structures containing the handler and sources.
      • sourceCount

        protected final ObjectCounting<Triple<String,​String,​String>> sourceCount
        The amount of sources per source ID. In case a source has been added several times it must not be removed until the last adder removes it again.
      • futures

        protected final Map<PollingSource<?>,​ScheduledFuture<?>> futures
        /** All the event sources mapped to the corresponding futures from the poll service. This allows to terminate an event source.
      • sharedSources

        protected final Collection<SharedPollingSource<?>> sharedSources
        All shared polling sources. These need to be tracked separately so that they can be reused when adding a sharing event source.
      • supportedEventTypes

        protected Map<String,​Class<? extends Event>> supportedEventTypes
        All event types that are supported by this event manager.
    • Constructor Detail

      • AbstractEventManager

        protected AbstractEventManager​(org.apache.commons.configuration2.Configuration conf,
                                       Registry registry,
                                       String[] startupRequiredServices,
                                       String[] runtimeRequiredServices)
                                throws ConfigurationException
        Creates an event manager creating event sources and combining them with the appropriate event handlers. It also provides the means for starting instances or activities.
        Parameters:
        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.
        Throws:
        ConfigurationException - If the password for this authenticated service cannot be parsed from the configuration, a ConfigurationException will be thrown.
      • AbstractEventManager

        @Deprecated(since="14.4.0",
                    forRemoval=true)
        protected AbstractEventManager​(org.apache.commons.configuration2.Configuration conf,
                                       Registry registry,
                                       String[] startupRequiredServices,
                                       String[] runtimeRequiredServices,
                                       Map<String,​Class<? extends Event>> supportedEvents)
                                throws ConfigurationException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Creates an event manager creating event sources and combining them with the appropriate event handlers. It also provides the means for starting instances or activities.
        Parameters:
        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. This keys of this map will be used to preregister event sources and handlers. This is no longer required since the supported event types are determined via the event sources declared as plugins for this event manager.
        Throws:
        ConfigurationException - If the password for this authenticated service cannot be parsed from the configuration, a ConfigurationException will be thrown.
    • Method Detail

      • mergeEventRequiredServices

        protected static String[] mergeEventRequiredServices​(org.apache.commons.configuration2.Configuration conf,
                                                             String[] startupRequiredServices)
      • init

        public void init​(URI[] localExportedUris,
                         URI[] globalExportedUris)
                  throws AbortServiceException
        Description copied from class: AbstractNonPrivilegedService
        Copies the designated URI array and stores it internally and authenticates to the system and sets the session factory.
        This method can be called any time in overriding init-methods.
        Specified by:
        init in interface ADEPT2Service
        Overrides:
        init in class AbstractNonPrivilegedService
        Parameters:
        localExportedUris - 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.
        Throws:
        AbortServiceException - If authenticating at the security manager fails, an AbortServiceException will be thrown.
      • getSupportedEventTypes

        protected Map<String,​Class<? extends Event>> getSupportedEventTypes​(SessionToken session,
                                                                                  ServiceAccess sa)
        Gets all event types declared via plugin types for this event manager. This retrieves all declared event source types and retrieves the corresponding event types from the corresponding classes.
        Parameters:
        session - The session which is used to check for access rights on plugin types retrieval.
        sa - The service access from which to retrieve the plugin types.
        Returns:
        A map containing the type names of all event sources declared as plugins for this event manager mapped to the class of the corresponding Event.
      • addPreregistered

        protected void addPreregistered​(org.apache.commons.configuration2.Configuration conf)
                                 throws ServiceNotKnownException,
                                        ConfigurationException
        Reads the event handler and sources from the configuration based on the supported event types, registers and starts them initially and adds them afterwards.
        Parameters:
        conf - The configuration from which to retrieve the event handler and event sources to be registered when initialising/starting this event manager.
        Throws:
        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.
      • addPreregistered

        protected void addPreregistered​(org.apache.commons.configuration2.Configuration conf,
                                        Iterator<String> sourceTypes)
                                 throws ServiceNotKnownException,
                                        ConfigurationException
        Reads the event handler and sources for the designated source types from the configuration, registers and starts them initially and adds them afterwards.
        Parameters:
        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.
        Throws:
        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.
      • createSession

        public SessionToken createSession()
        Creates a new session token using the client session factory assigned to this service.

        Overridden to make it accessible within this package.

        Overrides:
        createSession in class AbstractNonPrivilegedService
        Returns:
        A new session token using the client session factory assigned to this service.
      • getScheduledExecutorService

        @Deprecated
        protected LoggingScheduledThreadPoolExecutor getScheduledExecutorService()
        Deprecated.
        Use OneWorkWorklistHandler which does not require this method.
        Gets the scheduled executor service for usage by worklist handler and event source management. Use this for polling at determined times.
        Returns:
        The scheduled executor service for usage by worklist handler and event source management.
      • getHandlerExecutorService

        public ExecutorService getHandlerExecutorService()
        Gets an executor service for event handling by arbitrary event sources. This allows them to handle events asynchronously without creating too many threads.
        Returns:
        An executor service for event handling by arbitrary event sources allowing them to handle events asynchronously without creating too many threads.
      • removeAllSources

        protected void removeAllSources()
        Removes all currently active data sources and stops their polling.
      • getSupportedEventTypes

        public Map<String,​Class<? extends Event>> getSupportedEventTypes​(SessionToken session)
        Description copied from interface: EventManager
        Gets all the event types this event manager supports, that is, it can create event sources for these event types.
        Specified by:
        getSupportedEventTypes in interface EventManager
        Parameters:
        session - The session which is used to check for access rights on this method.
        Returns:
        All event types that are supported by this event manager and for which this event manager can create event sources. They are indexed by the event type name (which equals the plugin type name for event sources).
      • getEventSources

        public Collection<String> getEventSources​(SessionToken session,
                                                  String eventType,
                                                  String sourceType)
        Description copied from interface: EventManager
        Gets the event sources that exist for the designated event type and source type.
        Specified by:
        getEventSources in interface EventManager
        Parameters:
        session - 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.
        Returns:
        The event sources registered for the designated event type and source type. In case no source exists for this event type and source type, the empty collection will be returned.
      • addEventSource

        public EventSource<?> addEventSource​(SessionToken session,
                                             String eventType,
                                             String sourceType,
                                             String sourceID,
                                             org.apache.commons.configuration2.Configuration conf)
                                      throws ConfigurationException,
                                             ServiceNotKnownException
        Description copied from interface: EventManager
        Adds an event source having the designated ID to the designated event type and event source. The designated configuration will complement the plugin configuration of the source. If there is already a source of the designated ID for the designated event type and source type, it will be returned. Event handler registered for the designated event type and source type will be registered at the new source.
        Specified by:
        addEventSource in interface EventManager
        Parameters:
        session - 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.
        Returns:
        The newly created or the existing event source.
        Throws:
        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.
      • removeEventSource

        public EventSource<?> removeEventSource​(SessionToken session,
                                                String eventType,
                                                String sourceType,
                                                String sourceID)
        Description copied from interface: EventManager
        Removes the event source having the designated event type, event source and ID. The removed event source will be returned. If no event source is found, null will be returned. All handler will be removed from the designated event source.
        Specified by:
        removeEventSource in interface EventManager
        Parameters:
        session - 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.
        Returns:
        The removed event source or null in case there is already an event source of the designated source ID.
      • getEventHandler

        public List<String> getEventHandler​(SessionToken session,
                                            String eventType,
                                            String sourceType)
        Description copied from interface: EventManager
        Gets the event handler that are registered for the designated event type and source type.
        Specified by:
        getEventHandler in interface EventManager
        Parameters:
        session - 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.
        Returns:
        The event handler registered for the designated event type and source type in the order they are notified about the corresponding events. In case no handler is registered, the empty list will be returned.
      • addEventHandler

        public EventHandler addEventHandler​(SessionToken session,
                                            String eventType,
                                            String sourceType,
                                            String handlerID,
                                            int index)
                                     throws ServiceNotKnownException
        Description copied from interface: EventManager
        Adds an event handler having the designated ID to the designated event type and event source at the designated position. If there is already an event handler of the designated ID for the designated event type and source type, it will be returned. An existing handler may change its position according to the provided one. The event handler will be registered at all existing sources of the designated event type and source type.
        Specified by:
        addEventHandler in interface EventManager
        Parameters:
        session - 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.
        Returns:
        The newly created or the existing event handler.
        Throws:
        ServiceNotKnownException - If there are problems with the plugin configuration or no plugin configured at all for the designated source a ServiceNotKnownException will be thrown.
      • addEventHandler

        public EventHandler addEventHandler​(SessionToken session,
                                            String eventType,
                                            String sourceType,
                                            EventHandler current,
                                            int index)
        Description copied from interface: EventManager
        Adds the designated event handler to the designated event type and event source at the designated position. If there is already an event handler of the designated ID for the designated event type and source type, it will be returned and the designated handler will be ignored. An existing handler may change its position according to the provided one. The event handler will be registered at all existing sources of the designated event type and source type.
        This method does not retrieve the handler as plugin and therefore does not need an appropriate plugin configuration for the handler.
        Specified by:
        addEventHandler in interface EventManager
        Parameters:
        session - 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.
        Returns:
        The designated or the existing event handler.
      • addEventHandler

        protected EventHandler addEventHandler​(SessionToken session,
                                               String eventType,
                                               String sourceType,
                                               String handlerID,
                                               EventHandler current,
                                               int index)
                                        throws ServiceNotKnownException
        Adds the designated event handler to the designated event type and source type. This handler will be registered at all sources providing this event type and having this source type. If only a handler ID is provided, a new handler will be created as plugin to this event manager.
        Adding as well as creating will be skipped, if a handler of the designated ID is already registered for the event type and source type. In this case the existing handler may change its position in the list (if the position differs from the handler’s current position). Additionally, the existing handler will be returned instead of the designated or the newly created one.
        Parameters:
        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.
        Returns:
        The newly created handler or the handler object that has already been registered for the designated event type and source type (and having the same handler ID).
        Throws:
        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.
      • removeEventHandler

        public EventHandler removeEventHandler​(SessionToken session,
                                               String eventType,
                                               String sourceType,
                                               String handlerID)
        Description copied from interface: EventManager
        Removes the event handler having the designated ID and being registered for the designated event type and event source. The removed event handler will be returned. If no event handler is found, null will be returned. The handler will be removed from the corresponding event sources.
        Specified by:
        removeEventHandler in interface EventManager
        Parameters:
        session - 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.
        Returns:
        The removed event source or null in case there is already an event source of the designated source ID.
      • getPlugin

        public <P> P getPlugin​(String pluginTypeName,
                               Class<P> pluginType,
                               String instanceName)
                        throws ServiceNotKnownException
        Gets the plugin instance configured for the designated plugin type and name.
        Type Parameters:
        P - The plugin type.
        Parameters:
        pluginTypeName - The name of the plugin type.
        pluginType - The plugin type.
        instanceName - The (simple) instance name of the desired plugin; use null for the default instance.
        Returns:
        The requested plugin.
        Throws:
        ServiceNotKnownException - If the requested plugin could not be found or created, a ServiceNotNKnowException will be thrown.
      • getService

        public <S extends ADEPT2Service> S getService​(String serviceTypeName,
                                                      String simpleServName,
                                                      Class<S> serviceType)
                                               throws ServiceNotKnownException
        Gets the service of the designated type and name (or the corresponding service configured for this event manager).
        When using this method make sure to add the designated service type to the startup or runtime required services in constructor!
        Type Parameters:
        S - The type of the requested service. This is a subtype of ADEPT2Service and either interface configured for the service type or a super type hereof.
        Parameters:
        serviceTypeName - The type of the service which to retrieve.
        simpleServName - The simple name of the service which to retrieve or null to retrieve the default service configured for usage by this event manager.
        serviceType - The type of the requested service. This is a subtype of ADEPT2Service and the interface configured for the service type or a super type hereof.
        Returns:
        The requested service (or a service stub). The object is never null.
        Throws:
        ServiceNotKnownException - If
        • the service is not configured properly,
        • the service cannot be created or started,
        • a required service is not configured properly or cannot be started,
        • the creation of a required service object fails,
        • the service does not fulfill the ADEPT2Service -interface appropriately,
        • an exception is thrown while creating or starting a required service,
        a ServiceNotKnownException will be thrown. This may encapsulate a ConfigurationException or an AbortServiceException.
        InvalidServiceStateException - If this registry failed to start or is shut down, an InvalidServiceStateException will be thrown.
        IllegalArgumentException - If the designated service type interface does not conform to the interface configured for the service type, an IllegalArgumentException will be thrown.
      • getInstanceControl

        public 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.
        Returns:
        The instance control of the execution manager of this event manager for starting a new instance based on an occurred database event.
      • getLatestTemplateReference

        public TemplateReference getLatestTemplateReference​(SessionToken session,
                                                            String processType,
                                                            boolean checkStarterRule)
        Description copied from interface: InstanceStartEventManager
        Gets the lightweight representation of the "latest" process template of the designated process type. Note that the "latest" template need not really be the latest template of the designated process type and dynamic retrieval may cause some trouble in case the template input or output parameter have changed.
        Specified by:
        getLatestTemplateReference in interface InstanceStartEventManager
        Parameters:
        session - 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.
        Returns:
        The "latest" template of the designated process type from the designated template manager. This is the instantiable top-level template having the highest version number. If no template is found for the designated process type, null will be returned.
        See Also:
        ProcessManagerTools.getLatestTemplateVersion(SessionToken, String, de.aristaflow.adept2.core.processmanager.TemplateManager, de.aristaflow.adept2.model.filter.FilterFactory)
      • createInstanceDataContainer

        public InstanceDataContainer createInstanceDataContainer​(SessionToken session,
                                                                 UUID templateID)
        Description copied from interface: InstanceStartEventManager
        Creates an instance data container for the input (and output) parameters of the designated template. The values of the input parameters can be set and provided to the start of an instance based on the designated template.
        Specified by:
        createInstanceDataContainer in interface InstanceStartEventManager
        Parameters:
        session - 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.
        Returns:
        An 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. The caller is responsible for closing.
        See Also:
        InstanceControl.createInstanceDataContainer(SessionToken, UUID)