(Flexible) correlation, custom code or expression?

Home Page Forums BizTalk 2004 – BizTalk 2010 (Flexible) correlation, custom code or expression?

Viewing 1 reply thread
  • Author
    Posts
    • #20459

      Hi,
      I posted the problem below eariler, but here is the the problem put in a more descriptive way:

      I have two clients  (A,B)sending messages to two receive ports. Message type for both are .net classes written by myself (using WCF and data contract serializer). From the messages i need to create a third message and send it forward.

      I don’t know in which order the clients are sending the messages, so I figured I need to use the parallel shape(?). The problem for me comes with the correlation, since the only logic available is to compare the “ReadTime” -value coming in the message from A to “ObservationTime” coming in the message from B.

      The logic for combining these two is that I know that the “ReadTime” is three seconds less than “ObservationTime”. If this is true I can process the messages.

       

      Thank you for your help.

    • #20461

      BizTalk only allows you to use “equals” comparisons for correlation.  What you can do is write a custom pipeline component to add another context property to one of the messages.  For the ObservationTime message, you can calculate the read time (ObservationTime – 3) and add the ReadTime property onto that message.  Then just correlate on ReadTime.  will that work?

      • #20472

        I didn’t mention that the difference between ObservationTime and Readtime is between 0-3 seconds, I can’t know for sure. Also, the relationship of messages is not 1:1. I have 100 ObservationTimes for each arriving ReadTime message. Should I do somekind of loop?

         

        Thank you for helping me out.

        • #20475

          Can you clarify the relationship between ObservationTime messages and ReadTime messages?

          I’m thinking that if you can receive 100 OT messages into the same orchestration, then an RT message that kicks off your third message, why do you need to worry about the time that they come in? Or is it that the RT message can only be associated with those OT messages received < 3 seconds ago? If you don’t need to worry about the time, just create your correlation on MessageType.

          In terms of practically writing this orchestration, You will need a parallel orchestration to accept OT messages on one side and RT messages on the other. On the RT side of the parallel shape, you will need to create a sequential convoy to accept the OT messages in a loop. However, this is a bit theoretical and I’m assuming that you can do this – you will need to try it out.

          Rgds, Nick.

           

          • #20476

            Yes, the only thing that I can use to associate the messages with time only (less than 3 seconds). It’s not the arrival time of these messages, but a datetime value in both of the messages I can do the association with.

            • #20477

              Anon,

              As ruselw pointed out, BizTalk only allows you to use “equals” comparisons for correlation; so if you are using the received time of the OT message for correlation to the nearest second, you are likely to get tens of orchestrations, rather than a single orchestration with tens of correlated messages (as a received time of 10:10:10 is different to 10:10:11 for example).

              I therefore don’t think what you’re looking to acheive is (IMHO) possible – is there any other correlation properties you can use to acheive the same effect? Can you possibly explain the process behind these messages so we can (possibly) offer an alternative?

              Rgds, Nick.

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.