use of org.camunda.bpm.engine.RuntimeService in project camunda-bpm-platform by camunda.
the class VariableInstanceQueryForOracleTest method testQueryWhen1001InstancesActive.
@Test
public void testQueryWhen1001InstancesActive() {
// given
Assume.assumeTrue(engineRule.getProcessEngineConfiguration().getDatabaseType().equals("oracle"));
RuntimeService runtimeService = engineRule.getRuntimeService();
testRule.deploy(ProcessModels.TWO_TASKS_PROCESS);
String[] ids = new String[1001];
// when
for (int i = 0; i < 1001; i++) {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("Process", Variables.createVariables().putValue("foo", "bar"));
String activityInstanceId = runtimeService.getActivityInstance(processInstance.getId()).getId();
ids[i] = activityInstanceId;
}
// then
List<VariableInstance> variables = engineRule.getRuntimeService().createVariableInstanceQuery().activityInstanceIdIn(ids).list();
assertEquals(1001, variables.size());
}
use of org.camunda.bpm.engine.RuntimeService in project camunda-bpm-platform by camunda.
the class VariableInstanceQueryForOracleTest method testQueryWhen2001InstancesActive.
@Test
public void testQueryWhen2001InstancesActive() {
// given
Assume.assumeTrue(engineRule.getProcessEngineConfiguration().getDatabaseType().equals("oracle"));
RuntimeService runtimeService = engineRule.getRuntimeService();
testRule.deploy(ProcessModels.TWO_TASKS_PROCESS);
String[] ids = new String[2001];
// when
for (int i = 0; i < 2001; i++) {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("Process", Variables.createVariables().putValue("foo", "bar"));
String activityInstanceId = runtimeService.getActivityInstance(processInstance.getId()).getId();
ids[i] = activityInstanceId;
}
// then
List<VariableInstance> variables = engineRule.getRuntimeService().createVariableInstanceQuery().activityInstanceIdIn(ids).list();
assertEquals(2001, variables.size());
}
use of org.camunda.bpm.engine.RuntimeService in project camunda-bpm-platform by camunda.
the class BatchModificationHelper method startAfterAsync.
public Batch startAfterAsync(String key, int numberOfProcessInstances, String activityId, String processDefinitionId) {
RuntimeService runtimeService = engineRule.getRuntimeService();
List<String> processInstanceIds = startInstances(key, numberOfProcessInstances);
return runtimeService.createModification(processDefinitionId).startAfterActivity(activityId).processInstanceIds(processInstanceIds).executeAsync();
}
use of org.camunda.bpm.engine.RuntimeService in project camunda-bpm-platform by camunda.
the class BatchModificationHelper method startBeforeAsync.
public Batch startBeforeAsync(String key, int numberOfProcessInstances, String activityId, String processDefinitionId) {
RuntimeService runtimeService = engineRule.getRuntimeService();
List<String> processInstanceIds = startInstances(key, numberOfProcessInstances);
return runtimeService.createModification(processDefinitionId).startBeforeActivity(activityId).processInstanceIds(processInstanceIds).executeAsync();
}
use of org.camunda.bpm.engine.RuntimeService in project camunda-bpm-platform by camunda.
the class ExecuteRuntimeServiceOperationTaskListener method notify.
public void notify(DelegateTask delegateTask) {
ProcessEngineServices services = delegateTask.getProcessEngineServices();
RuntimeService runtimeService = services.getRuntimeService();
runtimeService.setVariable(delegateTask.getExecutionId(), "taskListenerCalled", true);
}
Aggregations