Bitwise-And (&) predicate on BizTalk Orchestration activation filter expression
Hi all. One of the latest issues on BizTalk advanced usage I encountered was to activate several BizTalk orchestrations with the same published message, where one promoted field is distinguishing which orchestrations are activated.
Instantly, I suggested solving the issue by designating a special numeric (e.g. integer) field in the published message, which represents a binary value of orchestration activation state. E.g. value of "3" (101) in the field, means that orchestration 1 & 3 need to be activated, and orchestration 2 will not. After that stage I planned on using a filter expression in the orchestration activating receive shape, that will use the bitwise-and (&) predicate, between the numeric field and the orchestration "numeric value".
I was so sure the above scenario will work as planned! This is of a great experience in dealing with bitwise-and predicate with filtering in send ports that works really fine.
So after checking it in all direction I sadly found out it is not working. Visual Studio let us creating the above filter expression, but the compilation stage is failing with the following error: "illegal 'activate' predicate". Checking dipper we found that the Microsoft.XLANGs.Core.PredicateBase.Operators enumeration definition, responsible of the runtime aspects of the orchestration predicates, is no including the bitwise-and predicate.
We found that Microsoft explicitly documents that this predicate is not supported (by not including it in the supported predicates table in http://technet.microsoft.com/en-us/library/aa560178.aspx).
Alternatively, we resolved the issue in runtime. We implemented all the above steps with another predicate (e.g. NotEqual predicate), compiled and deployed the orchestrations. Now, after enlisting the orchestration (only after that), a new records are inserted for us in the [BizTalkMsgBoxDb].[dbo].[NotEqualsPredicates] table, for each orchestration filter expression definition. At this stage, we moved the records to [BizTalkMsgBoxDb].[dbo].[BitwiseANDPredicates] table. We started all the application components and …. All worked as designed!!!!!
This resolved the issue but is not supported by Microsoft.