Overview
A custom workflow task action is aWorkflowTaskActionDTO bean. Each bean renders a button in the UI. Build it with its builder:
Each input field is a
WorkflowTaskActionInputField, with a label, a taskVariable that links it to a workflow variable, an
inputType (SELECT, TEXT, LINK, CHECKBOX or ATTACHMENTS), and optionally required, options (for SELECT) and
defaultValue.
Define the beans
Depending on the type ofWorkflowTaskActionDTO 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 aWorkflowTaskActionDTO will look as follows:
2. Popup with execution action
A more complex instance of aWorkflowTaskActionDTO 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:
Classification and Risk comment, with the following properties:
Classificationis required, so the form may not be submitted until its value is filled.Risk commentis not specified as required, so it defaults to false.Classificationhas input typeSELECT, so the options listed will be available in a dropdown.Risk commenthas input typeTEXT, 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: