As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
org.activiti.engine.test.bpmn.event.timer.StartTimerEventTest#testCycleWithLimitStartTimerEvent_failing
repetition timer is executed n times
repetition timer period will be constant for all repetitions.
<br> @Deployment(resources = {"org/activiti/engine/test/bpmn/event/timer/StartTimerEventTest.testCycleWithLimitStartTimerEvent.bpmn20.xml"})<br> public void testCycleWithLimitStartTimerEvent_keepTimerPeriod() throws Exception {<br> processEngineConfiguration.getClock().setCurrentTime(new Date());<br><br> final ProcessInstanceQuery piq = runtimeService.createProcessInstanceQuery().processDefinitionKey("startTimerEventExampleCycle");<br><br> // move to 15 mins forward - e.g. server was down and it was started again<br> moveByMinutes(15);<br> waitForJobExecutorOnCondition(10000, 500, new Callable<Boolean>() {<br> public Boolean call() throws Exception {<br> // one process instance should be started - because time is after start date<br> return 1 == piq.count();<br> }<br> });<br><br> moveByMinutes(1);<br> waitForJobExecutorOnCondition(10000, 500, new Callable<Boolean>() {<br> public Boolean call() throws Exception {<br> // we have moved the time 1 minute forward. Process start period is 5 mins. => No other process instance<br> // should be started<br> // @FIXME: 5.18-SNAPSHOT - there are 2 process instances running because of org.activiti.engine.impl.calendar.DurationHelper.getDateAfterRepeat<br> return 1 == piq.count();<br> }<br> });<br><br> // +4 mins -> new process instance should be started because time period was reached since the last timer execution<br> moveByMinutes(4);<br> waitForJobExecutorOnCondition(10000, 500, new Callable<Boolean>() {<br> public Boolean call() throws Exception {<br> return 2 == piq.count();<br> }<br> });<br> }<br>
* The timer is moved by 64 seconds. Time is now 11:11:57* The timer is moved 1 second. Time was now 11:12:03Oh-oh. That is exact T + (4 * 1minute). The job executor inspects the start time and sees it should fire NOW.