本文整理汇总了Java中org.camunda.bpm.engine.ProcessEngines类的典型用法代码示例。如果您正苦于以下问题:Java ProcessEngines类的具体用法?Java ProcessEngines怎么用?Java ProcessEngines使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProcessEngines类属于org.camunda.bpm.engine包,在下文中一共展示了ProcessEngines类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.camunda.bpm.engine.ProcessEngines; //导入依赖的package包/类
protected void init() {
if (executed)
throw new IllegalStateException("Scenarios may use execute() just once per Scenario.run(). " +
"Please create a new Scenario.run().");
executed = true;
if (processEngine == null) {
Map<String, ProcessEngine> processEngines = ProcessEngines.getProcessEngines();
if (processEngines.size() == 1) {
init(processEngines.values().iterator().next());
} else {
String message = processEngines.size() == 0 ? "No ProcessEngine found to be " +
"registered with " + ProcessEngines.class.getSimpleName() + "!"
: String.format(processEngines.size() + " ProcessEngines initialized. " +
"Explicitely initialise engine by calling " + ScenarioImpl.class.getSimpleName() +
"(scenario, engine)");
throw new IllegalStateException(message);
}
}
}
示例2: updatedNewConfiguration
import org.camunda.bpm.engine.ProcessEngines; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
@Test
public void updatedNewConfiguration() throws Exception {
String engineName = "TestEngine";
Bundle bundle = mock(Bundle.class);
// mock stuff the BundleDelegatingClassLoader does/needs
mockGetResource(bundle);
mockLoadClass(bundle);
BundleContext bundleContext = mock(BundleContext.class);
when(bundle.getBundleContext()).thenReturn(bundleContext);
when(bundleContext.registerService(eq(ProcessEngine.class), any(ProcessEngine.class), any(Dictionary.class))).thenReturn(mock(ServiceRegistration.class));
ManagedProcessEngineFactoryImpl factory = new ManagedProcessEngineFactoryImpl(bundle);
Hashtable<String, String> properties = createEngineProperties(engineName);
factory.updated("id", properties);
ArgumentCaptor<Dictionary> propsCapture = ArgumentCaptor.forClass(Dictionary.class);
ArgumentCaptor<ProcessEngine> engineCapture = ArgumentCaptor.forClass(ProcessEngine.class);
verify(bundleContext, times(1)).registerService(eq(ProcessEngine.class), engineCapture.capture(), propsCapture.capture());
assertThat(engineCapture.getValue(), is(notNullValue()));
assertThat(propsCapture.getValue().get("process-engine-name"), is((Object) engineName));
assertThat(ProcessEngines.getProcessEngine(engineName), is(notNullValue()));
}
示例3: deleteEngine
import org.camunda.bpm.engine.ProcessEngines; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void deleteEngine() throws Throwable{
String engineName = "TestEngine";
Bundle bundle = mock(Bundle.class);
// mock stuff the BundleDelegatingClassLoader does/needs
mockGetResource(bundle);
mockLoadClass(bundle);
BundleContext bundleContext = mock(BundleContext.class);
when(bundle.getBundleContext()).thenReturn(bundleContext);
ServiceRegistration registrationMock = mock(ServiceRegistration.class);
when(bundleContext.registerService(eq(ProcessEngine.class), any(ProcessEngine.class), any(Dictionary.class))).thenReturn(registrationMock);
ManagedProcessEngineFactoryImpl factory = new ManagedProcessEngineFactoryImpl(bundle);
Hashtable<String, String> properties = createEngineProperties(engineName);
factory.updated("id", properties);
factory.deleted("id");
verify(registrationMock, times(1)).unregister();
assertThat(ProcessEngines.getProcessEngine(engineName), is(nullValue()));
}
示例4: close
import org.camunda.bpm.engine.ProcessEngines; //导入依赖的package包/类
@Override
public void close() {
ProcessEngines.unregister(this);
if(processEngineConfiguration.isMetricsEnabled()) {
processEngineConfiguration.getDbMetricsReporter().stop();
}
if ((jobExecutor != null)) {
// unregister process engine with Job Executor
jobExecutor.unregisterProcessEngine(this);
}
commandExecutorSchemaOperations.execute(new SchemaOperationProcessEngineClose());
processEngineConfiguration.close();
LOG.processEngineClosed(name);
}
示例5: updateUsers
import org.camunda.bpm.engine.ProcessEngines; //导入依赖的package包/类
public void updateUsers() {
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
Set<User> currentUsers = this.orgStructure.getUsers();
Set<User> firedUsers = this.orgStructure.getFiredUsers(currentUsers);
Set<User> newUsers = this.orgStructure.getNewUsers(currentUsers);
firedUsers.forEach(user -> deleteUser(user, processEngine));
Map<String, String> userPass = this.orgStructure.getUserPass(newUsers);
newUsers.forEach(user -> createUser(user, userPass, processEngine));
this.orgStructure.update();
}
示例6: placeInquiry
import org.camunda.bpm.engine.ProcessEngines; //导入依赖的package包/类
public void placeInquiry() {
if (!EmailValidator.validate(email)) {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Invalid Email format"));
} else {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("customerFirstname", firstname);
variables.put("customerSurname", lastname);
variables.put("customerCompanyName", companyName);
variables.put("customerEmail", email);
variables.put("customerPhoneNumber", phoneNumber);
variables.put("customerDateOfBirth", dateOfBirth);
variables.put("customerStreet", street);
variables.put("customerHouseNumber", houseNumber);
variables.put("customerPostcode", postcode);
variables.put("customerCity", city);
variables.put("customerCountry", country);
variables.put("fleet", fleetRental);
variables.put("pickUpDate", pickupDate);
variables.put("returnDate", returnDate);
variables.put("pickUpLoc", pickupLocation);
variables.put("returnStore", returnLocation);
variables.put("insuranceType", insuranceType);
variables.put("car", car);
variables.put("inquiryText", comment);
variables.put("priceCars", priceCars);
variables.put("priceInsurance_expected", priceInsurance_expected);
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
RuntimeService runtimeService = processEngine.getRuntimeService();
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("contracting", variables);
System.out.println(WebUrls.getUrl(WebUrls.ORDER_SUBMITTED, false, false));
try {
FacesContext.getCurrentInstance().getExternalContext()
.redirect(WebUrls.getUrl(WebUrls.ORDER_SUBMITTED, false, false));
} catch (IOException e) {
e.printStackTrace();
}
}
}
示例7: placeInquiry2
import org.camunda.bpm.engine.ProcessEngines; //导入依赖的package包/类
/**
* Method for placing inquiries when already logged in
*/
public void placeInquiry2() {
long cid = sessionBean.getUid();
Customer customer = customerService.getCustomer(cid);
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("customerID", customer.getCustomerID());
variables.put("fleet", fleetRental);
variables.put("pickUpDate", pickupDate);
variables.put("returnDate", returnDate);
variables.put("pickUpLoc", pickupLocation);
variables.put("returnStore", returnLocation);
variables.put("insuranceType", insuranceType);
variables.put("car", car);
variables.put("inquiryText", comment);
variables.put("priceCars", priceCars);
variables.put("priceInsurance_expected", priceInsurance_expected);
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
RuntimeService runtimeService = processEngine.getRuntimeService();
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("contracting", variables);
System.out.println(WebUrls.getUrl(WebUrls.ORDER_SUBMITTED, false, false));
try {
FacesContext.getCurrentInstance().getExternalContext()
.redirect(WebUrls.getUrl(WebUrls.ORDER_SUBMITTED, false, false));
} catch (IOException e) {
e.printStackTrace();
}
}
示例8: setName_ignore_empty
import org.camunda.bpm.engine.ProcessEngines; //导入依赖的package包/类
@Test
public void setName_ignore_empty() throws Exception {
properties.setProcessEngineName(null);
instance.preInit(configuration);
assertThat(configuration.getProcessEngineName()).isEqualTo(ProcessEngines.NAME_DEFAULT);
properties.setProcessEngineName(" ");
instance.preInit(configuration);
assertThat(configuration.getProcessEngineName()).isEqualTo(ProcessEngines.NAME_DEFAULT);
}
开发者ID:camunda,项目名称:camunda-bpm-spring-boot-starter,代码行数:11,代码来源:DefaultProcessEngineConfigurationTest.java
示例9: cleanUp
import org.camunda.bpm.engine.ProcessEngines; //导入依赖的package包/类
@After
public void cleanUp() {
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
if (processEngine != null) {
processEngine.close();
}
}
示例10: check
import org.camunda.bpm.engine.ProcessEngines; //导入依赖的package包/类
@Override
protected Result check() throws Exception {
try {
ProcessEngines.getDefaultProcessEngine().getIdentityService().createGroupQuery().list();
return Result.healthy();
} catch (final Exception e) {
return Result.unhealthy(e);
}
}
示例11: startProcess
import org.camunda.bpm.engine.ProcessEngines; //导入依赖的package包/类
public ProcessInstance startProcess() {
if (instance != null) {
if (!instance.isEnded()) {
return instance;
}
}
instance = ProcessEngines.getDefaultProcessEngine().getRuntimeService().startProcessInstanceByKey(processKey);
return instance;
}
示例12: starts_process_engine
import org.camunda.bpm.engine.ProcessEngines; //导入依赖的package包/类
@Test
public void starts_process_engine() {
manager.start();
final ProcessEngine defaultProcessEngine = ProcessEngines.getDefaultProcessEngine();
assertThat(defaultProcessEngine).isNotNull();
assertThat(defaultProcessEngine.getName()).isEqualTo(ProcessEngines.NAME_DEFAULT);
manager.stop();
}
示例13: main
import org.camunda.bpm.engine.ProcessEngines; //导入依赖的package包/类
public static void main(String[] args) {
// start process engine
StandaloneInMemProcessEngineConfiguration processEngineConfiguration = new StandaloneInMemProcessEngineConfiguration();
processEngineConfiguration.setProcessEngineName(ProcessEngines.NAME_DEFAULT);
// add plugins
List<ProcessEnginePlugin> processEnginePlugins = processEngineConfiguration.getProcessEnginePlugins();
processEnginePlugins.add(new DebuggerPlugin());
processEnginePlugins.add(new SpinProcessEnginePlugin());
processEnginePlugins.add(new ConnectProcessEnginePlugin());
processEngineConfiguration.buildProcessEngine();
DebugSessionFactory.getInstance().setSuspend(false);
// start debug server
DebugWebsocket debugWebsocket = null;
try {
// configure & start the server
debugWebsocket = new DebugWebsocketConfiguration()
.port(9090)
.startServer();
// block
debugWebsocket.waitForShutdown();
} finally {
if(debugWebsocket != null) {
debugWebsocket.shutdown();
}
}
}
示例14: main
import org.camunda.bpm.engine.ProcessEngines; //导入依赖的package包/类
public static void main(String[] args) {
ProcessEngineImpl processEngine = (ProcessEngineImpl) ProcessEngines.getDefaultProcessEngine();
CommandExecutor commandExecutor = processEngine.getProcessEngineConfiguration().getCommandExecutorTxRequired();
commandExecutor.execute(new Command<Object> (){
public Object execute(CommandContext commandContext) {
commandContext
.getSession(PersistenceSession.class)
.dbSchemaPrune();
return null;
}
});
}
示例15: main
import org.camunda.bpm.engine.ProcessEngines; //导入依赖的package包/类
public static void main(String[] args) {
ProcessEngineImpl processEngine = (ProcessEngineImpl) ProcessEngines.getDefaultProcessEngine();
CommandExecutor commandExecutor = processEngine.getProcessEngineConfiguration().getCommandExecutorTxRequired();
commandExecutor.execute(new Command<Object> (){
public Object execute(CommandContext commandContext) {
commandContext
.getSession(PersistenceSession.class)
.dbSchemaDrop();
return null;
}
});
processEngine.close();
}