11-28-2010 06:42 AM
<boundaryEvent id="escalationTimer" cancelActivity="true" attachedToRef="firstLineSupport">
<timerEventDefinition>
<timeDuration>PT8S</timeDuration>
</timerEventDefinition>
</boundaryEvent>
I just changed the time duration to 8 seconds
public void testInterruptingTimerDuration() {
// Start process instance
ProcessInstance pi = runtimeService.startProcessInstanceByKey("escalationExample");
// There should be one task, with a timer : first line support
Task task = taskService.createTaskQuery().processInstanceId(pi.getId()).singleResult();
assertEquals("First line support", task.getName());
//taskService.complete(task.getId());
// Manually execute the job
Job timer = managementService.createJobQuery().singleResult();
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
System.out.println("time elapsed");
}
// managementService.executeJob(timer.getId());
// The timer has fired, and the second task (secondlinesupport) now exists
task = taskService.createTaskQuery().processInstanceId(pi.getId()).singleResult();
System.out.println("task "+ task.getName());
}
The above code prints "First line support".11-29-2010 02:59 AM
11-29-2010 07:44 AM
11-29-2010 07:48 AM
02-26-2016 03:44 AM
03-01-2016 03:40 PM
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.