02-26-2016 04:29 AM
public static void main (String[] args) {
ProcessEngine processEngine=ProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration().buildProcessEngine();
RepositoryService repositoryService = processEngine.getRepositoryService();
repositoryService.createDeployment().addClasspathResource("diagrams/demo2.bpmn").deploy();
RuntimeService runtimeService = processEngine.getRuntimeService();
ProcessInstance pi = runtimeService.startProcessInstanceByKey("escalationExample");
// There should be one task, with a timer : first line support
TaskService taskService = processEngine.getTaskService();
Task task = taskService.createTaskQuery().processInstanceId(pi.getId()).singleResult();
System.out.println("First line support = " + task.getName());
// Manually execute the job
ManagementService managementService = processEngine.getManagementService();
Job timer = managementService.createJobQuery().singleResult();
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("Handle escalated issue = " + task.getName());
}
02-29-2016 03:04 AM
Is there any way to handle the timer event and how?
org.activiti.examples.bpmn.event.timer.BoundaryTimerEventTest
Have a look on the org.activiti.engine.test.bpmn.event.timer.BoundaryTimerEventTest
in the activiti source.02-29-2016 11:21 PM
03-01-2016 03:25 AM
Is it something to do with the junit framework?No
Does activiti provide that?I am not sure what you are looking for.
Is it not recommended to have a standalone workflow application using the APIs?Stand alone apps are quite common (we use them too)
What I understand is we will have to write our own code to send the emails to intended user, is that correct?No that's not correct. Activiti mail sending task is the simple one, but is completely working.
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.