<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Hi all,<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>I have a general question regarding best practice or perhaps better put as right architecture design.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>We are using Drools (Expert in particularly) to model and execute the behavior aspects of our service, which revolves around meeting scheduling between various users.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>My main challenge is how to properly structure the rules so that they provide the desired flexibility to both modify and control over time.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Following is a small example which illustrates my question:<o:p></o:p></p><p class=MsoNormal>I need to determine a specific execution time and it is based on many conditions and in general about 15 scenarios where I create a rule per scenario. I find that there is a wide set of conditions that are common to all scenarios.<o:p></o:p></p><p class=MsoNormal>So for example a rule would look like: <o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>when <o:p></o:p></p><p class=MsoNormal>a1 == X1<o:p></o:p></p><p class=MsoNormal>a2 == X2<o:p></o:p></p><p class=MsoNormal>a3 == X3<o:p></o:p></p><p class=MsoNormal>a4 == X4<o:p></o:p></p><p class=MsoNormal>b1 == Y1<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Then <o:p></o:p></p><p class=MsoNormal>Something &#8230;<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Another rule would be <o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>when <o:p></o:p></p><p class=MsoNormal>a1 == X1<o:p></o:p></p><p class=MsoNormal>a2 == X2<o:p></o:p></p><p class=MsoNormal>a3 == X3<o:p></o:p></p><p class=MsoNormal>a4 == X4<o:p></o:p></p><p class=MsoNormal>b2 == Y2<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Then <o:p></o:p></p><p class=MsoNormal>Something else &#8230;<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>As you can see I am duplicating the a&#8217; conditions which are the common conditions and the b&#8217; is a new unique condition. It seems to me like a poorer code maintainability and possibly performance reduction (but I may be wrong, perhaps this is how rules should be written).<o:p></o:p></p><p class=MsoNormal>I assume this is a common case in rules so my question is what would be the best way (architecturally wise) to implement such cases (e.g. insert a new class that indicates that conditions a&#8217; are set and base the rules on the existence of such a class)<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Thanks <o:p></o:p></p><p class=MsoNormal>Hezi &nbsp;<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></body></html>