Updating user task details after its marked completed

Our customers would like to define workflows by linking them to externally defined & designed forms. The forms accept user inputs like shown in the below screenshots. These user inputs (fields) span across multiple UI pages. As the user details are entered, our backend marks the user tasks as complete.

We have scenarios where the user could go back to some previous screen and update its details. For e.g. After the salary details are entered, the user may want to go and correct the address details.

  1. Through code how do we fetch the address task and mark it complete again?
  2. Would the next set of tasks also have to be executed again? If so can we somehow skip the re-execution since the user inputs would already be validated.

Thanks.

@JGeek You can try like below. No code is required.

You just need to maintain 2 flags:

addressStatus: create/update
addressChange: needed/not needed

Note: You can maintain boolean flags for simplicity.

Thanks @aravindhrs for the reply. Address update was one just possibility (example). The user could practically go back to any of the previous UI screens to update any of the previously entered details. Defining decision gateway for every such user task that goes back to any of the previous user tasks would not be a feasible solution since we could theoretically have ā€˜nā€™ user tasks

Our UI would be calling our application apis to enter user inputs. The application api implementation fetches the workflow tasks through the TaskService and marks them complete. At runtime if the user goes back to the previous UI screens our UI code would call our application rest apis.

The question - how can we generically fetch a task that could be possibly completed and re-complete it as appropriate?

Thanks.

@JGeek Then you have to refer to Process instance modification. Process Instance Modification | docs.camunda.org

Thanks @aravindhrs for the input. Process instance modication looks like a powerful concept.

Before I call the createProcessInstanceModification() api how do I find out if a given task is completed or not?

Currently I have this code

Task addr = taskService.createTaskQuery().processInstanceId(processInstanceId)
                .taskName("Enter Address").singleResult()

If the task is already completed I get null else I get the task. Do I perform a null check to know if the task is already completed? I hope there is a better way to do that.

Thanks.