Skip to content
Advertisement

How to terminate Camunda running process?

Have an existing bpmn process that already does some work:

  • processes received payload;
  • triggers sub-process;
  • creates a few task for manual user processing;
  • etc.

And now I need to find a way how to stop/terminate/cancel running workflow (I am not sure which action is preferable in terms of Camunda) because the action that we expect to be done by Camunda process already successfully performed by another external system.

Camunda docs say that I can start/stop/cancel process via REST API or just via Java API but I am looking on way of visualization of possibility to cancel/terminate process via Camunda Modeller.

How can I do it? I see that multiple types of events supported: Start, End, Intermediate but which one can suite my needs?

Advertisement

Answer

Place an event sub process in the desired scope (full parent process, right on the canvas). Use an interrupting start event (solid line) either of type message or condition. Connect it either directly to an end event, or to additional tasks you want to perform before the process is fully terminated. The interrupting start event will cancel any tokens in the surrounding scope (parent process) when it is triggered. You can trigger it either by setting a process data (conditional start event) or via a message (message start event) e.g. REST API.

https://camunda.com/bpmn/reference/#activities-event-subprocess

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement