<HTML >
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">



<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:Verdana;
        color:windowtext;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:Verdana;
        color:blue;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>

</HEAD>
<BODY lang=FR link=blue vlink=purple>
<DIV>
<DIV>

<div class=Section1>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span lang=EN-GB
style='font-size:10.0pt;font-family:Verdana;color:blue'>I forgot to give the
priority of the booking rules in my example, here it is : <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span lang=EN-GB
style='font-size:10.0pt;font-family:Verdana;color:blue'>- BR1 : low priority (1<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span lang=EN-GB
style='font-size:10.0pt;font-family:Verdana;color:blue'>- BR2 : higher priority
(2)<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span lang=EN-GB
style='font-size:10.0pt;font-family:Verdana;color:blue'>- BR3 : same as BR2<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span lang=EN-GB
style='font-size:10.0pt;font-family:Verdana;color:blue'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span lang=EN-GB
style='font-size:10.0pt;font-family:Verdana;color:blue'>Sorry<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span lang=EN-GB
style='font-size:10.0pt;font-family:Verdana;color:blue'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Verdana><span lang=EN-GB
style='font-size:10.0pt;font-family:Verdana;color:blue'>Joel<o:p></o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>De&nbsp;:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <b><span style='font-weight:bold'>De
la part de</span></b> Costigliola Joel (EXT)<br>
<b><span style='font-weight:bold'>Envoy&#233;&nbsp;:</span></b> mercredi 28 octobre
2009 14:57<br>
<b><span style='font-weight:bold'>&#192;&nbsp;:</span></b> '<st1:PersonName w:st="on">Rules
 Users List</st1:PersonName>'<br>
<b><span style='font-weight:bold'>Objet&nbsp;:</span></b> [rules-users]
Specific Agenda strategy to control which rules to fire</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>Hello all,<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>I need some help to to set a specific Agenda
strategy in order to control finely which activated rules will be fired.<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>Problem context :<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>-----------------<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>My company is a bank where traders are making deals
on markets, these deals must be classified in book, this is what we call
&#8220;booking process&#8221;.<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>Booking is done according to booking criteria :
which trader has made the deal ? on which product ? wich market ? etc &#8230; <u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>A booking rule defines a set of criteria and the
target book where the deal will classified, it also has a priority, note that
it is ok that two booking rule have same priority. <u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>I want to implement booking rule as Drools rule.<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>Several booking rule can be applied to a deal, in
that case choosing the right booking rule to fire depends on the following
algorithm : <u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>- look all the activated booking rule of the
highest priority, <u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>--- if there is a unique rule apply it<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>--- if there is no unique rule (0 rule or more than
one), look at rules of a lesser priority and apply the same logic.<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>Next section is an example that will clear things
(I hope).<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>Example :<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>---------<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>A deal D1 has been done by Alex on NY market to buy
Google stocks.<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>We have 3 booking rules : <u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>- BR1 : criteria = trader=Alex / book = B1<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>- BR2 : criteria = trader=Alex and product = google
stock / book = B2<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>As BR2 is more precise than BR1, il will matches
the deal and book it in B1<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>If the deal was on another product, BR1 would have
been applied.<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>Things gets more complicated when 2 rules of same
priority can be applied. <u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>Let's imagine we add the following booking rule <u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>- BR3 : criteria = trader=Alex and market = NY /
book = B3<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>We have a problem to book D1 since BR2 and BR3 can
be applied but have same priority. <u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>We can't choose one over the other thus we must
apply a less precise/prioritary rule (if unique at its own precision level).<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>In my example, that would lead to apply BR1.<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>Question :<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>----------<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>If I define BR1,BR2,BR3 as Drools rules, how can I
tell Drools : <u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>- to execute a rule only if there is no other
active rule with same precision that could be applied ?<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>- to look for a unique matching rule with less
precision level ?<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>I think it's the Agenda responsibility to take this
decision, but I don't know how implement that.<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>Can you give some advices on that ?<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span lang=EN-GB style='font-size:
10.0pt;font-family:Verdana'>Thanks for your lights in advance,<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span style='font-size:10.0pt;
font-family:Verdana'>Regards,<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span style='font-size:10.0pt;
font-family:Verdana'><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span style='font-size:10.0pt;
font-family:Verdana'>Joel<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Verdana><span style='font-size:10.0pt;
font-family:Verdana'><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><u1:p>&nbsp;</u1:p><o:p></o:p></span></font></p>

</div>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center>

</span></font></div>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=2 color=black face="Times New Roman"><span
style='font-size:10.0pt;color:black'>Ce courriel et toutes les pi&#232;ces jointes
sont confidentiels et peuvent &#234;tre couverts par un privil&#232;ge ou une protection
l&#233;gale. Il est &#233;tabli &#224; l&#8217;attention exclusive de ses destinataires. Toute
utilisation de ce courriel non conforme &#224; sa destination, toute diffusion ou
toute publication, totale ou partielle, est interdite, sauf autorisation
expresse pr&#233;alable. Toutes opinions exprim&#233;es dans ce courriel ne sauraient
n&#233;cessairement refl&#233;ter celle de Natixis, de ses filiales. Elles sont aussi
susceptibles de modification sans notification pr&#233;alable. Si vous recevez ce
courriel par erreur, merci de le d&#233;truire et d&#8217;en avertir imm&#233;diatement
l&#8217;exp&#233;diteur. L&#8217;Internet ne permettant pas d&#8217;assurer l&#8217;int&#233;grit&#233; de ce
courriel, Natixis d&#233;cline toute responsabilit&#233; s&#8217;il a &#233;t&#233; alt&#233;r&#233;, d&#233;form&#233; ou
falsifi&#233; et chaque destinataire qui utilise ce mode de communication est
suppos&#233; en accepter les risques.</span></font> <o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=2 color=black face="Times New Roman"><span
style='font-size:10.0pt;color:black'>This email and any attachment are
confidential and may be legally privileged or otherwise protected from
disclosure. It is intended only for the stated addressee(s) and access to it by
any other person(s) is unauthorised. Any use, dissemination or disclosure not
in accordance with its purpose, either in whole or in part, is prohibited
without our prior formal approval. Any opinion expressed in this email may not
necessarily reflect the opinion of Natixis, its affiliates. It may also be
subject to change without prior notice. If you are not an addressee, you must
not disclose, copy, circulate or in any other way use or rely on the
information contained in this email. If you have received it in error, please
inform us immediately and delete all copies. The Internet can not guarantee the
integrity of this email therefore Natixis shall not be liable for the email if
altered, changed or falsified and anyone who communicates with us by e-mail is
taken to accept these risks.</span></font> <o:p></o:p></p>

</div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center>

</span></font></div>

</div>

</div>

 </DIV>
<DIV>
</DIV>
<DIV>
<HR>
</DIV>
<DIV ALIGN="justify">
<FONT FACE="Arial" COLOR="gray" SIZE="1"><SPAN STYLE="FONT-SIZE: 12pt"><FONT FACE="Arial">
<FONT FACE="Times New Roman" COLOR="#000000" SIZE="3">
</FONT>
</FONT></SPAN></FONT>&nbsp;</DIV>
<DIV ALIGN="justify">
<FONT COLOR="gray"><SPAN STYLE="FONT-SIZE: 12pt"><FONT COLOR="#000000" SIZE="2">Ce courriel et toutes les pi&#232;ces jointes sont confidentiels et peuvent &#234;tre couverts par un privil&#232;ge ou une protection l&#233;gale. Il est &#233;tabli &#224; l&#8217;attention exclusive de ses destinataires. Toute utilisation de ce courriel non conforme &#224; sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse pr&#233;alable. Toutes opinions exprim&#233;es dans ce courriel ne sauraient n&#233;cessairement refl&#233;ter celle de Natixis, de ses filiales. Elles sont aussi susceptibles de modification sans notification pr&#233;alable. Si vous recevez ce courriel par erreur, merci de le d&#233;truire et d&#8217;en avertir imm&#233;diatement l&#8217;exp&#233;diteur. L&#8217;Internet ne permettant pas d&#8217;assurer l&#8217;int&#233;grit&#233; de ce courriel, Natixis d&#233;cline toute responsabilit&#233; s&#8217;il a &#233;t&#233; alt&#233;r&#233;, d&#233;form&#233; ou falsifi&#233; et chaque destinataire qui utilise ce mode de communication est suppos&#233; en accepter les risques.</FONT></SPAN></FONT>
</DIV>
<DIV ALIGN="justify">
<FONT COLOR="gray"><SPAN STYLE="FONT-SIZE: 12pt"></SPAN></FONT>&nbsp;</DIV>
<DIV ALIGN="justify">
<FONT COLOR="gray"><SPAN STYLE="FONT-SIZE: 12pt"></SPAN></FONT>
<FONT COLOR="gray"><SPAN STYLE="FONT-SIZE: 12pt"><FONT COLOR="#000000" SIZE="2">This email and any attachment are confidential and may be legally privileged or otherwise protected from disclosure. It is intended only for the stated addressee(s) and access to it by any other person(s) is unauthorised. Any use, dissemination or disclosure not in accordance with its purpose, either in whole or in part, is prohibited without our prior formal approval. Any opinion expressed in this email may not necessarily reflect the opinion of Natixis, its affiliates. It may also be subject to change without prior notice. If you are not an addressee, you must not disclose, copy, circulate or in any other way use or rely on the information contained in this email. If you have received it in error, please inform us immediately and delete all copies. The Internet can not guarantee the integrity of this email therefore Natixis shall not be liable for the email if altered, changed or falsified and anyone who communicates with us by e-mail is taken to accept these risks.</FONT></SPAN></FONT>
</DIV>
<P CLASS="MsoNormal" ALIGN="justify">
<HR>

<P>
</P>
<P>
</P>
</P>
</DIV></BODY></HTML>