agileflow.java

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

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

import java.util.List;

import org.hibernate.HibernateException;

import com.hongsoft.agile.workflow.FacadeActivity;
import com.hongsoft.agile.workflow.FacadeProcess;

/**
 * @author hongsoft.com TODO To change the template for this generated type comment go to Window - Preferences - Java -
 *         Code Style - Code Templates
 */
public class AgileFlow {
    /**
     * 启动新的流程
     * 
     * @param session
     * @param processDefId
     * @return
     * @throws HibernateException
     * @throws AgileException
     */
    public static String startProcess(AgileConnection conn, String processDefId) throws HibernateException,
            AgileException {
        return FacadeProcess.startProcess(conn.getHibernateSession(), processDefId);
    }

    /**
     * 管理员得到所有的任务
     * 
     * @return
     * @throws HibernateException
     */
    public static List getAllAssignments(AgileConnection conn) throws HibernateException {
        return FacadeActivity.getAllAssignments(conn.getHibernateSession());
    }

    /**
     * 得到每个用户的任务
     * 
     * @param conn
     * @param userId
     * @return
     * @throws Exception
     */
    public static List getWorkList(AgileConnection conn, long userId) throws Exception {
        return FacadeActivity.getAssignments(conn.getHibernateSession(), userId);
    }

    /**
     * 接收一个任务
     * 
     * @param conn
     * @param userId
     * @param processInsId
     * @param activityInsId
     * @throws HibernateException
     */
    public static void acceptAssignment(AgileConnection conn, String userId, String activityInsId)
            throws HibernateException, AgileException {
        FacadeActivity.acceptAssignment(conn.getHibernateSession(), userId, activityInsId);
    }

    /**
     * 完成活动
     * 
     * @param conn
     * @param userId
     * @param processInsId
     * @param activityInsId
     * @throws HibernateException
     */
    public static void completeActivity(AgileConnection conn, String processInsId, String activityInsId)
            throws HibernateException, AgileException {
        (new FacadeActivity()).completeActivity(conn.getHibernateSession(), processInsId, activityInsId);
    }
}

⌨️ 快捷键说明

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