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);
}
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();
}
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;
}
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);
}
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());
}
Aggregations