use of org.camunda.bpm.engine.rest.dto.batch.BatchDto in project camunda-bpm-platform by camunda.
the class BatchRestServiceImpl method getBatches.
public List<BatchDto> getBatches(UriInfo uriInfo, Integer firstResult, Integer maxResults) {
BatchQueryDto queryDto = new BatchQueryDto(getObjectMapper(), uriInfo.getQueryParameters());
BatchQuery query = queryDto.toQuery(getProcessEngine());
List<Batch> matchingBatches;
if (firstResult != null || maxResults != null) {
matchingBatches = executePaginatedQuery(query, firstResult, maxResults);
} else {
matchingBatches = query.list();
}
List<BatchDto> batchResults = new ArrayList<BatchDto>();
for (Batch matchingBatch : matchingBatches) {
batchResults.add(BatchDto.fromBatch(matchingBatch));
}
return batchResults;
}
use of org.camunda.bpm.engine.rest.dto.batch.BatchDto in project camunda-bpm-platform by camunda.
the class BatchRestServiceQueryTest method verifyBatchListJson.
protected void verifyBatchListJson(String batchListJson) {
List<Object> batches = from(batchListJson).get();
assertEquals("There should be one batch returned.", 1, batches.size());
BatchDto batch = from(batchListJson).getObject("[0]", BatchDto.class);
assertNotNull("The returned batch should not be null.", batch);
assertEquals(MockProvider.EXAMPLE_BATCH_ID, batch.getId());
assertEquals(MockProvider.EXAMPLE_BATCH_TYPE, batch.getType());
assertEquals(MockProvider.EXAMPLE_BATCH_TOTAL_JOBS, batch.getTotalJobs());
assertEquals(MockProvider.EXAMPLE_BATCH_JOBS_CREATED, batch.getJobsCreated());
assertEquals(MockProvider.EXAMPLE_BATCH_JOBS_PER_SEED, batch.getBatchJobsPerSeed());
assertEquals(MockProvider.EXAMPLE_INVOCATIONS_PER_BATCH_JOB, batch.getInvocationsPerBatchJob());
assertEquals(MockProvider.EXAMPLE_SEED_JOB_DEFINITION_ID, batch.getSeedJobDefinitionId());
assertEquals(MockProvider.EXAMPLE_MONITOR_JOB_DEFINITION_ID, batch.getMonitorJobDefinitionId());
assertEquals(MockProvider.EXAMPLE_BATCH_JOB_DEFINITION_ID, batch.getBatchJobDefinitionId());
assertEquals(MockProvider.EXAMPLE_TENANT_ID, batch.getTenantId());
assertTrue(batch.isSuspended());
}
use of org.camunda.bpm.engine.rest.dto.batch.BatchDto in project camunda-bpm-platform by camunda.
the class JobRestServiceInteractionTest method verifyBatchJson.
protected void verifyBatchJson(String batchJson) {
BatchDto batch = JsonPathUtil.from(batchJson).getObject("", BatchDto.class);
assertNotNull("The returned batch should not be null.", batch);
assertEquals(MockProvider.EXAMPLE_BATCH_ID, batch.getId());
assertEquals(MockProvider.EXAMPLE_BATCH_TYPE, batch.getType());
assertEquals(MockProvider.EXAMPLE_BATCH_TOTAL_JOBS, batch.getTotalJobs());
assertEquals(MockProvider.EXAMPLE_BATCH_JOBS_PER_SEED, batch.getBatchJobsPerSeed());
assertEquals(MockProvider.EXAMPLE_INVOCATIONS_PER_BATCH_JOB, batch.getInvocationsPerBatchJob());
assertEquals(MockProvider.EXAMPLE_SEED_JOB_DEFINITION_ID, batch.getSeedJobDefinitionId());
assertEquals(MockProvider.EXAMPLE_MONITOR_JOB_DEFINITION_ID, batch.getMonitorJobDefinitionId());
assertEquals(MockProvider.EXAMPLE_BATCH_JOB_DEFINITION_ID, batch.getBatchJobDefinitionId());
assertEquals(MockProvider.EXAMPLE_TENANT_ID, batch.getTenantId());
}
use of org.camunda.bpm.engine.rest.dto.batch.BatchDto in project camunda-bpm-platform by camunda.
the class ProcessInstanceRestServiceInteractionTest method verifyBatchJson.
protected void verifyBatchJson(String batchJson) {
BatchDto batch = JsonPathUtil.from(batchJson).getObject("", BatchDto.class);
assertNotNull("The returned batch should not be null.", batch);
assertEquals(MockProvider.EXAMPLE_BATCH_ID, batch.getId());
assertEquals(MockProvider.EXAMPLE_BATCH_TYPE, batch.getType());
assertEquals(MockProvider.EXAMPLE_BATCH_TOTAL_JOBS, batch.getTotalJobs());
assertEquals(MockProvider.EXAMPLE_BATCH_JOBS_PER_SEED, batch.getBatchJobsPerSeed());
assertEquals(MockProvider.EXAMPLE_INVOCATIONS_PER_BATCH_JOB, batch.getInvocationsPerBatchJob());
assertEquals(MockProvider.EXAMPLE_SEED_JOB_DEFINITION_ID, batch.getSeedJobDefinitionId());
assertEquals(MockProvider.EXAMPLE_MONITOR_JOB_DEFINITION_ID, batch.getMonitorJobDefinitionId());
assertEquals(MockProvider.EXAMPLE_BATCH_JOB_DEFINITION_ID, batch.getBatchJobDefinitionId());
assertEquals(MockProvider.EXAMPLE_TENANT_ID, batch.getTenantId());
}
use of org.camunda.bpm.engine.rest.dto.batch.BatchDto in project camunda-bpm-platform by camunda.
the class HistoricProcessInstanceRestServiceInteractionTest method verifyBatchJson.
protected void verifyBatchJson(String batchJson) {
BatchDto batch = JsonPathUtil.from(batchJson).getObject("", BatchDto.class);
assertNotNull("The returned batch should not be null.", batch);
assertEquals(MockProvider.EXAMPLE_BATCH_ID, batch.getId());
assertEquals(MockProvider.EXAMPLE_BATCH_TYPE, batch.getType());
assertEquals(MockProvider.EXAMPLE_BATCH_TOTAL_JOBS, batch.getTotalJobs());
assertEquals(MockProvider.EXAMPLE_BATCH_JOBS_PER_SEED, batch.getBatchJobsPerSeed());
assertEquals(MockProvider.EXAMPLE_INVOCATIONS_PER_BATCH_JOB, batch.getInvocationsPerBatchJob());
assertEquals(MockProvider.EXAMPLE_SEED_JOB_DEFINITION_ID, batch.getSeedJobDefinitionId());
assertEquals(MockProvider.EXAMPLE_MONITOR_JOB_DEFINITION_ID, batch.getMonitorJobDefinitionId());
assertEquals(MockProvider.EXAMPLE_BATCH_JOB_DEFINITION_ID, batch.getBatchJobDefinitionId());
assertEquals(MockProvider.EXAMPLE_TENANT_ID, batch.getTenantId());
}
Aggregations