use of org.camunda.bpm.engine.runtime.ProcessInstance in project camunda-bpm-platform by camunda.
the class ServiceTaskSpringDelegationTest method testExecutionAndTaskListenerDelegationExpression.
@Deployment
public void testExecutionAndTaskListenerDelegationExpression() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("executionAndTaskListenerDelegation");
assertEquals("working", runtimeService.getVariable(processInstance.getId(), "executionListenerVar"));
assertEquals("working", runtimeService.getVariable(processInstance.getId(), "taskListenerVar"));
assertEquals("executionListenerInjection", runtimeService.getVariable(processInstance.getId(), "executionListenerField"));
assertEquals("taskListenerInjection", runtimeService.getVariable(processInstance.getId(), "taskListenerField"));
}
use of org.camunda.bpm.engine.runtime.ProcessInstance in project camunda-bpm-platform by camunda.
the class ServiceTaskSpringDelegationTest method testDelegateExpression.
@Deployment
public void testDelegateExpression() {
ProcessInstance procInst = runtimeService.startProcessInstanceByKey("delegateExpressionToSpringBean");
assertEquals("Activiti BPMN 2.0 process engine", runtimeService.getVariable(procInst.getId(), "myVar"));
assertEquals("fieldInjectionWorking", runtimeService.getVariable(procInst.getId(), "fieldInjection"));
}
use of org.camunda.bpm.engine.runtime.ProcessInstance in project camunda-bpm-platform by camunda.
the class SpringTransactionIntegrationTest method testBasicActivitiSpringIntegration.
@Deployment
public void testBasicActivitiSpringIntegration() {
userBean.hello();
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().singleResult();
assertEquals("Hello from Printer!", runtimeService.getVariable(processInstance.getId(), "myVar"));
}
use of org.camunda.bpm.engine.runtime.ProcessInstance in project camunda-bpm-platform by camunda.
the class SpringJobExecutorTest method testRollbackJobExecutorPath.
@Deployment(resources = { "org/camunda/bpm/engine/spring/test/components/SpringTimersProcess.bpmn20.xml", "org/camunda/bpm/engine/spring/test/components/SpringJobExecutorRollBack.bpmn20.xml" })
public void testRollbackJobExecutorPath() throws Exception {
// shutdown job executor first, otherwise waitForJobExecutorToProcessAllJobs will not actually start it....
processEngineConfiguration.getJobExecutor().shutdown();
ProcessInstance instance = runtimeService.startProcessInstanceByKey("errorProcess1");
assertNotNull(instance);
waitForJobExecutorToProcessAllJobs(10000);
List<Task> activeTasks = taskService.createTaskQuery().processInstanceId(instance.getId()).list();
assertTrue(activeTasks.size() == 1);
}
use of org.camunda.bpm.engine.runtime.ProcessInstance in project camunda-bpm-platform by camunda.
the class AbstractDeleteProcessInstanceCmd method triggerHistoryEvent.
public void triggerHistoryEvent(List<ProcessInstance> subProcesslist) {
ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration();
HistoryLevel historyLevel = configuration.getHistoryLevel();
for (final ProcessInstance processInstance : subProcesslist) {
// ParseListener
if (historyLevel.isHistoryEventProduced(HistoryEventTypes.PROCESS_INSTANCE_UPDATE, processInstance)) {
HistoryEventProcessor.processHistoryEvents(new HistoryEventProcessor.HistoryEventCreator() {
@Override
public HistoryEvent createHistoryEvent(HistoryEventProducer producer) {
return producer.createProcessInstanceUpdateEvt((DelegateExecution) processInstance);
}
});
}
}
}
Aggregations