Timer start event not triggering at night?

Hi there, I have a strange behaviour: my process engine should start a new process instance each night at 20:30 on workdays. I’m using spring boot, and the cycle is read from a property:

  <bpmn:timerEventDefinition>
    <bpmn:timeCycle xsi:type="bpmn:tFormalExpression">${configurationHolder.getEodConfiguration().getCronStart()}</bpmn:timeCycle>
  </bpmn:timerEventDefinition>

When I set this property in my application.yaml file to

cron-start: 0 22 10 ? * MON-FRI

a new process instance is started a couple of seconds after 10:22 o’clock. But that’s not the correct time, it should not be started before 20:30 . When I changed this property to

cron-start: 0 30 20 ? * MON-FRI

no new process instance was started. The fact that the instance was started during day time proves that no other settings concerning job scheduling was forgotten. Has anybody an idea?

Many thanks in advance!
Regards,
Christian

one additional info: though I had restarted the process and the logging of all configuration parameters at process startup clearly say that

0 30 20 ? * MON-FRI

would be used, the new process instance was started today at a couple of seconds after 10:22 today. As if

0 22 10 ? * MON-FRI

would be active.

See How to force a re-evaluation of the start timer definition?. You have to change the process model to force a re-evaluation of the spring property. Or use other tricks.

To re-inforce the re-evaluation of the spring property seemed me to be quite too complicated. As I had pointed out there, I took a different approach: I used Spring’s

@Scheduled(cron="${cron-expression-in-property-file}")

at a Java method. In this method, I used Camunda’s

runtimeService.startProcessInstanceByKey("ProcessId")

And I modified the BPM model: I changed the start event from timer based to ordinary.

To the Camunda folks: I consider this as a bug.

And now run this in a cluster consisting of two or more nodes :slight_smile:

yeah, that’s a point. But that doesn’t bother me because my process should by started only once every night from MON-FRI. :slight_smile:

my process should by started only once every night from MON-FRI.

But I think exactly that won’t happen if you’re in a clustered environment; you’ll get multiple process instances.

I have one small Spring Boot project that is deployed only once on one server. Therefore no sweat

Lucky you :slight_smile: