Search in sources :

Example 1 with Deployer

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;
}
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)

Example 2 with Deployer

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);
    }
}
Also used : ProcessDefinitionInfoCache(org.activiti.engine.impl.persistence.deploy.ProcessDefinitionInfoCache) DeploymentManager(org.activiti.engine.impl.persistence.deploy.DeploymentManager) ProcessDefinitionEntity(org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity) BpmnDeployer(org.activiti.engine.impl.bpmn.deployer.BpmnDeployer) Deployer(org.activiti.engine.impl.persistence.deploy.Deployer) BpmnModel(org.activiti.bpmn.model.BpmnModel)

Aggregations

BpmnDeployer (org.activiti.engine.impl.bpmn.deployer.BpmnDeployer)2 Deployer (org.activiti.engine.impl.persistence.deploy.Deployer)2 ArrayList (java.util.ArrayList)1 BpmnModel (org.activiti.bpmn.model.BpmnModel)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 DeploymentManager (org.activiti.engine.impl.persistence.deploy.DeploymentManager)1 ProcessDefinitionInfoCache (org.activiti.engine.impl.persistence.deploy.ProcessDefinitionInfoCache)1 ProcessDefinitionEntity (org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity)1 BpmnParseHandler (org.activiti.engine.parse.BpmnParseHandler)1