assertNotNull(varSetInExecutionListener);
assertEquals("firstValue", varSetInExecutionListener);
// Transition take executionListener will set 2 variables
TaskService taskService = activitiRule.getTaskService();
Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
assertNotNull(task);
taskService.complete(task.getId());
varSetInExecutionListener = (String) runtimeService.getVariable(processInstance.getId(), "variableSetInExecutionListener");
assertNotNull(varSetInExecutionListener);
assertEquals("secondValue", varSetInExecutionListener);
ExampleExecutionListenerPojo myPojo = new ExampleExecutionListenerPojo();
runtimeService.setVariable(processInstance.getId(), "myPojo", myPojo);
task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
assertNotNull(task);
taskService.complete(task.getId());
// First usertask uses a method-expression as executionListener: ${myPojo.myMethod(execution.eventName)}
ExampleExecutionListenerPojo pojoVariable = (ExampleExecutionListenerPojo) runtimeService.getVariable(processInstance.getId(), "myPojo");
assertNotNull(pojoVariable.getReceivedEventName());
assertEquals("end", pojoVariable.getReceivedEventName());
task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
assertNotNull(task);
taskService.complete(task.getId());
assertNull("Process ended", activitiRule
.getRuntimeService()
.createProcessInstanceQuery()
.processInstanceId(processInstance.getId())