use of org.activiti.engine.impl.bpmn.parser.BpmnParseHandlers 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;
}
Aggregations