Search in sources :

Example 1 with CockpitRuntimeDelegate

use of org.camunda.bpm.cockpit.CockpitRuntimeDelegate 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)

Aggregations

CockpitRuntimeDelegate (org.camunda.bpm.cockpit.CockpitRuntimeDelegate)1 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)1 IllegalWebAppConfigurationException (org.camunda.bpm.webapp.impl.IllegalWebAppConfigurationException)1