java开源项目-使用java开源工作流jbpm开发一个简单的内容摘要:

ce().findExecutionById(()). getProcessInstance().getId()) amp。 amp。 ().equals(填写请假申请 )) { ().pleteTask(())。 } } } catch (Exception e) { rollback = true。 ()。 throw e。 } finally { if (ut != null amp。 amp。 () != ) { if (rollback) ()。 else ()。 } if (conn != null) ()。 } } /** * 获取经理的工作列表 * @return * @throws Exception */ public static ListMap getManagerWorkList() throws Exception { ListMap workList = new ArrayListMap()。 ListTask tasks = ().findGroupTasks(managerNa me)。 (task count: + ())。 for (Task t : tasks) { String processDefinitionId = ().findExecutionById(t .getExecutionId()).getProcessInstance().getProcessD efinitionId()。 ProcessDefinition processDefinition = ().createProcessDefin itionQuery().processDefinitionId(processDefinitionI d).uniqueResult()。 (pro name: + ().findExecutionById(t .getExecutionId()).getProcessInstance().getProcessD efinitionId())。 (acct name: + ())。 if (请假流程 .equals(()) amp。 amp。 ().equals(审批 )) { Map item = new HashMap()。 (wfId, ().findExecutionById(t .getExecutionId()).getProcessInstance().getId())。 (wfName, 请假流程 )。 (taskId, ())。 (taskName, ())。 (item)。 } } return workList。 } /** * 获取位置 * @param wfId * @return */ public static ListActivityCoordinates getActiveActivityCoordinates(String wfId) { ListActivityCoordinates result = new ArrayListActivityCoordinates()。 ProcessInstance processInstance = ().findProcessInstance ById(wfId)。 String processDefinitionId = ()。 SetString activities = ()。 for (String act : activities) { ActivityCoordinates coor = ().getActivityCoordin ates(processDefinitionId, act)。 (coor)。 } return result。 } /** * 根据请假单 id获取请假单信息 * @param id * @return * @throws Exception */ public static Map getById(String id) throws Exception { Map form = new HashMap()。 Connection conn = ()。 try { Statement stmt = ()。 ResultSet rst = (select * from ask_for_leave where id= + id)。 if (()) { (apply_user, (apply_user))。 (begin_leave_time, (begin_leave_time))。 (end_leave_time, (end_leave_time))。 (leave_reason, (leave_reason))。 } ()。 ()。 } catch (Exception e) { ()。 throw e。 } finally { if (conn != null) ()。 } return form。 } /** * 根据工作 流 id货物请假单 id * @param wfId * @return * @throws Exception */ public static String getBizId(String taskId) throws Exception { return ().getVariable(taskId, biz_id).toString()。 } /** * 审批 * @param request * @throws Exception */ public static void approval(HttpServletRequest request) throws Exception { UserTransaction ut = ()。 Connection conn = ()。 boolean rollback = false。 try { ()。 //*********业务部分 //审批信息存入数据库 Statement stmt = ()。 String sql = update ask_for_leave set + approve_user=39。 + managerName + 39。 , + approve_time=now(), + is_passed= + (is_passed) + , + approve_remark=39。 + (approve_remark) + 39。 + where id= + (biz_id)。 (update: + sql)。 (sql)。 (update plete)。 //*********工作流部分 boolean isPassed = false。 if (1.equals((is_passed))) isPassed = true。 Map var = new HashMap()。 (is_passed, isPassed)。 ().pleteTask( Parameter(taskId), var)。 } catch (Exception e) { rollback = true。 ()。 throw e。 } finally { if (ut != null amp。 amp。 () != ) { if (rollback) ()。 else ()。 } if (conn != null) ()。 } } /** * 获取员工的工作列表 * @return。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。