Search in sources :

Example 21 with DeploymentWithDefinitions

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);
}
Also used : ProcessInstanceQuery(org.camunda.bpm.engine.runtime.ProcessInstanceQuery) Batch(org.camunda.bpm.engine.batch.Batch) ProcessDefinition(org.camunda.bpm.engine.repository.ProcessDefinition) DeploymentWithDefinitions(org.camunda.bpm.engine.repository.DeploymentWithDefinitions) Test(org.junit.Test)

Aggregations

DeploymentWithDefinitions (org.camunda.bpm.engine.repository.DeploymentWithDefinitions)21 Test (org.junit.Test)17 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)15 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)15 ActivityInstance (org.camunda.bpm.engine.runtime.ActivityInstance)12 Batch (org.camunda.bpm.engine.batch.Batch)9 Job (org.camunda.bpm.engine.runtime.Job)7 BpmnModelInstance (org.camunda.bpm.model.bpmn.BpmnModelInstance)3 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)2 ProcessInstanceQuery (org.camunda.bpm.engine.runtime.ProcessInstanceQuery)2 Task (org.camunda.bpm.engine.task.Task)2 URI (java.net.URI)1 NotFoundException (org.camunda.bpm.engine.exception.NotFoundException)1 NotValidException (org.camunda.bpm.engine.exception.NotValidException)1 ReadOnlyProcessDefinition (org.camunda.bpm.engine.impl.pvm.ReadOnlyProcessDefinition)1 DeploymentWithDefinitionsDto (org.camunda.bpm.engine.rest.dto.repository.DeploymentWithDefinitionsDto)1 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)1