Previous Task in camunda 8

I am presently developing a BPMN flow using Camunda 8, and I’m utilizing the Zeebe Java client dependency to communicate with it programmatically. I’ve nearly completed the implementation of the start, complete, close, and search APIs. However, there are instances in the flow where I need to enable a “go back” functionality to return to the previous task. Despite reviewing the documentation, I haven’t yet identified a viable solution for implementing this feature.

Hi @Rania_Chakroun and welcome to the Camunda Community,

This sound like going back to the previous task is part of your business logic. Thus, it should be explicitly modeled in your process model. There is no API to “revert” the state of a process instance back to a previous point.

While I do not recommend it, you can use process instance modification to move the execution of a process instance to a particular element:

hello @StephanHaarmann I appreciate your prompt reply. However, I encountered an issue while using the “newModifyProcessInstanceCommand” to terminate a particular element and activate a preceding element. Unfortunately, it doesn’t seem to be effective with human tasks.

Specifically, my goal is to transition from User Task C back to User Task B in a straightforward process with three tasks: Task A → Task B → Task C. I’m seeking a solution that allows me to navigate back to the previous task while retaining associated variables through APIs.

Which version of Camunda do you use? I tried it via UI and hat no issue.
Here is the process:
threeUserTasks.bpmn (3.5 KB)

  1. I deployed the model via Desktop Modeler
  2. I started the process via Tasklist
  3. I completed task A
  4. I went to Operate, selected the instance and chose “Modify instance”:
  5. I selected “Move instance” from “B” to “A”
  6. Everything worked as expected:

I assume that the same should work via Zeebe API, doesn’t it?

Hello, thank you for your help, and yes that’s the point. i am now just developping this idea in code using zeebe client: it provides the method “newModifyProcessInstanceCommand”

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.