Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Add or insert records to XML Repeating Sequence Group › Add or insert records to XML Repeating Sequence Group
[quote:9f69ecc8b3=\”nwalters\”]The C# code has NOTHING to do with a map.
It is called from a Biztalk message assignment shape in an orchestration.
The C# must have a strong name, and must be installed in the GAC on the machine where Biztalk server is running.
In your Biztalk project, you make a reference to the assembly (project, right click reference, click \”Browse\” button, find BIN directory where you compiled .DLL to, and select the .DLL.
Since the C# routine is static, you do not need a variable/object to call it.
You will code something like this:
YourNamespace.YourClass.AddChildDocument(
msgParent, msgChild,
\”ParentElement\”, \”http://*.com/schema\”);
Since normal messages are xmlDocuments, I’m pretty sure you can pass them directly where the C# program expects an xmlDocument object.
Eventually, you will probably develop several \”helper\” classes in C#,
so you will probably have something like an XmlHelpersClass, and it may have 5 to 20 methods in it that you can call.[/quote:9f69ecc8b3]
First of all, [u:9f69ecc8b3]thanks a lot[/u:9f69ecc8b3] for your answer. I now understand how works your [i:9f69ecc8b3]C# Class[/i:9f69ecc8b3].
Actually, I need to insert a row (not blank) in my output flat file only if one of the values of the [color=orange:9f69ecc8b3][b:9f69ecc8b3]source schema[/b:9f69ecc8b3][/color:9f69ecc8b3] is [i:9f69ecc8b3]true[/i:9f69ecc8b3] else I don’t need to add it.
Doesn’t matter, I think I can use a part of your code and add it in a [color=green:9f69ecc8b3][b:9f69ecc8b3]Message assignement[/b:9f69ecc8b3] shape[/color:9f69ecc8b3] inside my [color=green:9f69ecc8b3][b:9f69ecc8b3]Construct Message[/b:9f69ecc8b3] shape[/color:9f69ecc8b3], juste after the [color=green:9f69ecc8b3][b:9f69ecc8b3]transform[/b:9f69ecc8b3] shape[/color:9f69ecc8b3] (where the mapping is done). [size=9:9f69ecc8b3][i:9f69ecc8b3]hope that is enough clear …[/i:9f69ecc8b3][/size:9f69ecc8b3]
But this involve I had to [color=darkred:9f69ecc8b3][b:9f69ecc8b3]promote[/b:9f69ecc8b3][/color:9f69ecc8b3] the value of my [color=orange:9f69ecc8b3][b:9f69ecc8b3]source schema[/b:9f69ecc8b3][/color:9f69ecc8b3] which is [i:9f69ecc8b3]true [/i:9f69ecc8b3]or [i:9f69ecc8b3]false [/i:9f69ecc8b3] to test if the row must be inserted or not, isn’t it ?
In any case, I’m gonna try this !