agile.java

来自「java实现的可配置的工作流引擎,采用jsp+javabean实现」· Java 代码 · 共 35 行

JAVA
35
字号
/*
 * Created on 2004-10-12 TODO To change the template for this generated file go to Window - Preferences - Java - Code
 * Style - Code Templates
 */
package com.hongsoft.agile;

import org.hibernate.HibernateException;
import org.hibernate.Session;

import com.hongsoft.agile.hibernate.HibernateBase;
import com.hongsoft.agile.hpdl.HpdlFacade;

/**
 * 接口部分都抛出AgileException TODO To change the template for this generated type comment go to Window - Preferences - Java -
 * Code Style - Code Templates
 */
public class Agile {
    public static AgileConnection connectToServer() throws HibernateException, AgileException {
        Session session = HibernateBase.getSession();
        // 读取流程定义
        HpdlFacade.getProcessesObject(session);
        // 建立连接
        return new AgileConnection(session, session.beginTransaction());
    }

    public static void disConnectServer(AgileConnection connection, boolean toCommit) throws HibernateException {
        if (toCommit)
            connection.getTransaction().commit();
        else
            connection.getTransaction().rollback();
        HibernateBase.closeSession();
    }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?