none
Multiple receive shape in the same Orchestration? RRS feed

  • Question

  • I have 2 processes, A and B.

    Process B needs to use the input message in process A for comparison. So I need to receive 2 different schema input files in the same orchestration to complete process B. How can I do it?

    I had a search on the web, seems convoy(http://msdn.microsoft.com/en-US/library/ms942189(v=BTS.10).aspx) is like a solution, but I haven't figured out how to implement it.

    Thank you.

    Friday, April 12, 2013 4:45 AM

Answers

  • As per Leonid's point, you have to have something to correlate on.  Looking at your file names, the file name up to the second underscore (i.e. 20130418_ABC) is what I would think you could use for your correlation.

    If this does not exist inside your file, then you will need a custom pipeline component to get this portion of the received file name, and put this in a promoted property for each message.  You can then use this new promoted property for your correlation. 

    Thursday, April 18, 2013 8:33 AM
  • The most straightforward way would be to use a pipeline component to promote the file creation date.

    But you have to answer on couple questions:

    • what is the time interval for the creation of these two files? If it is a minute and the next twins will be created on the next day, you are in good position. If it is a minute and the next twins will be created in the next minute, you are not in a good position.
    • what if the file producer is down for some time and when it up, you have got several files in folder simultaneously?
    • what if the files are created on the day border, one at the 23:59:59 and the second at the 00:00:01? 

    I would avoid to use the date or time for correlation.

    But in my experience there is always something that can be used for correlation. If data has the logical relation, they must have some correlated data.


    Leonid Ganeline [BizTalk MVP] BizTalk: the Naming Conventions in Examples

    Thursday, April 18, 2013 4:31 PM
    Moderator

All replies

  • Hi,

    There are few things which needs to be taken care here.

    1. If you need both the messages to be received in your orchestration and then only move for further processing, in that case you need to use the parallel shape (Parallel Convoy). Here you have to create a correlation type as well and initilaise it on both the receive shapes.

    2. And if you need any of the message (whichever received first) should kick of the orchestration without waiting for the other one, in that case you need to use Listen shape.

    In both the cases, you will have to make the activation property as TRUE for both receives shapes in two branches.

    You can refer this link for more information.

    Thanks,

    Sumit


    Sumit Verma - MCTS BizTalk 2006/2010 - Please indicate "Mark as Answer" or "Mark as Helpful" if this post has answered the question


    Friday, April 12, 2013 5:35 AM
  • Hi ,

    Can you explain what is ur requirement in depth


    Manish

    Friday, April 12, 2013 6:22 AM
  • Use Sequential Convoys

    ,

    Regards

    MG

    Friday, April 12, 2013 8:27 AM
  • Use Sequential Convoys

    ,

    Regards

    MG

    Thank you for your reply,

    If I want to use two different receive ports to receive these 2 input messages, is it possible? Cause the two input messages have different schema, I don't think I can combine them into one port type.


    • Edited by Xiao Han Sunday, April 14, 2013 11:33 PM
    Sunday, April 14, 2013 11:23 PM
  • Hi,

    There are few things which needs to be taken care here.

    1. If you need both the messages to be received in your orchestration and then only move for further processing, in that case you need to use the parallel shape (Parallel Convoy). Here you have to create a correlation type as well and initilaise it on both the receive shapes.

    2. And if you need any of the message (whichever received first) should kick of the orchestration without waiting for the other one, in that case you need to use Listen shape.

    In both the cases, you will have to make the activation property as TRUE for both receives shapes in two branches.

    You can refer this link for more information.

    Thanks,

    Sumit


    Sumit Verma - MCTS BizTalk 2006/2010 - Please indicate "Mark as Answer" or "Mark as Helpful" if this post has answered the question


    My requirement is actually when I receive the input message for process B, I need to compare with the input message for process A first, filter the non-match ones, then keep process input message for process B.

    So when the orchestration is triggered, both messages must be received and available. I think parallel won't work in this case.

    For Sequential convoy, can I use two different receive ports rather than an combined one in M--G's example below? Because the schema types are different. So I don't think I can use a combined received port.

    Thank you.


    • Edited by Xiao Han Sunday, April 14, 2013 11:33 PM
    Sunday, April 14, 2013 11:29 PM
  • Yes two input message have different schema .

    it works only with single port with two operation .

    Any reason that you can not combine into one port type.

    Regards

    Mohit Gupta

    Monday, April 15, 2013 8:21 AM
  • Do you have to get A and B in specific order (A then B, or B then A) or A and B could be in any order?

    Leonid Ganeline [BizTalk MVP] BizTalk: the Naming Conventions in Examples

    Monday, April 15, 2013 9:06 PM
    Moderator
  • Yes two input message have different schema .

    it works only with single port with two operation .

    Any reason that you can not combine into one port type.

    Regards

    Mohit Gupta

    Do I need to create a correlation set for this solution? Because these 2 input messages are not related by any id, I can't think of any way to create a correlation set.

    If it works I don't mind to combine into one port type.

    Monday, April 15, 2013 9:54 PM
  • Do you have to get A and B in specific order (A then B, or B then A) or A and B could be in any order?

    Leonid Ganeline [BizTalk MVP] BizTalk: the Naming Conventions in Examples

    Both input messages are generated at the same time. But process B's input message is depended on process A's input message, because I need to do a comparison when I receive process B's input message.

    So I think the logic is when process B is triggered, process A's input message must be ready to use.

     
    Monday, April 15, 2013 9:55 PM
  • It could be a typical sequential convoy (please, google the Convoy Deep Dive article).

    More about convoys here: 

    BizTalk: Instance Subscription and Convoys: Details

    BizTalk: Suspend shape and Convoy


    Leonid Ganeline [BizTalk MVP] BizTalk: the Naming Conventions in Examples

    Monday, April 15, 2013 10:11 PM
    Moderator
  • It could be a typical sequential convoy (please, google the Convoy Deep Dive article).

    More about convoys here: 

    BizTalk: Instance Subscription and Convoys: Details

    BizTalk: Suspend shape and Convoy


    Leonid Ganeline [BizTalk MVP] BizTalk: the Naming Conventions in Examples

    Do I have to create a correlation set to use sequential convoy for this case?

    The two input messages are not really related by any id. They are transactions files.

    There are only one file each received everyday for this case, is there any other way to handle this situation?

    Thank you.

    • Edited by Xiao Han Tuesday, April 16, 2013 12:53 AM
    Tuesday, April 16, 2013 12:51 AM
  • The two input messages are not really related by any id. ...

    You have to find out the parameter which links A and B. period

    Let's see an example:

    we need to process A then B in the order.

    The producers of the A-s and B-s are independent.

    The input is: A1, A2, B1, A3, B3, A4, B2, B5,...

    How to select A1 and B1 in one process? There is nothing to "correlate", to link the related A-s and B-s, so we cannot select the sequence. Period.

    We could discuss the problem from the opposite way. If we cannot correlate An and Bn, the requirement to process An->Bn doesn't make sense. 

    So, please, investigate your case in details and make sure your requirement is correct. If it is correct, there must be the parameter(s) which links/correlates the messages.


    Leonid Ganeline [BizTalk MVP] BizTalk: the Naming Conventions in Examples

    Tuesday, April 16, 2013 4:03 AM
    Moderator
  • The two input messages are not really related by any id. ...

    You have to find out the parameter which links A and B. period

    Let's see an example:

    we need to process A then B in the order.

    The producers of the A-s and B-s are independent.

    The input is: A1, A2, B1, A3, B3, A4, B2, B5,...

    How to select A1 and B1 in one process? There is nothing to "correlate", to link the related A-s and B-s, so we cannot select the sequence. Period.

    We could discuss the problem from the opposite way. If we cannot correlate An and Bn, the requirement to process An->Bn doesn't make sense. 

    So, please, investigate your case in details and make sure your requirement is correct. If it is correct, there must be the parameter(s) which links/correlates the messages.


    Leonid Ganeline [BizTalk MVP] BizTalk: the Naming Conventions in Examples

    I found both files have the same creation date. So each file got generated everyday in file name format:
    20130418_ABC_Sales.txt
    20130418_ABC_Payment.txt
    I am not sure if there is any system built in correlation property I can use in BizTalk?
    Or I need to grab the date part from both files file name and use as a correlation set?
    Thursday, April 18, 2013 4:28 AM
  • As per Leonid's point, you have to have something to correlate on.  Looking at your file names, the file name up to the second underscore (i.e. 20130418_ABC) is what I would think you could use for your correlation.

    If this does not exist inside your file, then you will need a custom pipeline component to get this portion of the received file name, and put this in a promoted property for each message.  You can then use this new promoted property for your correlation. 

    Thursday, April 18, 2013 8:33 AM
  • The most straightforward way would be to use a pipeline component to promote the file creation date.

    But you have to answer on couple questions:

    • what is the time interval for the creation of these two files? If it is a minute and the next twins will be created on the next day, you are in good position. If it is a minute and the next twins will be created in the next minute, you are not in a good position.
    • what if the file producer is down for some time and when it up, you have got several files in folder simultaneously?
    • what if the files are created on the day border, one at the 23:59:59 and the second at the 00:00:01? 

    I would avoid to use the date or time for correlation.

    But in my experience there is always something that can be used for correlation. If data has the logical relation, they must have some correlated data.


    Leonid Ganeline [BizTalk MVP] BizTalk: the Naming Conventions in Examples

    Thursday, April 18, 2013 4:31 PM
    Moderator