How does Business Rule work with priority and same conditions
-
Monday, April 16, 2012 5:25 AM
I am wondering how the priority works with rules with similar conditions, e.g.
Rule 1
Priority:0
Conditions:(Credit=1 or -1) and (Status=0) and (Tier=30)
Actions:(Set message="welcome") and (door open=true) and (Credit=1)
Rule 2
Priority:10
Conditions:(Credit=-1) and (Balance>100)
Actions:(Set code="Open") and (Credit=1)
What happens the original message matches both rules' conditions? Would rule 1 be applied to message first, then the updated message will be validated by Rule 2? or it will use the original message to validate all the rules?
All Replies
-
Monday, April 16, 2012 5:53 AM
Hi,
Rules with higher priority are executed first. So in the case of your example Rule 2 will be executed first. Check this blog post for a good explaination.
Regards,
Bali
MCTS: BizTalk Server 2010,BizTalk Server 2006 and WCF
My Blog:dpsbali-biztalkweblog
-----------------------------------------------------
Mark As Answer or Vote As Helpful if this helps.- Proposed As Answer by Rohit.SharmaMVP, Moderator Monday, April 16, 2012 7:05 AM
- Marked As Answer by Rohit.SharmaMVP, Moderator Friday, April 20, 2012 1:52 PM
-
Monday, April 16, 2012 6:29 AM
Hi,
Rules with higher priority are executed first in case if conditions match for both of them. When rules have same priority and condition matches any rule can be executed. Hence setting the priority is very important in case of probablities of multiple rules matching the condition.
Please refer to articles below,
Understanding Rule Execution in BizTalk Rule Engine
Order of execution of rules in BizTalk BRE
Also i would suggest you to have a look at the BizTalk Server Business Rule Engine: Survival Guide for help during your development.
Thanks With Regards,
Shailesh Kawade
MCTS BizTalk Server
Please Mark This As Answer If This Helps You.
http://shaileshbiztalk.blogspot.com/- Edited by Shailesh Kawade Monday, April 16, 2012 6:43 AM
- Proposed As Answer by Rohit.SharmaMVP, Moderator Monday, April 16, 2012 7:05 AM
- Marked As Answer by Rohit.SharmaMVP, Moderator Friday, April 20, 2012 1:52 PM

