Camunda Forms are one way to handle a user task on Tasklist. These forms can be created in Camunda Modeler, where they can also be embedded in the BPMN file with your diagram. You can then assign a form to a user task.
After deploying a diagram with an embedded form, Tasklist imports this form schema and uses it to render the form on every task assigned to it.
All new tasks with a form assigned to it on the BPMN diagram render the form modeled on Camunda Modeler. The fields are pre-filled with variables with the same names as the respective fields. When the task is complete, variables are updated or created based on the field names of the form.
To model the diagram and form, take the following steps:
Open Camunda Modeler and create a new diagram for the Zeebe Engine.
Model a process with a user task.
Click on Form (Camunda Forms) to create a form.
Model your form and click on the bottom left corner that says JSON to switch to the JSON view.
Use caution when naming the fields of your form. Fields have their values pre-filled from variables with the same name.
Copy the JSON schema.
Go back to the BPMN diagram you modeled earlier. Select the user task and click on the Forms tab. After switching tabs, you should see the field where you can paste the form JSON schema. Paste the schema and save the file.
Deploy your diagram to Zeebe and create an instance using the following command:
zbctl deploy /path/to/my/diagram.bpmnzbctl create instance diagram-id
To complete the task, take the following three steps:
Open Tasklist; you should see an unclaimed task. Click on the task and the details will open with the form you modeled earlier.
Claim this task, fill in the form, and complete the task.
Filter by Completed Tasks to see your task listed.
While in Operate, note your instance completed (if your diagram consisted of only one user task).
Go to the instance details page and note the values you filled out in the form are now process variables.