Java Code Examples for org.camunda.bpm.engine.ProcessEngineConfiguration#createProcessEngineConfigurationFromResource()

The following examples show how to use org.camunda.bpm.engine.ProcessEngineConfiguration#createProcessEngineConfigurationFromResource() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: KeycloakUseKeycloakIdAsUserIdQueryTest.java    From camunda-bpm-identity-keycloak with Apache License 2.0 6 votes vote down vote up
public static Test suite() {
    return new TestSetup(new TestSuite(KeycloakUseKeycloakIdAsUserIdQueryTest.class)) {

    	// @BeforeClass
        protected void setUp() throws Exception {
    		ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
    				.createProcessEngineConfigurationFromResource("camunda.useKeycloakIdAsCamundaUserId.cfg.xml");
    		configureKeycloakIdentityProviderPlugin(config);
    		PluggableProcessEngineTestCase.cachedProcessEngine = config.buildProcessEngine();
        }
        
        // @AfterClass
        protected void tearDown() throws Exception {
    		PluggableProcessEngineTestCase.cachedProcessEngine.close();
    		PluggableProcessEngineTestCase.cachedProcessEngine = null;
        }
    };
}
 
Example 2
Source File: KeycloakConfigureAdminGroupAndUsePathAsId.java    From camunda-bpm-identity-keycloak with Apache License 2.0 6 votes vote down vote up
public static Test suite() {
    return new TestSetup(new TestSuite(KeycloakConfigureAdminGroupAndUsePathAsId.class)) {

    	// @BeforeClass
        protected void setUp() throws Exception {
    		ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
    				.createProcessEngineConfigurationFromResource("camunda.configureAdminGroupAndUsePathAsId.cfg.xml");
    		configureKeycloakIdentityProviderPlugin(config);
    		PluggableProcessEngineTestCase.cachedProcessEngine = config.buildProcessEngine();
        }
        
        // @AfterClass
        protected void tearDown() throws Exception {
    		PluggableProcessEngineTestCase.cachedProcessEngine.close();
    		PluggableProcessEngineTestCase.cachedProcessEngine = null;
        }
    };
}
 
Example 3
Source File: DmnEngineConfigurationTest.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
@Test
public void setDmnEngineConfigurationOverXmlConfiguration() {
  // given an embedded DMN engine configuration in XML process engine configuration
  // with default expression language
  ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
      .createProcessEngineConfigurationFromResource(CONFIGURATION_XML);

  // checks that the configuration is set as on XML
  DefaultDmnEngineConfiguration dmnEngineConfiguration = processEngineConfiguration.getDmnEngineConfiguration();
  assertThat(dmnEngineConfiguration, is(notNullValue()));
  assertThat(dmnEngineConfiguration.getDefaultInputExpressionExpressionLanguage(), is("groovy"));

  // when the engine is initialized
  engine = processEngineConfiguration.buildProcessEngine();

  // then the default expression language should be set in the DMN engine
  assertThat(getConfigurationOfDmnEngine().getDefaultInputExpressionExpressionLanguage(), is("groovy"));
}
 
Example 4
Source File: KeycloakConfigureAdminUserIdAndUseMailAsIdTest.java    From camunda-bpm-identity-keycloak with Apache License 2.0 6 votes vote down vote up
public static Test suite() {
    return new TestSetup(new TestSuite(KeycloakConfigureAdminUserIdAndUseMailAsIdTest.class)) {

    	// @BeforeClass
        protected void setUp() throws Exception {
    		ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
    				.createProcessEngineConfigurationFromResource("camunda.configureAdminUserIdAndUseMailAsId.cfg.xml");
    		configureKeycloakIdentityProviderPlugin(config).setAdministratorUserId(USER_ID_CAMUNDA_ADMIN);
    		PluggableProcessEngineTestCase.cachedProcessEngine = config.buildProcessEngine();
        }
        
        // @AfterClass
        protected void tearDown() throws Exception {
    		PluggableProcessEngineTestCase.cachedProcessEngine.close();
    		PluggableProcessEngineTestCase.cachedProcessEngine = null;
        }
    };
}
 
