Пример #1
0
        public Activity Parse(XElement inputElement)
        {
            var xmlParseActivity = new XmlParseActivity ();

            xmlParseActivity.Name = inputElement.Attribute ("name").Value;
            xmlParseActivity.Type = (ActivityType) inputElement.Element (XmlnsConstant.tibcoProcessNameSpace + "type").Value;
            var configElement = inputElement.Element ("config");

            xmlParseActivity.XsdReference = configElement.Element("term").Attribute("ref").Value;

            xmlParseActivity.InputBindings = inputElement.Element (XmlnsConstant.tibcoProcessNameSpace + "inputBindings").Nodes();

            xmlParseActivity.Parameters = new XslParser().Build(xmlParseActivity.InputBindings);

            return xmlParseActivity;
        }
 public void SetUp()
 {
     this.xmlParseActivityBuilder = new XmlParseActivityBuilder(new XslBuilder(new XpathBuilder()), new XmlParserHelperBuilder());
     this.activity = new XmlParseActivity( "My Activity Name",ActivityType.xmlParseActivityType);
     this.activity.XsdReference = "pf4:EquityRecord";
     var xml =
         @"
     <pd:inputBindings xmlns:pd=""http://xmlns.tibco.com/bw/process/2003"" xmlns:xsl=""http://w3.org/1999/XSL/Transform"">
     <xmlString>
         <xsl:value-of select=""'TestString'""/>
     </xmlString>
     </pd:inputBindings>
     ";
     XElement doc = XElement.Parse(xml);
     this.activity.InputBindings = doc.Nodes();
     this.activity.Parameters = new List<ClassParameter>{
         new ClassParameter{
             Name = "xmlString",
             Type= "string"}
     };
 }