use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.
the class TaskRestServiceImpl method queryTasks.
@Override
public List<TaskDto> queryTasks(TaskQueryDto queryDto, Integer firstResult, Integer maxResults) {
ProcessEngine engine = getProcessEngine();
queryDto.setObjectMapper(getObjectMapper());
TaskQuery query = queryDto.toQuery(engine);
List<Task> matchingTasks = executeTaskQuery(firstResult, maxResults, query);
List<TaskDto> tasks = new ArrayList<TaskDto>();
for (Task task : matchingTasks) {
TaskDto returnTask = TaskDto.fromEntity(task);
tasks.add(returnTask);
}
return tasks;
}
use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.
the class VariableInstanceRestServiceImpl method queryVariableInstances.
@Override
public List<VariableInstanceDto> queryVariableInstances(VariableInstanceQueryDto queryDto, Integer firstResult, Integer maxResults, boolean deserializeObjectValues) {
ProcessEngine engine = getProcessEngine();
queryDto.setObjectMapper(getObjectMapper());
VariableInstanceQuery query = queryDto.toQuery(engine);
// disable binary fetching by default.
query.disableBinaryFetching();
// disable custom object fetching by default. Cannot be done to not break existing API
if (!deserializeObjectValues) {
query.disableCustomObjectDeserialization();
}
List<VariableInstance> matchingInstances;
if (firstResult != null || maxResults != null) {
matchingInstances = executePaginatedQuery(query, firstResult, maxResults);
} else {
matchingInstances = query.list();
}
List<VariableInstanceDto> instanceResults = new ArrayList<VariableInstanceDto>();
for (VariableInstance instance : matchingInstances) {
VariableInstanceDto resultInstance = VariableInstanceDto.fromVariableInstance(instance);
instanceResults.add(resultInstance);
}
return instanceResults;
}
use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.
the class CaseInstanceRestServiceImpl method queryCaseInstancesCount.
public CountResultDto queryCaseInstancesCount(CaseInstanceQueryDto queryDto) {
ProcessEngine engine = getProcessEngine();
queryDto.setObjectMapper(getObjectMapper());
CaseInstanceQuery query = queryDto.toQuery(engine);
long count = query.count();
CountResultDto result = new CountResultDto();
result.setCount(count);
return result;
}
use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.
the class DecisionRequirementsDefinitionRestServiceImpl method getDecisionRequirementsDefinitionsCount.
@Override
public CountResultDto getDecisionRequirementsDefinitionsCount(UriInfo uriInfo) {
DecisionRequirementsDefinitionQueryDto queryDto = new DecisionRequirementsDefinitionQueryDto(getObjectMapper(), uriInfo.getQueryParameters());
ProcessEngine engine = getProcessEngine();
DecisionRequirementsDefinitionQuery query = queryDto.toQuery(engine);
long count = query.count();
CountResultDto result = new CountResultDto();
result.setCount(count);
return result;
}
use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.
the class DecisionRequirementsDefinitionRestServiceImpl method getDecisionRequirementsDefinitions.
@Override
public List<DecisionRequirementsDefinitionDto> getDecisionRequirementsDefinitions(UriInfo uriInfo, Integer firstResult, Integer maxResults) {
DecisionRequirementsDefinitionQueryDto queryDto = new DecisionRequirementsDefinitionQueryDto(getObjectMapper(), uriInfo.getQueryParameters());
List<DecisionRequirementsDefinitionDto> dtos = new ArrayList<DecisionRequirementsDefinitionDto>();
ProcessEngine engine = getProcessEngine();
DecisionRequirementsDefinitionQuery query = queryDto.toQuery(engine);
List<DecisionRequirementsDefinition> matchingDefinitions = null;
if (firstResult != null || maxResults != null) {
matchingDefinitions = executePaginatedQuery(query, firstResult, maxResults);
} else {
matchingDefinitions = query.list();
}
for (DecisionRequirementsDefinition definition : matchingDefinitions) {
DecisionRequirementsDefinitionDto dto = DecisionRequirementsDefinitionDto.fromDecisionRequirementsDefinition(definition);
dtos.add(dto);
}
return dtos;
}
Aggregations