public Activity Parse(XElement inputElement) { var activity = new RdvPublishActivity(); activity.Name = inputElement.Attribute("name").Value; activity.Type = (ActivityType)inputElement.Element(XmlnsConstant.tibcoProcessNameSpace + "type").Value; var configElement = inputElement.Element("config"); activity.Subject = XElementParserUtils.GetStringValue(configElement.Element("subject")); activity.SharedChannel = XElementParserUtils.GetStringValue(configElement.Element("sharedChannel")); activity.isXmlEncode = XElementParserUtils.GetBoolValue(configElement.Element("xmlEncoding")); var xsdStringElement = configElement.Element("xsdString"); if (xsdStringElement.Attribute("ref") != null) { activity.XsdString = xsdStringElement.Attribute("ref").ToString(); } else { activity.ObjectXNodes = xsdStringElement.Nodes(); } if (inputElement.Element(XmlnsConstant.tibcoProcessNameSpace + "inputBindings") != null) { activity.InputBindings = inputElement.Element(XmlnsConstant.tibcoProcessNameSpace + "inputBindings").Nodes(); activity.Parameters = new XslParser().Parse(activity.InputBindings); } return(activity); }
public void SetUp() { this.activityBuilder = new RdvPublishActivityBuilder(new XslBuilder(new XpathBuilder())); this.activity = new RdvPublishActivity("My Activity Name", ActivityType.rdvPubActivityType); this.activity.XsdString = "pfx:FileStatisticalData"; this.activity.Subject = "MY.Tibco.subject"; var xml = @"<pd:inputBindings xmlns:pd=""http://xmlns.tibco.com/bw/process/2003"" xmlns:xsl=""http://w3.org/1999/XSL/Transform""> <ActivityInput> <body> <xsl:value-of select=""'TestString'""/> </body> </ActivityInput> </pd:inputBindings> "; XElement doc = XElement.Parse(xml); this.activity.InputBindings = doc.Nodes(); this.activity.Parameters = new List <ClassParameter> { new ClassParameter { Name = "ActivityInput", Type = "ActivityInput" } }; }