Configure timer settings from system properties

Hi there, I’m new to camunda, and maybe I’ve overseen something in the forum. I wanted to start with a simple process that is started by a timer. I intended to feed the timer interval from a system property or something like that. The doc says that I can configure it like

<timeDuration>${duration}</timeDuration>

But when I used it this way:

  <bpmn:timerEventDefinition>
    <bpmn:timeCycle xsi:type="bpmn:tFormalExpression">${timersettings}</bpmn:timeCycle>
  </bpmn:timerEventDefinition>

some exceptions are thrown when my bpmn file is loaded.

I had implemented a spring boot event listener that should start my process instance with a propriate Map, but the exception was thrown before this listener was triggered:

	@EventListener
	private void postDeploy(PostDeployEvent pEvent)
	{
		String lTimerSettings = System.getProperty("timersettings");
		Map<String, Object> lSettings = new HashMap<>();
		lSettings.put("timersettings", lTimerSettings);
		this.runtimeService.startProcessInstanceByKey("Process_Timer", lSettings);
	}

whats the variable value of lTimerSettings ?

Timers are configured using an ISO 8601 time format. A timer definition must have exactly one of the following elements.

Possible values are ex: 2016-03-11T12:13:14 or 2016-03-11T12:13:14Z or 2016-03-11T12:13:14+01

Refer this docs page: Timer Events | docs.camunda.org

Hi @cjacobme,

it’s a chicken-and-egg problem to use configurable timeDuarations on start events. They are evaluated during the depolyment of the process model.

I assume that if you provide a spring bean instead of an spring boot event listener, you can achive your goal.

And then you can configure ${timersettings.getTime()}.

Hope this helps, Ingo

Hi Ingo, since I’m totally new to Spring as well, I had to dig a little bit, but finally I found the solution. Your hint solved my problem, thanks a lot.