12-11-2014 10:44 AM
ProcessEngine processEngine = ProcessEngineConfiguration
.createStandaloneInMemProcessEngineConfiguration()
.buildProcessEngine();
runtimeService = processEngine.getRuntimeService();
RepositoryService repositoryService = processEngine.getRepositoryService();
IdentityService identityService = processEngine.getIdentityService();
TaskService taskService = processEngine.getTaskService();
repositoryService.createDeployment()
.addClasspathResource("my_bpmn.bpmn20.xml").
deploy();
Map<String,Object> variables = new HashMap<String, Object>();
variables.put("abc", "xyz");
identityService.setAuthenticatedUserId("kermit");
ProcessInstance processInstance =
runtimeService.startProcessInstanceByKey("my_process", generateWorkOrderId(), variables);
if(null == processInstance.getId() )
System.out.println("Null Process Instance ID");
System.out.println("id " + processInstance.getId() + " " +
processInstance.getProcessDefinitionId());
List<Task> taskList = taskService.createTaskQuery()
.taskCandidateUser("kermit").list();
System.out.println("Task List Size: " + taskList.size());
System.out.println("found task " + taskList.get(0).getName());
taskService.complete(taskList.get(0).getId());
12-12-2014 01:42 AM
12-12-2014 03:52 AM
12-12-2014 03:59 AM
12-12-2014 04:42 AM
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.