Search in sources :

Example 11 with ProcessEngineConfigurationImpl

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();
}
Also used : NoExecutionVariableScope(org.activiti.engine.impl.el.NoExecutionVariableScope) DefaultClockFactory(org.activiti.crystalball.simulator.impl.clock.DefaultClockFactory) ThreadLocalClock(org.activiti.crystalball.simulator.impl.clock.ThreadLocalClock) Clock(org.activiti.engine.runtime.Clock) ProcessEngineConfigurationImpl(org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl) ThreadLocalClock(org.activiti.crystalball.simulator.impl.clock.ThreadLocalClock) ProcessEngineImpl(org.activiti.engine.impl.ProcessEngineImpl) Test(org.junit.Test)

Example 12 with ProcessEngineConfigurationImpl

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;
}
Also used : ProcessEngineConfigurationImpl(org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl)

Example 13 with ProcessEngineConfigurationImpl

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();
}
Also used : DefaultClockFactory(org.activiti.crystalball.simulator.impl.clock.DefaultClockFactory) ThreadLocalClock(org.activiti.crystalball.simulator.impl.clock.ThreadLocalClock) Clock(org.activiti.engine.runtime.Clock) ProcessEngineConfigurationImpl(org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl) ThreadLocalClock(org.activiti.crystalball.simulator.impl.clock.ThreadLocalClock)

Example 14 with ProcessEngineConfigurationImpl

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();
}
Also used : ProcessEngineConfigurationImpl(org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl) ProcessEngineImpl(org.activiti.engine.impl.ProcessEngineImpl)

Example 15 with ProcessEngineConfigurationImpl

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();
}
Also used : ProcessEngineConfiguration(org.activiti.engine.ProcessEngineConfiguration) DefaultClockImpl(org.activiti.engine.impl.util.DefaultClockImpl) ThreadLocalClock(org.activiti.crystalball.simulator.impl.clock.ThreadLocalClock) Clock(org.activiti.engine.runtime.Clock) ProcessEngineConfigurationImpl(org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl) RecordableProcessEngineFactory(org.activiti.crystalball.simulator.impl.RecordableProcessEngineFactory)

Aggregations

ProcessEngineConfigurationImpl (org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl)36 ThreadLocalClock (org.activiti.crystalball.simulator.impl.clock.ThreadLocalClock)5 Clock (org.activiti.engine.runtime.Clock)5 ActivitiException (org.activiti.engine.ActivitiException)4 ProcessEngine (org.activiti.engine.ProcessEngine)4 ProcessEngineImpl (org.activiti.engine.impl.ProcessEngineImpl)4 HistoricActivityInstanceEntity (org.activiti.engine.impl.persistence.entity.HistoricActivityInstanceEntity)4 ProcessDefinition (org.activiti.engine.repository.ProcessDefinition)4 Date (java.util.Date)3 HashMap (java.util.HashMap)3 IdGenerator (org.activiti.engine.impl.cfg.IdGenerator)3 StandaloneInMemProcessEngineConfiguration (org.activiti.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration)3 HistoricProcessInstanceEntity (org.activiti.engine.impl.persistence.entity.HistoricProcessInstanceEntity)3 DefaultClockImpl (org.activiti.engine.impl.util.DefaultClockImpl)3 EntityManagerSession (org.activiti.engine.impl.variable.EntityManagerSession)3 EntityManagerSessionFactory (org.activiti.engine.impl.variable.EntityManagerSessionFactory)3 Task (org.activiti.engine.task.Task)3 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)2 ArrayList (java.util.ArrayList)2 DefaultClockFactory (org.activiti.crystalball.simulator.impl.clock.DefaultClockFactory)2