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 or
 process 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 SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic classException thrown if a timeout occurred.static interfaceContext representing a manual activity in the corresponding workflow process.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final SpecialistType<WorkflowAgent>The agent's technical type to be used to request the agent from aSpecialistsBroker.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanisTransitionAllowed(@NotNull Task task, @NotNull StoreElement element, @NotNull Transition transition, @NotNull User user) Returns whether or not aTransitionis allowed for a givenTaskperformed by aUseron aStoreElementprocess(@NotNull Task task, @NotNull Transition transition) Processes the nextactivityof the given task specified by given transition, wherefore given transition must be one of the outgoing transitions of the currenttask state(task.getTaskState().getModelState().getTargetTransitions()).
 The returned context represents the nextactivityof the belongingworkflow modelproviding means toprocessthe 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.@NotNull WorkflowAgent.WorkflowProcessContextstartWorkflow(@NotNull Workflow workflow) Starts a new workflow processwithout context.@NotNull WorkflowAgent.WorkflowProcessContextstartWorkflow(@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- 
TYPEThe 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 newtaskwhich will be reachable via the returnedcontext.The returned context represents the first manual activityof the correspondingworkflow model, providing means toprocessthe 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 newtaskwhich is reachable throughgetTask()of the returned context instance.The returned context represents the first manual activityof the correspondingworkflow modelproviding means toprocessthe 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
 
- 
processWorkflowAgent.WorkflowProcessContext process(@NotNull @NotNull Task task, @NotNull @NotNull Transition transition) throws LockException Processes the nextactivityof the given task specified by given transition, wherefore given transition must be one of the outgoing transitions of the currenttask state(task.getTaskState().getModelState().getTargetTransitions()).
 The returned context represents the nextactivityof the belongingworkflow modelproviding means toprocessthe 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
 
- 
isTransitionAllowedboolean isTransitionAllowed(@NotNull @NotNull Task task, @NotNull @NotNull StoreElement element, @NotNull @NotNull Transition transition, @NotNull @NotNull User user) Returns whether or not aTransitionis allowed for a givenTaskperformed by aUseron aStoreElement- Parameters:
- task- The- Taskto test
- element- The- StoreElementto test
- transition- The- Transitionto test
- user- The- Userto test
- Since:
- 5.2.211004
- See Also:
 
 
-