Package org.camunda.bpm.engine.impl.cfg

Examples of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl


* @author Joram Barrez
*/
public class ConnectionPoolTest extends PvmTestCase {
 
  public void testMyBatisConnectionPoolProperlyConfigured() {
    ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
      .createProcessEngineConfigurationFromResource("org/camunda/bpm/engine/test/db/connection-pool.camunda.cfg.xml");
   
    ProcessEngine engine = config.buildProcessEngine();
   
    // Expected values
    int maxActive = 25;
    int maxIdle = 10;
    int maxCheckoutTime = 30000;
    int maxWaitTime = 25000;
   
    assertEquals(maxActive, config.getJdbcMaxActiveConnections());
    assertEquals(maxIdle, config.getJdbcMaxIdleConnections());
    assertEquals(maxCheckoutTime, config.getJdbcMaxCheckoutTime());
    assertEquals(maxWaitTime, config.getJdbcMaxWaitTime());
   
    // Verify that these properties are correctly set in the MyBatis datasource
    DataSource datasource = config.getDbSqlSessionFactory().getSqlSessionFactory().getConfiguration().getEnvironment().getDataSource();
    assertTrue(datasource instanceof PooledDataSource);
   
    PooledDataSource pooledDataSource = (PooledDataSource) datasource;
    assertEquals(maxActive, pooledDataSource.getPoolMaximumActiveConnections());
    assertEquals(maxIdle, pooledDataSource.getPoolMaximumIdleConnections());
View Full Code Here


   * Just assures that diagram creation actually creates something and does not crash.
   * No qualitative evaluation of created diagram.
   * @throws IOException
   */
  public void testProcessDiagramCreation() throws IOException {
    ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("camunda.cfg.xml");
    config.setCreateDiagramOnDeploy(true);
    ProcessEngine engine = config.buildProcessEngine();
    String deploymentId = engine.getRepositoryService().createDeployment()
      .addClasspathResource("org/camunda/bpm/engine/test/bpmn/deployment/BpmnDeploymentTest.testProcessDiagramCreation.bpmn20.xml")
      .deploy().getId();

    ProcessDefinition definition = engine.getRepositoryService().createProcessDefinitionQuery().singleResult();
View Full Code Here

    connection.createStatement().execute("create schema SCHEMA1");
    connection.createStatement().execute("create schema SCHEMA2");   
    connection.close();

    // configure & build two different process engines, each having a separate table prefix
    ProcessEngineConfigurationImpl config1 = createCustomProcessEngineConfiguration()
            .setProcessEngineName("DatabaseTablePrefixTest-engine1")
            .setDataSource(pooledDataSource)
            .setDatabaseSchemaUpdate("NO_CHECK"); // disable auto create/drop schema
    config1.setDatabaseTablePrefix("SCHEMA1.");
    ProcessEngine engine1 = config1.buildProcessEngine();
   
    ProcessEngineConfigurationImpl config2 = createCustomProcessEngineConfiguration()
            .setProcessEngineName("DatabaseTablePrefixTest-engine2")
            .setDataSource(pooledDataSource)
            .setDatabaseSchemaUpdate("NO_CHECK"); // disable auto create/drop schema       
    config2.setDatabaseTablePrefix("SCHEMA2.");
    ProcessEngine engine2 = config2.buildProcessEngine();
   
    // create the tables in SCHEMA1
    connection = pooledDataSource.getConnection();
    connection.createStatement().execute("set schema SCHEMA1");   
    engine1.getManagementService().databaseSchemaUpgrade(connection, "", "SCHEMA1");
View Full Code Here

    // existing process engines to make sure that the db is clean
    // and that there are no existing process engines involved.
    ProcessEngines.destroy();

    // Creating the DB schema (without building a process engine)
    ProcessEngineConfigurationImpl processEngineConfiguration = new StandaloneInMemProcessEngineConfiguration();
    processEngineConfiguration.setProcessEngineName("reboot-test-schema");
    processEngineConfiguration.setJdbcUrl("jdbc:h2:mem:activiti-reboot-test;DB_CLOSE_DELAY=1000");
    ProcessEngine schemaProcessEngine = processEngineConfiguration.buildProcessEngine();
   
    // Create process engine and deploy test process
     ProcessEngine processEngine = new StandaloneProcessEngineConfiguration()
       .setProcessEngineName("reboot-test")
       .setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_FALSE)
View Full Code Here

    return processEngine;
  }

  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"));

    // 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();
  }
View Full Code Here

*
*/
public class CmmnDeployerTest extends PluggableProcessEngineTestCase {

  public void testCmmnDeployment() {
    ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("camunda.cfg.xml");
    ProcessEngine engine = config.buildProcessEngine();

    String deploymentId = engine
        .getRepositoryService()
        .createDeployment()
        .addClasspathResource("org/camunda/bpm/engine/test/cmmn/deployment/CmmnDeploymentTest.testSimpleDeployment.cmmn")
View Full Code Here

  private final static Logger LOGG = Logger.getLogger(TestFixture70.class.getName());

  public static void main(String[] args) {

    ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
      .createProcessEngineConfigurationFromResource("process-engine-config70.xml");
    ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();

    dropCreateDatabase(processEngine);

    TestFixture70 fixture = new TestFixture70(processEngine);
View Full Code Here

    }
  }

  public void logUserOperations(UserOperationLogContext context) {
    if (isHistoryLevelFullEnabled()) {
      ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration();

      HistoryEventProducer eventProducer = configuration.getHistoryEventProducer();
      HistoryEventHandler eventHandler = configuration.getHistoryEventHandler();

      List<HistoryEvent> historyEvents = eventProducer.createUserOperationLogEvents(context);
      eventHandler.handleEvents(historyEvents);
    }
  }
View Full Code Here

    return processApplicationForDeployment;
  }

  public static ProcessApplicationReference getTargetProcessApplication(String deploymentId) {
    ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
    ProcessApplicationManager processApplicationManager = processEngineConfiguration.getProcessApplicationManager();

    ProcessApplicationReference processApplicationForDeployment = processApplicationManager.getProcessApplicationForDeployment(deploymentId);

    return processApplicationForDeployment;
  }
View Full Code Here

  private static EntityManagerFactory entityManagerFactory;

  protected void initializeProcessEngine() {
    if (cachedProcessEngine==null) {
      ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
        .createProcessEngineConfigurationFromResource("org/camunda/bpm/engine/test/standalone/jpa/camunda.cfg.xml");

      cachedProcessEngine = processEngineConfiguration.buildProcessEngine();

      EntityManagerSessionFactory entityManagerSessionFactory = (EntityManagerSessionFactory) processEngineConfiguration
        .getSessionFactories()
        .get(EntityManagerSession.class);

      entityManagerFactory = entityManagerSessionFactory.getEntityManagerFactory();
    }
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.