Example 5
Source File: KeycloakConfigureAdminUserIdAndUseUsernameAsIdTest.java    From camunda-bpm-identity-keycloak with Apache License 2.0 6 votes vote down vote up
public static Test suite() {
    return new TestSetup(new TestSuite(KeycloakConfigureAdminUserIdAndUseUsernameAsIdTest.class)) {

    	// @BeforeClass
        protected void setUp() throws Exception {
    		ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
    				.createProcessEngineConfigurationFromResource("camunda.configureAdminUserIdAndUseUsernameAsId.cfg.xml");
    		configureKeycloakIdentityProviderPlugin(config).setAdministratorUserId(USER_ID_CAMUNDA_ADMIN);
    		PluggableProcessEngineTestCase.cachedProcessEngine = config.buildProcessEngine();
        }
        
        // @AfterClass
        protected void tearDown() throws Exception {
    		PluggableProcessEngineTestCase.cachedProcessEngine.close();
    		PluggableProcessEngineTestCase.cachedProcessEngine = null;
        }
    };
}
 
Example 6
Source File: KeycloakConfigureAdminUserIdAsUsernameAndUseUsernameAsIdTest.java    From camunda-bpm-identity-keycloak with Apache License 2.0 6 votes vote down vote up
public static Test suite() {
    return new TestSetup(new TestSuite(KeycloakConfigureAdminUserIdAsUsernameAndUseUsernameAsIdTest.class)) {

    	// @BeforeClass
        protected void setUp() throws Exception {
    		ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
    				.createProcessEngineConfigurationFromResource("camunda.configureAdminUserIdAsUsernameAndUseUsernameAsId.cfg.xml");
    		configureKeycloakIdentityProviderPlugin(config);
    		PluggableProcessEngineTestCase.cachedProcessEngine = config.buildProcessEngine();
        }
        
        // @AfterClass
        protected void tearDown() throws Exception {
    		PluggableProcessEngineTestCase.cachedProcessEngine.close();
    		PluggableProcessEngineTestCase.cachedProcessEngine = null;
        }
    };
}
 
Example 7
Source File: KeycloakUseUsernameAsUserIdQueryTest.java    From camunda-bpm-identity-keycloak with Apache License 2.0 6 votes vote down vote up
public static Test suite() {
    return new TestSetup(new TestSuite(KeycloakUseUsernameAsUserIdQueryTest.class)) {

    	// @BeforeClass
        protected void setUp() throws Exception {
    		ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
    				.createProcessEngineConfigurationFromResource("camunda.useUsernameAsCamundaUserId.cfg.xml");
    		configureKeycloakIdentityProviderPlugin(config);
    		PluggableProcessEngineTestCase.cachedProcessEngine = config.buildProcessEngine();
        }
        
        // @AfterClass
        protected void tearDown() throws Exception {
    		PluggableProcessEngineTestCase.cachedProcessEngine.close();
    		PluggableProcessEngineTestCase.cachedProcessEngine = null;
        }
    };
}
 
Example 8
Source File: TestFixture.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) {
  ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
    .createProcessEngineConfigurationFromResource("camunda.cfg.xml");
  ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();

  // register test scenarios
  ScenarioRunner runner = new ScenarioRunner(processEngine, ENGINE_VERSION);

  // compensation
  runner.setupScenarios(CreateProcessInstanceWithJsonVariablesScenario.class);

  processEngine.close();
}
 
Example 9
Source File: TestFixture.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) {
  ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
    .createProcessEngineConfigurationFromResource("camunda.cfg.xml");
  ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();

  // register test scenarios
  ScenarioRunner runner = new ScenarioRunner(processEngine, ENGINE_VERSION);
  // compensation
  runner.setupScenarios(DeployProcessWithoutIsExecutableAttributeScenario.class);

  processEngine.close();
}
 
