Maybe this happens because the job creation is done at main camunda app level and the process beans are not visible until the process starts ?
I’m thinking to some workaroud though:
Old cron process become a normal process with a ‘Start Message Event’. We can call it the MAIN process.
A new process (CRON) that manages the cron
- Start Event (Timer Start Event configured to start after 1 or 2 seconds from deploy)
- An Intermediate Timer Event (expressions will work at this point)
- A Intermediate message event that makes the MAIN process start
- A final End Message Event that makes the CRON process to restart (this avoids loops and a neverending process)
The problem is that I have to do it for a lot of existing processes, each one with different cron settings.
My workaround was to use the quartz/timer features built into the Apache Camel library. I’d initiate timers which then call on various components to start the process. This workaround also allows you to change timer intervals without needing to update and re-deploy process models. This being a BIG deal when promoting models through QA->Prod. Also a nice feature to just simply manage “start process” events (or any timer for that matter) as a configuration (i.e. within property files)
I tried to avoid external tech solutions like Quartz to give users the controls even for cron bpms inside the cockpit. But your solution appears more clean than mine.
My solution had to cope with a lot of redeploys and I had to manage the killing of all old cron bpm processes.
I did end up using Quartz. But, Apache Camel provides an excellent wrapper to help with startup and setting various timers. The timer startup code is built into the Camunda project - so everything starts up accordingly.
A clustered server configuration did require some extra work to insure I didn’t end up with multiple timers firing off various duplicate events.
One of the nice features I had with using Quartz is that I could monitor the generated events desperately. And, isolating the timer “service” from the Camunda process meant that I didn’t get a process instance per each event generated.