public interface InstanceControl
| Modifier and Type | Method and Description |
|---|---|
SerialisablePair<java.lang.Boolean,ProcessConstants.InstanceExecutionStatus> |
checkForAndFixInconsistencies(SessionToken session,
java.util.UUID instId)
Checks the designated instance for inconsistencies and tries to fix them.
|
void |
commitInstance(SessionToken session,
java.util.UUID instanceID)
Commits the designated instance, that means, the instance is marked as
successfully completed.
|
java.util.UUID |
createAndStartInstance(SessionToken session,
java.util.UUID processTemplateID,
ExecutionContext executionContext,
java.net.URI[] rtMgr,
java.net.URI[] stateListener)
Creates a new instance of the designated process template, starts the instance and logs the
designated user as initiator of the process instance.
|
java.util.UUID |
createAndStartInstance(SessionToken session,
java.util.UUID processTemplateID,
java.net.URI[] stateListener)
Creates a new instance of the designated process template, starts the
instance and logs the designated user as initiator of the process instance.
|
java.util.UUID |
createAndStartInstance(SessionToken session,
java.util.UUID processTemplateID,
java.net.URI[] rtMgr,
java.net.URI[] stateListener)
Creates a new instance of the designated process template, starts the instance and logs the
designated user as initiator of the process instance.
|
java.util.UUID |
createAndStartSubInstance(SessionToken session,
EBPInstanceReference superInstanceActivity,
ExecutionContext executionContext,
java.net.URI[] stateListener)
Creates a new instance of the designated process template as a subprocess
of the designated activity.
|
InstanceDataContainer |
createInstanceDataContainer(SessionToken session,
java.util.UUID processTemplateID)
Creates an instance data container for the input (and output) parameters of
the designated template.
|
java.util.Set<TemplateReference> |
getInstantiableTemplateReferences(SessionToken session,
boolean includeOutdated)
Gets the lightweight representations of all templates that can be
instantiated as top-level-processes, that is, they exist in the process
manager and they are in the state
INSTANTIABLE as top-level
processes. |
RemoteIterator<java.util.List<TemplateReference>> |
getInstantiableTemplateReferencesIterator(SessionToken session,
boolean includeOutdated)
The same as
getInstantiableTemplateReferences(SessionToken, boolean)
but with partial retrieval of the template references. |
java.util.Set<java.util.UUID> |
getInstantiableTemplates(SessionToken session,
boolean includeOutdated)
Gets the IDs of all templates that can be instantiated as
top-level-processes, that is, they exist in the process manager and they
are in the state
INSTANTIABLE as top-level processes. |
RemoteIterator<java.util.List<java.util.UUID>> |
getInstantiableTemplatesIterator(SessionToken session,
boolean includeOutdated)
The same as
getInstantiableTemplates(SessionToken, boolean) but with
partial retrieval of the template IDs. |
ParameterDataContext |
getPublicDataContext(SessionToken session,
java.util.UUID instanceID)
Gets the data context providing the (most recent) values of the public data
elements of the designated instance.
|
TemplateReference |
getTemplateReference(SessionToken session,
java.util.UUID templateID)
Gets the lightweight representation of the designated process template.
|
Vote |
prepareCommitInstance(SessionToken session,
java.util.UUID instanceID)
Prepares the commit of an instance.
|
void |
resumeInstance(SessionToken session,
java.util.UUID instanceID)
Resumes the designated (top-level or sub-process) instance and (re-)offers
all active (including suspended) activities to the worklist manager.
|
void |
resumeInstance(SessionToken session,
java.util.UUID instanceID,
java.net.URI[] stateListener)
Resumes the designated (top-level or sub-process) instance and (re-)offers
all active (including suspended) activities to the worklist manager.
|
void |
rollbackInstance(SessionToken session,
java.util.UUID instanceID)
Resets the designated instance, which includes rolling back the data and
the effects of the instance as a whole.
|
void |
stopAndAbortInstance(SessionToken session,
java.util.UUID instanceID,
boolean propagateToRunningActs,
java.lang.String errorMessage,
java.lang.String state,
long errorCode)
Stops the designated instance and if appropriate also the running activities.
|
boolean |
suspendInstance(SessionToken session,
java.util.UUID instanceID,
boolean propagateToRunningActs)
Suspends the designated instance and if appropriate also the running activities.
|
InstanceDataContainer createInstanceDataContainer(SessionToken session, java.util.UUID processTemplateID)
session - The session which is used to check for access rights on this
method.processTemplateID - 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.ParameterDataContext getPublicDataContext(SessionToken session, java.util.UUID instanceID)
session - The session which is used to check for access rights on this
method and to retrieve the accessing agent and the corresponding
organisational position.instanceID - The ID of the instance for which to retrieve the values
of the public data elements.java.util.UUID createAndStartInstance(SessionToken session, java.util.UUID processTemplateID, java.net.URI[] stateListener) throws InvalidTemplateStateException, InvalidDataContainerException
PRODUCTION). The start
node of the created instance is executed internally immediately. This
method forwards to
createAndStartInstance(SessionToken, UUID, ExecutionContext, URI[], URI[])
whereas the ExecutionContext contains only
agent and orgPosition.session - The session which is used to check for access rights on this
method and to retrieve the starting agent and the corresponding
organisational position.processTemplateID - The template which is to be instantiated. The
template has to be in state INSTANTIABLE for
top-level usage.stateListener - The URIs identifying a callback interface to be
notified when the top-level instance to be started has changed its
state (has been suspended, resumed, finished or failed) or null in
case no notification is necessary. The listener has to implement
InstanceStateListener.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 parameters, an
InvalidDataContainerException will be raised.InternalServiceException - If the current licence does not support
the process type of the designated template, an
InvalidLicenceException wrapped as
InternalServiceException will be thrown.TemplateStatus.isInstantiable(boolean)java.util.UUID createAndStartInstance(SessionToken session, java.util.UUID processTemplateID, java.net.URI[] rtMgr, java.net.URI[] stateListener) throws InvalidTemplateStateException, InvalidDataContainerException
PRODUCTION). The
start node of the created instance is executed internally immediately. This method forwards to
createAndStartInstance(SessionToken, UUID, ExecutionContext, URI[], URI[]) whereas the
ExecutionContext contains only agent and orgPosition.session - The session which is used to check for access rights on this method and to
retrieve the starting agent and the corresponding organisational position.processTemplateID - The template which is to be instantiated. The template has to be in
state INSTANTIABLE for top-level usage.rtMgr - The runtime manager URIs allowing to autostart the first activity on the
designated runtime manager. If autostart is not enabled for the first activity or
null is provided, no autostart will occur.stateListener - The URIs identifying a callback interface to be notified when the
top-level instance to be started has changed its state (has been suspended, resumed,
finished or failed) or null in case no notification is necessary. The listener has to
implement InstanceStateListener.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 parameters,
an InvalidDataContainerException will be raised.InternalServiceException - If the current licence does not support the process type of
the designated template, an InvalidLicenceException wrapped as
InternalServiceException will be thrown.TemplateStatus.isInstantiable(boolean)java.util.UUID createAndStartInstance(SessionToken session, java.util.UUID processTemplateID, ExecutionContext executionContext, java.net.URI[] rtMgr, java.net.URI[] stateListener) throws InvalidTemplateStateException, InvalidDataContainerException
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!processTemplateID - The template which is to be instantiated. The template has to be in
state INSTANTIABLE for top-level usage.executionContext - The execution context contains the data container with input and output
data of the instance and the execution mode. SUBSTITUTED_TEST or
COMPONENT_TEST) all activities are wrapped in the test environment and
the mode is provided to the respective components - if not changed by the user at the
corresponding step. Additionally, the ExecutableBusinessProcessInstance
are ignored and may therefore be null.rtMgr - The runtime manager URIs allowing to autostart the first activity on the
designated runtime manager. If autostart is not enabled for the first activity or
null is provided, no autostart will occur.stateListener - The URIs identifying a callback interface to be notified when the
subprocess instance to be started has changed its state (has been suspended, resumed,
finished or failed) or null in case no notification is necessary. The listener has to
implement InstanceStateListener.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 templateInternalServiceException - If the current licence does not support the process type of
the designated template, an InvalidLicenceException wrapped as
InternalServiceException will be thrown.TemplateStatus.isInstantiable(boolean)java.util.UUID createAndStartSubInstance(SessionToken session, EBPInstanceReference superInstanceActivity, ExecutionContext executionContext, java.net.URI[] stateListener) throws InvalidTemplateStateException, InvalidDataContainerException
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!superInstanceActivity - A reference to the activity which represents
the subprocess in the corresponding super-process.executionContext - The execution context identifying the agent
creating the subprocess instance, a reference to the light weight
process containing the ID of the subprocess template, the data
container forwarding the data from the super- to the subprocess
and the execution mode.stateListener - The URIs identifying a callback interface to be
notified when the subprocess instance to be started has changed
its state (has been suspended, resumed, finished or failed) or
null in case no notification is necessary. The listener has to
implement either InstanceStateListener or
SubInstanceStateListener depending on whether the resumed
instance is a top-level or a subprocess.InvalidTemplateStateException - If the process template is not
instantiable for subprocess usage, an
InvalidTemplateStateException will be raised.InvalidDataContainerException - If the designated subprocess 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
templatejava.util.Set<java.util.UUID> getInstantiableTemplates(SessionToken session, boolean includeOutdated)
INSTANTIABLE as top-level processes.
For a non-administrative user, only these templates are returned, which may be started by the qualified agent in the session.
session - The session which is used to check for access rights on this
method.includeOutdated - Whether outdated process templates should be
included and returned.RemoteIterator<java.util.List<java.util.UUID>> getInstantiableTemplatesIterator(SessionToken session, boolean includeOutdated)
getInstantiableTemplates(SessionToken, boolean) but with
partial retrieval of the template IDs.session - The session which is used to check for access rights on this
method.includeOutdated - Whether outdated process templates should be
included and returned.TemplateReference getTemplateReference(SessionToken session, java.util.UUID templateID)
getInstantiableTemplates(SessionToken, boolean).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.java.lang.IllegalArgumentException - If the designated template ID is not known
or it is not instantiable as top-level-process by the designated
user, a IllegalArgumentException will be thrown.java.util.Set<TemplateReference> getInstantiableTemplateReferences(SessionToken session, boolean includeOutdated)
INSTANTIABLE as top-level
processes. Process templates in state OUTDATED will only be
recognised if requested.
For a non-administrative user, only the references of the templates are returned, which may be started by the qualified agent in the session.
session - The session which is used to check for access rights on this
method.includeOutdated - Whether outdated process templates should be
included and returned.getInstantiableTemplates(SessionToken, boolean)RemoteIterator<java.util.List<TemplateReference>> getInstantiableTemplateReferencesIterator(SessionToken session, boolean includeOutdated)
getInstantiableTemplateReferences(SessionToken, boolean)
but with partial retrieval of the template references.session - The session which is used to check for access rights on this
method.includeOutdated - Whether outdated process templates should be
included and returned.SerialisablePair<java.lang.Boolean,ProcessConstants.InstanceExecutionStatus> checkForAndFixInconsistencies(SessionToken session, java.util.UUID instId) throws DataConsistencyException
session - The session with which to check for and fix inconsistencies in the designated
instance. The agent must have the
Capabilities.SUPERVISOR_ROLE.instId - The ID of the instance which to check for inconsistencies and fix them.DataConsistencyException - If an inconsistency was found that could not be fixed
automatically a DataConsistencyException will be thrown.boolean suspendInstance(SessionToken session, java.util.UUID instanceID, boolean propagateToRunningActs) throws InvalidInstanceStateException
IE_RUNNING, IE_SOFTLY_SUSPENDED or IE_SUSPENDED.session - The session which is used to check for access rights on this method. This can
also be used to allow only a dependent session to resume the designated instance. The
policy is determined by the corresponding implementation.instanceID - The ID of the instance to be suspended.propagateToRunningActs - Whether running activities also should be suspended (
IE_SUSPENDED) or not. This will also propagate to subprocesses if the
running nodes refer to subprocesses.FALSE indicates, that a
few activities are still running but as soon as they are finished, the instance does
not progress any more.InvalidInstanceStateException - If the process instance is not running or suspended or it
is a sub-process instance and its parent instance is not running, softly suspended or
softly aborted, an InvalidInstanceStateException will be raised. This
will also apply if either is locked for changes.ProcessConstants.InstanceExecutionStatusvoid resumeInstance(SessionToken session, java.util.UUID instanceID) throws InvalidInstanceStateException
IE_SUSPENDED or
IE_SOFTLY_SUSPENDED.
If the instance has a state listener it will be notified and kept for
further notifications. If you need to change the state listener, for
instance, when moving a suspended process instance from one execution
manager to another one, you will need to use
resumeInstance(SessionToken, UUID, URI[]).
session - The session which is used to check for access rights on this
method and to retrieve the resuming agent and the corresponding
organisational position.instanceID - The ID of the instance to be resumed.InvalidInstanceStateException - If the process instance is not
suspended or it is a sub-process instance and its parent instance
is not running, an InvalidInstanceStateException
will be raised. This will also apply if either is locked for
changes.ProcessConstants.InstanceExecutionStatusvoid resumeInstance(SessionToken session, java.util.UUID instanceID, java.net.URI[] stateListener) throws InvalidInstanceStateException
IE_SUSPENDED or
IE_SOFTLY_SUSPENDED.
If the instance already has a state listener it will not be notified and it will be removed from further notifications. The designated state listener will be used instead. But the new one will not receive the current resume.
session - The session which is used to check for access rights on this
method and to retrieve the resuming agent and the corresponding
organisational position.instanceID - The ID of the instance to be resumed.stateListener - The URIs identifying a callback interface to be
notified when the top-level instance to be started has changed its
state (has been suspended, resumed, finished or failed). The
listener has to implement InstanceStateListener. It will
not be notified about the current resume.InvalidInstanceStateException - If the process instance is not
suspended or it is a sub-process instance and its parent instance
is not running, an InvalidInstanceStateException
will be raised. This will also apply if either is locked for
changes.ProcessConstants.InstanceExecutionStatusvoid stopAndAbortInstance(SessionToken session, java.util.UUID instanceID, boolean propagateToRunningActs, java.lang.String errorMessage, java.lang.String state, long errorCode) throws InvalidInstanceStateException
IE_RUNNING, IE_SUSPENDED, IE_SOFTLY_SUSPENDED,
IE_SOFTLY_ABORTED or IE_ABORTED. Afterwards the instance is in state
IE_ABORTED (with propagation to running activities) or
IE_SOFTLY_ABORTED (without propagation). IE_SUSPENDED or
IE_ABORTED.session - The session which is used to check for access rights on this method and to
retrieve the stopping agent and the corresponding organisational position.instanceID - The ID of the instance to be stopped.propagateToRunningActs - Whether running activities should also be aborted
(IE_ABORTED) or not (IE_SOFTLY_ABORTED). This will also
propagate to subprocesses if the running nodes refer to subprocesses.errorMessage - A human readable description of the reason for the abortion.state - The state of the caller in which the error occurred that led to the abortion.errorCode - A code that identifies the reason why the instance should be aborted.InvalidInstanceStateException - If the process instance is not running, suspended or
aborted or it is a sub-process instance and its parent instance is not running,
softly suspended or softly aborted, an InvalidInstanceStateException
will be raised. This will also apply if either is locked for changes.ProcessConstants.InstanceExecutionStatusVote prepareCommitInstance(SessionToken session, java.util.UUID instanceID) throws InvalidInstanceStateException
IE_FINISHED.session - The session which is used to check for access rights on this
method. This can also be used to allow only a dependent session to
commit the designated instance. The policy is determined by the
corresponding implementation.instanceID - The ID of the instance to be committed.InvalidInstanceStateException - If the process instance is not
finished, an InvalidInstanceStateException will be
raised.ProcessConstants.InstanceExecutionStatusvoid commitInstance(SessionToken session, java.util.UUID instanceID) throws InvalidInstanceStateException
IE_FINISHED.session - The session which is used to check for access rights on this
method and to retrieve the committing agent and the corresponding
organisational position.instanceID - The ID of the instance to be committed.InvalidInstanceStateException - If the process instance is not
finished, an InvalidInstanceStateException will be
raised.ProcessConstants.InstanceExecutionStatusvoid rollbackInstance(SessionToken session, java.util.UUID instanceID) throws InvalidInstanceStateException
IE_FINISHED, IE_ABORTED or
IE_SOFTLY_ABORTED.session - The session which is used to check for access rights on this
method and to retrieve the aborting agent and the corresponding
organisational position.instanceID - The ID of the instance to be committed.InvalidInstanceStateException - If the process instance is not
finished or not aborted, an
InvalidInstanceStateException will be raised.ProcessConstants.InstanceExecutionStatus