Interface ExecutionManager

  • All Superinterfaces:
    ADEPT2Service, ConfigurableService

    public interface ExecutionManager
    extends ConfigurableService
    The execution manager executes process instances, that is, it interprets the process structure and the node states and steps through the process by manipulating node states and starting applications assigned to nodes. State transitions are communicated to the worklist management to update the worklists of the users assigned to process steps that may be started.
    There exist four interfaces: one for the manipulation of complete instances, one for starting activities (process steps) used by the worklist management, one for terminating activities used by the runtime management, one for controlling the execution of activities used by monitoring components and one for the interaction with the worklist management.

    The designated sessions allow for checking access rights on a coarse level, for instance, to prevent controlling instances at all.

    Author:
    Ulrich Kreher
    • Method Detail

      • getInstanceControl

        InstanceControl getInstanceControl()
        Gets a reference to the management of instances, that is, controlling the state of an instance (start, suspend, resume, commit, abort,...) and starting new instances.
        Returns:
        A reference to an instance to allow for managing the life cycle of an instance.
      • getInstanceChanging

        InstanceChanging getInstanceChanging()
        Gets a reference to the management of instance changes, that is, retrieving, committing and aborting the changing of instances. The execution manager controls this in order to perform the necessary notifications (worklist manager, data manager,...) before and after instance changes.
        Returns:
        A reference to an instance to allow for managing instance changes.
      • getActivityStarting

        ActivityStarting getActivityStarting()
        Gets a reference to a controller for all start-related states of activities, which includes starting, resuming and (de-)selecting. This is mainly used by worklists.
        Returns:
        A reference to an instance to allow for managing the first half of the life cycle of an activity (process step).
      • getActivityTermination

        ActivityTermination getActivityTermination()
        Gets a reference to a controller for all termination-related states of activities, which includes finishing, suspending and aborting. This is mainly used by runtime managers.
        Returns:
        A reference to an instance to allow for managing the second half of the life cycle of an activity (process step).
      • getActivityExecutionControl

        ActivityExecutionControl getActivityExecutionControl()
        Gets a reference to a controller for all execution-related states of activities, which includes suspending, resetting and aborting. This is mainly used by monitors or other components from the outside. Accessing the methods of this interface requires the appropriate authorisation.
        Returns:
        A reference to an instance to allow for managing the execution part of the life cycle of an activity (process step).
      • getWorklistInteraction

        WorklistInteraction getWorklistInteraction()
        Gets a reference to the management of worklist managers that need to be informed by this execution manager. That is, registering and deregistering of worklist managers, retrieval of all active activities (the ones that need to be in the worklists) and the resolution of dependencies of staff assignment rules, for instance, references to the agents who have performed a specific activity of a process instance.
        Returns:
        A reference to an instance to allow for interacting of worklist managers with the execution manager.
      • getDataManager

        URI[] getDataManager​(SessionToken session,
                             UUID instanceID)
                      throws ServiceNotKnownException
        Gets the data manager that is associated with this execution manager for the designated process instance.
        Parameters:
        session - The session which is used to access the data manager for the designated instance. This is just used as a coarse check for the necessary access rights.
        instanceID - The instance for which to retrieve the corresponding process manager.
        Returns:
        The communication protocol dependent URIs identifying the manager for the data of this execution manager.
        Throws:
        ServiceNotKnownException - If the data manager for the designated instance can not be retrieved, a ServiceNotKnownException will be thrown.
      • getProcessManager

        URI[] getProcessManager​(SessionToken session,
                                UUID instanceID)
                         throws ServiceNotKnownException
        Gets the process manager that is associated with this execution manager for the designated process instance
        Parameters:
        session - The session which is used to access the process manager for the designated instance. This is just used as a coarse check for the necessary access rights.
        instanceID - The instance for which to retrieve the corresponding process manager.
        Returns:
        The communication protocol dependent URIs identifying the manager for the process templates and instances of this execution manager.
        Throws:
        ServiceNotKnownException - If the process manager for the designated instance can not be retrieved, a ServiceNotKnownException will be thrown.
      • getProcessManagerLogId

        URI[] getProcessManagerLogId​(SessionToken session,
                                     UUID instLogId)
                              throws ServiceNotKnownException
        Gets the process manager that is associated with this execution manager for the designated process instance. This is using the (internal) log ID of the process instance.
        Parameters:
        session - The session which is used to access the process manager for the designated instance. This is just used as a coarse check for the necessary access rights.
        instLogId - The (internal) log ID of the instance for which to retrieve the corresponding process manager.
        Returns:
        The communication protocol dependent URIs identifying the manager for the process templates and instances of this execution manager.
        Throws:
        ServiceNotKnownException - If the process manager for the designated instance can not be retrieved, a ServiceNotKnownException will be thrown.
      • archiveTemplate

        SerialisablePair<Collection<UUID>,​Map<UUID,​UUID>> archiveTemplate​(SessionToken session,
                                                                                      UUID templateID)
                                                                               throws InvalidTemplateStateException,
                                                                                      InvalidInstanceStateException,
                                                                                      DataConsistencyException
        Archives the designated template which removes the template and the instance data completely from the underlying services which includes the TemplateManager, the InstanceManager, the DataManager and the ExecutionHistory. The archived template data includes all templates and embedded templates as well as the template status. Additionally all instances of the designated template as well as the corresponding sub-instances, the instance status, the data, execution and change history as well as the instance-specific (modified) templates will be archived.
        Since this operation is rather critical, there are some prerequisites on the designated template instance that need to be fulfilled for performing it:
        • it has to be a non-modified top-level template,
        • it has to be outdated and must not be instantiable for top-level as well as subprocess usage,
        • it must not be locked (including all of its embedded templates),
        • all instances (and their sub-instances) have to be IE_FINISHED or IE_ABORTED,
        • all instances must not be locked.

        Use this method carefully! Archiving one template will also archive a lot of dependent data. When archiving distributed template hierarchies (parent or child templates are handled by different template managers), one has to take care of the consistency manually.

        Parameters:
        session - The session which is used to check for access rights on this method.
        templateID - The ID of the template which to remove from this template manager.
        Returns:
        The IDs of all archived templates (first element of the pair) and a collection of all archived instances (second element of the pair. The instances provide the logical ID (key) and the log ID (value). The template IDs will contain normal and embedded templates but no IDs of modified templates.
        Throws:
        InvalidTemplateStateException - If one of the templates to be removed is instantiable for top-level or subprocess usage, an InvalidTemplateStateException will be thrown.
        InvalidInstanceStateException - If one of the instances of the designated template is not IE_FINISHED or IE_ABORTED, an InvalidInstanceStateException will be thrown.
        DataConsistencyException - If removing the template leads to inconsistencies, that is, the prerequisites are not fulfilled, a DataConsistencyException will be thrown.
      • archiveInstance

        Map<UUID,​UUID> archiveInstance​(SessionToken session,
                                             UUID instanceID)
                                      throws InvalidInstanceStateException,
                                             DataConsistencyException
        Archives the designated instance which removes the instance data completely from the underlying services which includes the InstanceManager, the DataManager and the ExecutionHistory. The archived instance data includes all instances and sub-instances, the instance status, the data, execution and change history as well as the instance-specific (modified) templates.
        Since this operation is rather critical, there are some prerequisites on the designated instance that need to be fulfilled for performing it:
        • it has to be a top-level instance,
        • it hast to be IE_FINISHED or IE_ABORTED,
        • it must not be locked (including all sub-instances).

        Use this method carefully! When archiving instances one has to take care of the consistency manually, especially for instance hierarchies which are distributed on several execution managers.

        Parameters:
        session - The session which is used to check for access rights on this method.
        instanceID - The ID of the instance which to remove from this execution manager.
        Returns:
        The IDs of all archived instances (key) along with the corresponding log ID (value) which allows to archive data related to these instances.
        Throws:
        InvalidInstanceStateException - If the designated instance is not IE_FINISHED or IE_ABORTED, an InvalidInstanceStateException will be thrown.
        DataConsistencyException - If removing the instance leads to inconsistencies, that is, the prerequisites are not fulfilled, a DataConsistencyException will be thrown.