If you read the documentation for Correlation Sets (here), you will see that it clearly states that:
“Each correlation set supports a maximum of three parameters.”
Now, the documentation for BizTalk 2010 is still subject to change, but you will find the same text in the documentation for previous versions.
The funny part is, that inside the Orchestration View, you are allowed to add as many properties to your Correlation Type as you please:
You will get no compiler error, as I would have expected, and no compiler warning, either.
I implemented a small orchestration that uses the Correlation Type seen above and it looks like this:
Basically, a message in, a transformation, an output and then a response back in. The “msg_FirstOut” initializes the correlation set and the “msg_SecondIn” follows it.
As mentioned, the compiler will not complain at all and I can deploy the solution. Once I send a message through, an instance subscription is created once the send shape has finished, and this surprisingly looks like this:
As you can see, ALL five properties are used in the instance subscription, which in effect means that the documentation is wrong.
So this brings me to the point; The documentation states, that you can only have three parameters (not sure why they call them parameters) in a Correlation Set, but this actually ONLY applies to Correlation Sets used in Convoys.
If I change my solution to utilize a parallel convoy like this:
or to be a sequential convoy like this:
then I still get no compiler warning or error no matter how many properties I have in my Correlation Type, but if I deploy the solution and try to start the orchestration, I get this error message:
“The maximum number of convoy set properties has been exceeded. A convoy set can only contain up to 3 properties.”
Now, you may very well ask, what is a convoy set? And yes, it is a bit confusing that the error message uses a term that is actually internal to BizTalk and not something your average BizTalk developer cares about. But a convoy set is simply a correlation set that is used in a convoy.
So this means, that for correlation sets that are used for convoys you can only have three properties, which actually comes from the fact that the table “ConvoySets” in the MessageBox database has three columns called “uidPropertyID1”, “uidPropertyID2”, and “uidPropertyID3” which contain GUIDs that are the GUIDs of the properties in the correlation set. So since only three fields exist in the database, only three properties can be in a convoy set.
So to me, it would nice if:
- The documentation was clear about the fact that the limitation only applies to correlation sets used in convoys
- The compiler would provide an error if you use more than three properties in a correlation set used in a convoy so you don’t ahve to wait until starting the orchestration to find that out.
Happy correlating and convoying out there!