Search in sources :

Example 1 with ProcessEngine

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();
        }
    }
}
Also used : IllegalWebAppConfigurationException(org.camunda.bpm.webapp.impl.IllegalWebAppConfigurationException) CockpitRuntimeDelegate(org.camunda.bpm.cockpit.CockpitRuntimeDelegate) ProcessEngine(org.camunda.bpm.engine.ProcessEngine)

Example 2 with ProcessEngine

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

Example 3 with ProcessEngine

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;
}
Also used : CaseExecution(org.camunda.bpm.engine.runtime.CaseExecution) CaseExecutionDto(org.camunda.bpm.engine.rest.dto.runtime.CaseExecutionDto) ArrayList(java.util.ArrayList) ProcessEngine(org.camunda.bpm.engine.ProcessEngine) CaseExecutionQuery(org.camunda.bpm.engine.runtime.CaseExecutionQuery)

Example 4 with ProcessEngine

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;
}
Also used : CaseInstance(org.camunda.bpm.engine.runtime.CaseInstance) ArrayList(java.util.ArrayList) CaseInstanceQuery(org.camunda.bpm.engine.runtime.CaseInstanceQuery) CaseInstanceDto(org.camunda.bpm.engine.rest.dto.runtime.CaseInstanceDto) ProcessEngine(org.camunda.bpm.engine.ProcessEngine)

Example 5 with ProcessEngine

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;
}
Also used : DecisionDefinitionQueryDto(org.camunda.bpm.engine.rest.dto.repository.DecisionDefinitionQueryDto) DecisionDefinitionQuery(org.camunda.bpm.engine.repository.DecisionDefinitionQuery) CountResultDto(org.camunda.bpm.engine.rest.dto.CountResultDto) 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