use of org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl in project Activiti by Activiti.
the class PlaybackRunTest method testProcessInstanceStartEvents.
@Test
public void testProcessInstanceStartEvents() throws Exception {
recordEvents();
final SimpleSimulationRun.Builder builder = new SimpleSimulationRun.Builder();
// init simulation run
Clock clock = new ThreadLocalClock(new DefaultClockFactory());
ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration.createProcessEngineConfigurationFromResourceDefault();
config.setClock(clock);
SimulationProcessEngineFactory simulationProcessEngineFactory = new SimulationProcessEngineFactory(config);
final ProcessEngineImpl simProcessEngine = simulationProcessEngineFactory.getObject();
builder.processEngine(simProcessEngine).eventCalendar((new SimpleEventCalendarFactory(clock, new SimulationEventComparator(), listener.getSimulationEvents())).getObject()).eventHandlers(getHandlers());
SimpleSimulationRun simRun = builder.build();
simRun.execute(new NoExecutionVariableScope());
checkStatus(simProcessEngine);
simProcessEngine.getProcessEngineConfiguration().setDatabaseSchemaUpdate("create-drop");
simProcessEngine.close();
ProcessEngines.destroy();
}
use of org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl in project Activiti by Activiti.
the class ReplayEventLogTest method getProcessEngineConfiguration.
private ProcessEngineConfigurationImpl getProcessEngineConfiguration() {
ProcessEngineConfigurationImpl configuration = new org.activiti.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration();
configuration.setEnableDatabaseEventLogging(true).setDatabaseSchemaUpdate("create-drop").setJobExecutorActivate(false);
return configuration;
}
use of org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl in project Activiti by Activiti.
the class SimpleSimulationRunTest method createDebugger.
private SimulationDebugger createDebugger() {
final SimpleSimulationRun.Builder builder = new SimpleSimulationRun.Builder();
// init simulation run
Clock clock = new ThreadLocalClock(new DefaultClockFactory());
ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration.createProcessEngineConfigurationFromResourceDefault();
config.setClock(clock);
SimulationProcessEngineFactory simulationProcessEngineFactory = new SimulationProcessEngineFactory(config);
builder.processEngine(simulationProcessEngineFactory.getObject()).eventCalendar((new SimpleEventCalendarFactory(clock, new SimulationEventComparator(), listener.getSimulationEvents())).getObject()).eventHandlers(getHandlers());
return builder.build();
}
use of org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl in project Activiti by Activiti.
the class EventRecorderTestUtils method closeProcessEngine.
public static void closeProcessEngine(ProcessEngine processEngine, ActivitiEventListener listener) {
if (listener != null) {
final ProcessEngineConfigurationImpl processEngineConfiguration = ((ProcessEngineImpl) processEngine).getProcessEngineConfiguration();
processEngineConfiguration.getEventDispatcher().removeEventListener(listener);
}
processEngine.close();
}
use of org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl in project Activiti by Activiti.
the class AbstractPlaybackTest method initializeProcessEngine.
@Override
protected void initializeProcessEngine() {
Clock clock = new DefaultClockImpl();
ProcessEngineConfiguration processEngineConfiguration = ProcessEngineConfiguration.createProcessEngineConfigurationFromResourceDefault();
processEngineConfiguration.setClock(clock);
this.processEngine = (new RecordableProcessEngineFactory((ProcessEngineConfigurationImpl) processEngineConfiguration, listener)).getObject();
}
Aggregations