public ActionForward processPayment( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws AppException { String forwardPage = ""; Inform inf = new Inform(); Workflow workflow = (Workflow) form; JbpmContext jbpmContext = JbpmUtil.getJbpmContext(); try { long taskInstanceId = workflow.getTaskInstanceId(); TaskInstance taskInstance = jbpmContext.getTaskInstance(taskInstanceId); // String isSubmit 结束/总经理处理 此处省略 taskInstance.end(); inf.setMessage("处理完成"); inf.setForwardPage("../workflow/workflowList.do?thisAction=listTask"); } catch (Exception e) { e.printStackTrace(); inf.setMessage("异常信息:" + e.getMessage()); } finally { jbpmContext.close(); } return forwardInformPage(inf, mapping, request); }
/** Delete Task Instance Variable */ public static void deleteTaskInstanceVariable(long taskInstanceId, String name) throws WorkflowException { log.debug("deleteTaskInstanceVariable({}, {})", new Object[] {taskInstanceId, name}); JbpmContext jbpmContext = JBPMUtils.getConfig().createJbpmContext(); try { org.jbpm.taskmgmt.exe.TaskInstance ti = jbpmContext.getTaskInstance(taskInstanceId); ti.deleteVariable(name); jbpmContext.getSession().flush(); } catch (JbpmException e) { throw new WorkflowException(e.getMessage(), e); } finally { jbpmContext.close(); } log.debug("deleteTaskInstanceVariable: void"); }
/** Set Task Instance Actor Id */ public static void setTaskInstanceActorId(long taskInstanceId, String actorId) throws WorkflowException { log.debug("setTaskInstanceActorId({}, {})", new Object[] {taskInstanceId, actorId}); JbpmContext jbpmContext = JBPMUtils.getConfig().createJbpmContext(); try { org.jbpm.taskmgmt.exe.TaskInstance ti = jbpmContext.getTaskInstance(taskInstanceId); ti.setActorId(actorId); jbpmContext.getSession().flush(); } catch (JbpmException e) { throw new WorkflowException(e.getMessage(), e); } finally { jbpmContext.close(); } log.debug("setTaskInstanceActorId: void"); }
public Object execute(JbpmContext jbpmContext) throws Exception { TaskInstance ti = jbpmContext.getTaskInstance(taskInstanceId); ti.setActorId(null); ti.setStart(null); return null; }