biztalkbiztalk-2010biztalk-orchestrations

BizTalk find ID


We have BizTalk 2010.
Description task:
First system send message with:
- ID in First system
- ID in Second system

Second system receive message and send another message with:
- Confirmed received message number
- ID in First system
- ID in Second system
.
Questions:
1. What is the best way find ID in Second system in next time?
e.g.
-------------------------------------
Mess1 from First System
IntIdMess1 = 123456789
IdFirst = 1
IdSecond = Empty
-------------------------------------
Mess2 from Second System
IntIdMess2 = 9876545432
Confirmed = 123456789
IdFirst = 1
IdSecond = 367
-------------------------------------
Mess2 from First System
IntIdMess1 = 534735648
IdFirst = 1
IdSecond = 367

How I can find 367 for Mess2 using Orchestration in BizTalk?
Or other way I can use?


Solution

  • What you need to use are what is are called correlations.

    Depending on the situation you are either going to need one or two correlations sets, depending if the the Confirmation message from Second system is Synchronous or Asynchronous. I will assume Asynchronous as that is the more complex

    You will need to define two correlation sets, one for IntIdMess1, lets call it IntIdMess1Corr and the other for IdSecond, lets call it IdSecondCorr

    Orchestration receives Mess1 from System1 via a Receive Shape and sends it to System2 via a Send shape, you need the Initializing Correlation Sets and this Send Shape configured to the IntIdMess1Corr.

    Then you will have a Receive Shape that gets the Confirmed message from System2, this receive shape will have the Following Correlation Sets set to IntIdMess1Corr and the Initializing Correlation Sets configured to IdSecondCorr.

    Then you will have another receive shape to receive the last shape where the Following Correlation Sets is configured to IdSecondCorr.

    When you initialize an correlation, the Orchestration will publish a Instance Subscription. That is, it is looking for a message with the Promoted Properties that are specified.