use of org.camunda.bpm.engine.RuntimeService in project camunda-bpm-platform by camunda.
the class MyDelegationService method executeCommand.
protected void executeCommand(ProcessEngineServices services) {
RuntimeService runtimeService = services.getRuntimeService();
executeCommand(runtimeService);
}
use of org.camunda.bpm.engine.RuntimeService in project camunda-bpm-platform by camunda.
the class MyStartFormHandler method createStartFormData.
public StartFormData createStartFormData(ProcessDefinitionEntity processDefinition) {
ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
IdentityService identityService = processEngineConfiguration.getIdentityService();
RuntimeService runtimeService = processEngineConfiguration.getRuntimeService();
logAuthentication(identityService);
logInstancesCount(runtimeService);
StartFormDataImpl result = new StartFormDataImpl();
result.setProcessDefinition(processDefinition);
return result;
}
use of org.camunda.bpm.engine.RuntimeService in project camunda-bpm-platform by camunda.
the class ProcessInstanceQueryTest method deployTestProcesses.
/**
* Setup starts 4 process instances of oneTaskProcess
* and 1 instance of otherOneTaskProcess
*/
@Before
public void deployTestProcesses() throws Exception {
org.camunda.bpm.engine.repository.Deployment deployment = engineRule.getRepositoryService().createDeployment().addClasspathResource("org/camunda/bpm/engine/test/api/runtime/oneTaskProcess.bpmn20.xml").addClasspathResource("org/camunda/bpm/engine/test/api/runtime/otherOneTaskProcess.bpmn20.xml").deploy();
engineRule.manageDeployment(deployment);
RuntimeService runtimeService = engineRule.getRuntimeService();
processInstanceIds = new ArrayList<String>();
for (int i = 0; i < 4; i++) {
processInstanceIds.add(runtimeService.startProcessInstanceByKey(PROCESS_DEFINITION_KEY, i + "").getId());
}
processInstanceIds.add(runtimeService.startProcessInstanceByKey(PROCESS_DEFINITION_KEY_2, "businessKey_123").getId());
}
use of org.camunda.bpm.engine.RuntimeService in project camunda-bpm-platform by camunda.
the class SetExternalTaskRetriesUserOperationLogTest method deployTestProcesses.
@Before
public void deployTestProcesses() throws Exception {
org.camunda.bpm.engine.repository.Deployment deployment = rule.getRepositoryService().createDeployment().addClasspathResource("org/camunda/bpm/engine/test/api/externaltask/oneExternalTaskProcess.bpmn20.xml").addClasspathResource("org/camunda/bpm/engine/test/api/externaltask/externalTaskPriorityExpression.bpmn20.xml").deploy();
rule.manageDeployment(deployment);
RuntimeService runtimeService = rule.getRuntimeService();
processInstanceIds = new ArrayList<String>();
for (int i = 0; i < 4; i++) {
processInstanceIds.add(runtimeService.startProcessInstanceByKey(PROCESS_DEFINITION_KEY, i + "").getId());
}
processInstanceIds.add(runtimeService.startProcessInstanceByKey(PROCESS_DEFINITION_KEY_2).getId());
}
use of org.camunda.bpm.engine.RuntimeService in project camunda-bpm-platform by camunda.
the class TestOrderingUtil method executionByProcessDefinitionKey.
public static NullTolerantComparator<Execution> executionByProcessDefinitionKey(ProcessEngine processEngine) {
final RuntimeService runtimeService = processEngine.getRuntimeService();
final RepositoryService repositoryService = processEngine.getRepositoryService();
return propertyComparator(new PropertyAccessor<Execution, String>() {
@Override
public String getProperty(Execution obj) {
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(obj.getProcessInstanceId()).singleResult();
ProcessDefinition processDefinition = repositoryService.getProcessDefinition(processInstance.getProcessDefinitionId());
return processDefinition.getKey();
}
});
}
Aggregations