Skip to main content

Overview

The class WorkflowTaskActionDTO is used to represent a custom workflow task action.
The class WorkflowTaskActionInputFieldDTO is defined as:
where WorkflowTaskActionInputFieldInputType can be one of:
We have added lombok builder methods to quickly create instances of this class.

Define the beans

Depending on the type of WorkflowTaskActionDTO supplied to the UI, it will render a button that on clicking will either:
  • Execute an action
  • Show a popup for submission and then execute an action

1. Execution only action

The simplest instance of a WorkflowTaskActionDTO will look as follows:
In this case, a button will appear on the UI with the label Approve and when clicked, it will submit a response to the server to execute the task specified by the task key “APPROVED”. For more information on how the task is executed see Executing the Java Task.

2. Popup with execution action

A more complex instance of a WorkflowTaskActionDTO will specify input fields to be rendered in the UI, updated and submitted to the server. It can also provide an defaultValue for fields, which will pre-populate the input field in the UI. Example:
In this example, we define two input fields: Classification and Risk Comment, with the following properties:
  • Classification is required, so the form may not be submitted until its value is filled. Risk Comment is not specified as required, so it defaults to false.
  • Classification has input type SELECT, so the options listed will be available in a dropdown.
  • Risk Comment has input type TEXT, so a text field will appear requesting input.

Import the beans

Once defined, the beans can then be imported into the Atoti Limits project. A nice convention is to have one @Configuration file per workflow, and to import these into a parent @Configuration. Then, this one parent @Configuration can be imported to the project. For example, the out-of-the-box workflow actions are included in WorkflowTaskActionsConfig:
  • and the FourEyesWorkflowTaskActionConfig class contains the tasks related to the four eyes workflow: