本站首页    管理页面    写新日志    退出


«November 2025»
1
2345678
9101112131415
16171819202122
23242526272829
30


公告
 本博客在此声明所有文章均为转摘,只做资料收集使用。

我的分类(专题)

日志更新

最新评论

留言板

链接

Blog信息
blog名称:
日志总数:1304
评论数量:2242
留言数量:5
访问次数:7652112
建立时间:2006年5月29日




[JBoss]一个JBPM工作流管理示例(四)
软件技术,  电脑与网络

lhwork 发表于 2006/6/30 15:30:58

(一)  开始一个请假流程       //user是请假人的actorId       ExecutionService es=JbpmServiceFactory.getInstance().openExecutionService(user);        HashMap vs=new HashMap();       //一些参数        vs.put(Constants.REQUEST_STATUS,String.valueOf(0));        vs.put(Constants.REQUEST_RETURN_INFO,"No info!");        vs.put(Constants.USER_NAME,EncodeTransfer.toISO(user));        vs.put(Constants.REQUEST_DAYS,String.valueOf(rea.getDays()));        try {           //开启请假流程            es.startProcessInstance(Constants.WORK_NAME, vs);            log.info("["+user+"]"+"申请假期开始!请假"+rea.getDays()+"天!");            return am.findForward("main");        } catch (ExecutionException ex) {            ex.printStackTrace();            log.error("请假进程无法开始!");            return am.findForward("error");        }finally{            es.close();        }(二)当前执行任务    对于部门经理或者老板,找到要处理的请假。       String actorId = (String) req.getSession().getAttribute(Constants.USER);            if(actorId.equals("wang")){                actorId="boss";            }else if(actorId.equals("bigli")){                actorId="chief";            }            // get the execution service            ExecutionService executionService = JbpmServiceFactory.getInstance().                                                openExecutionService(actorId);             // get the tasklist from jbpm for user            List tasks = new ArrayList();            // add the jbpm tasks            tasks.addAll(executionService.getTaskList(actorId));            // put the tasklist into the form            mf.setTasks(tasks);            // get the tasklist from jbpm for user            List definitions = new ArrayList();            // add the jbpm definitions            definitions.addAll(executionService.getLatestDefinitions());            // put the tasklist into the form            mf.setRequests(definitions);            // close the execution service            executionService.close();            req.getSession().setAttribute("mainForm",mf);            log.debug("任务: " + tasks);            log.debug("当前可以执行的请求: " + definitions);(三)处理请假           String actorId = (String) reqrest.getSession().getAttribute(Constants.                    USER);            Long tokenId=new Long(req.getParameter("tokenId"));            // get the execution service            ExecutionService executionService = JbpmServiceFactory.getInstance().                                                openExecutionService(actorId);            Map hm=executionService.getVariables(tokenId);//变量            String act=req.getParameter("action");//进行转换的transition            executionService.endOfState(tokenId,hm,act);            executionService.close();


阅读全文(1976) | 回复(0) | 编辑 | 精华
 



发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)



站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.797 second(s), page refreshed 144802525 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号