use of org.activiti.engine.RuntimeService in project Activiti by Activiti.
the class ActivitiRuleJunit4Test method ruleUsageExample.
@Test
@Deployment
public void ruleUsageExample() {
RuntimeService runtimeService = activitiRule.getRuntimeService();
runtimeService.startProcessInstanceByKey("ruleUsage");
TaskService taskService = activitiRule.getTaskService();
Task task = taskService.createTaskQuery().singleResult();
assertThat(task.getName()).isEqualTo("My Task");
taskService.complete(task.getId());
assertThat(runtimeService.createProcessInstanceQuery().count()).isEqualTo(0);
}
use of org.activiti.engine.RuntimeService in project Activiti by Activiti.
the class GetVariableLocalTask method execute.
@Override
public void execute(DelegateExecution execution) {
RuntimeService runtimeService = Context.getProcessEngineConfiguration().getRuntimeService();
runtimeService.getVariableLocal(execution.getProcessInstanceId(), "Variable-That-Does-Not-Exist");
}
use of org.activiti.engine.RuntimeService in project Activiti by Activiti.
the class StartProcessInstanceTestDelegate method execute.
public void execute(DelegateExecution execution) {
RuntimeService runtimeService = Context.getProcessEngineConfiguration().getRuntimeService();
runtimeService.startProcessInstanceByKey("oneTaskProcess");
}
use of org.activiti.engine.RuntimeService in project Activiti by Activiti.
the class StartProcessInstanceTestDelegate method execute.
public void execute(DelegateExecution execution) {
RuntimeService runtimeService = Context.getProcessEngineConfiguration().getRuntimeService();
runtimeService.startProcessInstanceByKey("oneTaskProcess");
}
use of org.activiti.engine.RuntimeService in project tutorials by eugenp.
the class ProcessExecutionIntegrationTest method givenProcessDefinition_whenStartProcessInstance_thenProcessRunning.
@Test
public void givenProcessDefinition_whenStartProcessInstance_thenProcessRunning() {
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
RepositoryService repositoryService = processEngine.getRepositoryService();
repositoryService.createDeployment().addClasspathResource("org/activiti/test/vacationRequest.bpmn20.xml").deploy();
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("employeeName", "Kermit");
variables.put("numberOfDays", new Integer(4));
variables.put("vacationMotivation", "I'm really tired!");
RuntimeService runtimeService = processEngine.getRuntimeService();
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("vacationRequest", variables);
Long count = runtimeService.createProcessInstanceQuery().count();
assertTrue(count >= 1);
}
Aggregations