/// <summary> /// 把Xml节点转换为ActivityTypeDetail 类(用于会签等复杂类型) /// </summary> /// <param name="typeNode"></param> /// <returns></returns> private ActivityTypeDetail ConvertXmlNodeToActivityTypeDetail(XmlNode typeNode) { ActivityTypeDetail entity = new ActivityTypeDetail(); entity.ActivityType = (ActivityTypeEnum)Enum.Parse(typeof(ActivityTypeEnum), XMLHelper.GetXmlAttribute(typeNode, "type")); if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "complextype"))) { entity.ComplexType = (ComplexTypeEnum)Enum.Parse(typeof(ComplexTypeEnum), XMLHelper.GetXmlAttribute(typeNode, "complextype")); } if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "mergetype"))) { entity.MergeType = (MergeTypeEnum)Enum.Parse(typeof(MergeTypeEnum), XMLHelper.GetXmlAttribute(typeNode, "mergetype")); } if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "completeorder"))) { entity.CompleteOrder = float.Parse(XMLHelper.GetXmlAttribute(typeNode, "completeorder")); } if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "skip"))) { var skip = Boolean.Parse(XMLHelper.GetXmlAttribute(typeNode, "skip")); var skipto = XMLHelper.GetXmlAttribute(typeNode, "to"); if (skip) { entity.SkipInfo = new SkipInfo { IsSkip = skip, Skipto = skipto }; } } return(entity); }
/// <summary> /// 把Xml节点转换为ActivityTypeDetail 类(用于会签等复杂类型) /// </summary> /// <param name="typeNode">类型节点</param> /// <returns>活动类型详细</returns> private static ActivityTypeDetail ConvertXmlNodeToActivityTypeDetail(XmlNode typeNode) { ActivityTypeDetail entity = new ActivityTypeDetail(); entity.ActivityType = (ActivityTypeEnum)Enum.Parse(typeof(ActivityTypeEnum), XMLHelper.GetXmlAttribute(typeNode, "type")); if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "trigger"))) { TriggerTypeEnum triggerType = TriggerTypeEnum.None; Enum.TryParse <TriggerTypeEnum>(XMLHelper.GetXmlAttribute(typeNode, "trigger"), out triggerType); entity.TriggerType = triggerType; //获取时间表达式 if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "expression"))) { entity.Expression = XMLHelper.GetXmlAttribute(typeNode, "expression"); } } if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "complexType"))) { entity.ComplexType = EnumHelper.ParseEnum <ComplexTypeEnum>(XMLHelper.GetXmlAttribute(typeNode, "complexType")); } if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "mergeType"))) { entity.MergeType = EnumHelper.ParseEnum <MergeTypeEnum>(XMLHelper.GetXmlAttribute(typeNode, "mergeType")); } if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "compareType"))) { entity.CompareType = EnumHelper.ParseEnum <CompareTypeEnum>(XMLHelper.GetXmlAttribute(typeNode, "compareType")); } if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "completeOrder"))) { entity.CompleteOrder = float.Parse(XMLHelper.GetXmlAttribute(typeNode, "completeOrder")); } if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "skip"))) { var skip = Boolean.Parse(XMLHelper.GetXmlAttribute(typeNode, "skip")); var skipto = XMLHelper.GetXmlAttribute(typeNode, "to"); if (skip) { entity.SkipInfo = new SkipInfo { IsSkip = skip, Skipto = skipto }; } } return(entity); }
/// <summary> /// 把Xml节点转换为ActivityTypeDetail 类(用于会签等复杂类型) /// </summary> /// <param name="typeNode">类型节点</param> /// <returns>活动类型详细</returns> private static ActivityTypeDetail ConvertXmlNodeToActivityTypeDetail(XmlNode typeNode) { ActivityTypeDetail typeDetail = new ActivityTypeDetail(); typeDetail.ActivityType = (ActivityTypeEnum)Enum.Parse(typeof(ActivityTypeEnum), XMLHelper.GetXmlAttribute(typeNode, "type")); if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "trigger"))) { TriggerTypeEnum triggerType = TriggerTypeEnum.None; Enum.TryParse <TriggerTypeEnum>(XMLHelper.GetXmlAttribute(typeNode, "trigger"), out triggerType); typeDetail.TriggerType = triggerType; //获取时间或消息表达式 if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "expression"))) { typeDetail.Expression = XMLHelper.GetXmlAttribute(typeNode, "expression"); } //获取消息捕获或抛出类型 if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "messageDirection"))) { MessageDirectionEnum msgDirection = MessageDirectionEnum.None; Enum.TryParse <MessageDirectionEnum>(XMLHelper.GetXmlAttribute(typeNode, "messageDirection"), out msgDirection); typeDetail.MessageDirection = msgDirection; } } if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "complexType"))) { typeDetail.ComplexType = EnumHelper.ParseEnum <ComplexTypeEnum>(XMLHelper.GetXmlAttribute(typeNode, "complexType")); } if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "mergeType"))) { typeDetail.MergeType = EnumHelper.ParseEnum <MergeTypeEnum>(XMLHelper.GetXmlAttribute(typeNode, "mergeType")); } if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "compareType"))) { typeDetail.CompareType = EnumHelper.ParseEnum <CompareTypeEnum>(XMLHelper.GetXmlAttribute(typeNode, "compareType")); } if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "completeOrder"))) { typeDetail.CompleteOrder = float.Parse(XMLHelper.GetXmlAttribute(typeNode, "completeOrder")); } if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "subType"))) { typeDetail.SubProcessType = EnumHelper.ParseEnum <SubProcessTypeEnum>(XMLHelper.GetXmlAttribute(typeNode, "subType")); typeDetail.SubProcessGUID = XMLHelper.GetXmlAttribute(typeNode, "subId"); typeDetail.SubVariableName = XMLHelper.GetXmlAttribute(typeNode, "subVar"); } if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "skip"))) { var skip = Boolean.Parse(XMLHelper.GetXmlAttribute(typeNode, "skip")); var skipto = XMLHelper.GetXmlAttribute(typeNode, "to"); if (skip) { typeDetail.SkipInfo = new SkipInfo { IsSkip = skip, Skipto = skipto }; } } return(typeDetail); }
/// <summary> /// 把Xml节点转换为ActivityTypeDetail 类(用于会签等复杂类型) /// </summary> /// <param name="typeNode"></param> /// <returns></returns> private ActivityTypeDetail ConvertXmlNodeToActivityTypeDetail(XmlNode typeNode) { ActivityTypeDetail entity = new ActivityTypeDetail(); entity.ActivityType = (ActivityTypeEnum)Enum.Parse(typeof(ActivityTypeEnum), XMLHelper.GetXmlAttribute(typeNode, "type")); if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "complextype"))) { entity.ComplexType = (ComplexTypeEnum)Enum.Parse(typeof(ComplexTypeEnum), XMLHelper.GetXmlAttribute(typeNode, "complextype")); } if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "mergetype"))) { entity.MergeType = (MergeTypeEnum)Enum.Parse(typeof(MergeTypeEnum), XMLHelper.GetXmlAttribute(typeNode, "mergetype")); } if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "completeorder"))) { entity.CompleteOrder = float.Parse(XMLHelper.GetXmlAttribute(typeNode, "completeorder")); } if (!string.IsNullOrEmpty(XMLHelper.GetXmlAttribute(typeNode, "skip"))) { var skip = Boolean.Parse(XMLHelper.GetXmlAttribute(typeNode, "skip")); var skipto = XMLHelper.GetXmlAttribute(typeNode, "to"); if (skip) { entity.SkipInfo = new SkipInfo { IsSkip = skip, Skipto = skipto }; } } return entity; }