Integrating Integrators – BizTalk, Windows Azure, Windows Workflow, and Beyond

Initialize Correlation Set without a Send?

BizTalk 2004

This group is for all content related to BizTalk Server 2004. This includes a forum, samples, videos, labs, whitepapers, and tools. Most of the content here also applies to other versions of BizTalk beyond 2004.

Initialize Correlation Set without a Send?

  • rated by 0 users
  • This post has 11 Replies |
  • 1 Follower
  • It seems like there should be an initialize correlation shape!

    To get around the problem I posted earlier today about the parallel action shape, I'm considering starting two different orchestrations. I don't want to use the StartOrch shape because I need to continue when they are done.

    Thus, I was going to use a Send with direct binding, then have a gather-loop. The problem is that I might call Orch-X and I might call Orch-Y or I might not call either one (but each one will not be called more than once). I'm planning on doing a receive in a loop based on counter.

    If I keep the send that starts Orch-X and Orch-Y in a parallel shape for readability, then neither branch can initialize the correlation.

    My correlation will be a GUID in a SOAP-Header.

    If I switch to sequential where I might call Orch-X then I might call Orch-Y, then I guess I have to put the second Send under a decide shape that has to know if the previous Send already initialized correlation or not?

    Sorry if I'm babbling - life would be much easier if the parallel shape worked like I think it should.

    Any sympathetic souls out there?

    Neal Walters
    http://Biztalk-Training.com
  • I'll try to upload a picture later. I create a demo orch just to see what is possible...

    1) Receive TestOrderIn (activating receive)
    2) Map to TestOrderReq
    3) Under an Decide statement I send TestOrderReq
    The decide is based on x > 1, and x is initialized to 10.
    I initialize correlation set on the send.
    4) I have a second Decide statement, same critieria x> 1.
    I use the following correlation set on the receive.

    The compiler is trying to \"help\" me, and giving me error:
    error X2279: uninitialized correlation 'TestCorrelationInit.TestCorrInitOrch.Correlation_1'

    Of course, I know it is initialized because I know that my if statement is always true. So this gets back to my question in previous posts, is there a way to initialize correlation other than sending a message?

    It seems like one get around would be to send a dummy message.

    I know you can also initialize correlation on a receive, but might want to generate a GUID to use for the value of the correlation.

    This gets back to something else I've been trying to figure out.
    When is the subscription written to the database?
    I.e. when you use the subscription viewer, it is show us entries in a subscription table.

    Is the subscript set up:
    1) On the initialize correlation
    2) When a receive is encountered
    3) Send
    4) Other


    Here's another case - what about the scatter gather model?
    If you send out 10 messages, then receive 10 messages in a loop?
    What happens if the one of the 10 messages results in a return message before the last of the 10 messages is sent? This makes me think that the subscription must be entered on the Send?

    Thanks again - lost in correlation and parallel shape land.

    Neal Walters
    http://Biztalk-Training.com
  • Wow, you are getting deep on me…

    I think the parallel action shape is miss-leading. Typically, it is used for receive multiple messages. Not really do two tasks.

    I agree with you, I would love to see another way to initialize a correlation. Some made an adapter to no place (think its on gotdotnet) to help with this.

    If I remember right, subscriptions are created at the next persistence point (usually a Send) unless you are a Convoy. Then, the “correction” is handled outside of the Orchestration.

    Once you get into correlation you start getting into instance subscriptions. These are specific subscriptions that route messages to specific Orchestration instances and specific ports. I thought these could only be filled once – but not sure. In any loop case, I have always used a convoy to receive the messages.

    If you talk about the 10 messages, that would be a case for the parallel action shape to send the 10 messages and receive them back in any order.

    What if you used the Start Orchestration shape and passing in a configured port parameter on a Self-Correlation port? Not sure it that’s “parallel shape allowed” or not. I have a sample (without the parallel shape) that I’ll be posting to the site in a day or two.

    Doing that, you do not need a correlation at all.

    Does any of this rambling make sense? I’m a little rusty on my BizTalk internal knowledge…

    Stephen W. Thomas
    http://www.BizTalkGurus.com

  • Thanks a lot for the ideas. It's kind of hard to learn the internals unless they publish them or you are \"lucky\" enough to enter a few support tickets or time enough to do dozens of tests.

    As to the Start-Orch, I've never tried passing anything other than a variable and a message, but I've seen the other items there - I'll research that further. Also I'll have to read-up on Self-Correlation ports.

    Thanks again - it was a frustrating day thinking my orchestration was 95% done, then during final testing of the parallel the whole things falls apart.

    Neal Walters
    http://Biztalk-Training.com
    Neal Walters http://Biztalk-Training.com - Learn Biztalk Faster http://Sharepoint-Training.com - End-User Sharepoint Videos http://CMSTrainingVideos.com - WordPress, Joomla, PHP-Fusion videos
  • Hi Neal/Stephen, I have a similar issue like you have described. Did you get a solution for your problem? Could you please share the solution?

    Edit
  • What exactly are you trying to do?  Set up a correlation to receive a message?

    If you give me a little more detail I might be able to help.

    Stephen W. Thomas
    http://www.BizTalkGurus.com

  • I have to map nearly 50,000 messages. If I map one after other then it takes nearly 25 hours for mapping. S0 I want to instantiate parallel mapping by triggering multiple instances of an orchestration. I am planning to instantiate nearly 16 instances in a loop so that each instance can handle nearly 4000 messages. So I thought of initializing correlation set in a loop and send 16 message to a folder. these messages instantiates 16 child orchestrations. I need to know when all 16 are complete. So I have put a receive shape in a loop for the same correlation set. The it failed with a compilation error "a correlation may be initialized only once". If I have to initialize a correlation set in a scope in side the loop then I cannot use the correlation set in another loop to receive the message. Also, I want the programming logic to determine the number of instances (16 or more or less) so I was unable to use parallel shape. I will not be able to change the map to loop through messages as I have nearly 30 maps with very complex logic. I am thinking to change the orchestration rather than changing 30 maps.

    Basically, I am looking for parallel mapping in B1zTalk 2004 and the main orchestration need to know when all the mappings are complete. Any help would be great..!!!

    Edit
  • Stephen,  Do you have any suggestion for the above issue?

    Edit
  • Neil,

    >>  The it failed with a compilation error "a correlation may be initialized only once"

    Try using one send shape to initialize the correlation and another to send all subsequent messages.  Since you have already initialized a correlation set on the first one, if you are sending out other messages on the second send, that use the same correlation token, I belive your receive will pick these up as well.

     

    >> Also, I want the programming logic to determine the number of instances (16 or more or less) so I was unable to use parallel shape.

    Could you not two smaller loops inside of a bigger loop? One small loop would be to publish (n) number of messages at a time, the other would be to wait to receive all of the responses (scatter/gatherer as you spoke of earlier).  THese two loops would be contained inside of a bigger loop that knows when all of the mapping is complete. Not sure if this will allow you to complete your maps in the time frame you have available, but it should be faster than 25 hours.

    Hope this helps somewhat

    -Ben

  • Neal,

       Sorry for misspelling your name in my earlier post.

     

    -Ben

  • Please note that my original post was back in 2006 - someone else recently asked if there was a solution. That was two projects ago for me.

    I believe we ended up sending a dummy message.  We temporarily used a send to a flat file directory that we just purged regularly.  We also discovered that someone provided a free downloadable adapter, I believe one was called a NULL adapter and maybe one called a NOPE? adapter that just "ate" the messages.

    It's still ashame there is no "InitCorrelation" command.

    Neal

    Neal Walters http://Biztalk-Training.com - Learn Biztalk Faster http://Sharepoint-Training.com - End-User Sharepoint Videos http://CMSTrainingVideos.com - WordPress, Joomla, PHP-Fusion videos
  • This option has worked well for us.. Thank you Ben.

    >>  The it failed with a compilation error "a correlation may be initialized only once"

    Try using one send shape to initialize the correlation and another to send all subsequent messages.  Since you have already initialized a correlation set on the first one, if you are sending out other messages on the second send, that use the same correlation token, I belive your receive will pick these up as well.

    Edit
Page 1 of 1 (12 items)