use of org.camunda.bpm.engine.RuntimeService in project camunda-bpm-platform by camunda.
the class MigrationTestRule method migrateProcessInstance.
public void migrateProcessInstance(MigrationPlan migrationPlan, ProcessInstance processInstance) {
snapshotBeforeMigration = takeFullProcessInstanceSnapshot(processInstance);
RuntimeService runtimeService = processEngine.getRuntimeService();
runtimeService.newMigration(migrationPlan).processInstanceIds(Collections.singletonList(snapshotBeforeMigration.getProcessInstanceId())).execute();
// fetch updated process instance
processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstance.getId()).singleResult();
snapshotAfterMigration = takeFullProcessInstanceSnapshot(processInstance);
}
use of org.camunda.bpm.engine.RuntimeService in project camunda-bpm-platform by camunda.
the class ProcessEngineRuleJunit4Test method ruleUsageExample.
@Test
@Deployment
public void ruleUsageExample() {
RuntimeService runtimeService = engineRule.getRuntimeService();
runtimeService.startProcessInstanceByKey("ruleUsage");
TaskService taskService = engineRule.getTaskService();
Task task = taskService.createTaskQuery().singleResult();
assertEquals("My Task", task.getName());
taskService.complete(task.getId());
assertEquals(0, runtimeService.createProcessInstanceQuery().count());
}
use of org.camunda.bpm.engine.RuntimeService in project camunda-bpm-platform by camunda.
the class ProcessEngineRuleParameterizedJunit4Test method ruleUsageExampleWithNamedAnnotation.
@Test
@Deployment(resources = "org/camunda/bpm/engine/test/standalone/testing/ProcessEngineRuleParameterizedJunit4Test.ruleUsageExample.bpmn20.xml")
public void ruleUsageExampleWithNamedAnnotation() {
RuntimeService runtimeService = engineRule.getRuntimeService();
runtimeService.startProcessInstanceByKey("ruleUsage");
TaskService taskService = engineRule.getTaskService();
Task task = taskService.createTaskQuery().singleResult();
assertEquals("My Task", task.getName());
taskService.complete(task.getId());
assertEquals(0, runtimeService.createProcessInstanceQuery().count());
}
use of org.camunda.bpm.engine.RuntimeService in project camunda-bpm-platform by camunda.
the class TimerStartEventJobHandler method startProcessInstance.
protected void startProcessInstance(CommandContext commandContext, String tenantId, ProcessDefinition processDefinition) {
if (!processDefinition.isSuspended()) {
RuntimeService runtimeService = commandContext.getProcessEngineConfiguration().getRuntimeService();
runtimeService.createProcessInstanceByKey(processDefinition.getKey()).processDefinitionTenantId(tenantId).execute();
} else {
LOG.ignoringSuspendedJob(processDefinition);
}
}
use of org.camunda.bpm.engine.RuntimeService in project camunda-bpm-platform by camunda.
the class MyTaskFormHandler method submitFormVariables.
public void submitFormVariables(VariableMap properties, VariableScope variableScope) {
ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
IdentityService identityService = processEngineConfiguration.getIdentityService();
RuntimeService runtimeService = processEngineConfiguration.getRuntimeService();
logAuthentication(identityService);
logInstancesCount(runtimeService);
}
Aggregations