use of org.camunda.bpm.engine.rest.dto.history.HistoricProcessInstanceDto in project camunda-bpm-platform by camunda.
the class HistoricProcessInstanceRestServiceImpl method queryHistoricProcessInstances.
@Override
public List<HistoricProcessInstanceDto> queryHistoricProcessInstances(HistoricProcessInstanceQueryDto queryDto, Integer firstResult, Integer maxResults) {
queryDto.setObjectMapper(objectMapper);
HistoricProcessInstanceQuery query = queryDto.toQuery(processEngine);
List<HistoricProcessInstance> matchingHistoricProcessInstances;
if (firstResult != null || maxResults != null) {
matchingHistoricProcessInstances = executePaginatedQuery(query, firstResult, maxResults);
} else {
matchingHistoricProcessInstances = query.list();
}
List<HistoricProcessInstanceDto> historicProcessInstanceDtoResults = new ArrayList<HistoricProcessInstanceDto>();
for (HistoricProcessInstance historicProcessInstance : matchingHistoricProcessInstances) {
HistoricProcessInstanceDto resultHistoricProcessInstanceDto = HistoricProcessInstanceDto.fromHistoricProcessInstance(historicProcessInstance);
historicProcessInstanceDtoResults.add(resultHistoricProcessInstanceDto);
}
return historicProcessInstanceDtoResults;
}
use of org.camunda.bpm.engine.rest.dto.history.HistoricProcessInstanceDto in project camunda-bpm-platform by camunda.
the class ProcessInstanceRestServiceInteractionTest method testActivateHistoricProcessInstanceQuery.
@Test
public void testActivateHistoricProcessInstanceQuery() {
HistoricProcessInstanceDto query = new HistoricProcessInstanceDto();
Map<String, Object> messageBodyJson = new HashMap<String, Object>();
messageBodyJson.put("historicProcessInstanceQuery", query);
messageBodyJson.put("suspended", false);
given().contentType(ContentType.JSON).body(messageBodyJson).then().expect().statusCode(Status.NO_CONTENT.getStatusCode()).when().put(PROCESS_INSTANCE_SUSPENDED_URL);
verify(mockUpdateSuspensionStateSelectBuilder).byHistoricProcessInstanceQuery(any(HistoricProcessInstanceQuery.class));
verify(mockUpdateProcessInstancesSuspensionStateBuilder).activate();
}
Aggregations