private String preView(String operate) { log.debug("*** preView 方法开始"); log.debug( new StringBuilder("*** Received parameter:[") .append("task:") .append(task) .append("]") .toString()); workflowInstance = workflowInstanceManager.getWorkflowInstance(task.getProcessInstanceId()); workflowId = task.getProcessInstanceId(); StringBuilder builder = new StringBuilder(); builder .append("<input type=\"hidden\" name=\"dataId\" value=\"") .append(workflowInstance.getDataId()) .append("\"/>"); FormView form = formViewManager.getFormView(workflowInstance.getFormId()); formHtml = workflowInstanceManager.setValueForHtml(workflowInstance.getDataId(), form, form.getHtml()); formHtml = builder.toString() + formHtml; if (SAVE.equals(operate)) { formHtml = workflowInstanceManager.getFormHtml( workflowInstance, formHtml, workflowInstance.getDataId(), true, false); fieldPermission = ApiFactory.getFormService().getFieldPermission(task.getId()); } else { formHtml = workflowInstanceManager.getFormHtml( workflowInstance, formHtml, workflowInstance.getDataId(), false, false); fieldPermission = workflowRightsManager.getFieldPermission(false); } ApiFactory.getBussinessLogService().log("工作流管理", "查看已完成任务", ContextUtils.getSystemId("wf")); log.debug("*** preView 方法结束"); return "view"; }
public String assignTransactorPop() throws Exception { if (task.getId() == null) { this.addErrorMessage("非法的任务"); } else { candidates = taskService.getNextTasksCandidates(task); this.addErrorMessage("请选择办理人"); } ApiFactory.getBussinessLogService().log("工作流管理", "弹出指定办理人", ContextUtils.getSystemId("wf")); return "assignPop"; }
/** * 流程监控/保存更改的办理人 * * @return * @throws Exception */ public String changeTransactorSave() throws Exception { taskService.changeTransactor(taskId, transactor); task = taskService.getWorkflowTask(taskId); workflowId = task.getProcessInstanceId(); workflowInstance = workflowInstanceManager.getWorkflowInstance(workflowId); // 更改办理人业务补偿 taskService.changeTransactorSet(workflowInstance, transactor, task.getId()); ApiFactory.getBussinessLogService().log("流程监控", "更改办理人", ContextUtils.getSystemId("wf")); this.addSuccessMessage("办理人已更改"); return changeTransactor(); }
public void rtxReminder(WorkflowTask task) { String msg = new StringBuilder("(") .append(new SimpleDateFormat("yyyy-MM-dd").format(new Date(System.currentTimeMillis()))) .append(")任务:") .append(task.getTitle()) .append("已经生成") .append(((System.currentTimeMillis() - task.getCreatedTime().getTime()) / MILLI_SECOND)) .append("天了。请尽快办理!") .toString(); String url = SystemUrls.getSystemUrl(StringUtils.substring(task.getUrl(), 0, task.getUrl().indexOf('/'))) + StringUtils.substring(task.getUrl(), task.getUrl().indexOf('/')); if (url.contains("?")) { url = url + task.getId(); } else { url = url + "?taskId=" + task.getId(); } User user = userManager.getUserByLoginName(task.getTransactor()); rtx.RtxMsgSender.sendNotify(task.getTransactor(), "任务办理提醒", "1", msg, url, user.getCompanyId()); }
/** 处理任务 */ @Override public String input() throws Exception { log.debug("*** input 处理任务方法开始"); log.debug( new StringBuilder("*** Received parameter:[") .append("task:") .append(task) .append("]") .toString()); taskService.updateTaskIsRead(task); workflowId = task.getProcessInstanceId(); workflowInstance = workflowInstanceManager.getWorkflowInstance(workflowId); opinions = workflowInstanceManager.getOpinions(taskId, task.getCompanyId()); if (workflowRightsManager.mustOpinionRight(BeanUtil.turnToModelTask(task)) && (opinions == null || opinions.size() <= 0)) { must = true; } StringBuilder builder = new StringBuilder(); builder .append("<input type=\"hidden\" name=\"dataId\" value=\"") .append(workflowInstance.getDataId()) .append("\"/>"); formHtml = workflowInstanceManager.getHtml( workflowInstance.getProcessDefinitionId(), workflowInstance.getFormId(), workflowInstance.getDataId(), task.getName()); formHtml = builder.toString() + formHtml; if (TaskState.COMPLETED.getIndex().equals(task.getActive()) || TaskState.CANCELLED.getIndex().equals(task.getActive())) { // 列表控件控制 formHtml = workflowInstanceManager.getFormHtml( workflowInstance, formHtml, workflowInstance.getDataId(), false, false); fieldPermission = workflowRightsManager.getFieldPermission(false); } else if (TaskState.WAIT_CHOICE_TACHE.getIndex().equals(task.getActive())) { canChoiceTaches = taskService.isNeedChoiceTache(task, workflowInstance).getCanChoiceTaches(); return choiceTache(); } else { // 列表控件控制 formHtml = workflowInstanceManager.getFormHtml( workflowInstance, formHtml, workflowInstance.getDataId(), true, false); fieldPermission = ApiFactory.getFormService().getFieldPermission(task.getId()); } ApiFactory.getBussinessLogService().log("工作流管理", "任务办理页面", ContextUtils.getSystemId("wf")); log.debug("*** input 处理任务方法结束"); return INPUT; }
/** 指定办理人 */ @Action(value = "taskassign") public String assignTransactor() throws Exception { String to = INPUT; if (task.getId() == null) { this.addErrorMessage("非法的任务"); } else { WorkflowInstance instance = workflowInstanceManager.getWorkflowInstance(task.getProcessInstanceId()); CompleteTaskTipType result = taskService.isNeedAssigningTransactor(instance, task); if (result == null) { result = taskService.isSubProcessNeedChoiceTransactor(task, instance); } switch (result) { case OK: this.addSuccessMessage(result.getContent()); to = input(); break; case MESSAGE: this.addErrorMessage(result.getContent()); to = INPUT; break; case RETURN_URL: candidates = taskService.getNextTasksCandidates(task); this.addErrorMessage("请选择办理人"); to = "assign"; break; case TACHE_CHOICE_URL: addActionMessage("请选择环节"); canChoiceTaches = result.getCanChoiceTaches(); to = choiceTache(); case SINGLE_TRANSACTOR_CHOICE: User temp; for (String tran : result.getCanChoiceTransactor()) { temp = userManager.getUserByLoginName(tran); if (temp != null) canChoiceTransactor.put(tran, temp.getName()); } moreTransactor = CompleteTaskTipType.SINGLE_TRANSACTOR_CHOICE.getContent().equals("true"); to = "singleTransactorChoice"; } } ApiFactory.getBussinessLogService().log("工作流管理", "指定办理人", ContextUtils.getSystemId("wf")); return to; }
public void swingInform(WorkflowTask task) throws Exception { String msg = new StringBuilder("任务:") .append(task.getTitle()) .append("的办理人") .append(task.getTransactorName()) .append("被催办次数已经超过设置上限,请您核实情况。") .toString(); if (StringUtils.isNotEmpty(task.getReminderNoticeUser())) { for (String userLoginName : task.getReminderNoticeUser().split(",")) { ApiFactory.getPortalService() .addMessage( "task", "系统管理员", ContextUtils.getLoginName(), userLoginName, "催办超期提醒", msg, "/task/message-task.htm?id=" + task.getId()); } } }
public String saveChoicePop() throws Exception { CompleteTaskTipType completeTaskTipType = taskService.completeTacheChoice(taskId, transitionName); String to = ""; switch (completeTaskTipType) { case OK: to = "OK:" + completeTaskTipType.getContent(); break; case MESSAGE: to = "MS:" + completeTaskTipType.getContent(); break; case RETURN_URL: String url = completeTaskTipType.getContent(); if (url.equals(TaskService.DEFAULT_URL)) url = url + "?taskId=" + task.getId(); to = "RU:" + url; break; case TACHE_CHOICE_URL: to = "TC:" + completeTaskTipType.getContent(); break; } ApiFactory.getBussinessLogService().log("工作流管理", "完成选择环节任务", ContextUtils.getSystemId("wf")); this.renderText(to); return null; }
public void swingReminder(WorkflowTask task) throws Exception { if (StringUtils.isNotEmpty(task.getTransactor())) { String msg = new StringBuilder("(") .append( new SimpleDateFormat("yyyy-MM-dd").format(new Date(System.currentTimeMillis()))) .append(")任务:") .append(task.getTitle()) .append("已经生成") .append( ((System.currentTimeMillis() - task.getCreatedTime().getTime()) / MILLI_SECOND)) .append("天了。请尽快办理!") .toString(); ApiFactory.getPortalService() .addMessage( "task", "系统管理员", ContextUtils.getLoginName(), task.getTransactor(), "待办任务催办提醒", msg, "/task/message-task.htm?id=" + task.getId()); } }