<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_1_1443619319298_51524"><span id="yui_3_16_0_1_1443619319298_51607">Hello Everyone,</span></div><div id="yui_3_16_0_1_1443619319298_51524"><span><br></span></div><div></div><div id="yui_3_16_0_1_1443619319298_51523"><div style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 34, 34); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 19.5px;" id="yui_3_16_0_1_1443619319298_51587" class="">I am new to Drools and have some questions. I am working on creating rules which detects customers in departments in a store.</div><div style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 34, 34); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 19.5px;" id="yui_3_16_0_1_1443619319298_51589" class="">My model is as below:&nbsp;</div><div style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 34, 34); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 19.5px;" id="yui_3_16_0_1_1443619319298_51589" class=""><br></div><div style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 34, 34); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 19.5px;" id="yui_3_16_0_1_1443619319298_51589" class="">Customer : Id, Point (x,y)</div><div style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 34, 34); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 19.5px;" id="yui_3_16_0_1_1443619319298_51589" class="">Department : Id, Rectangle</div><div style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 34, 34); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 19.5px;" id="yui_3_16_0_1_1443619319298_51589" class="">CustomerEvent</div><div style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 34, 34); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 19.5px;" id="yui_3_16_0_1_1443619319298_51591" class="">I currently have customers represented with x,y location or a point and a department is represented by rectangle.&nbsp;</div><div style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 34, 34); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 19.5px;" id="yui_3_16_0_1_1443619319298_51591" class="">1.) How do I write a rule to detect if a customer is in a rectangle?&nbsp;</div><div style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 34, 34); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 19.5px;" id="yui_3_16_0_1_1443619319298_51591" class="">2.) If a customer changes location within a department at least 2 times, trigger an event. How do I write a rule to detect if the customer is in a department and has changed location two times?<br></div><div style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 34, 34); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 19.5px;" id="yui_3_16_0_1_1443619319298_51593" class="">Please let me know.</div><div style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(34, 34, 34); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 19.5px;" dir="ltr" id="yui_3_16_0_1_1443619319298_51595" class="">Thanks!</div></div></div></body></html>