Overview
Once the task has been submitted on the Atoti Sign-Off UI, the details are sent to the Atoti Sign-Off server, where the action is completed by theIWorkflowTaskActionDelegator. This delegator accepts the submitted WorkflowTaskActionExecutionDTO, then delegates and
executes the task as required.
The submitted DTO
TheWorkflowTaskActionExecutionDTO object looks as follows:
- the
taskKeyis used by the delegator to determine which task to execute. - the
workflowTypeindicates the type of workflow the action belongs to. - the
keysindicate the objects upon which the action is executed. - the
taskVariablesstore optional task variables to be handled by the backend and are the result of the inputs to theWorkflowTaskActionInputFieldDTO.
The delegator
TheIWorkflowTaskActionDelegator is a simple delegator that accepts a WorkflowTaskActionExecutionDTO and delegates the work to a backend service. It contains one method:
executeTaskAction() method accepts the WorkflowTaskActionExecutionDTO and delegates it to a task action based on its taskKey.
Customize the Java tasks
The delegator has a custom implementation defined. This can be overridden if you’re not using the out-of-the-box workflows. Alternatively, you can append custom actions to the default implementation by implementing theICustomWorkflowTaskActionService.
The default delegator
The default delegator is implemented inDefaultWorkflowTaskActionDelegator, which is imported in the starter.
Take a look to see how the tasks are delegated, but note that the methods of delegation are completely up to you.
Override the default delegator
To override the delegator, implement your ownIWorkflowTaskActionDelegator.
Here’s an example of a simple delegator that logs the action that is executed:
WorkflowTaskActionExecutionDTO object.
Append to the default delegator
To append to the default delegator, add an implementation ofICustomWorkflowTaskActionService.
The ICustomWorkflowTaskActionService has one method that needs to be overridden: executeCustomTask(). This method is responsible for managing how the task is executed in the backend.
If a task key is provided that is not currently handled, it will eventually be routed to the
ICustomWorkflowTaskActionService and the default implementation in the starter will throw an exception:DefaultWorkflowTaskActionDelegator.java this implements a logic that fits both workflow types.