public void Should_Return_Namespace_of_input_paramter_in_config() { var xml = @"<pd:activity name=""LookUp Strat"" xmlns:pd=""http://xmlns.tibco.com/bw/process/2003"" xmlns:xsl=""http://w3.org/1999/XSL/Transform"" xmlns:pfx3=""http://pfx3Transform""> <pd:type>com.tibco.pe.core.CallProcessActivity</pd:type> <config> <processName>/Process/DAI/PrLookup.Fund.process</processName> </config> <pd:inputBindings> <pfx3:sqlParams> <FundName> <xsl:value-of select=""testvalue""/> </FundName> <AdminID> <xsl:value-of select=""EVL""/> </AdminID> </pfx3:sqlParams> </pd:inputBindings> </pd:activity>"; var doc2 = XElement.Parse(xml); CallProcessActivity callProcessActivity = (CallProcessActivity)this.callProcessActivityParser.Parse(doc2); Assert.AreEqual("http://pfx3Transform", ((XElement)callProcessActivity.InputBindings.First()).Name.Namespace.ToString()); }
public void Should_Return_2_input_parameter_in_the_method() { var activity = new CallProcessActivity("My Call Process Activity", ActivityType.callProcessActivityType); activity.ProcessName = "/Process/DAI/PNO/process.To.Call.process"; var xml = @"<pd:inputBindings xmlns:ns=""http://mynamespace/schemas"" xmlns:pd=""http://xmlns.tibco.com/bw/process/2003"" xmlns:xsl=""http://w3.org/1999/XSL/Transform""> <ns:logInfo> <message> <xsl:value-of select=""'Lookup Strategy'""/> </message> <msgCode> <xsl:value-of select=""'LOOKUP'""/> </msgCode> <param> <name> <xsl:value-of select=""'in:FundName'""/> </name> <value> <xsl:value-of select=""$Start/sqlParams/FundName""/> </value> </param> <param> <name> <xsl:value-of select=""'out:Strategy'""/> </name> <value> <xsl:value-of select=""$Lookup-Strategy/resultSet/Resultsets/ResultSet1[1]/Record1[1]/Strategy""/> </value> </param> <param> <name> <xsl:value-of select=""'out:SubStrategy'""/> </name> <value> <xsl:value-of select=""$Lookup-Strategy/resultSet/Resultsets/ResultSet1[1]/Record1[1]/SubStrategy""/> </value> </param> </ns:logInfo> </pd:inputBindings> "; XElement doc = XElement.Parse(xml); activity.InputBindings = doc.Nodes(); activity.Parameters = new List <ClassParameter> { new ClassParameter { Name = "logInfo", Type = "logInfo" } }; var executeQueryMethod = this.CallProcessActivityBuilder.GenerateMethods(activity, new Dictionary <string, string> { { "start_sqlParams", "start_sqlParams" }, { "Lookup_Strategy", "Lookup_Strategy" } })[0]; Assert.AreEqual(2, executeQueryMethod.Parameters.Count); }
public Activity Parse(XElement inputElement) { var callProcessActivity = new CallProcessActivity(); callProcessActivity.Name = inputElement.Attribute("name").Value; callProcessActivity.Type = (ActivityType)inputElement.Element(XmlnsConstant.tibcoProcessNameSpace + "type").Value; var configElement = inputElement.Element("config"); callProcessActivity.ProcessName = XElementParserUtils.GetStringValue(configElement.Element("processName")); if (inputElement.Element(XmlnsConstant.tibcoProcessNameSpace + "inputBindings") != null) { callProcessActivity.InputBindings = inputElement.Element(XmlnsConstant.tibcoProcessNameSpace + "inputBindings").Nodes(); callProcessActivity.Parameters = new XslParser().Parse(callProcessActivity.InputBindings); } return(callProcessActivity); }
public void SetUp() { this.CallProcessActivityBuilder = new CallProcessActivityBuilder(new XslBuilder(new XpathBuilder()), new OverideTibcoBWProcessLinqParser()); this.activity = new CallProcessActivity("My Call Process Activity", ActivityType.callProcessActivityType); this.activity.ProcessName = "/Process/DAI/PNO/process.To.Call.process"; 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 = "System.String" } }; }
public void Should_Return_ProcessName_in_config() { CallProcessActivity callProcessActivity = (CallProcessActivity)callProcessActivityParser.Parse(doc); Assert.AreEqual("/Process/DAI/PrLookup.Fund.process", callProcessActivity.ProcessName); }
public void Should_Return_Activity_Type_Is_CallProcessActivity() { CallProcessActivity callProcessActivity = (CallProcessActivity)callProcessActivityParser.Parse(doc); Assert.AreEqual("com.tibco.pe.core.CallProcessActivity", callProcessActivity.Type.ToString()); }
private static string GetServiceFieldName(CallProcessActivity callProcessActivity) { return(VariableHelper.ToVariableName(callProcessActivity.TibcoProcessToCall.ProcessName)); }
private static CodeTypeReference GetServiceFieldType(CallProcessActivity callProcessActivity) { return(new CodeTypeReference(TargetAppNameSpaceService.myAppName() + "." + callProcessActivity.TibcoProcessToCall.ShortNameSpace + ".I" + VariableHelper.ToClassName(callProcessActivity.TibcoProcessToCall.ProcessName))); }
private static bool IsTheProcessInputRequiresAnImport(CallProcessActivity callProcessActivity) { return(callProcessActivity.InputBindings != null && callProcessActivity.InputBindings.Count() != 0 && String.IsNullOrEmpty(((XElement)callProcessActivity.InputBindings.First()).Name.Namespace.ToString())); }