/*-----------------------------------------------------*/ public virtual void Submit_UpdateData(cDataObjectList aDataObjectList, bool aRaiseSingleEvent) { foreach (cWfTaskAssignment aDataObject in aDataObjectList) { aDataObject.RaiseProcessEvents = true; //flag to raise pre and post submission processing events aDataObject["WfTaskStatusID"] = 2; aDataObject["SubmittedDate"] = System.DateTime.Now; aDataObject["ModifyUser"] = WebSession.DataObjectFactory.User.UserID; aDataObject["ModifyDate"] = System.DateTime.Now; WebSession.DataObjectFactory.SaveDataObject(aDataObject); aDataObject.RaiseProcessEvents = false; } //WebSession.DataObjectFactory.SaveDataObject(aDataObjectList); //Process outcomes for only one data object so that e-mails and tasks can be processed. //Since e-mail events use the entire data object list, we must create a new list containing only //one of these data objects for (int Pos = 0; Pos < aDataObjectList.Count; Pos++) { int aWfTaskAssignmentID = aDataObjectList[Pos].GetPropertyInt("WfTaskAssignmentID"); cWfTaskAssignment aWfTaskAssignment = (cWfTaskAssignment)WebSession.DataObjectFactory.GetDataObjectFromPrimaryKey("WfTaskAssignment", aWfTaskAssignmentID); if (aRaiseSingleEvent && (Pos == 0)) { aWfTaskAssignment.SetWfTaskOutcome(OutcomeConfigDoc, false, true, true); } else if (aRaiseSingleEvent && (Pos > 0)) { aWfTaskAssignment.SetWfTaskOutcome(OutcomeConfigDoc, false, true, false); } else { aWfTaskAssignment.SetWfTaskOutcome(OutcomeConfigDoc, false, true, true); } } //Set WfTaskStatusID property of WfTaskAssignmentObject in memory (this allows the post-submission content control to be displayed to the reviewer on redirect) WfTaskAssignmentObject["WfTaskStatusID"] = 2; }
/*-----------------------------------------------------*/ public virtual void Submit_UpdateData(cXMLDoc aOutcomeConfigDoc) { cWfTaskAssignment aWfTaskAssignment = (cWfTaskAssignment)WebSession.DataObjectFactory.GetDataObjectFromPrimaryKey("WfTaskAssignment", WfTaskAssignmentID); aWfTaskAssignment.RaiseProcessEvents = true; //flag to raise pre and post submission processing events cDataObject aSubmissionHistory = null; if (WebAppl.CreateSubmissionHistory) { aSubmissionHistory = WebSession.DataObjectFactory.CreateNewDataObjectFromKey("SubmissionHistory"); aSubmissionHistory["WfTaskAssignmentID"] = WfTaskAssignmentID; aSubmissionHistory["WfTaskID"] = aWfTaskAssignment.GetPropertyInt("WfTaskID"); aSubmissionHistory["PersonID"] = aWfTaskAssignment.GetPropertyInt("PersonID"); //aSubmissionHistory["StartDate"] = (System.DateTime)aWfTaskAssignment.GetPropertyValue("StartDate"); aSubmissionHistory["OpenDate"] = aWfTaskAssignment.GetPropertyValue("OpenDate"); aSubmissionHistory["DueDate"] = aWfTaskAssignment.GetPropertyValue("DueDate"); aSubmissionHistory["CloseDate"] = aWfTaskAssignment.GetPropertyValue("CloseDate"); //aSubmissionHistory["EndDate"] = (System.DateTime)aWfTaskAssignment.GetPropertyValue("EndDate"); aSubmissionHistory["PreWfTaskStatusID"] = aWfTaskAssignment.GetPropertyValue("WfTaskStatusID"); aSubmissionHistory.SaveData(); } aWfTaskAssignment["WfTaskStatusID"] = 2; aWfTaskAssignment["SubmittedDate"] = System.DateTime.Now; aWfTaskAssignment["SubmittedBy"] = WebSession.DataObjectFactory.User.UserID; aWfTaskAssignment["ModifyUser"] = WebSession.DataObjectFactory.User.UserID; aWfTaskAssignment["ModifyDate"] = System.DateTime.Now; WebSession.DataObjectFactory.SaveDataObject(aWfTaskAssignment); aWfTaskAssignment.RaiseProcessEvents = false; //Continue processing the post submission workflow tasks only if the ContinueProcessing is still true if (aWfTaskAssignment.ContinueProcessing) { aWfTaskAssignment.SetWfTaskOutcome(aOutcomeConfigDoc); } if (WebAppl.CreateSubmissionHistory) { aSubmissionHistory["SubmittedDate"] = aWfTaskAssignment.GetPropertyValue("SubmittedDate"); aSubmissionHistory["WfTaskOutcomeID"] = aWfTaskAssignment.GetPropertyValue("WfTaskOutcomeID"); aSubmissionHistory["PostWfTaskStatusID"] = aWfTaskAssignment.GetPropertyValue("WfTaskStatusID"); aSubmissionHistory.SaveData(); } WebSession.DataObjectFactory.CopyDataObject(aWfTaskAssignment, ((cEGUser)ModuleUser).WfTaskAssignmentObject); }