return processEngineConfiguration.getCommandExecutorTxRequired().execute(new AcquireJobsCmd(jobExecutor));
}
private String deployAndInstantiateWithNewEngineConfiguration(String resource) {
// 1. create another process engine confguration
ProcessEngineConfiguration otherProcessEngineConfiguration = null;
try {
otherProcessEngineConfiguration = ProcessEngineConfiguration
.createProcessEngineConfigurationFromResource("camunda.cfg.xml")
.setJobExecutorDeploymentAware(true);
} catch (RuntimeException ex) {
if (ex.getCause() != null && ex.getCause() instanceof FileNotFoundException) {
otherProcessEngineConfiguration = ProcessEngineConfiguration
.createProcessEngineConfigurationFromResource("activiti.cfg.xml")
.setJobExecutorDeploymentAware(true);
} else {
throw ex;
}
}
ProcessEngine otherEngine = otherProcessEngineConfiguration.buildProcessEngine();
// 2. deploy again
RepositoryService otherRepositoryService = otherEngine.getRepositoryService();
String deploymentId = otherRepositoryService.createDeployment()