Search in sources :

Example 56 with ProcessEngineConfigurationImpl

use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.

the class HistoricExternalTaskLogManager method isHistoryEventProduced.

// helper /////////////////////////////////////////////////////////
protected boolean isHistoryEventProduced(HistoryEventType eventType, ExternalTask externalTask) {
    ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration();
    HistoryLevel historyLevel = configuration.getHistoryLevel();
    return historyLevel.isHistoryEventProduced(eventType, externalTask);
}
Also used : HistoryLevel(org.camunda.bpm.engine.impl.history.HistoryLevel) ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)

Example 57 with ProcessEngineConfigurationImpl

use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.

the class TestHelper method historyLevelCheck.

private static boolean historyLevelCheck(ProcessEngine processEngine, RequiredHistoryLevel annotation) {
    ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) processEngine.getProcessEngineConfiguration();
    HistoryLevel requiredHistoryLevel = getHistoryLevelForName(processEngineConfiguration.getHistoryLevels(), annotation.value());
    HistoryLevel currentHistoryLevel = processEngineConfiguration.getHistoryLevel();
    return currentHistoryLevel.getId() >= requiredHistoryLevel.getId();
}
Also used : RequiredHistoryLevel(org.camunda.bpm.engine.test.RequiredHistoryLevel) HistoryLevel(org.camunda.bpm.engine.impl.history.HistoryLevel) ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)

Example 58 with ProcessEngineConfigurationImpl

use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.

the class ScriptingEngines method getScriptEngineForLanguage.

/**
 * Loads the given script engine by language name. Will throw an exception if no script engine can be loaded for the given language name.
 *
 * @param language the name of the script language to lookup an implementation for
 * @return the script engine
 * @throws ProcessEngineException if no such engine can be found.
 */
public ScriptEngine getScriptEngineForLanguage(String language) {
    if (language != null) {
        language = language.toLowerCase();
    }
    ProcessApplicationReference pa = Context.getCurrentProcessApplication();
    ProcessEngineConfigurationImpl config = Context.getProcessEngineConfiguration();
    ScriptEngine engine = null;
    if (config.isEnableFetchScriptEngineFromProcessApplication()) {
        if (pa != null) {
            engine = getPaScriptEngine(language, pa);
        }
    }
    if (engine == null) {
        engine = getGlobalScriptEngine(language);
    }
    return engine;
}
Also used : ProcessApplicationReference(org.camunda.bpm.application.ProcessApplicationReference) ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl) ScriptEngine(javax.script.ScriptEngine)

Example 59 with ProcessEngineConfigurationImpl

use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.

the class BatchStatisticsQueryTest method saveAndReduceBatchJobsPerSeed.

@Before
public void saveAndReduceBatchJobsPerSeed() {
    ProcessEngineConfigurationImpl configuration = engineRule.getProcessEngineConfiguration();
    defaultBatchJobsPerSeed = configuration.getBatchJobsPerSeed();
    // reduce number of batch jobs per seed to not have to create a lot of instances
    configuration.setBatchJobsPerSeed(10);
}
Also used : ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl) Before(org.junit.Before)

Example 60 with ProcessEngineConfigurationImpl

use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.

the class HistoryCleanupOnEngineStartTest method testHistoryCleanupJob.

@Test
public void testHistoryCleanupJob() throws ParseException {
    Job historyCleanupJob = historyService.findHistoryCleanupJob();
    assertNotNull(historyCleanupJob);
    Date historyCleanupBatchWindowStartTime = ((ProcessEngineConfigurationImpl) engineRule.getProcessEngine().getProcessEngineConfiguration()).getHistoryCleanupBatchWindowStartTimeAsDate();
    Date historyCleanupBatchWindowEndTime = ((ProcessEngineConfigurationImpl) engineRule.getProcessEngine().getProcessEngineConfiguration()).getHistoryCleanupBatchWindowEndTimeAsDate();
    assertEquals(HistoryCleanupHelper.getCurrentOrNextBatchWindowStartTime(ClockUtil.getCurrentTime(), historyCleanupBatchWindowStartTime, HistoryCleanupHelper.addDays(historyCleanupBatchWindowEndTime, 1)), historyCleanupJob.getDuedate());
}
Also used : Job(org.camunda.bpm.engine.runtime.Job) ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl) Date(java.util.Date) Test(org.junit.Test)

Aggregations

ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)161 Test (org.junit.Test)35 HistoryLevel (org.camunda.bpm.engine.impl.history.HistoryLevel)22 DeploymentCache (org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache)18 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)17 CommandContext (org.camunda.bpm.engine.impl.interceptor.CommandContext)17 HistoryEvent (org.camunda.bpm.engine.impl.history.event.HistoryEvent)13 HistoryEventProcessor (org.camunda.bpm.engine.impl.history.event.HistoryEventProcessor)12 HistoryEventProducer (org.camunda.bpm.engine.impl.history.producer.HistoryEventProducer)12 Before (org.junit.Before)11 CommandChecker (org.camunda.bpm.engine.impl.cfg.CommandChecker)8 ProcessDefinitionEntity (org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity)8 After (org.junit.After)8 Date (java.util.Date)7 PooledDataSource (org.apache.ibatis.datasource.pooled.PooledDataSource)7 ProcessApplicationReference (org.camunda.bpm.application.ProcessApplicationReference)7 DefaultDmnEngineConfiguration (org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration)7 IdentityService (org.camunda.bpm.engine.IdentityService)7 ProcessEngineImpl (org.camunda.bpm.engine.impl.ProcessEngineImpl)7 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)6