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, anInstanceStartEventManagerprovides some methods of aTemplateManagerand ofInstanceControl. 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.
-
-
Field Summary
-
Fields inherited from interface de.aristaflow.adept2.core.eventmanager.EventManager
PLUGIN_TYPE_EVENT_HANDLER
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default UUIDcreateAndStartInstance(SessionToken session, UUID templateID, InstanceDataContainer dataContainer)Deprecated, for removal: This API element is subject to removal in a future version.InstanceDataContainercreateInstanceDataContainer(SessionToken session, UUID templateID)Creates an instance data container for the input (and output) parameters of the designated template.TemplateReferencegetLatestTemplateReference(SessionToken session, String processType, boolean checkStarterRule)Gets the lightweight representation of the "latest" process template of the designated process type.TemplateReferencegetTemplateReference(SessionToken session, UUID templateID)Gets the lightweight representation of the designated process template.SerialisablePair<UUID,UUID>startInstance(SessionToken session, UUID templId, 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.-
Methods inherited from interface de.aristaflow.adept2.base.service.ADEPT2Service
getLocalUris, getRelease, getRuntimeRequiredServices, getServiceInstanceName, getStartupRequiredServices, getURIs, init, ping, preShutdown, shutdown, start
-
Methods inherited from interface de.aristaflow.adept2.core.eventmanager.EventManager
addEventHandler, addEventHandler, addEventSource, getEventHandler, getEventSources, getSupportedEventTypes, removeEventHandler, removeEventSource
-
-
-
-
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 theEventManageris allowed to start the process from one of itsInstanceStartEventHandlers.- 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,
nullwill 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
InstanceDataContainerhaving 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 stateINSTANTIABLEfor top-level usage.dataContainer- The data container providing the input data and output data of the instance. This can benullin 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, anInvalidTemplateStateExceptionwill be raised.InvalidDataContainerException- If the designated process has mandatory input or output parameters that are not incorporated in the designated data container, anInvalidDataContainerExceptionwill be raised.ServiceAccessControlException- if the current user (who owns the session) is not allowed to start an instance of the specified templateInternalServiceException- If the current licence does not support the process type of the designated template, anInvalidLicenceExceptionwrapped asInternalServiceExceptionwill 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 stateINSTANTIABLEfor top-level usage.dataContainer- The data container providing the input data and output data of the instance. This can benullin 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, anInvalidTemplateStateExceptionwill be raised.InvalidDataContainerException- If the designated process has mandatory input or output parameters that are not incorporated in the designated data container, anInvalidDataContainerExceptionwill be raised.ServiceAccessControlException- if the current user (who owns the session) is not allowed to start an instance of the specified templateInternalServiceException- If the current licence does not support the process type of the designated template, anInvalidLicenceExceptionwrapped asInternalServiceExceptionwill be thrown.- See Also:
InstanceControl.startInstance(SessionToken, UUID, de.aristaflow.adept2.model.execution.ExecutionContext, java.net.URI[], java.net.URI[])
-
-