private void FillPartnerLinkList(WorkflowContext workflowContext, XmlNode currentStep) { if (currentStep.LocalName == "partnerLinks") { foreach (XmlNode variableNode in currentStep.ChildNodes) { if (variableNode.LocalName == "partnerLink") { var partnerLinkEntity = new PartnerLinkModel(); if (variableNode.Attributes != null) { foreach (XmlAttribute variableAttribute in variableNode.Attributes) { if (variableAttribute.LocalName == "name") { partnerLinkEntity.Name = variableAttribute.Value; } else if (variableAttribute.LocalName == "partnerLinkType") { partnerLinkEntity.PartnerLinkType = variableAttribute.Value; } else if (variableAttribute.LocalName == "myRole") { partnerLinkEntity.MyRole = variableAttribute.Value; } else if (variableAttribute.LocalName == "partnerRole") { partnerLinkEntity.PartnerRole = variableAttribute.Value; } } } if (!string.IsNullOrEmpty(partnerLinkEntity.Name)) { workflowContext.PartnerLinkList.Add(partnerLinkEntity); } } } } }
public void AddStateRoleByCondition(string workflowName, string stateNodeName, PartnerLinkModel partnerLink) { var workflowStateEntity = GetWorkflowStateInfoByCondition(workflowName, stateNodeName); var roleInfoEntity = UserOperationDAL.QueryRoleInfoByWorkflowStateId(workflowStateEntity.Id); if (roleInfoEntity == null) { roleInfoEntity = UserOperationDAL.QueryRoleInfoByCondition(workflowName, partnerLink.MyRole); if (roleInfoEntity == null) { roleInfoEntity = new RoleInfoModel { CreateDateTime = DateTime.Now, LastUpdateDateTime = DateTime.Now, RoleDisplayName = partnerLink.MyRole, RoleName = partnerLink.MyRole, WorkflowName = workflowName, WorkflowDisplayName = workflowName, }; DataOperationBLL.Current.Insert(roleInfoEntity); } else { roleInfoEntity.RoleDisplayName = partnerLink.MyRole; roleInfoEntity.WorkflowDisplayName = workflowName; roleInfoEntity.LastUpdateDateTime = DateTime.Now; DataOperationBLL.Current.Modify(roleInfoEntity); } UserOperationDAL.AddWorkflowStateInRole(workflowStateEntity.Id, roleInfoEntity.Id); } else { roleInfoEntity.RoleName = partnerLink.MyRole; roleInfoEntity.WorkflowName = workflowName; roleInfoEntity.RoleDisplayName = partnerLink.MyRole; roleInfoEntity.WorkflowDisplayName = workflowName; roleInfoEntity.LastUpdateDateTime = DateTime.Now; DataOperationBLL.Current.Modify(roleInfoEntity); } }