use of org.camunda.bpm.engine.repository.DeploymentWithDefinitions in project camunda-bpm-platform by camunda.
the class ModificationExecutionAsyncTest method testBatchCreationWithProcessInstanceQuery.
@Test
public void testBatchCreationWithProcessInstanceQuery() {
int processInstanceCount = 15;
DeploymentWithDefinitions deployment = testRule.deploy(instance);
ProcessDefinition processDefinition = deployment.getDeployedProcessDefinitions().get(0);
helper.startInstances("process1", 15);
ProcessInstanceQuery processInstanceQuery = runtimeService.createProcessInstanceQuery().processDefinitionId(processDefinition.getId());
assertEquals(processInstanceCount, processInstanceQuery.count());
// when
Batch batch = runtimeService.createModification(processDefinition.getId()).startAfterActivity("user1").processInstanceQuery(processInstanceQuery).executeAsync();
// then a batch is created
assertBatchCreated(batch, processInstanceCount);
}
Aggregations