Interface InstanceStartEventManager

  • All Superinterfaces:
    ADEPT2Service, EventManager
    All Known Implementing Classes:
    AbstractEventManager, DefaultEventManager

    public interface InstanceStartEventManager
    extends EventManager
    To allow for event handler to start process instances, an InstanceStartEventManager provides some methods of a TemplateManager and of InstanceControl. This includes retrieving a template reference as well as creating an instance data container and starting an instance. These methods should not be used from other services but are merely for more generic implementations of event handler plugins.
    • Method Detail

      • getTemplateReference

        TemplateReference getTemplateReference​(SessionToken session,
                                               UUID templateID)
        Gets the lightweight representation of the designated process template.
        Parameters:
        session - 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.
        Returns:
        The lightweight representation of the designated process template.
        See Also:
        TemplateManager.getTemplateReference(SessionToken, UUID)
      • getLatestTemplateReference

        TemplateReference getLatestTemplateReference​(SessionToken session,
                                                     String processType,
                                                     boolean checkStarterRule)
        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.
        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

        InstanceDataContainer createInstanceDataContainer​(SessionToken session,
                                                          UUID templateID)
        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.
        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)
      • createAndStartInstance

        @Deprecated(since="15.0.0",
                    forRemoval=true)
        default UUID createAndStartInstance​(SessionToken session,
                                            UUID templateID,
                                            InstanceDataContainer dataContainer)
                                     throws InvalidTemplateStateException,
                                            InvalidDataContainerException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Creates a new instance of the designated process template, starts the instance and logs the designated user as initiator of the process instance. The start node of the created instance is executed immediately internally and the values of the input parameter provided by the (appropriate) data container are set in the created instance.
        Parameters:
        session - 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.
        Returns:
        The ID of the created process instance which is unique with respect to the process management system and the server respectively
        Throws:
        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.
        ServiceAccessControlException - if the current user (who owns the session) is not allowed to start an instance of the specified template
        InternalServiceException - If the current licence does not support the process type of the designated template, an InvalidLicenceException wrapped as InternalServiceException will be thrown.
        See Also:
        InstanceControl.createAndStartInstance(SessionToken, UUID, de.aristaflow.adept2.model.execution.ExecutionContext, java.net.URI[], java.net.URI[])
      • startInstance

        SerialisablePair<UUID,​UUID> startInstance​(SessionToken session,
                                                        UUID templId,
                                                        InstanceDataContainer dataContainer)
                                                 throws InvalidTemplateStateException,
                                                        InvalidDataContainerException
        Creates a new instance of the designated process template, starts the instance and logs the designated user as initiator of the process instance. The start node of the created instance is executed immediately internally and the values of the input parameter provided by the (appropriate) data container are set in the created instance.
        Parameters:
        session - 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!
        templId - 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.
        Returns:
        The ID and the log ID of the created process instance which are both unique with respect to the process management system and the server respectively.
        Throws:
        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.
        ServiceAccessControlException - if the current user (who owns the session) is not allowed to start an instance of the specified template
        InternalServiceException - If the current licence does not support the process type of the designated template, an InvalidLicenceException wrapped as InternalServiceException will be thrown.
        See Also:
        InstanceControl.startInstance(SessionToken, UUID, de.aristaflow.adept2.model.execution.ExecutionContext, java.net.URI[], java.net.URI[])