none
Dynamic Maps with Multiple Input Messages RRS feed

  • Question

  • Hi,

    Is there a way to execute a map in Helper Class ( c#) dynamically from Orchestration with Multiple Inputs.

    I understand that i can use the transform method in side the orchestration and pass multiple message but if there is a exception in the transformation it is going to General Exception so i want to use a help method to call execute the maps and catch the exception. I am able to pass one message and transform and get the message .. but i have a case when i need to pass two input message .. how do i achieve it.

    Thanks..


    Monday, November 7, 2016 7:24 PM

Answers

  • Thanks i came accors it ..  Its basically constructing the single XML with Root and Input message parts .. i am not sure if that is the approach that i need to take for execution .. 

    Well! For executing multi-input map through C# helper code you have to go with approach suggested in the article. 

    If you try to disassemble BizTalk code with Reflector you will see that BizTalk Server uses a trick to handle maps with multiple input messages. BizTalk uses an envelope to wrap the individual input messages. the envelope is created at runtime by the private class called CompositeStreamReader that can be found within the assembly Microsoft.XLANGs.Engine.

    You can also make use of the custom classes developed by Paolo Salvatori to handle multiple input message transformation in C# helper. Refer: How To Boost Message Transformations Using the XslCompiledTransform class Extended. But still you will be creating an envelope message which targetNamespace is equal to ‘http://schemas.microsoft.com/BizTalk/2003/aggschema’ and that contains as many InputMessagePart elements as the incoming documents to the map.

    On the other hand, I would also suggest you to go with regular transformation in orchestration and for catching the exception message in case of transformation failure refer the discussion I had with Lillian in one of the earlier thread: How to catch the exception message throw in the map?


    Rachit Sikroria (Microsoft Azure MVP)

    Monday, November 7, 2016 8:20 PM
    Moderator

All replies

  • Hi,

    Refer: Execute a BizTalk 2013 map with multiple input messages from .NET


    Rachit Sikroria (Microsoft Azure MVP)

    Monday, November 7, 2016 7:38 PM
    Moderator
  • Thanks i came accors it ..  Its basically constructing the single XML with Root and Input message parts .. i am not sure if that is the approach that i need to take for execution .. 
    Monday, November 7, 2016 7:54 PM
  • Thanks i came accors it ..  Its basically constructing the single XML with Root and Input message parts .. i am not sure if that is the approach that i need to take for execution .. 

    Well! For executing multi-input map through C# helper code you have to go with approach suggested in the article. 

    If you try to disassemble BizTalk code with Reflector you will see that BizTalk Server uses a trick to handle maps with multiple input messages. BizTalk uses an envelope to wrap the individual input messages. the envelope is created at runtime by the private class called CompositeStreamReader that can be found within the assembly Microsoft.XLANGs.Engine.

    You can also make use of the custom classes developed by Paolo Salvatori to handle multiple input message transformation in C# helper. Refer: How To Boost Message Transformations Using the XslCompiledTransform class Extended. But still you will be creating an envelope message which targetNamespace is equal to ‘http://schemas.microsoft.com/BizTalk/2003/aggschema’ and that contains as many InputMessagePart elements as the incoming documents to the map.

    On the other hand, I would also suggest you to go with regular transformation in orchestration and for catching the exception message in case of transformation failure refer the discussion I had with Lillian in one of the earlier thread: How to catch the exception message throw in the map?


    Rachit Sikroria (Microsoft Azure MVP)

    Monday, November 7, 2016 8:20 PM
    Moderator
  • Hi,

    Apart from what Rachit said, one another way could be using an itinerary. Use the trnasformation service and have the muti part map break down into more than one maps.

    The standard receive port map will only allow to execute one map at a time, while an ESB itinerary will allow you to execute more than one. 

    Read this Article on how to execute multiple maps in the receive port.

    https://seroter.wordpress.com/2009/06/29/esb-toolkit-executing-multiple-maps-in-sequence/

    As far as capturing en error goes you can do that with a custom itinerary service


    Regards PK: Please mark the reply as answer or vote it up, as deemed fit.

    Thursday, November 10, 2016 4:02 AM