How to return to the specified node?

I think in the process run, any node can return to the designated node, how to achieve this.

Is it achievable?
thanks。

Hi,

What is a designated node? Probably a diagram is required to explain your meaning.

Conor

I can’t say it clearly.
This is the normal process.


I need to go back to task 1 when task3,Continue from Task1。
Does Camunda have a fallback function?
thanks;

Not necessarily a feature of Camunda, but you can model such cases with BPMN. Assuming task3 is what determines whether to go back or proceed, you can model that using a gateway after the task, like so:

In general, it’s not recommended to model conditional flow from an activity such as the task, even though it’s allowed.

The operation I want is to roll back.
It’s the random scheduling between tasks.
Similar to running historical tasks here

Ah, task escalation and error boundaries are not supported at the moment. For now, the way to do this would be to use an interrupting message boundary event on the task and route the flow back to the first task.

Technically speaking you can’t rollback to something that’s already completed and was performed in another transaction (which is the case if these are user tasks; for service tasks by default, Camunda will attempt to perform as much as possible in the same transaction unless you demarcate the transaction boundaries by using asyncBefore/After).

Instead, you move the process to that point as I pointed out, which creates a new instance of the task you already performed before. Which makes sense also because there’s no trivial way to rollback any actions performed in the meantime.

If compensation for what was done before is really what you’re after, take a look at the saga pattern, which you can implement using BPMN’s compensation boundary events. There’s a very good description of that up here: https://blog.bernd-ruecker.com/saga-how-to-implement-complex-business-transactions-without-two-phase-commit-e00aa41a1b1b

Not quite sure what you mean by random ordering, because at the moment you have the tasks in sequence.

Thank you very much for your answer.
I implemented this function by directly modifying database data.

I just noticed a post relating to something similar. @felix-mueller suggested using the process instance modification API in this post to move the process to a point where you would normally not be able to get to from the regular process flow. I would prefer that approach over a database modification any time, since the API will make sure the state in the database is correct for the engine.

4 Likes