04-03-2012 05:58 AM
<intermediateCatchEvent id="timerintermediatecatchevent3" name="Wait for Collection">
<timerEventDefinition>
<timeDuration>PT${processConfig.getDuration('timeBetweenTasks')}S</timeDuration>
</timerEventDefinition>
</intermediateCatchEvent>
<intermediateCatchEvent id="timerintermediatecatchevent3" name="Wait for Collection">
<timerEventDefinition>
<timeDuration>PT${timeBetweenTasks}S</timeDuration>
</timerEventDefinition>
</intermediateCatchEvent>
04-03-2012 07:14 AM
04-03-2012 11:14 AM
04-04-2012 03:28 AM
04-04-2012 06:09 AM
public class TimerIssueTest extends PluggableActivitiTestCase {
@Deployment(resources="TimerIssueTest.testTimerIssue.bpmn20.xml")
public void testTimerIssue() {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("test", "2");
ProcessInstance processInstance = runtimeService
.startProcessInstanceByKey("TimerIssueTest", variables);
Task task = taskService.createTaskQuery().taskName("Complete Order")
.singleResult();
assertEquals("Complete Order", task.getName());
taskService.complete(task.getId());
JobQuery jobQuery = managementService.createJobQuery().processInstanceId(processInstance.getId());
assertEquals(1, jobQuery.count());
Calendar nowCal = new GregorianCalendar();
nowCal.add(Calendar.MINUTE, 1);
ClockUtil.setCurrentTime(nowCal.getTime());
waitForJobExecutorToProcessAllJobs(10000L, 1000L);
Task task2 = taskService.createTaskQuery().taskName("Send Order").singleResult();
assertNotNull(task2);
assertEquals("Send Order", task2.getName());
taskService.complete(task2.getId());
}
}public class TimerIssueTest extends PluggableActivitiTestCase {
@Deployment(resources="TimerIssueTest.testTimerIssue.bpmn20.xml")
public void testTimerIssue() {
Calendar nowCal = new GregorianCalendar(); //Using the current time
ClockUtil.setCurrentTime(nowCal.getTime());
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("test", "60");//Wait for 60 seconds
ProcessInstance processInstance = runtimeService
.startProcessInstanceByKey("TimerIssueTest", variables);
Task task = taskService.createTaskQuery().taskName("Complete Order")
.singleResult();
assertEquals("Complete Order", task.getName());
taskService.complete(task.getId());
JobQuery jobQuery = managementService.createJobQuery().processInstanceId(processInstance.getId());
assertEquals(1, jobQuery.count());
// Calendar nowCal = new GregorianCalendar();
// nowCal.add(Calendar.MINUTE, 1);
// ClockUtil.setCurrentTime(nowCal.getTime());
waitForJobExecutorToProcessAllJobs(70000L, 1000L); //Wait for 70 seconds
Task task2 = taskService.createTaskQuery().taskName("Send Order").singleResult();
assertNotNull(task2);
assertEquals("Send Order", task2.getName());
taskService.complete(task2.getId());
}
}
04-05-2012 03:22 AM
04-05-2012 06:07 AM
// Check if this timer fires before the next time the job executor will check for new timers to fire.
// This is highly unlikely because normally waitTimeInMillis is 5000 (5 seconds)
// and timers are usually set further in the future
JobExecutor jobExecutor = Context.getProcessEngineConfiguration().getJobExecutor();
int waitTimeInMillis = jobExecutor.getWaitTimeInMillis();
if (duedate.getTime() < (ClockUtil.getCurrentTime().getTime()+waitTimeInMillis)) {
hintJobExecutor(timer);
}Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.