use of org.activiti.engine.impl.persistence.deploy.Deployer in project Activiti by Activiti.
the class ProcessEngineConfigurationImpl method getDefaultDeployers.
protected Collection<? extends Deployer> getDefaultDeployers() {
List<Deployer> defaultDeployers = new ArrayList<Deployer>();
if (bpmnDeployer == null) {
bpmnDeployer = new BpmnDeployer();
}
bpmnDeployer.setExpressionManager(expressionManager);
bpmnDeployer.setIdGenerator(idGenerator);
if (bpmnParseFactory == null) {
bpmnParseFactory = new DefaultBpmnParseFactory();
}
if (activityBehaviorFactory == null) {
DefaultActivityBehaviorFactory defaultActivityBehaviorFactory = new DefaultActivityBehaviorFactory();
defaultActivityBehaviorFactory.setExpressionManager(expressionManager);
activityBehaviorFactory = defaultActivityBehaviorFactory;
} else if ((activityBehaviorFactory instanceof AbstractBehaviorFactory) && ((AbstractBehaviorFactory) activityBehaviorFactory).getExpressionManager() == null) {
((AbstractBehaviorFactory) activityBehaviorFactory).setExpressionManager(expressionManager);
}
if (listenerFactory == null) {
DefaultListenerFactory defaultListenerFactory = new DefaultListenerFactory();
defaultListenerFactory.setExpressionManager(expressionManager);
listenerFactory = defaultListenerFactory;
} else if ((listenerFactory instanceof AbstractBehaviorFactory) && ((AbstractBehaviorFactory) listenerFactory).getExpressionManager() == null) {
((AbstractBehaviorFactory) listenerFactory).setExpressionManager(expressionManager);
}
if (bpmnParser == null) {
bpmnParser = new BpmnParser();
}
bpmnParser.setExpressionManager(expressionManager);
bpmnParser.setBpmnParseFactory(bpmnParseFactory);
bpmnParser.setActivityBehaviorFactory(activityBehaviorFactory);
bpmnParser.setListenerFactory(listenerFactory);
List<BpmnParseHandler> parseHandlers = new ArrayList<BpmnParseHandler>();
if (getPreBpmnParseHandlers() != null) {
parseHandlers.addAll(getPreBpmnParseHandlers());
}
parseHandlers.addAll(getDefaultBpmnParseHandlers());
if (getPostBpmnParseHandlers() != null) {
parseHandlers.addAll(getPostBpmnParseHandlers());
}
BpmnParseHandlers bpmnParseHandlers = new BpmnParseHandlers();
bpmnParseHandlers.addHandlers(parseHandlers);
bpmnParser.setBpmnParserHandlers(bpmnParseHandlers);
bpmnDeployer.setBpmnParser(bpmnParser);
defaultDeployers.add(bpmnDeployer);
return defaultDeployers;
}
use of org.activiti.engine.impl.persistence.deploy.Deployer in project Activiti by Activiti.
the class ProcessEngineConfigurationImpl method initDeployers.
// deployers ////////////////////////////////////////////////////////////////
protected void initDeployers() {
if (this.deployers == null) {
this.deployers = new ArrayList<Deployer>();
if (customPreDeployers != null) {
this.deployers.addAll(customPreDeployers);
}
this.deployers.addAll(getDefaultDeployers());
if (customPostDeployers != null) {
this.deployers.addAll(customPostDeployers);
}
}
if (deploymentManager == null) {
deploymentManager = new DeploymentManager();
deploymentManager.setDeployers(deployers);
// Process Definition cache
if (processDefinitionCache == null) {
if (processDefinitionCacheLimit <= 0) {
processDefinitionCache = new DefaultDeploymentCache<ProcessDefinitionEntity>();
} else {
processDefinitionCache = new DefaultDeploymentCache<ProcessDefinitionEntity>(processDefinitionCacheLimit);
}
}
// BpmnModel cache
if (bpmnModelCache == null) {
if (bpmnModelCacheLimit <= 0) {
bpmnModelCache = new DefaultDeploymentCache<BpmnModel>();
} else {
bpmnModelCache = new DefaultDeploymentCache<BpmnModel>(bpmnModelCacheLimit);
}
}
if (processDefinitionInfoCache == null) {
if (processDefinitionInfoCacheLimit <= 0) {
processDefinitionInfoCache = new ProcessDefinitionInfoCache(commandExecutor);
} else {
processDefinitionInfoCache = new ProcessDefinitionInfoCache(commandExecutor, processDefinitionInfoCacheLimit);
}
}
// Knowledge base cache (used for Drools business task)
if (knowledgeBaseCache == null) {
if (knowledgeBaseCacheLimit <= 0) {
knowledgeBaseCache = new DefaultDeploymentCache<Object>();
} else {
knowledgeBaseCache = new DefaultDeploymentCache<Object>(knowledgeBaseCacheLimit);
}
}
deploymentManager.setProcessDefinitionCache(processDefinitionCache);
deploymentManager.setBpmnModelCache(bpmnModelCache);
deploymentManager.setProcessDefinitionInfoCache(processDefinitionInfoCache);
deploymentManager.setKnowledgeBaseCache(knowledgeBaseCache);
}
}
Aggregations