use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class DmnEngineConfigurationTest method setFeelEngineFactory.
@Test
public void setFeelEngineFactory() {
// given a DMN engine configuration with feel engine factory
DefaultDmnEngineConfiguration dmnEngineConfiguration = (DefaultDmnEngineConfiguration) DmnEngineConfiguration.createDefaultDmnEngineConfiguration();
FeelEngineFactory feelEngineFactory = mock(FeelEngineFactory.class);
dmnEngineConfiguration.setFeelEngineFactory(feelEngineFactory);
ProcessEngineConfigurationImpl processEngineConfiguration = createProcessEngineConfiguration();
processEngineConfiguration.setDmnEngineConfiguration(dmnEngineConfiguration);
// when the engine is initialized
engine = processEngineConfiguration.buildProcessEngine();
// then the feel engine factory should be set on the DMN engine
assertThat(getConfigurationOfDmnEngine().getFeelEngineFactory(), is(feelEngineFactory));
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class ForceCloseMybatisConnectionPoolTest method testForceCloseMybatisConnectionPoolFalse.
@Test
public void testForceCloseMybatisConnectionPoolFalse() {
// given
// that the process engine is configured with forceCloseMybatisConnectionPool = false
ProcessEngineConfigurationImpl configurationImpl = new StandaloneInMemProcessEngineConfiguration().setJdbcUrl("jdbc:h2:mem:camunda-forceclose").setProcessEngineName("engine-forceclose").setForceCloseMybatisConnectionPool(false);
ProcessEngine processEngine = configurationImpl.buildProcessEngine();
PooledDataSource pooledDataSource = (PooledDataSource) configurationImpl.getDataSource();
PoolState state = pooledDataSource.getPoolState();
int idleConnections = state.getIdleConnectionCount();
// then
// if the process engine is closed
processEngine.close();
// the idle connections are not closed
Assert.assertEquals(state.getIdleConnectionCount(), idleConnections);
pooledDataSource.forceCloseAll();
Assert.assertTrue(state.getIdleConnectionCount() == 0);
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class MyFormFieldValidator method validate.
public boolean validate(Object submittedValue, FormFieldValidatorContext validatorContext) {
ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
IdentityService identityService = processEngineConfiguration.getIdentityService();
RuntimeService runtimeService = processEngineConfiguration.getRuntimeService();
logAuthentication(identityService);
logInstancesCount(runtimeService);
return true;
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class DatabaseHistoryPropertyAutoTest method usesDefaultValueAuditWhenNoValueIsConfigured.
@Test
public void usesDefaultValueAuditWhenNoValueIsConfigured() {
final ProcessEngineConfigurationImpl config = config("true", ProcessEngineConfiguration.HISTORY_AUTO);
ProcessEngineImpl processEngine = buildEngine(config);
final Integer level = config.getCommandExecutorSchemaOperations().execute(new Command<Integer>() {
@Override
public Integer execute(CommandContext commandContext) {
return HistoryLevelSetupCommand.databaseHistoryLevel(commandContext);
}
});
assertThat(level, equalTo(HistoryLevel.HISTORY_LEVEL_AUDIT.getId()));
assertThat(processEngine.getProcessEngineConfiguration().getHistoryLevel(), equalTo(HistoryLevel.HISTORY_LEVEL_AUDIT));
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class MyTaskFormHandler method createTaskForm.
public TaskFormData createTaskForm(TaskEntity task) {
ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
IdentityService identityService = processEngineConfiguration.getIdentityService();
RuntimeService runtimeService = processEngineConfiguration.getRuntimeService();
logAuthentication(identityService);
logInstancesCount(runtimeService);
TaskFormDataImpl result = new TaskFormDataImpl();
result.setTask(task);
return result;
}
Aggregations