/*----------------------------------------------------*/ protected void WfTaskOutcome_SaveNewTaskAssignment(cDataObject aWfTaskAssgDataObject, XmlNode aTaskNode) { if (cXMLDoc.AttributeToInt(aTaskNode, "RoleID", 0) > 0) aWfTaskAssgDataObject["WfTaskRoleID"] = cXMLDoc.AttributeToInt(aTaskNode, "RoleID", 0); else aWfTaskAssgDataObject["WfTaskRoleID"] = this["WfTaskRoleID"]; aWfTaskAssgDataObject["GranteeProjectID"] = this["GranteeProjectID"]; if (aWfTaskAssgDataObject.GetRelatedPropertyValue("WfProjectTask.OpenDate") == null) aWfTaskAssgDataObject["OpenDate"] = System.DateTime.Now; aWfTaskAssgDataObject["CreateUser"] = this.DataObjectFactory.User.UserID; aWfTaskAssgDataObject["CreateDate"] = System.DateTime.Now; aWfTaskAssgDataObject["WfTaskStatusID"] = cXMLDoc.AttributeToInt(aTaskNode, "Status", 0); if (IndexNewWfTAs) NewWfTACollection.Add(cXMLDoc.AttributeToString(aTaskNode, "Key"), aWfTaskAssgDataObject); //update status and outcome on either new or existing WfTaskAssignment Object. If the task specifies NoPersonID=True //(i.e., a workgroup task assignment), the status will not be updated unless the UpdateStatus=True attribute is also present. if (!cXMLDoc.AttributeToBool(aTaskNode, "NoPersonID", false) || cXMLDoc.AttributeToBool(aTaskNode, "UpdateStatus", false)) aWfTaskAssgDataObject["WfTaskStatusID"] = cXMLDoc.AttributeToInt(aTaskNode, "Status", 0); if (cXMLDoc.AttributeToInt(aTaskNode, "Outcome", 0) > 0) aWfTaskAssgDataObject["WfTaskOutcomeID"] = cXMLDoc.AttributeToInt(aTaskNode, "Outcome"); if (cXMLDoc.AttributeToString(aTaskNode, "WorkgroupID", "") != "") aWfTaskAssgDataObject["WorkgroupID"] = cXMLDoc.AttributeToInt(aTaskNode, "WorkgroupID"); //save WfTaskAssignment object aWfTaskAssgDataObject.SaveData(); }
/*----------------------------------------------------*/ protected void WfTaskOutcome_SetRelatedDataObjectArgValues(cDataObject aNewWfTaskAssgDataObject, XmlNode aArgNode) { Object aDataValue = null; bool SetDataValue = false; XmlAttribute aAttr = aArgNode.Attributes["Value"]; if (aAttr == null) { aAttr = aArgNode.OwnerDocument.CreateAttribute("Value"); aArgNode.Attributes.Append(aAttr); } switch (cXMLDoc.AttributeToString(aArgNode, "Type")) { case "": case "Data": //Do nothing break; case "NewWfTaskAssignment": if (aNewWfTaskAssgDataObject != null) aDataValue = aNewWfTaskAssgDataObject.GetRelatedPropertyValue(cXMLDoc.AttributeToString(aArgNode, "TypeKey")); SetDataValue = true; break; case "SubmittedWfTaskAssignment": aDataValue = this.GetRelatedPropertyValue(cXMLDoc.AttributeToString(aArgNode, "TypeKey")); SetDataValue = true; break; case "NewWfTACollection": cDataObject aWfTA = (cDataObject) NewWfTACollection[cXMLDoc.AttributeToString(aArgNode, "TypeKey")]; aDataValue = aWfTA.GetPropertyValue(cXMLDoc.AttributeToString(aArgNode, "DataObjectPropertyKey")); SetDataValue = true; break; case "RelatedDataObjectCollection": aWfTA = (cDataObject) RelatedDataObjectCollection[cXMLDoc.AttributeToString(aArgNode, "TypeKey")]; aDataValue = aWfTA.GetPropertyValue(cXMLDoc.AttributeToString(aArgNode, "DataObjectPropertyKey")); SetDataValue = true; break; } if (SetDataValue) { if (aDataValue == System.DBNull.Value || aDataValue == null) { cXMLDoc.AddAttribute_ToNode(aArgNode, "Null", "True"); } else { cXMLDoc.AddAttribute_ToNode(aArgNode, "Null", "False"); aAttr.Value = aDataValue.ToString(); } } }