Package cn.ctit.ruleworkflow

Source Code of cn.ctit.ruleworkflow.JbpmSpringHelper

/*
* Copyright (c) 2010.
* Copyright © 2009 CTIT, All Rights Reserved
*/
package cn.ctit.ruleworkflow;

import org.jbpm.api.ProcessEngine;
import org.jbpm.pvm.internal.cfg.ConfigurationImpl;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

/**
* Class Name: JbpmSpringHelper
*
* @author hengheng8848
* @version 1.0
*/
public class JbpmSpringHelper implements ApplicationContextAware {
    protected ApplicationContext applicationContext;
    protected String jbpmCfg = "jbpm.cfg.xml";

    public void setJbpmCfg(String jbpmCfg) {
        this.jbpmCfg = jbpmCfg;
    }

    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        this.applicationContext = applicationContext;
    }

    public ProcessEngine createProcessEngine() {
        return new ConfigurationImpl()
            .springInitiated(applicationContext)
            .setResource(jbpmCfg)
            .buildProcessEngine();
    }

}
TOP

Related Classes of cn.ctit.ruleworkflow.JbpmSpringHelper

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.