locked
BizTalk Correlation RRS feed

  • Question

  • Hi All,

    We have a scenario in which we need to implement the below logic:

    We are receiving a Order Msg in which if Type(field from schema) =1 then it means it is a Buy Msg and if Type = 2 then it will be a Sell Msg

    Now,

    If a Sell order message contains tag 58 = CFXMASH, then We need to wait(indefinitely) for a Buy order message with tag 58 = CFXMASH , Client Order ID of Buy message = SecondaryClOrdID of the Sell message , SecondaryClOrdID of the Buy message = Client Order ID of the Sell message.

    Similarly,

    If a Buy order message contains tag 58 = CFXMASH, then We need to wait(indefinitely) for a Sell order message with tag 58 = CFXMASH , Client Order ID of Buy message = SecondaryClOrdID of the Sell message , SecondaryClOrdID of the Buy message = Client Order ID of the Sell message.

    Once we have both the correlated Sell and Buy, then we need to send the message to Target system 

    Please Help.

    Wednesday, November 6, 2013 1:56 PM

Answers

All replies

  • This could be treated as a conditional convoy pattern (convoy required correlated receive), conditional because if Tag 58 not = CFXMASH then no need to branch into the correlated receive.

    So you have OrderType & Tag 58 as two of the properties in the correlation set. However, ONLY these two would not work. You would need to identify a third/fourth property (such as Buy & Sell the same Product/Quantity). The jugglery of the ClientOrderId & SecondaryCIOrdID is something you;d do on receiving a successfull correlated message.

    Regards.

    Wednesday, November 6, 2013 2:46 PM
  • Thanks Shankycheil for your quick reply.

    Can anyone please throw some more light on how to achieve this technically.

    Regards,

    Ali

    Thursday, November 7, 2013 5:23 AM
  • Refer to Sequential Convoys @http://msdn.microsoft.com/en-us/library/aa561843.aspx and using correlation in orchestrations @http://msdn.microsoft.com/en-us/library/aa578692.aspx.

    You might also want to review promoted properties @http://msdn.microsoft.com/en-us/library/aa561535.aspx

    Regards.

    Thursday, November 7, 2013 8:46 AM
  • Hi Help,

    The scenario has been modified slightly by the client, so the modified requirement is as below.

    We are receiving a Order Msg in which if Type(field from schema) =1 then it means it is a Buy Msg and if Type = 2 then it will be a Sell Msg

    If we receive a Sell message then we need to wait for the corresponding Buy message having ClientId of Sell message = SecondaryClientOrderId of Buy message, if it matches send the output, but suppose again a Sell message comes instead of a Buy message having a different ClientId  then a new orchestration instance should start and it has to wait for its corresponding Buy message matching both the ClientId and SecondaryClientId, also if a Buy message comes in between then also a new instance should start and it has to wait for the Sell message having SecondaryClientId of Buy = ClientId of Sell.

    Please help on how to implement it technically in BizTalk:).

    Thanks In Advance,
    Ali Mahedi

    Monday, November 18, 2013 9:16 AM
  • Hi Ali,

    Your requirement can be implemented by implementing parallel convoy.

    In parallel shape processing of later shapes only happens if all the branches are executed successfully.

    In your case correlation id should be combination of Type and ClientID.

    Please see the below link which provides one example having similar requirement as yours.

    http://allcomputers.us/windows_server/biztalk-2010-recipes---orchestrations---configuring-parallel-convoys.aspx

    Let us know if you are facing any issue.


    Thanks,
    Prashant
    ----------------------------------------
    Please mark this post accordingly if it answers your query or is helpful.

    Monday, November 18, 2013 9:27 AM
  • Hi Prashant,

    I have used parrallel convoy for receiving Buy and Sell messages(filter on Orch Receive shape side==1 and side ==2), now how can we receive its corresponding Sell and Buy messages?

    Thanks,

    Ali Mahedi

    Monday, November 18, 2013 1:59 PM
  • You can correlate message based on Product/Quantity. Once correlated you'd need to then do the assignments related to seller id/client id.

    Regards.

    Monday, November 18, 2013 2:04 PM
  • Hi Ali,

    In case of parallel convoy if one branch is initiated it waits for its corresponding(corelated) branch automatically.

    So let say in your case you have two branches one for sell and other for Buy. 

    Case 1- Lets say you have received Sell invoice, in this one instance of orchestration will be initiated and it will be waiting for its corresponding Buy message. Once it receives the Buy message with same co-rellation id it will continue further processing.

    Case2- In this case it acts for the reverse case of above one.

    So, every time it receives any message with New correlation id, it will trigger/instantiate a new branch which will be waiting for its corresponding co-related message of other branch.

    If you see the example shared earlier may be it will helpful.


    Thanks,
    Prashant
    ----------------------------------------
    Please mark this post accordingly if it answers your query or is helpful.

    Monday, November 18, 2013 7:17 PM