Search in sources :

Example 1 with DefaultListenerFactory

use of org.activiti.engine.impl.bpmn.parser.factory.DefaultListenerFactory 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;
}
Also used : BpmnDeployer(org.activiti.engine.impl.bpmn.deployer.BpmnDeployer) BpmnParser(org.activiti.engine.impl.bpmn.parser.BpmnParser) DefaultListenerFactory(org.activiti.engine.impl.bpmn.parser.factory.DefaultListenerFactory) AbstractBehaviorFactory(org.activiti.engine.impl.bpmn.parser.factory.AbstractBehaviorFactory) DefaultActivityBehaviorFactory(org.activiti.engine.impl.bpmn.parser.factory.DefaultActivityBehaviorFactory) ArrayList(java.util.ArrayList) BpmnParseHandler(org.activiti.engine.parse.BpmnParseHandler) BpmnParseHandlers(org.activiti.engine.impl.bpmn.parser.BpmnParseHandlers) BpmnDeployer(org.activiti.engine.impl.bpmn.deployer.BpmnDeployer) Deployer(org.activiti.engine.impl.persistence.deploy.Deployer)

Aggregations

ArrayList (java.util.ArrayList)1 BpmnDeployer (org.activiti.engine.impl.bpmn.deployer.BpmnDeployer)1 BpmnParseHandlers (org.activiti.engine.impl.bpmn.parser.BpmnParseHandlers)1 BpmnParser (org.activiti.engine.impl.bpmn.parser.BpmnParser)1 AbstractBehaviorFactory (org.activiti.engine.impl.bpmn.parser.factory.AbstractBehaviorFactory)1 DefaultActivityBehaviorFactory (org.activiti.engine.impl.bpmn.parser.factory.DefaultActivityBehaviorFactory)1 DefaultListenerFactory (org.activiti.engine.impl.bpmn.parser.factory.DefaultListenerFactory)1 Deployer (org.activiti.engine.impl.persistence.deploy.Deployer)1 BpmnParseHandler (org.activiti.engine.parse.BpmnParseHandler)1