none
Correlation types in Loops RRS feed

  • Question

  • Hello All,

    I have an existing orchestration with correlations. Now I want to convert this orchestration to a sequential convoy so, I have created the new correlation but when I use this I am getting an error that the correlation type can be used only once. I googled a bit and it seems that I have to keep the previous correlations in separate scopes if I want to use them in a loop. But, due to my current orchestration design I cannot keep the existing correlations in different scopes.

    So, what I was thinking was I create a new orchestration and receive the message there start the loop with the correlation for sequential flow and then instead of having a send port I will have a start orchestration shape in the loop which will start my original orchestration and then after the start orchestration I can have my 2nd receive shape with the following correlation type.

    Just wanted to know if this would work as in this I will just be starting the original orchestration in my sequential convoy loop

    Monday, April 17, 2017 10:40 AM

Answers

  • Okay I found a way to use the filter and the loop for sequential convoy together which is very straight forward. There is a property on the logical receive port called ordered delivery. I just set it to True and I am able to build the solution.

    Now the issue that I am having is that when I process the message it is not getting any subscriptions. but when I see the subscriptions in the BizTalk console I can see that the orchestration subscription is there along with the receiveportname and the account number and both are set as exists.
    • Marked as answer by abhinav bansal Wednesday, April 19, 2017 2:25 PM
    Wednesday, April 19, 2017 11:28 AM
  • You have actually two unrelated problems here.

    Regardless of the additional Enriched filter, you can't republish the same Message Type with the same Promoted Properties in the Correlation set.  Meaning you will have to not Promote AccountID and/or Enriched on the result message anyway.

    So, any Messages Published by the Called Orchestration can't match the Correlation properties no matter what.

    • Marked as answer by abhinav bansal Wednesday, April 19, 2017 2:25 PM
    Tuesday, April 18, 2017 2:55 PM
    Moderator

