当前位置: 首页>>代码示例>>Java>>正文


Java ProcessEngines类代码示例

本文整理汇总了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);
    }
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-assert-scenario,代码行数:20,代码来源:ScenarioImpl.java

示例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()));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform-osgi,代码行数:25,代码来源:ManagedProcessEngineFactoryImplTest.java

示例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()));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform-osgi,代码行数:23,代码来源:ManagedProcessEngineFactoryImplTest.java

示例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);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:21,代码来源:ProcessEngineImpl.java

示例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();
}
 
开发者ID:IntegrityVision,项目名称:Purchase-order-process-template,代码行数:11,代码来源:ResourcesAuthorization.java

示例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();
		}
	}
}
 
开发者ID:derursm,项目名称:bvis,代码行数:39,代码来源:PlaceInquiryBackingBean.java

示例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();
	}
}
 
开发者ID:derursm,项目名称:bvis,代码行数:30,代码来源:PlaceInquiryBackingBean.java

示例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();
  }
}
 
开发者ID:holisticon,项目名称:skill-based-routing,代码行数:8,代码来源:ShowcaseSetupTest.java

示例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);
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-dropwizard,代码行数:10,代码来源:ProcessEngineIsRunning.java

示例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;
    }
 
开发者ID:camunda,项目名称:camunda-bpm-dropwizard,代码行数:11,代码来源:StartProcessTask.java

示例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();
}
 
开发者ID:camunda,项目名称:camunda-bpm-dropwizard,代码行数:11,代码来源:ProcessEngineManagerTest.java

示例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();
      }
    }

  }
 
开发者ID:camunda,项目名称:camunda-bpm-workbench,代码行数:36,代码来源:StandaloneDebugWebsocketBootstrap.java

示例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;
    }
  });
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:13,代码来源:DbSchemaPrune.java

示例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();
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:14,代码来源:DbSchemaDrop.java


注:本文中的org.camunda.bpm.engine.ProcessEngines类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。