Skip to main content

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 the IWorkflowTaskActionDelegator. This delegator accepts the submitted WorkflowTaskActionExecutionDTO, then delegates and executes the task as required.

The submitted DTO

The WorkflowTaskActionExecutionDTO object looks as follows:
where:
  • the taskKey is used by the delegator to determine which task to execute.
  • the workflowType indicates the type of workflow the action belongs to.
  • the keys indicate the objects upon which the action is executed.
  • the taskVariables store optional task variables to be handled by the backend and are the result of the inputs to the WorkflowTaskActionInputFieldDTO.

The delegator

The IWorkflowTaskActionDelegator is a simple delegator that accepts a WorkflowTaskActionExecutionDTO and delegates the work to a backend service. It contains one method:
The 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 the ICustomWorkflowTaskActionService.

The default delegator

The default delegator is implemented in DefaultWorkflowTaskActionDelegator, 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 own IWorkflowTaskActionDelegator. Here’s an example of a simple delegator that logs the action that is executed:
You then may implement different logic for different combinations of workflow types and task keys retrieved from the WorkflowTaskActionExecutionDTO object.

Append to the default delegator

To append to the default delegator, add an implementation of ICustomWorkflowTaskActionService. 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:
Here’s an example of a custom comment action:
Note that unlike actions defined in the DefaultWorkflowTaskActionDelegator.java this implements a logic that fits both workflow types.

Import the services

Once the appropriate components/services have been defined, import them to the project using a Spring configuration class.