How to remove an execution data from camunda using workflows

Hi Folks,

I have a bpmn process that once starts and continues its execution forever based on the Timer cycle event. There is no end event for it.
I had recently done few changes with the workflow and made a redeployment to camunda. Since the existing processes are already running I need an option to stop it which I am finding difficult to do through workflow.
How can I stop existing execution if a new workflow started its execution? Can we achieve that using workflow itself? REST / Java coding cannot be done to achieve this.

I have another question regarding an order by query in camunda.
From the above scenario, i ended up seeing quite a few similar variables in variable table. How can i get the latest variable out of it? orderByActivityInstanceId is the only option i saw, which i feel is not reliable.

@Shibin_Thomas2 Can we have a bpmn diagram without endevent?

Even if you don’t have end event, if the execution token arrives at the last activity and executes without any incidents the process instance will be ended.

Process instance will be active if some recursive tasks or looping exists in the process and evaluates always true which keeps the process instance always active.

Considering this as criteria, you can set boundary events to terminate the process on the triggered events.

Can you upload your model?

diagram_1.bpmn (3.3 KB)

This process should start immediately after the deployment and then do a token generation logic every 3:50 minutes.

The start timer is not on a cycle, It is running in Duration. So it only start once and run forever.

If that’s the case your process model should have Signal events to respond to events. The process should be able to throw signal event stating that new process deployed and catching signal event should terminate the process in old processes.

Refer the below process model:

Deploy this bpmn file and test: timer-signal-process-test.bpmn (8.4 KB)

You can notice that as soon as new process deployed and the timer starts in the new process, the old instance will be stopped.

1 Like

Can I use this?
This flow is beautiful, appreciate your help.
Let me test this and let you know.

@Shibin_Thomas2 Yes. you can use that process

1 Like

It is working fine. :slight_smile:.

1 Like