Search in sources :

Example 6 with ProcessEngine

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;
}
Also used : DecisionDefinitionQueryDto(org.camunda.bpm.engine.rest.dto.repository.DecisionDefinitionQueryDto) DecisionDefinitionQuery(org.camunda.bpm.engine.repository.DecisionDefinitionQuery) ArrayList(java.util.ArrayList) DecisionDefinitionDto(org.camunda.bpm.engine.rest.dto.repository.DecisionDefinitionDto) DecisionDefinition(org.camunda.bpm.engine.repository.DecisionDefinition) ProcessEngine(org.camunda.bpm.engine.ProcessEngine)

Example 7 with ProcessEngine

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;
}
Also used : CountResultDto(org.camunda.bpm.engine.rest.dto.CountResultDto) ExecutionQuery(org.camunda.bpm.engine.runtime.ExecutionQuery) ProcessEngine(org.camunda.bpm.engine.ProcessEngine)

Example 8 with ProcessEngine

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;
}
Also used : ExternalTaskQuery(org.camunda.bpm.engine.externaltask.ExternalTaskQuery) CountResultDto(org.camunda.bpm.engine.rest.dto.CountResultDto) ProcessEngine(org.camunda.bpm.engine.ProcessEngine)

Example 9 with ProcessEngine

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);
}
Also used : CountResultDto(org.camunda.bpm.engine.rest.dto.CountResultDto) BatchQuery(org.camunda.bpm.engine.batch.BatchQuery) BatchQueryDto(org.camunda.bpm.engine.rest.dto.batch.BatchQueryDto) ProcessEngine(org.camunda.bpm.engine.ProcessEngine)

Example 10 with ProcessEngine

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);
    }
}
Also used : ServiceName(org.jboss.msc.service.ServiceName) ServiceController(org.jboss.msc.service.ServiceController) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException) ProcessEngine(org.camunda.bpm.engine.ProcessEngine)

Aggregations

ProcessEngine (org.camunda.bpm.engine.ProcessEngine)162 DescribesScenario (org.camunda.bpm.qa.upgrade.DescribesScenario)60 ScenarioSetup (org.camunda.bpm.qa.upgrade.ScenarioSetup)60 Task (org.camunda.bpm.engine.task.Task)52 Times (org.camunda.bpm.qa.upgrade.Times)52 Test (org.junit.Test)26 ExtendsScenario (org.camunda.bpm.qa.upgrade.ExtendsScenario)18 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)17 ArrayList (java.util.ArrayList)16 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)15 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)14 AbstractFoxPlatformIntegrationTest (org.camunda.bpm.integrationtest.util.AbstractFoxPlatformIntegrationTest)14 RepositoryService (org.camunda.bpm.engine.RepositoryService)13 PooledDataSource (org.apache.ibatis.datasource.pooled.PooledDataSource)7 StandaloneInMemProcessEngineConfiguration (org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration)6 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)5 Job (org.camunda.bpm.engine.runtime.Job)5 Connection (java.sql.Connection)4 CaseService (org.camunda.bpm.engine.CaseService)4 StandaloneProcessEngineConfiguration (org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration)4