05-25-2010 10:30 AM
ProcessEngine processEngine = new DbProcessEngineBuilder()
.configureFromPropertiesResource("activiti.properties")
.buildProcessEngine();
ProcessEngine processEngine = new DbProcessEngineBuilder()
.setDatabaseH2()
.setJdbcUrl("jdbc:some:url")
.buildProcessEngine();
public class ProcessEngineConfiguration {
String processEngineName;
DeployerManager deployerManager;
VariableTypes variableTypes;
ScriptingEngines scriptingEngines;
JobExecutor jobExecutor;
boolean jobExecutorAutoActivate;
IdGenerator idGenerator;
PersistenceSessionFactory persistenceSessionFactory;
ProcessCache processCache;
CommandContextFactory commandContextFactory;
CommandExecutor commandExecutor;
DbSchemaStrategy dbSchemaStrategy;
ProcessServiceImpl processService;
IdentityServiceImpl identityService;
TaskServiceImpl taskService;
ManagementServiceImpl managementService;
public ProcessEngineConfiguration() {
deployerManager = createDefaultDeployerManager();
variableTypes = createDefaultVariableTypes();
scriptingEngines = createDefaultScriptingEngines();
jobExecutor = createDefaultJobExecutor();
jobExecutorAutoActivate = createDefaultJobExecutorAutoActivate();
idGenerator = createDefaultIdGenerator();
persistenceSessionFactory = createDefaultPersistenceSessionFactory();
processCache = createDefaultProcessCache();
commandContextFactory = createDefaultCommandContextFactory();
commandExecutor = createDefaultCmdExecutor();
dbSchemaStrategy = createDefaultDbSchemaStrategy();
processService = createDefaultProcessService();
identityService = createDefaultIdentityService();
taskService = createDefaultTaskService();
managementService = createDefaultManagementService();
}
public ProcessEngineImpl buildProcessEngine() {
// wiring the configurable objects together
this.processService.setCmdExecutor(commandExecutor);
this.identityService.setCmdExecutor(commandExecutor);
this.taskService.setCmdExecutor(commandExecutor);
this.managementService.setCmdExecutor(commandExecutor);
this.idGenerator.setCmdExecutor(commandExecutor);
this.processCache.setDeployerManager(deployerManager);
this.commandContextFactory.setDbidGenerator(idGenerator);
this.commandContextFactory.setDeployerManager(deployerManager);
this.commandContextFactory.setPersistenceSessionFactory(persistenceSessionFactory);
this.commandContextFactory.setProcessCache(processCache);
this.commandContextFactory.setScriptingEngines(scriptingEngines);
this.commandContextFactory.setTypes(variableTypes);
this.jobExecutor.setCmdExecutor(commandExecutor);
this.persistenceSessionFactory.setDbidGenerator(idGenerator);
this.commandExecutor.setProcessEngineConfiguration(this);
return new ProcessEngineImpl(processEngineName,
processService,
identityService,
taskService,
managementService,
dbSchemaStrategy,
jobExecutor,
jobExecutorAutoActivate,
persistenceSessionFactory);
}
05-25-2010 01:45 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.