use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.
the class DecisionDefinitionRestServiceImpl method getDecisionDefinitions.
@Override
public List<DecisionDefinitionDto> getDecisionDefinitions(UriInfo uriInfo, Integer firstResult, Integer maxResults) {
DecisionDefinitionQueryDto queryDto = new DecisionDefinitionQueryDto(getObjectMapper(), uriInfo.getQueryParameters());
List<DecisionDefinitionDto> definitions = new ArrayList<DecisionDefinitionDto>();
ProcessEngine engine = getProcessEngine();
DecisionDefinitionQuery query = queryDto.toQuery(engine);
List<DecisionDefinition> matchingDefinitions = null;
if (firstResult != null || maxResults != null) {
matchingDefinitions = executePaginatedQuery(query, firstResult, maxResults);
} else {
matchingDefinitions = query.list();
}
for (DecisionDefinition definition : matchingDefinitions) {
DecisionDefinitionDto def = DecisionDefinitionDto.fromDecisionDefinition(definition);
definitions.add(def);
}
return definitions;
}
use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.
the class ExecutionRestServiceImpl method queryExecutionsCount.
@Override
public CountResultDto queryExecutionsCount(ExecutionQueryDto queryDto) {
ProcessEngine engine = getProcessEngine();
queryDto.setObjectMapper(getObjectMapper());
ExecutionQuery 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 ExternalTaskRestServiceImpl method queryExternalTasksCount.
@Override
public CountResultDto queryExternalTasksCount(ExternalTaskQueryDto queryDto) {
ProcessEngine engine = getProcessEngine();
queryDto.setObjectMapper(getObjectMapper());
ExternalTaskQuery 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 BatchRestServiceImpl method getBatchesCount.
public CountResultDto getBatchesCount(UriInfo uriInfo) {
ProcessEngine processEngine = getProcessEngine();
BatchQueryDto queryDto = new BatchQueryDto(getObjectMapper(), uriInfo.getQueryParameters());
BatchQuery query = queryDto.toQuery(processEngine);
long count = query.count();
return new CountResultDto(count);
}
use of org.camunda.bpm.engine.ProcessEngine in project camunda-bpm-platform by camunda.
the class MscRuntimeContainerDelegate method unregisterProcessEngine.
@SuppressWarnings("unchecked")
public void unregisterProcessEngine(ProcessEngine processEngine) {
if (processEngine == null) {
throw new ProcessEngineException("Cannot unregister process engine with Msc Runtime Container: process engine is 'null'");
}
ServiceName serviceName = ServiceNames.forManagedProcessEngine(processEngine.getName());
// remove the service asynchronously
ServiceController<ProcessEngine> service = (ServiceController<ProcessEngine>) serviceContainer.getService(serviceName);
if (service != null && service.getService() instanceof MscManagedProcessEngine) {
service.setMode(Mode.REMOVE);
}
}
Aggregations