Example 10
Source File: TestFixture.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) {
  ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
    .createProcessEngineConfigurationFromResource("camunda.cfg.xml");
  ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();

  // register test scenarios
  ScenarioRunner runner = new ScenarioRunner(processEngine, ENGINE_VERSION);

  // cmmn sentries
  runner.setupScenarios(SentryScenario.class);

  // compensation
  runner.setupScenarios(SingleActivityCompensationScenario.class);
  runner.setupScenarios(NestedCompensationScenario.class);
  runner.setupScenarios(SingleActivityConcurrentCompensationScenario.class);
  runner.setupScenarios(ParallelMultiInstanceCompensationScenario.class);
  runner.setupScenarios(SequentialMultiInstanceCompensationScenario.class);
  runner.setupScenarios(NestedMultiInstanceCompensationScenario.class);
  runner.setupScenarios(InterruptingEventSubProcessCompensationScenario.class);
  runner.setupScenarios(NonInterruptingEventSubProcessCompensationScenario.class);
  runner.setupScenarios(InterruptingEventSubProcessNestedCompensationScenario.class);

  // job
  runner.setupScenarios(JobMigrationScenario.class);

  // boundary events
  runner.setupScenarios(NonInterruptingBoundaryEventScenario.class);

  processEngine.close();
}
 
Example 11
Source File: TestFixture.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) {
  ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
    .createProcessEngineConfigurationFromResource("camunda.cfg.xml");
  ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();

  // register test scenarios
  ScenarioRunner runner = new ScenarioRunner(processEngine, ENGINE_VERSION);

  // example scenario setup
  // runner.setupScenarios(ExampleScenario.class);

  processEngine.close();
}
 
Example 12
Source File: TestFixture.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) {
  ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
    .createProcessEngineConfigurationFromResource("camunda.cfg.xml");
  ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();

  // register test scenarios
  ScenarioRunner runner = new ScenarioRunner(processEngine, ENGINE_VERSION);

  // compensation
  runner.setupScenarios(DeployUserWithoutSaltForPasswordHashingScenario.class);

  processEngine.close();
}
 
Example 13
Source File: TestFixture.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) {
  ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
    .createProcessEngineConfigurationFromResource("camunda.cfg.xml");
  ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();

  // register test scenarios
  ScenarioRunner runner = new ScenarioRunner(processEngine, ENGINE_VERSION);

  runner.setupScenarios(DeleteHistoricDecisionsBatchScenario.class);
  runner.setupScenarios(DeleteHistoricProcessInstancesBatchScenario.class);
  runner.setupScenarios(DeleteProcessInstancesBatchScenario.class);
  runner.setupScenarios(SetExternalTaskRetriesBatchScenario.class);
  runner.setupScenarios(SetJobRetriesBatchScenario.class);
  runner.setupScenarios(UpdateProcessInstanceSuspendStateBatchScenario.class);
  runner.setupScenarios(RestartProcessInstanceBatchScenario.class);
  runner.setupScenarios(TimerChangeProcessDefinitionScenario.class);
  runner.setupScenarios(TimerChangeJobDefinitionScenario.class);
  runner.setupScenarios(ModificationBatchScenario.class);
  runner.setupScenarios(ProcessInstanceModificationScenario.class);
  runner.setupScenarios(MigrationBatchScenario.class);
  runner.setupScenarios(TaskFilterScenario.class);
  runner.setupScenarios(TaskFilterVariablesScenario.class);
  runner.setupScenarios(TaskFilterPropertiesScenario.class);
  runner.setupScenarios(DeploymentDeployTimeScenario.class);
  runner.setupScenarios(JobTimestampsScenario.class);
  runner.setupScenarios(IncidentTimestampScenario.class);
  runner.setupScenarios(TaskCreateTimeScenario.class);
  runner.setupScenarios(ExternalTaskLockExpTimeScenario.class);
  runner.setupScenarios(EventSubscriptionCreateTimeScenario.class);
  runner.setupScenarios(MeterLogTimestampScenario.class);
  runner.setupScenarios(UserLockExpTimeScenario.class);
  runner.setupScenarios(CreateStandaloneTaskScenario.class);
  runner.setupScenarios(SetAssigneeProcessInstanceTaskScenario.class);
  runner.setupScenarios(CreateStandaloneTaskDeleteScenario.class);
  runner.setupScenarios(SuspendProcessDefinitionDeleteScenario.class);
  runner.setupScenarios(AuthorizationCheckProcessDefinitionScenario.class);
  runner.setupScenarios(NoAuthorizationCheckScenario.class);

  processEngine.close();
}
 
