public void initHistoryLevel() { if (historyLevel != null) { setHistory(historyLevel.getName()); } if (historyLevels == null) { historyLevels = new ArrayList<HistoryLevel>(); historyLevels.add(HistoryLevel.HISTORY_LEVEL_NONE); historyLevels.add(HistoryLevel.HISTORY_LEVEL_ACTIVITY); historyLevels.add(HistoryLevel.HISTORY_LEVEL_AUDIT); historyLevels.add(HistoryLevel.HISTORY_LEVEL_FULL); } if (customHistoryLevels != null) { historyLevels.addAll(customHistoryLevels); } if (HISTORY_VARIABLE.equalsIgnoreCase(history)) { historyLevel = HistoryLevel.HISTORY_LEVEL_ACTIVITY; LOG.usingDeprecatedHistoryLevelVariable(); } else { for (HistoryLevel historyLevel : historyLevels) { if (historyLevel.getName().equalsIgnoreCase(history)) { this.historyLevel = historyLevel; } } } // do allow null for history level in case of "auto" if (historyLevel == null && !ProcessEngineConfiguration.HISTORY_AUTO.equalsIgnoreCase(history)) { throw new ProcessEngineException("invalid history level: " + history); } }
public void initHistoryLevel() { if (historyLevel != null) { setHistory(historyLevel.getName()); } if (historyLevels == null) { historyLevels = new ArrayList<HistoryLevel>(); historyLevels.add(HistoryLevel.HISTORY_LEVEL_NONE); historyLevels.add(HistoryLevel.HISTORY_LEVEL_ACTIVITY); historyLevels.add(HistoryLevel.HISTORY_LEVEL_AUDIT); historyLevels.add(HistoryLevel.HISTORY_LEVEL_FULL); } if (customHistoryLevels != null) { historyLevels.addAll(customHistoryLevels); } if (HISTORY_VARIABLE.equalsIgnoreCase(history)) { historyLevel = HistoryLevel.HISTORY_LEVEL_ACTIVITY; LOG.usingDeprecatedHistoryLevelVariable(); } else { for (HistoryLevel historyLevel : historyLevels) { if (historyLevel.getName().equalsIgnoreCase(history)) { this.historyLevel = historyLevel; } } } // do allow null for history level in case of "auto" if (historyLevel == null && !ProcessEngineConfiguration.HISTORY_AUTO.equalsIgnoreCase(history)) { throw new ProcessEngineException("invalid history level: " + history); } }
protected static ProcessEngine createProcessEngine(javax.sql.DataSource datasource, Properties properties) { ProcessEngineConfigurationImpl processEngineConfiguration = new StandaloneProcessEngineConfiguration(); processEngineConfiguration.setDataSource(datasource); processEngineConfiguration.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE); processEngineConfiguration.setHistory(properties.getProperty("historyLevel")); processEngineConfiguration.setJdbcBatchProcessing(Boolean.valueOf(properties.getProperty("jdbcBatchProcessing"))); // load plugins String processEnginePlugins = properties.getProperty("processEnginePlugins", ""); for (String pluginName : processEnginePlugins.split(",")) { if(pluginName.length() > 1) { Object pluginInstance = ReflectUtil.instantiate(pluginName); if(!(pluginInstance instanceof ProcessEnginePlugin)) { throw new PerfTestException("Plugin "+pluginName +" is not an instance of ProcessEnginePlugin"); } else { List<ProcessEnginePlugin> plugins = processEngineConfiguration.getProcessEnginePlugins(); if(plugins == null) { plugins = new ArrayList<ProcessEnginePlugin>(); processEngineConfiguration.setProcessEnginePlugins(plugins); } plugins.add((ProcessEnginePlugin) pluginInstance); } } } return processEngineConfiguration.buildProcessEngine(); }
public ProcessEngineConfiguration configureEngine(ProcessEngineConfigurationImpl processEngineConfiguration) { processEngineConfiguration.setJdbcUrl("jdbc:h2:mem:" + CustomHistoryLevelIncident.class.getSimpleName()); List<HistoryLevel> levels = new ArrayList<>(); levels.add(customHistoryLevelIncident); processEngineConfiguration.setCustomHistoryLevels(levels); processEngineConfiguration.setHistory("aCustomHistoryLevelIncident"); processEngineConfiguration.setDatabaseSchemaUpdate(DB_SCHEMA_UPDATE_CREATE_DROP); return processEngineConfiguration; } };
public ProcessEngineConfiguration configureEngine(ProcessEngineConfigurationImpl processEngineConfiguration) { processEngineConfiguration.setJdbcUrl("jdbc:h2:mem:" + getClass().getSimpleName()); List<HistoryLevel> levels = new ArrayList<>(); levels.add(customHisstoryLevelIL); processEngineConfiguration.setCustomHistoryLevels(levels); processEngineConfiguration.setHistory("aCustomHistoryLevelIL"); processEngineConfiguration.setDatabaseSchemaUpdate(DB_SCHEMA_UPDATE_CREATE_DROP); return processEngineConfiguration; } };
public ProcessEngineConfiguration configureEngine(ProcessEngineConfigurationImpl configuration) { configuration.setJdbcUrl("jdbc:h2:mem:CustomHistoryLevelUserOperationLogTest"); configuration.setCustomHistoryLevels(Arrays.asList(customHistoryLevelUOL)); configuration.setHistory("aCustomHistoryLevelUOL"); configuration.setDatabaseSchemaUpdate(DB_SCHEMA_UPDATE_CREATE_DROP); return configuration; } };
public ProcessEngineConfiguration configureEngine(ProcessEngineConfigurationImpl configuration) { configuration.setJdbcUrl("jdbc:h2:mem:CustomHistoryLevelWithoutUserOperationLogTest"); configuration.setCustomHistoryLevels(Arrays.asList(customHistoryLevelFullWUOL)); configuration.setHistory("aCustomHistoryLevelWUOL"); configuration.setDatabaseSchemaUpdate(DB_SCHEMA_UPDATE_CREATE_DROP); return configuration; } };
public ProcessEngineConfiguration configure(ProcessEngineConfigurationImpl configuration, HistoryEventTypes... historyEventTypes) { configuration.setJdbcUrl("jdbc:h2:mem:" + thisClass.getSimpleName()); configuration.setCustomHistoryLevels(setCustomHistoryLevel(historyEventTypes)); configuration.setHistory(customHistoryLevel.getName()); configuration.setDatabaseSchemaUpdate(DB_SCHEMA_UPDATE_CREATE_DROP); return configuration; }
@Test public void shouldInitHistoryLevelByString() throws Exception { ProcessEngineConfigurationImpl config = createConfig(); config.setHistory(HistoryLevel.HISTORY_LEVEL_FULL.getName()); ProcessEngineConfigurationImpl processEngineConfiguration = buildProcessEngine(config); assertThat(processEngineConfiguration.getHistoryLevels().size(), is(4)); assertThat(processEngineConfiguration.getHistoryLevel(), is(HistoryLevel.HISTORY_LEVEL_FULL)); assertThat(processEngineConfiguration.getHistory(), is(HistoryLevel.HISTORY_LEVEL_FULL.getName())); }
protected static ProcessEngineImpl createProcessEngineImpl(boolean dmnEnabled) { StandaloneInMemProcessEngineConfiguration config = (StandaloneInMemProcessEngineConfiguration) new CustomStandaloneInMemProcessEngineConfiguration() .setProcessEngineName("database-dmn-test-engine") .setDatabaseSchemaUpdate("false") .setHistory(ProcessEngineConfiguration.HISTORY_FULL) .setJdbcUrl("jdbc:h2:mem:DatabaseDmnTest"); config.setDmnEnabled(dmnEnabled); return (ProcessEngineImpl) config.buildProcessEngine(); }
private static ProcessEngineImpl createProcessEngineImpl(String databaseSchemaUpdate, boolean executeSchemaOperations) { ProcessEngineImpl processEngine = (ProcessEngineImpl) new CustomStandaloneInMemProcessEngineConfiguration() .setExecuteSchemaOperations(executeSchemaOperations) .setProcessEngineName("database-history-test-engine") .setDatabaseSchemaUpdate(databaseSchemaUpdate) .setHistory(ProcessEngineConfiguration.HISTORY_FULL) .setJdbcUrl("jdbc:h2:mem:DatabaseHistoryPropertyTest") .buildProcessEngine(); return processEngine; }
public void initHistoryLevel() { if (historyLevel != null) { setHistory(historyLevel.getName()); } if (historyLevels == null) { historyLevels = new ArrayList<HistoryLevel>(); historyLevels.add(HistoryLevel.HISTORY_LEVEL_NONE); historyLevels.add(HistoryLevel.HISTORY_LEVEL_ACTIVITY); historyLevels.add(HistoryLevel.HISTORY_LEVEL_AUDIT); historyLevels.add(HistoryLevel.HISTORY_LEVEL_FULL); } if (customHistoryLevels != null) { historyLevels.addAll(customHistoryLevels); } if (HISTORY_VARIABLE.equalsIgnoreCase(history)) { historyLevel = HistoryLevel.HISTORY_LEVEL_ACTIVITY; LOG.usingDeprecatedHistoryLevelVariable(); } else { for (HistoryLevel historyLevel : historyLevels) { if (historyLevel.getName().equalsIgnoreCase(history)) { this.historyLevel = historyLevel; } } } // do allow null for history level in case of "auto" if (historyLevel == null && !ProcessEngineConfiguration.HISTORY_AUTO.equalsIgnoreCase(history)) { throw new ProcessEngineException("invalid history level: " + history); } }
public ProcessEngineConfiguration configureEngine(ProcessEngineConfigurationImpl processEngineConfiguration) { processEngineConfiguration.setJdbcUrl("jdbc:h2:mem:" + getClass().getSimpleName()); List<HistoryLevel> levels = new ArrayList<>(); levels.add(customHisstoryLevelIL); processEngineConfiguration.setCustomHistoryLevels(levels); processEngineConfiguration.setHistory("aCustomHistoryLevelIL"); processEngineConfiguration.setDatabaseSchemaUpdate(DB_SCHEMA_UPDATE_CREATE_DROP); return processEngineConfiguration; } };
public ProcessEngineConfiguration configureEngine(ProcessEngineConfigurationImpl processEngineConfiguration) { processEngineConfiguration.setJdbcUrl("jdbc:h2:mem:" + CustomHistoryLevelIncident.class.getSimpleName()); List<HistoryLevel> levels = new ArrayList<>(); levels.add(customHistoryLevelIncident); processEngineConfiguration.setCustomHistoryLevels(levels); processEngineConfiguration.setHistory("aCustomHistoryLevelIncident"); processEngineConfiguration.setDatabaseSchemaUpdate(DB_SCHEMA_UPDATE_CREATE_DROP); return processEngineConfiguration; } };
public ProcessEngineConfiguration configureEngine(ProcessEngineConfigurationImpl configuration) { configuration.setJdbcUrl("jdbc:h2:mem:CustomHistoryLevelWithoutUserOperationLogTest"); configuration.setCustomHistoryLevels(Arrays.asList(customHistoryLevelFullWUOL)); configuration.setHistory("aCustomHistoryLevelWUOL"); configuration.setDatabaseSchemaUpdate(DB_SCHEMA_UPDATE_CREATE_DROP); return configuration; } };
public ProcessEngineConfiguration configureEngine(ProcessEngineConfigurationImpl configuration) { configuration.setJdbcUrl("jdbc:h2:mem:CustomHistoryLevelUserOperationLogTest"); configuration.setCustomHistoryLevels(Arrays.asList(customHistoryLevelUOL)); configuration.setHistory("aCustomHistoryLevelUOL"); configuration.setDatabaseSchemaUpdate(DB_SCHEMA_UPDATE_CREATE_DROP); return configuration; } };
public ProcessEngineConfiguration configure(ProcessEngineConfigurationImpl configuration, HistoryEventTypes... historyEventTypes) { configuration.setJdbcUrl("jdbc:h2:mem:" + thisClass.getSimpleName()); configuration.setCustomHistoryLevels(setCustomHistoryLevel(historyEventTypes)); configuration.setHistory(customHistoryLevel.getName()); configuration.setDatabaseSchemaUpdate(DB_SCHEMA_UPDATE_CREATE_DROP); return configuration; }
@Test public void shouldInitHistoryLevelByString() throws Exception { ProcessEngineConfigurationImpl config = createConfig(); config.setHistory(HistoryLevel.HISTORY_LEVEL_FULL.getName()); ProcessEngineConfigurationImpl processEngineConfiguration = buildProcessEngine(config); assertThat(processEngineConfiguration.getHistoryLevels().size(), is(4)); assertThat(processEngineConfiguration.getHistoryLevel(), is(HistoryLevel.HISTORY_LEVEL_FULL)); assertThat(processEngineConfiguration.getHistory(), is(HistoryLevel.HISTORY_LEVEL_FULL.getName())); }
private static ProcessEngineImpl createProcessEngineImpl(String databaseSchemaUpdate, boolean executeSchemaOperations) { ProcessEngineImpl processEngine = (ProcessEngineImpl) new CustomStandaloneInMemProcessEngineConfiguration() .setExecuteSchemaOperations(executeSchemaOperations) .setProcessEngineName("database-history-test-engine") .setDatabaseSchemaUpdate(databaseSchemaUpdate) .setHistory(ProcessEngineConfiguration.HISTORY_FULL) .setJdbcUrl("jdbc:h2:mem:DatabaseHistoryPropertyTest") .buildProcessEngine(); return processEngine; }
protected static ProcessEngineImpl createProcessEngineImpl(boolean dmnEnabled) { StandaloneInMemProcessEngineConfiguration config = (StandaloneInMemProcessEngineConfiguration) new CustomStandaloneInMemProcessEngineConfiguration() .setProcessEngineName("database-dmn-test-engine") .setDatabaseSchemaUpdate("false") .setHistory(ProcessEngineConfiguration.HISTORY_FULL) .setJdbcUrl("jdbc:h2:mem:DatabaseDmnTest"); config.setDmnEnabled(dmnEnabled); return (ProcessEngineImpl) config.buildProcessEngine(); }