public void SendBack(IWfAssignment sendBackAssign) { WfLogicalAbnormalContextData abnormalContextData = WfUtil.GetAbnormalContextData(); abnormalContextData.ReceiveAssignId = sendBackAssign.Key; abnormalContextData.ReceiveActinstId = sendBackAssign.Activity.Key; abnormalContextData.ReceiveActinstName = sendBackAssign.Activity.Name; abnormalContextData.ReceiveStaffId = sendBackAssign.StaffId; abnormalContextData.ReceiveStaffName = sendBackAssign.StaffName; if (sendBackAssign.Status != AssignStatusType.Abnormaled) { sendBackAssign.ChangeStatus(AssignStatusType.Abnormaled); sendBackAssign.ChangeStatus(WfAbnormalType.SEND_BACKING); } else { sendBackAssign.ChangeStatus(AssignStatusType.Accepted); sendBackAssign.ChangeStatus(WfAbnormalType.NO_ABNORMAL); } sendBackAssign.Store(); if (this.wfAssigninst.AbnormalStatus == WfAbnormalType.NO_ABNORMAL) { this.ChangeStatus(WfAbnormalType.SEND_BACKED); this.ChangeStatus(AssignStatusType.Abnormaled); } if (this.wfAssigninst.AbnormalStatus == WfAbnormalType.SEND_BACKING) { this.ChangeStatus(AssignStatusType.Completed); this.ChangeStatus(WfAbnormalType.NO_ABNORMAL); } this.Store(); }
private void SendBack(WorkItem workItem, IWfAssignment sendBackAssign, string sendBackActdefId) { if (sendBackAssign == null) { IList<WfAssigninst> list = this.Dao.Query<WfAssigninst>("GetSendBackToAssign", new object[] { workItem.ProinstId, sendBackActdefId }); if (list.Count == 0) { throw new CannotSendBackException("Cannot find the send to assignment for:" + workItem.AssignId + "," + workItem.ProinstName); } if (list.Count > 1) { throw new CannotSendBackException("Cannot batch send back the assignment:" + workItem.AssignId); } sendBackAssign = WfFactory.GetWfAssignment(list[0]); } IWfAssignment wfAssignment = WfFactory.GetWfAssignment(workItem.AssignId); if ((wfAssignment.AbnormalStatus == WfAbnormalType.NO_ABNORMAL) || (wfAssignment.AbnormalStatus == WfAbnormalType.SEND_BACKING)) { wfAssignment.SendBack(sendBackAssign); WfFactory.GetAbnormalAudit(workItem).Create(WfAbnormalType.SEND_BACKED); } }