use of org.camunda.bpm.engine.ProcessEngine in project AJSC by att.
the class ProcessEnginesFilter method getDefaultEngineName.
protected String getDefaultEngineName() {
CockpitRuntimeDelegate runtimeDelegate = Cockpit.getRuntimeDelegate();
Set<String> processEngineNames = runtimeDelegate.getProcessEngineNames();
if (processEngineNames.isEmpty()) {
throw new IllegalWebAppConfigurationException("No process engine found. camunda Webapp cannot work without a process engine. ");
} else {
ProcessEngine defaultProcessEngine = runtimeDelegate.getDefaultProcessEngine();
if (defaultProcessEngine != null) {
return defaultProcessEngine.getName();
} else {
return processEngineNames.iterator().next();
}
}
}
use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.
the class CaseExecutionRestServiceImpl method queryCaseExecutionsCount.
public CountResultDto queryCaseExecutionsCount(CaseExecutionQueryDto queryDto) {
ProcessEngine engine = getProcessEngine();
queryDto.setObjectMapper(getObjectMapper());
CaseExecutionQuery 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 CaseExecutionRestServiceImpl method queryCaseExecutions.
public List<CaseExecutionDto> queryCaseExecutions(CaseExecutionQueryDto queryDto, Integer firstResult, Integer maxResults) {
ProcessEngine engine = getProcessEngine();
queryDto.setObjectMapper(getObjectMapper());
CaseExecutionQuery query = queryDto.toQuery(engine);
List<CaseExecution> matchingExecutions;
if (firstResult != null || maxResults != null) {
matchingExecutions = executePaginatedQuery(query, firstResult, maxResults);
} else {
matchingExecutions = query.list();
}
List<CaseExecutionDto> executionResults = new ArrayList<CaseExecutionDto>();
for (CaseExecution execution : matchingExecutions) {
CaseExecutionDto resultExecution = CaseExecutionDto.fromCaseExecution(execution);
executionResults.add(resultExecution);
}
return executionResults;
}
use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.
the class CaseInstanceRestServiceImpl method queryCaseInstances.
public List<CaseInstanceDto> queryCaseInstances(CaseInstanceQueryDto queryDto, Integer firstResult, Integer maxResults) {
ProcessEngine engine = getProcessEngine();
queryDto.setObjectMapper(getObjectMapper());
CaseInstanceQuery query = queryDto.toQuery(engine);
List<CaseInstance> matchingInstances;
if (firstResult != null || maxResults != null) {
matchingInstances = executePaginatedQuery(query, firstResult, maxResults);
} else {
matchingInstances = query.list();
}
List<CaseInstanceDto> instanceResults = new ArrayList<CaseInstanceDto>();
for (CaseInstance instance : matchingInstances) {
CaseInstanceDto resultInstance = CaseInstanceDto.fromCaseInstance(instance);
instanceResults.add(resultInstance);
}
return instanceResults;
}
use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.
the class DecisionDefinitionRestServiceImpl method getDecisionDefinitionsCount.
@Override
public CountResultDto getDecisionDefinitionsCount(UriInfo uriInfo) {
DecisionDefinitionQueryDto queryDto = new DecisionDefinitionQueryDto(getObjectMapper(), uriInfo.getQueryParameters());
ProcessEngine engine = getProcessEngine();
DecisionDefinitionQuery query = queryDto.toQuery(engine);
long count = query.count();
CountResultDto result = new CountResultDto();
result.setCount(count);
return result;
}
Aggregations