locked
Biztalk Parallel Convoy establishing correlation RRS feed

  • Question

  • hi,

    I have a scenario where i get 2 xmls named like xxx_001.xml and YYY_001.xml and I have to establish correlation by seeing the part of the file name after _(underscore).in the above case its 001 once after doing this orchestration kick starts.

    I don't know how to extract the file name and pass it to establish correlation in a Parallel convoy. can you help me with this?

    Friday, February 6, 2015 5:16 PM

Answers

  • We have few options:

    • You can have a promoted file in the message you send out. In Orchestration in Message Assignment shape, where use similar code:
    //In Orchestraion declare string variable-sFileName 
    sFileName = System.IO.Path.GetFileNameWithoutExtension(msgYourInboundMessage(FILE.ReceivedFileName));
    
    //Following line will just extract part after the underscore from the file name like 001      
    //Assign the extract value to the context of the message 
    msgYourOutboundMessage(YourPropertySchema.ElementWhichIsPromoted) = sFileName.Substring(sFileName.IndexOf('_') + 1);

    Ensure your correlation type is based on the above promoted field.

    • Other option as said, do the same in the custom send pipeline component.


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

    • Proposed as answer by SOS 111 Monday, February 9, 2015 9:08 PM
    • Marked as answer by Angie Xu Monday, February 16, 2015 7:37 AM
    Friday, February 6, 2015 7:19 PM

All replies

  • Do i have to use Custom pipeline or helper class to achieve it?
    Friday, February 6, 2015 5:28 PM
  • Yes, you have to implement the pipe component and promote a file name part (the part after '_' : 001,...). There are plenty samples in internet how to do this promotion (it is not Write() it is Promote()!)

    Then in orchestration create a correlation set, based on this property.


    Leonid Ganeline [BizTalk MVP]

    Friday, February 6, 2015 6:06 PM
    Moderator
  • While you don't have to use a custom Pipeline Component, that would be the 'preferred' way to extract and Promote your correlation value.

    You could do the same in an Orchestration.

    Friday, February 6, 2015 7:19 PM
    Moderator
  • We have few options:

    • You can have a promoted file in the message you send out. In Orchestration in Message Assignment shape, where use similar code:
    //In Orchestraion declare string variable-sFileName 
    sFileName = System.IO.Path.GetFileNameWithoutExtension(msgYourInboundMessage(FILE.ReceivedFileName));
    
    //Following line will just extract part after the underscore from the file name like 001      
    //Assign the extract value to the context of the message 
    msgYourOutboundMessage(YourPropertySchema.ElementWhichIsPromoted) = sFileName.Substring(sFileName.IndexOf('_') + 1);

    Ensure your correlation type is based on the above promoted field.

    • Other option as said, do the same in the custom send pipeline component.


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

    • Proposed as answer by SOS 111 Monday, February 9, 2015 9:08 PM
    • Marked as answer by Angie Xu Monday, February 16, 2015 7:37 AM
    Friday, February 6, 2015 7:19 PM
  • Hi,

    Check the  context of your message. You can have a correlation defined based on that and have your second receive shape listen to it.

    Monday, February 9, 2015 9:08 PM
  • As a reminder, FILE.ReceivedFileName is not Promoted by default in the Pipeline so cannot be used for a Correlation unless it is Promoted either by a custom Pipeline Component or an Orchestration.
    Monday, February 9, 2015 9:26 PM
    Moderator
  • Hi Sujith,

    Please Follow the below steps


    1) In custom receive pipeline component promote Property 'SomeId' from ReceivedFileName field(You have to put logic to take only value after Underscroe "_")

    2)In you orchestration create correlation Type from  File.ReceivedFileName

    3) You can created correlation Set on the above created Correlation Type

    Thanks &Regards,

    -Ammu


    • Edited by Ammu_Biz Tuesday, February 10, 2015 7:58 PM
    Tuesday, February 10, 2015 5:38 AM