本文整理汇总了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);
}
示例2: getProcessEngine
import org.camunda.bpm.engine.ProcessEngines; //导入方法依赖的package包/类
@Override
public ProcessEngine getProcessEngine(String name) {
return ProcessEngines.getProcessEngine(name);
}
示例3: getProcessEngine
import org.camunda.bpm.engine.ProcessEngines; //导入方法依赖的package包/类
public ProcessEngine getProcessEngine(String name) {
return ProcessEngines.getProcessEngine(name);
}
示例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();
}