本文整理汇总了Java中org.camunda.bpm.engine.ProcessEngineConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java ProcessEngineConfiguration类的具体用法?Java ProcessEngineConfiguration怎么用?Java ProcessEngineConfiguration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ProcessEngineConfiguration类属于org.camunda.bpm.engine包,在下文中一共展示了ProcessEngineConfiguration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testWithCandidateGroups
import org.camunda.bpm.engine.ProcessEngineConfiguration; //导入依赖的package包/类
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL)
@Deployment(resources = { "org/camunda/bpm/engine/test/api/runtime/oneTaskProcess.bpmn20.xml" })
public void testWithCandidateGroups() {
// given
runtimeService.startProcessInstanceByKey("oneTaskProcess");
String taskId = taskService.createTaskQuery().singleResult().getId();
// when
identityService.setAuthenticatedUserId("aAssignerId");
taskService.addCandidateGroup(taskId, "aGroupId");
// then
assertEquals(historyService.createHistoricTaskInstanceQuery().withCandidateGroups().count(), 1);
// cleanup
taskService.deleteTask("newTask", true);
}
示例2: processEngineConfiguration
import org.camunda.bpm.engine.ProcessEngineConfiguration; //导入依赖的package包/类
@Bean
public ProcessEngineConfigurationImpl processEngineConfiguration() throws IOException {
SpringProcessWithCoverageEngineConfiguration config = new SpringProcessWithCoverageEngineConfiguration();
config.setExpressionManager(expressionManager());
config.setTransactionManager(transactionManager());
config.setDataSource(dataSource());
config.setDatabaseSchemaUpdate("true");
config.setHistory(ProcessEngineConfiguration.HISTORY_FULL);
config.setJobExecutorActivate(false);
config.init();
return config;
}
开发者ID:camunda,项目名称:camunda-bpm-process-test-coverage,代码行数:17,代码来源:InMemProcessEngineConfiguration.java
示例3: run
import org.camunda.bpm.engine.ProcessEngineConfiguration; //导入依赖的package包/类
@Override
public void run(final CamundaConfiguration configuration, final Environment environment) throws Exception {
// @formatter:off
final ProcessEngineConfiguration processEngineConfiguration = configuration
.overwriteHistoryLevel(environment)
.buildProcessEngineConfiguration();
// @formatter:on
environment.lifecycle().manage(new ProcessEngineManager(processEngineConfiguration));
if (configuration.getCamunda().isJobExecutorActivate()) {
environment.lifecycle().addServerLifecycleListener(ActivateJobExecutor.serverLifecycleListener());
}
environment.servlets().addServletListeners(new org.camunda.bpm.extension.dropwizard.application.CamundaServletProcessApplication());
CamundaHealthChecks.processEngineIsRunning(environment);
environment.admin().addTask(ActivateJobExecutor.task());
}
示例4: reads_camunda_db_settings_from_file
import org.camunda.bpm.engine.ProcessEngineConfiguration; //导入依赖的package包/类
@Test
public void reads_camunda_db_settings_from_file() {
// @formatter:off
final CamundaConfiguration configuration = configurationTestRule.apply(
"camunda:\n" +
" database:\n" +
" user: user\n" +
" password: password\n" +
" driverClass: com.db.Driver\n" +
" url: jdbc:foo:bar");
// @formatter:on
final ProcessEngineConfiguration processEngineConfiguration = configuration.buildProcessEngineConfiguration();
assertThat(processEngineConfiguration.getJdbcUsername()).isEqualTo("user");
assertThat(processEngineConfiguration.getHistory()).isEqualTo(HISTORY_AUDIT);
assertThat(configuration.getCamunda().getDatabase().getUser()).isEqualTo("user");
}
示例5: uses_configured_dropwizard_values
import org.camunda.bpm.engine.ProcessEngineConfiguration; //导入依赖的package包/类
@Test
public void uses_configured_dropwizard_values() {
final CamundaConfiguration configuration = new CamundaConfiguration();
final DataSourceFactory database = configuration.getCamunda().getDatabase();
database.setDriverClass(DRIVER);
database.setUser(USER);
database.setPassword(PASSWORD);
database.setUrl(URL);
final ProcessEngineConfiguration processEngineConfiguration = configuration.buildProcessEngineConfiguration();
assertThat(processEngineConfiguration.getJdbcDriver()).isEqualTo(DRIVER);
assertThat(processEngineConfiguration.getJdbcUsername()).isEqualTo(USER);
assertThat(processEngineConfiguration.getJdbcPassword()).isEqualTo(PASSWORD);
assertThat(processEngineConfiguration.getJdbcUrl()).isEqualTo(URL);
}
示例6: shutdownProcessEngine
import org.camunda.bpm.engine.ProcessEngineConfiguration; //导入依赖的package包/类
@Test(timeout = 40000L)
public void shutdownProcessEngine() throws IOException, InterruptedException {
Hashtable<String, Object> props = new Hashtable<String, Object>();
props.put("databaseSchemaUpdate", ProcessEngineConfiguration.DB_SCHEMA_UPDATE_CREATE_DROP);
props.put("jdbcUrl", "jdbc:h2:mem:camunda;DB_CLOSE_DELAY=-1");
props.put("jobExecutorActivate", "true");
props.put("processEngineName", "TestEngine");
org.osgi.service.cm.Configuration config = configAdmin.createFactoryConfiguration(ManagedProcessEngineFactory.SERVICE_PID, null);
config.update(props);
//give the engine some time to be created
Thread.sleep(10000L);
config.delete();
Thread.sleep(5000L);
ServiceReference<ProcessEngine> reference = null;
do {
Thread.sleep(500L);
reference = ctx.getServiceReference(ProcessEngine.class);
} while (reference != null);
}
开发者ID:camunda,项目名称:camunda-bpm-platform-osgi,代码行数:20,代码来源:ManagedProcessEngineFactoryImplIntegrationTest.java
示例7: init
import org.camunda.bpm.engine.ProcessEngineConfiguration; //导入依赖的package包/类
public void init() {
ClassLoader previous = Thread.currentThread().getContextClassLoader();
try {
ClassLoader cl = new BundleDelegatingClassLoader(bundle);
Thread.currentThread().setContextClassLoader(new ClassLoaderWrapper(
cl,
ProcessEngineFactory.class.getClassLoader(),
ProcessEngineConfiguration.class.getClassLoader(),
previous
));
processEngineConfiguration.setClassLoader(cl);
processEngine = processEngineConfiguration.buildProcessEngine();
} finally {
Thread.currentThread().setContextClassLoader(previous);
}
}
示例8: testTaskHadCandidateGroup
import org.camunda.bpm.engine.ProcessEngineConfiguration; //导入依赖的package包/类
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL)
@Deployment(resources = { "org/camunda/bpm/engine/test/api/runtime/oneTaskProcess.bpmn20.xml" })
public void testTaskHadCandidateGroup() {
// given
runtimeService.startProcessInstanceByKey("oneTaskProcess");
String taskId = taskService.createTaskQuery().singleResult().getId();
// if
identityService.setAuthenticatedUserId("aAssignerId");
taskService.addCandidateGroup(taskId, "bGroupId");
taskService.deleteCandidateGroup(taskId, "bGroupId");
// query test
assertEquals(1, historyService.createHistoricTaskInstanceQuery().taskHadCandidateGroup("bGroupId").count());
assertEquals(0, historyService.createHistoricTaskInstanceQuery().taskHadCandidateGroup("invalidGroupId").count());
// delete test
taskService.deleteTask("newTask",true);
}
示例9: getOrInitializeCachedProcessEngine
import org.camunda.bpm.engine.ProcessEngineConfiguration; //导入依赖的package包/类
private static ProcessEngine getOrInitializeCachedProcessEngine() {
if (cachedProcessEngine == null) {
try {
cachedProcessEngine = ProcessEngineConfiguration
.createProcessEngineConfigurationFromResource("camunda.cfg.xml")
.buildProcessEngine();
} catch (RuntimeException ex) {
if (ex.getCause() != null && ex.getCause() instanceof FileNotFoundException) {
cachedProcessEngine = ProcessEngineConfiguration
.createProcessEngineConfigurationFromResource("activiti.cfg.xml")
.buildProcessEngine();
} else {
throw ex;
}
}
}
return cachedProcessEngine;
}
示例10: testBatchActivatationByHistoricProcessInstanceQuery
import org.camunda.bpm.engine.ProcessEngineConfiguration; //导入依赖的package包/类
@Test
@Deployment(resources = {"org/camunda/bpm/engine/test/api/externaltask/oneExternalTaskProcess.bpmn20.xml",
"org/camunda/bpm/engine/test/api/externaltask/twoExternalTaskProcess.bpmn20.xml"})
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_ACTIVITY)
public void testBatchActivatationByHistoricProcessInstanceQuery() {
// given
ProcessInstance processInstance1 = runtimeService.startProcessInstanceByKey("oneExternalTaskProcess");
ProcessInstance processInstance2 = runtimeService.startProcessInstanceByKey("twoExternalTaskProcess");
// when the process instances are suspended
runtimeService.updateProcessInstanceSuspensionState()
.byHistoricProcessInstanceQuery(historyService.createHistoricProcessInstanceQuery().processInstanceIds(Sets.newHashSet(processInstance1.getId(), processInstance2.getId()))).suspend();
// when they are activated again
runtimeService.updateProcessInstanceSuspensionState()
.byHistoricProcessInstanceQuery(historyService.createHistoricProcessInstanceQuery().processInstanceIds(Sets.newHashSet(processInstance1.getId(), processInstance2.getId()))).activate();
// Update the process instances and they are active again
ProcessInstance p1c = runtimeService.createProcessInstanceQuery().processInstanceId(processInstance1.getId()).singleResult();
assertFalse(p1c.isSuspended());
ProcessInstance p2c = runtimeService.createProcessInstanceQuery().processInstanceId(processInstance2.getId()).singleResult();
assertFalse(p2c.isSuspended());
}
示例11: testDeployAppWithCustomEngine
import org.camunda.bpm.engine.ProcessEngineConfiguration; //导入依赖的package包/类
public void testDeployAppWithCustomEngine() {
TestApplicationWithCustomEngine processApplication = new TestApplicationWithCustomEngine();
processApplication.deploy();
ProcessEngine processEngine = BpmPlatform.getProcessEngineService().getProcessEngine("embeddedEngine");
assertNotNull(processEngine);
assertEquals("embeddedEngine", processEngine.getName());
ProcessEngineConfiguration configuration = ((ProcessEngineImpl) processEngine).getProcessEngineConfiguration();
// assert engine properties specified
assertTrue(configuration.isJobExecutorDeploymentAware());
assertTrue(configuration.isJobExecutorPreferTimerJobs());
assertTrue(configuration.isJobExecutorAcquireByDueDate());
assertEquals(5, configuration.getJdbcMaxActiveConnections());
processApplication.undeploy();
}
示例12: testHistoricProcessInstanceQueryIncidentStatusOpenWithTwoProcesses
import org.camunda.bpm.engine.ProcessEngineConfiguration; //导入依赖的package包/类
@Deployment(resources = {"org/camunda/bpm/engine/test/api/mgmt/IncidentTest.testShouldDeleteIncidentAfterJobWasSuccessfully.bpmn"})
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL)
public void testHistoricProcessInstanceQueryIncidentStatusOpenWithTwoProcesses() {
//given two processes, which will fail, are started
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("fail", true);
ProcessInstance pi1 = runtimeService.startProcessInstanceByKey("failingProcessWithUserTask", parameters);
runtimeService.startProcessInstanceByKey("failingProcessWithUserTask", parameters);
executeAvailableJobs();
assertEquals(2, historyService.createHistoricProcessInstanceQuery().incidentStatus("open").count());
//when 'fail' variable is set to false, job retry count is set to one
//and available jobs are executed
runtimeService.setVariable(pi1.getId(), "fail", false);
Job jobToResolve = managementService.createJobQuery().processInstanceId(pi1.getId()).singleResult();
managementService.setJobRetries(jobToResolve.getId(), 1);
executeAvailableJobs();
//then query with open and with resolved incidents returns one
assertEquals(1, historyService.createHistoricProcessInstanceQuery().incidentStatus("open").count());
assertEquals(1, historyService.createHistoricProcessInstanceQuery().incidentStatus("resolved").count());
}
示例13: shouldUseCfgValue_never
import org.camunda.bpm.engine.ProcessEngineConfiguration; //导入依赖的package包/类
@Test
public void shouldUseCfgValue_never() {
final ListQueryParameterObject query = new ListQueryParameterObject();
final AuthorizationCheck authCheck = query.getAuthCheck();
// given
when(mockedConfiguration.getAuthorizationCheckRevokes()).thenReturn(ProcessEngineConfiguration.AUTHORIZATION_CHECK_REVOKE_NEVER);
// if
authorizationManager.configureQuery(query);
// then
assertEquals(false, authCheck.isRevokeAuthorizationCheckEnabled());
verify(mockedEntityManager, never()).selectBoolean(eq("selectRevokeAuthorization"), any());
verifyNoMoreInteractions(mockedEntityManager);
}
示例14: shouldCheckDbForCfgValueWithNoRevokes_auto
import org.camunda.bpm.engine.ProcessEngineConfiguration; //导入依赖的package包/类
@Test
public void shouldCheckDbForCfgValueWithNoRevokes_auto() {
final ListQueryParameterObject query = new ListQueryParameterObject();
final AuthorizationCheck authCheck = query.getAuthCheck();
final HashMap<String, Object> expectedQueryParams = new HashMap<String, Object>();
expectedQueryParams.put("userId", AUTHENTICATED_USER_ID);
expectedQueryParams.put("authGroupIds", AUTHENTICATED_GROUPS);
// given
when(mockedConfiguration.getAuthorizationCheckRevokes()).thenReturn(ProcessEngineConfiguration.AUTHORIZATION_CHECK_REVOKE_AUTO);
when(mockedEntityManager.selectBoolean(eq("selectRevokeAuthorization"), eq(expectedQueryParams))).thenReturn(false);
// if
authorizationManager.configureQuery(query);
// then
assertEquals(false, authCheck.isRevokeAuthorizationCheckEnabled());
verify(mockedEntityManager, times(1)).selectBoolean(eq("selectRevokeAuthorization"), eq(expectedQueryParams));
}
示例15: setDmnEngineConfigurationOverXmlConfiguration
import org.camunda.bpm.engine.ProcessEngineConfiguration; //导入依赖的package包/类
@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"));
}