During the data import task, I need to start several instances of the camunda process in some โpausedโ or paused state. A process has several timers, and the values โโof these timers may be in the past. Therefore, if I start such a process normally, it will immediately start executing some tasks, but I want to somehow postpone this execution (because tasks use some data that has not yet been imported). So I want this behavior:
1) somehow stop the camunda engine, or the job performer, or the process definition.
2) import all the necessary data and at the same time start all the necessary processes
3) turn off the camera so that it starts and executes previously launched processes.
I tried the following solutions:
1) Globally suspend the process definition from the booth. But when I start this process, it throws an exception regarding the definition of an extended process. I start the process with the following code:
runtimeService.createProcessInstanceByKey("process-key")
.businessKey("some-business-key")
.setVariables(vars)
.startBeforeActivity("xxx")
.execute();
2) start the process with the same code and in the same tx suspend the process instance runtimeService.suspendProcessInstanceById (processInstance.getProcessInstanceId ()); But I get some exceptions and incidents.
3) Disable camunda job executor worldwide, in the configuration file. It works fine, but itโs not very convenient to change the configuration and restart the server every time.
Are there any better solutions?
source
share