All replies

  • Hi abhinav,

    Can you please provide more information on the current orchestration flow and ho the correlations are used there and what your new process is supposed to achieve. It will be helpful for us and we can provide better solution in the case we know the requirements in details


    Mandar Dharmadhikari

    Monday, April 17, 2017 10:49 AM
    Moderator
  • Hello Mandar,

    The current orchestration has a very complicated and lengthy flow business-wise. The basic thing that is happening is that the incoming message tags are saved in a SQL table for logging purpose, there is some quantity and account number in the message which is checked with another table which has quantities for each account number, if the quantity of the message is more then some business logic takes place and if it is less then some other business logic takes place and in the end this quantity is updated in the table. There are 2 correlations used in this orchestration in a scope with an exception. if any of the process fails an exception message is created and an SQL entry is done.

    Earlier we were getting a message for a particular account number in 2-3 hours so there was no issue. But, now messages are coming for a particular account number within seconds so, I want to create a sequential convoy now so that the accounts are updated with the right quantities.

    I am checking the below link to implement seq convoy:

    http://tutorial.programming4.us/windows_server/BizTalk-2010-Recipes---Orchestrations---Maintaining-Message-Order.aspx

    As I cant use separate scopes for the existing correlations so, what I was thinking was I create a new orchestration and receive the message there start the loop with the correlation for sequential flow and then instead of having a send port I will have a start orchestration shape in the loop which will start my original orchestration and then after the start orchestration I can have my 2nd receive shape with the following correlation type.


    Monday, April 17, 2017 11:02 AM
  • Hello All,

    I have an existing orchestration with correlations. Now I want to convert this orchestration to a sequential convoy so, I have created the new correlation.

    Hi Abhinav,

    what is current orchestration is doing and what is requirement , if it is possible then please provide here,  then people will surely help here. 

    Monday, April 17, 2017 11:06 AM
  • Hello Giri,

    Please go through the reply above I have already provided the required info.

    Monday, April 17, 2017 11:16 AM
  • Hi abhinav,

    It's because the Correlation Set can only be initialized once
    per Scope.  But you already know that
    I think what you really want is a Self Correlating Ports.
    You can refer below link.
    https://msdn.microsoft.com/en-us/library/aa954477.aspx

    Regards,
    Ritesh

    Monday, April 17, 2017 11:46 AM


  • Earlier we were getting a message for a particular account number in 2-3 hours so there was no issue. But, now messages are coming for a particular account number within seconds so, I want to create a sequential convoy now so that the accounts are updated with the right quantities.

    So what you want now, you want to update the accounts with the latest quantity or do you wan to track each quantity corresponding to a account? 

    In this case you can you use your account number to create correlation set and type and based on your requirement (means when you want the next quantity for same account ) you can use the secind receive shape to receive second message from messagebox.

    Please make me wrong here if i understand your scenario wrong. 



    Monday, April 17, 2017 12:53 PM
  • Check your next receive shape correlation set properties, you need to set 'Following Correlation sets' property in case of sequential convoys. 

    Hope this might helpful :)


    ArunReddy

    Monday, April 17, 2017 1:11 PM
  • 99.9%, I know exactly what you're trying to do. 

    This article describes probably exactly what you need to do for the outer Orchestration.  The reason this is important is that you may need to gracefully stop processing for some reason while handling all message for a specific Account in order.

    Wiki Article: https://social.technet.microsoft.com/wiki/contents/articles/34656.biztalk-server-sending-control-messages-to-long-running-processes.aspx

    You would use a Call Orchestration (not Start) in the far left lane of the Listen Shape.

    Monday, April 17, 2017 1:11 PM
    Moderator
  • Hello John,

    Thanks for the answer. I have a couple of questions:

    1. in my initial receive shape where I am initializing the correlation set I have a filter set too. so when I build the solution it is giving me an error as in a sequential convoy there cannot be an activation filter unless the port is marked for OrderedDelivery

    Is there a workaround for the same?

    2. Below is the image of the orchestration that I have prepared, I have kept the call orchestration out of the listen shape and in the expression_1 shape I have set the loop as false. Is this okay?

    Monday, April 17, 2017 3:02 PM
  • You would not use any Filter for a Sequential Convoy.  The correlation is the Filter.

    Please use the Article and sample code as a reference.  Everything you need to do is there.

    I strongly recommend you implement the signal as well.

    Monday, April 17, 2017 3:59 PM
    Moderator
  • I cannot work without that filter in the receive port. So, does that mean that I wont be able to implement Sequential convoy ?
    Monday, April 17, 2017 4:05 PM
  • Please trust us, you don't need the Filter in the Receive Shape.

    What are you trying to filter on?  Please explain why you think you need a Filter.

    Monday, April 17, 2017 7:13 PM
    Moderator
  • Hey John,

    The filter is not related to the Convoy. Its a business need. I need to filter out the messages in the messagebox and receive only those which have one of the required promoted property as per the business logic.

    Tuesday, April 18, 2017 7:54 AM
  • Hi abhinav,

    You can try the following design. This is working for me for initializing correlation sets in a loop.

    ->Orchestration: transaction type: none
    -->Loop for sequential convoy
    --->Scope shape, transaction type: none
    ---->Define correlation set in the scope
    ---->Send shape that initializes the correlation set
    ---->Receive shape that follows the correlation set
    --->End of scope
    -->End of Loop

    Tuesday, April 18, 2017 10:48 AM
  • Is you situation similar to this:

    Promoted Property AccountID = 122345.

    Promoted Property AccountType = AAA (not BBB or CCC)

    An you only need to process AccountType = AAA.

    Tuesday, April 18, 2017 1:47 PM
    Moderator
  • The scenario is that the message that we are receiving in the orchestration has a promoted property called Enriched which is set as false initially. when we receive the message with promoted property as false we apply some BRE rules and then set Enriched property as True as we send this message again to the message box in our flow and hence don't want the orchestration to pick up the same message and then start processing it again.

    And as per your example it is exactly the case. We want to have convoying for account id but in the orchestration we want to process only accounttype = AAA

    Tuesday, April 18, 2017 2:00 PM
  • What I would do is have the Orchestration talk all AccountID = 12345 Message then internally skip the Enriched = True messages.

    All you need is a Decide Shape around the Call Orchestration.

    Yes, it means the Orchestration will pick up messages it doesn't really need to, but this is a very lightweight operation so don't worry about 'performance' unless you can prove it's an actual problem.

    Tuesday, April 18, 2017 2:25 PM
    Moderator
  • I feel if I do that the message might go in a loop. Also, the BizTalk orchestration would keep picking up messages which are not even required by it as after setting the enriched property to true it sends the message to 2-3 sql ports and I feel that those will also be picked up by the orchestration.
    Tuesday, April 18, 2017 2:45 PM
  • You have actually two unrelated problems here.

    Regardless of the additional Enriched filter, you can't republish the same Message Type with the same Promoted Properties in the Correlation set.  Meaning you will have to not Promote AccountID and/or Enriched on the result message anyway.

    So, any Messages Published by the Called Orchestration can't match the Correlation properties no matter what.

    • Marked as answer by abhinav bansal Wednesday, April 19, 2017 2:25 PM
    Tuesday, April 18, 2017 2:55 PM
    Moderator
  • There are 2 filters used in the orchestration, as it is a direct bound receive port so one of the filters is the messagetype and the other is the enriched one. So, even if I start receiving the messages for all enriched status how could I get the messages of this messagetype in the orchestration if I don't set it in the filter ?
    Wednesday, April 19, 2017 8:15 AM
  • Okay I found a way to use the filter and the loop for sequential convoy together which is very straight forward. There is a property on the logical receive port called ordered delivery. I just set it to True and I am able to build the solution.

    Now the issue that I am having is that when I process the message it is not getting any subscriptions. but when I see the subscriptions in the BizTalk console I can see that the orchestration subscription is there along with the receiveportname and the account number and both are set as exists.
    • Marked as answer by abhinav bansal Wednesday, April 19, 2017 2:25 PM
    Wednesday, April 19, 2017 11:28 AM
  • It looks like you've asked the next question in a new thread, perfect. You should mark the Answers and Helpful posts here for future readers.
    • Marked as answer by abhinav bansal Wednesday, April 19, 2017 2:25 PM
    • Unmarked as answer by abhinav bansal Wednesday, April 19, 2017 2:25 PM
    Wednesday, April 19, 2017 2:20 PM
    Moderator
  • that question was something diff but you are right will start a new thread for the new issue.. thanks for your time everyone.
    Wednesday, April 19, 2017 2:25 PM