Example 14
Source File: TestFixture.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) {
  ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
    .createProcessEngineConfigurationFromResource("camunda.cfg.xml");
  ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();

  // register test scenarios
  ScenarioRunner runner = new ScenarioRunner(processEngine, ENGINE_VERSION);

  // compensation
  runner.setupScenarios(CreateProcessInstanceWithVariableScenario.class);

  processEngine.close();
}
 
Example 15
Source File: JPAVariableTest.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
protected void setUp() throws Exception {
  ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
      .createProcessEngineConfigurationFromResource("org/camunda/bpm/engine/test/standalone/jpa/camunda.cfg.xml");

  processEngineConfiguration.setJavaSerializationFormatEnabled(true);

  cachedProcessEngine = processEngineConfiguration.buildProcessEngine();

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

  entityManagerFactory = entityManagerSessionFactory.getEntityManagerFactory();
}
 
Example 16
Source File: AbstractKeycloakIdentityProviderTest.java    From camunda-bpm-identity-keycloak with Apache License 2.0 5 votes vote down vote up
/**
 * Initializes the process engine using standard configuration camunda.cfg.xml, but
 * replaces the KeyCloakProvider's client secret with the actual test setup.
 * Furthermore it uses a new database for each test class.
 * @return the process engine
 */
private ProcessEngine getOrInitializeCachedProcessEngine() {
	if (cachedProcessEngine == null) {
		ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
				.createProcessEngineConfigurationFromResource("camunda.cfg.xml");
		configureKeycloakIdentityProviderPlugin(config);
		config.setJdbcUrl(config.getJdbcUrl().replace("KeycloakIdentityServiceTest", getClass().getSimpleName()));
		cachedProcessEngine = config.buildProcessEngine();
	}
	return cachedProcessEngine;
}
 
Example 17
Source File: ResourceProcessEngineTestCase.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
@Override
protected void initializeProcessEngine() {
  ProcessEngineConfigurationImpl processEngineConfig = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
      .createProcessEngineConfigurationFromResource(engineConfigurationResource);
  processEngine = processEngineConfig.buildProcessEngine();
}
 
Example 18
Source File: ConcurrentProcessEngineJobExecutorHistoryCleanupJobTest.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
@Override
public Void execute(CommandContext commandContext) {

  bootstrapCommand = new ControllableBootstrapEngineCommand(this.monitor);

  ProcessEngineConfiguration processEngineConfiguration = ProcessEngineConfiguration
    .createProcessEngineConfigurationFromResource("org/camunda/bpm/engine/test/concurrency/historycleanup.camunda.cfg.xml");


  processEngineConfiguration.setProcessEngineBootstrapCommand(bootstrapCommand);

  processEngineConfiguration.setProcessEngineName(PROCESS_ENGINE_NAME);
  processEngineConfiguration.buildProcessEngine();

  return null;
}
 
