public Activity Parse(XElement inputElement) { var mapperActivity = new MapperActivity (); mapperActivity.Name = inputElement.Attribute ("name").Value; mapperActivity.Type = (ActivityType) inputElement.Element (XmlnsConstant.tibcoProcessNameSpace + "type").Value; var configElement = inputElement.Element ("config"); mapperActivity.XsdReference = configElement.Element("element").Attribute("ref").Value; mapperActivity.InputBindings = inputElement.Element (XmlnsConstant.tibcoProcessNameSpace + "inputBindings").Nodes(); mapperActivity.Parameters = new XslParser().Build(mapperActivity.InputBindings); return mapperActivity; }
public CodeStatementCollection GenerateCodeInvocation( MapperActivity mapperActivity) { var invocationCodeCollection = new CodeStatementCollection(); // Add the Log invocationCodeCollection.AddRange(DefaultActivityBuilder.LogActivity(mapperActivity)); // Add the mapping invocationCodeCollection.AddRange(this.xslBuilder.Build(mapperActivity.InputBindings)); // Add the invocation var variableReturnType = mapperActivity.XsdReference.Split(':')[1]; var variableName = VariableHelper.ToVariableName(mapperActivity.Name); var parameter = new CodeVariableReferenceExpression(mapperActivity.Parameters[0].Name); var code = new CodeVariableDeclarationStatement (variableReturnType, variableName, parameter); invocationCodeCollection.Add(code); return invocationCodeCollection; }