<html dir="ltr"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style title="owaParaStyle"><!--P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
--></style>
</head>
<body ocsi="x">
<div dir="ltr"><font color="#000000" size="2" face="Tahoma">Hi,</font><font size="2" face="tahoma"></font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma">I'm&nbsp;currently working with a system where we have customers with different status flags. This could look something like:</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma">customer has bought a car and a bicycle -&gt;&nbsp;&quot;wheel&quot; status</font></div>
<div dir="ltr"><font size="2" face="tahoma">customer has bought a tent, a jacket and food -&gt; &quot;camper&quot; status</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma">Since these rules can be quite complex and change often using Drools would be a good&nbsp;way so solve the problem. The problem now is that we want to answer the question, what's needed to achieve &quot;camper&quot; status?
</font><font size="2" face="tahoma">When it comes to DRL this becomes that we want to know which LHS facts that are missing for the &quot;camper&quot; rule to fire, i.e. so we can tell the customer that in order to achieve &quot;camper&quot; status you also need to buy a tent
 when he/she already have bought a jacket and food.</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma">The solution we have so far is to add a number of&nbsp;&quot;negative&quot; rules in DRL that can identify the missing facts. Our concern though is that this doesn't scale since these extra rules become several more then the base
 rules that define the statuses.</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma">Is it&nbsp;possible to solve this in a general way with Drools, i.e. to find missing facts leading to a specific conclusion?</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma">And example of status rule in DRL would look something like:</font></div>
<div dir="ltr"><font size="2" face="tahoma">-----</font></div>
<div dir="ltr"><font size="2" face="tahoma">when</font></div>
<div dir="ltr"><font size="2" face="tahoma">&nbsp;&nbsp; BoughtCar( $c&nbsp;:&nbsp;customer )</font></div>
<div dir="ltr"><font size="2" face="tahoma">&nbsp;&nbsp; BoughtBicycle( customer == $c )</font></div>
<div dir="ltr"><font size="2" face="tahoma">then</font></div>
<div dir="ltr"><font size="2" face="tahoma">&nbsp;&nbsp; insert( new WheelStatus( $c ) );</font></div>
<div dir="ltr"><font size="2" face="tahoma">end</font></div>
<div dir="ltr"><font size="2" face="tahoma">-----</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma">The example above is of course just an example and not actual rules from our system.</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
<div dir="ltr"><font size="2" face="tahoma">Regards,</font></div>
<div dir="ltr"><font size="2" face="tahoma">David</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font>&nbsp;</div>
</body>
</html>