Example 19
Source File: TestFixture.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
public static void main(String[] args) {
  ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration
    .createProcessEngineConfigurationFromResource("camunda.cfg.xml");
  ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();

  // register test scenarios
  ScenarioRunner runner = new ScenarioRunner(processEngine, ENGINE_VERSION);

  // event subprocesses
  runner.setupScenarios(InterruptingEventSubprocessScenario.class);
  runner.setupScenarios(NonInterruptingEventSubprocessScenario.class);
  runner.setupScenarios(NestedNonInterruptingEventSubprocessScenario.class);
  runner.setupScenarios(ParallelNestedNonInterruptingEventSubprocessScenario.class);
  runner.setupScenarios(NestedParallelNonInterruptingEventSubprocessScenario.class);
  runner.setupScenarios(NestedNonInterruptingEventSubprocessNestedSubprocessScenario.class);
  runner.setupScenarios(NestedInterruptingErrorEventSubprocessScenario.class);
  runner.setupScenarios(TwoLevelNestedNonInterruptingEventSubprocessScenario.class);
  runner.setupScenarios(NestedInterruptingEventSubprocessParallelScenario.class);

  // multi instance
  runner.setupScenarios(SequentialMultiInstanceSubprocessScenario.class);
  runner.setupScenarios(NestedSequentialMultiInstanceSubprocessScenario.class);
  runner.setupScenarios(MultiInstanceReceiveTaskScenario.class);
  runner.setupScenarios(ParallelMultiInstanceSubprocessScenario.class);

  // async
  runner.setupScenarios(AsyncParallelMultiInstanceScenario.class);
  runner.setupScenarios(AsyncSequentialMultiInstanceScenario.class);

  // boundary event
  runner.setupScenarios(NonInterruptingBoundaryEventScenario.class);
  runner.setupScenarios(NestedNonInterruptingBoundaryEventOnInnerSubprocessScenario.class);
  runner.setupScenarios(NestedNonInterruptingBoundaryEventOnOuterSubprocessScenario.class);

  // compensation
  runner.setupScenarios(SingleActivityCompensationScenario.class);
  runner.setupScenarios(SubprocessCompensationScenario.class);
  runner.setupScenarios(TransactionCancelCompensationScenario.class);
  runner.setupScenarios(InterruptingEventSubprocessCompensationScenario.class);
  runner.setupScenarios(SubprocessParallelThrowCompensationScenario.class);
  runner.setupScenarios(SubprocessParallelCreateCompensationScenario.class);

  // plain tasks
  runner.setupScenarios(OneTaskScenario.class);
  runner.setupScenarios(OneScopeTaskScenario.class);
  runner.setupScenarios(ParallelTasksScenario.class);
  runner.setupScenarios(ParallelScopeTasksScenario.class);

  // event-based gateway
  runner.setupScenarios(EventBasedGatewayScenario.class);

  runner.setupScenarios(HistoricInstancePermissionsWithoutProcDefKeyScenario.class);

  processEngine.close();
}
 
Example 20
Source File: DbSchemaExecuteFile.java    From camunda-bpm-platform with Apache License 2.0 3 votes vote down vote up
/**
 * @param args
 */
public static void main(String[] args) {

  if(args.length != 2) {
    throw LOG.invokeSchemaResourceToolException(args.length);
  }

  final String configurationFileResourceName = args[0];
  final String schemaFileResourceName = args[1];

  ensureNotNull("Process engine configuration file name cannot be null", "configurationFileResourceName", configurationFileResourceName);
  ensureNotNull("Schema resource file name cannot be null", "schemaFileResourceName", schemaFileResourceName);

  ProcessEngineConfigurationImpl configuration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration.createProcessEngineConfigurationFromResource(configurationFileResourceName);
  ProcessEngine processEngine = configuration.buildProcessEngine();

  configuration.getCommandExecutorTxRequired().execute(new Command<Void>() {

    public Void execute(CommandContext commandContext) {

      commandContext.getDbSqlSession()
        .executeSchemaResource(schemaFileResourceName);

      return null;
    }

  });

  processEngine.close();

}