Is there a timer cycle expression for 'never'?

Hello,

I have a process model with a timer start event of type “cycle”. The cycle expression (Property Timer Definition in the modeler) is set via a spring property.

In some environments, I want the timer to never fire. How should I set the property to achieve this?

Spring has a special syntax in its @Scheduled annotation (just a dash for the cron attribute) but camunda does not seem to support this syntax.

Thank you for any help.

I think you might have to do something hacky by scheduling it so far into the future it just doesn’t execute.

How are you packaging your deployments? You mentioned Spring, is this a Spring project? I ask, because if it were me, I may try to manage it at the packaging level. If I wanted to disable the cron scheduling for a process app in QA, for example, I may have a QA build profile that removes the timer definition completely during packaging, i.e. removing <bpmn:timerEventDefinition> from the XML entirely,

<bpmn:startEvent id="StartEvent_1">
  <bpmn:outgoing>Flow_1tw5q8p</bpmn:outgoing>
  <bpmn:timerEventDefinition id="TimerEventDefinition_1wt7nu7">
    <bpmn:timeCycle xsi:type="bpmn:tFormalExpression">0 0/5 * * * ?</bpmn:timeCycle>
  </bpmn:timerEventDefinition>
</bpmn:startEvent>

thus making it just a regular start event.

<bpmn:startEvent id="StartEvent_1">
  <bpmn:outgoing>Flow_1tw5q8p</bpmn:outgoing>
</bpmn:startEvent>

Just a thought :man_shrugging:

Hello @jgigliotti,

thank you for your ideas. As of now, I set it to a date in a far future (as is also recommended on stack overflow). I just hoped there would be something similar to the Spring’s syntax in camunda. That would be more expressive. Actually, after a thought: a dash is not expressive at all hence a comment would have to be written anyway. And then, a date in the future is equally good :slight_smile:

As for modifying processes during packaging / deployment… This is a no go in my view. For any software.