Should/can a BizTalk BRE ruleset have multiple versions?
I've been given an export of some BRE rules and noticed that some of the rulesets have got multiple <version>
elements, e.g.
<brl xmlns="http://schemas.microsoft.com/businessruleslanguage/2002">
<ruleset name="ExampleRule">
<version major="1" minor="3" date="2013-04-17T19:02:05.748159+01:00" />
<version major="1" minor="0" date="2013-04-17T19:05:58.2361695+01:00" />
<...
<ruleset name="ExampleRule">
<version major="1" minor="2" date="2013-03-29T08:23:43.6502257+00:00" />
<...
Is this valid?
Multiple deployed versions of a Policy are supported by the BRE itself and in the API you can specify a version number by overload, otherwise, the highest deployed version is used.
However, specifying a specific Policy version is not supported by the Call Rules Shape. So, the Call Rules Shape will always use the highest deployed version of a Policy.
Whether or not you maintain multiple versions depends on the app in question. I have seen cases where this is required for the business process or maybe regulatory needs. A way to accomodate this in BizTalk is to use a "Master Policy" in the Orchestration which internally figures out and executes the appropriate Sub-Policy version.
As for the version elements, this appears to be a valid construct but I can't reproduce it. The Wizard will only export one version or a Policy at a time, so, this was either exported in code using the API or was cut-and-paste together. I have used the API and not noticed this.
Either way, the import function will apply the version info from the last version element in the xml, not the highest version, so if you reorder the version elements, you will get inconsistent results.
And one final wrinkle, the multiple version elements are preserved in the same order through import/export.