Package de.espirit.firstspirit.workflow
Interface WorkflowAgent
public interface WorkflowAgent
Agent providing means to
This agent is related to the project specified by the surrounding context.
start
new workflows orprocess
steps in existing ones.This agent is related to the project specified by the surrounding context.
Example:
SpecialistsBroker.requireSpecialist(WorkflowAgent.TYPE)
- Since:
- 5.0.207
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Exception thrown if a timeout occurred.static interface
Context representing a manual activity in the corresponding workflow process. -
Field Summary
Modifier and TypeFieldDescriptionstatic final SpecialistType<WorkflowAgent>
The agent's technical type to be used to request the agent from aSpecialistsBroker
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
isTransitionAllowed
(@NotNull Task task, @NotNull StoreElement element, @NotNull Transition transition, @NotNull User user) Returns whether or not aTransition
is allowed for a givenTask
performed by aUser
on aStoreElement
process
(@NotNull Task task, @NotNull Transition transition) Processes the nextactivity
of the given task specified by given transition, wherefore given transitionmust be one of the outgoing transitions of the currenttask state
(task
.@NotNull WorkflowAgent.WorkflowProcessContext
startWorkflow
(@NotNull Workflow workflow) Starts a new workflow processwithout context
.@NotNull WorkflowAgent.WorkflowProcessContext
startWorkflow
(@NotNull Workflow workflow, @Nullable IDProvider element) Starts a new workflow process which context is based on the given element (mode isTask.Mode.ENTITY
, if given element is aDataset
, otherwiseTask.Mode.STORE_ELEMENT
).
-
Field Details
-
TYPE
The agent's technical type to be used to request the agent from aSpecialistsBroker
.- Since:
- 5.0.207
-
-
Method Details
-
startWorkflow
@NotNull @NotNull WorkflowAgent.WorkflowProcessContext startWorkflow(@NotNull @NotNull Workflow workflow) Starts a new workflow processwithout context
. This method will create a newtask
which will be reachable via the returnedcontext
.The returned context represents the first
manual activity
of the correspondingworkflow model
, providing means toprocess
the nexttransition
.
If the first activity is denoted asautomatic
, the activity will be processed automatically and the returned context just provides access to the task which is already in the nextstate
.- Throws:
IllegalArgumentException
- if provided workflow and provided element do not belong to the same project.- Since:
- 5.0.207
-
startWorkflow
@NotNull @NotNull WorkflowAgent.WorkflowProcessContext startWorkflow(@NotNull @NotNull Workflow workflow, @Nullable @Nullable IDProvider element) throws LockException, ElementDeletedException Starts a new workflow process which context is based on the given element (mode isTask.Mode.ENTITY
, if given element is aDataset
, otherwiseTask.Mode.STORE_ELEMENT
). This method will create a newtask
which is reachable throughgetTask()
of the returnedcontext instance.The returned context represents the first
manual activity
of the correspondingworkflow model
providing means toprocess
the nexttransition
.
If the first activity is denoted asautomatic
, the activity will be processed automatically and the returned context just provides access to the task which is already in the nextstate
.- Throws:
IllegalArgumentException
- if provided workflow and provided element do not belong to the same project.LockException
ElementDeletedException
- Since:
- 5.0.207
-
process
WorkflowAgent.WorkflowProcessContext process(@NotNull @NotNull Task task, @NotNull @NotNull Transition transition) throws LockException Processes the nextactivity
of the given task specified by given transition, wherefore given transitionmust be one of the outgoing transitions of the currenttask state
(task
.getTaskState()
.getModelState()
.getTargetTransitions()
).
The returned context represents the nextactivity
of the belongingworkflow model
providing means toprocess
the nexttransition
.
If the next activity has ascript
, the activity will be processed automatically and the returned context provides only access to the task which is already in the nextstate
.- Throws:
IllegalArgumentException
- if given task or transition are not part of the corresponding workflow model.LockException
- during lock problems with elements related to context based tasks- Since:
- 5.0.207
-
isTransitionAllowed
boolean isTransitionAllowed(@NotNull @NotNull Task task, @NotNull @NotNull StoreElement element, @NotNull @NotNull Transition transition, @NotNull @NotNull User user) Returns whether or not aTransition
is allowed for a givenTask
performed by aUser
on aStoreElement
- Parameters:
task
- TheTask
to testelement
- TheStoreElement
to testtransition
- TheTransition
to testuser
- TheUser
to test- Since:
- 5.2.211004
- See Also:
-