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


Java ProcessEngines.getProcessEngine方法代码示例

本文整理汇总了Java中org.camunda.bpm.engine.ProcessEngines.getProcessEngine方法的典型用法代码示例。如果您正苦于以下问题:Java ProcessEngines.getProcessEngine方法的具体用法?Java ProcessEngines.getProcessEngine怎么用?Java ProcessEngines.getProcessEngine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.camunda.bpm.engine.ProcessEngines的用法示例。


在下文中一共展示了ProcessEngines.getProcessEngine方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testProcessEngineInfo

import org.camunda.bpm.engine.ProcessEngines; //导入方法依赖的package包/类
public void testProcessEngineInfo() {

    List<ProcessEngineInfo> processEngineInfos = ProcessEngines.getProcessEngineInfos();
    assertEquals(1, processEngineInfos.size());

    ProcessEngineInfo processEngineInfo = processEngineInfos.get(0);
    assertNull(processEngineInfo.getException());
    assertNotNull(processEngineInfo.getName());
    assertNotNull(processEngineInfo.getResourceUrl());

    ProcessEngine processEngine = ProcessEngines.getProcessEngine(ProcessEngines.NAME_DEFAULT);
    assertNotNull(processEngine);
  }
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:14,代码来源:ProcessEnginesTest.java

示例2: getProcessEngine

import org.camunda.bpm.engine.ProcessEngines; //导入方法依赖的package包/类
@Override
public ProcessEngine getProcessEngine(String name) {
  return ProcessEngines.getProcessEngine(name);
}
 
开发者ID:camunda,项目名称:camunda-bpm-spring-boot-starter,代码行数:5,代码来源:SpringBootProcessEngineProvider.java

示例3: getProcessEngine

import org.camunda.bpm.engine.ProcessEngines; //导入方法依赖的package包/类
public ProcessEngine getProcessEngine(String name) {
    return ProcessEngines.getProcessEngine(name);
}
 
开发者ID:camunda,项目名称:camunda-bpm-dropwizard,代码行数:4,代码来源:RestProcessEngineProvider.java

示例4: migrateProcessInstance

import org.camunda.bpm.engine.ProcessEngines; //导入方法依赖的package包/类
@POST
@Path("{id}")
public void migrateProcessInstance(@PathParam("id") final String processInstanceId, VersionDto versionDto) {
  log.fine("process instance id" + processInstanceId + ", payload: " + versionDto);
  if (versionDto==null) {
    throw new IllegalArgumentException("version to migrate to must be given");
  }
  final int newVersion = versionDto.getVersion();
 
  log.fine("new version: " + newVersion);
  
  SetProcessDefinitionVersionCmd command = new SetProcessDefinitionVersionCmd(processInstanceId, newVersion);
  ProcessEngineImpl processEngineImpl = (ProcessEngineImpl) ProcessEngines.getProcessEngine(engineName);
  processEngineImpl.getProcessEngineConfiguration().getCommandExecutorTxRequired().execute(command);

  log.info("setProcessDefinitionVersionCmd finished");
  
  // get the new process definition id from the migrated process instance.
  // This is the easiest and works because the above transaction is already completed
  ProcessInstance pi = getProcessEngine().getRuntimeService().createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
  final String processDefinitionId = pi.getProcessDefinitionId();
  
  // now do a SQL update via MyBatis
  getCommandExecutor().executeCommand(new Command<Void>() {
    
    @Override
    public Void execute(CommandContext commandContext) {
      log.info("Now tweaking histor of " + processInstanceId);
      
      HistoricProcessInstanceEntity processInstanceDto = new HistoricProcessInstanceEntity();
      processInstanceDto.setProcessInstanceId(processInstanceId);
      processInstanceDto.setProcessDefinitionId(processDefinitionId);
      
      try {       
        // execute the update from the migrate-historic-processinstance-update.xml
        commandContext.getDbSqlSession().getSqlSession().update("cockpit.version-migration.updateHistoricProcessInstance", processInstanceDto);
        
        log.info("History tweaked successfully");
      }
      catch (Throwable ex) {
        log.log(Level.INFO, "Could not tweak history due to exception. Did you properly install the plugin? If you see a ClassNotFoundException please refer to https://github.com/camunda/camunda-cockpit-plugins/tree/master/cockpit-plugin-version-migration/#how-to-use-it.", ex);
        // Classloading problems!
        // caused by: java.lang.NoClassDefFoundError: org/apache/ibatis/session/SqlSession
        // at com.camunda.consulting.cockpitPluginVersionMigration.resources.ProcessInstanceMigrationResource$1.execute(ProcessInstanceMigrationResource.java:63) [cockpit-plugin-version-migration.jar:]
      }
      return null;
    }
  });
  getQueryService();
  
}
 
开发者ID:camunda,项目名称:camunda-cockpit-plugins,代码行数:52,代码来源:ProcessInstanceMigrationResource.java


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