Hi All,<div><br></div><div>I am new to Drools. I am working on a project where nature of rules are dynamic. I want to capture that rule which does not get executed. i need to store that rule because i have to display that rule in the UI.</div>
<div><br></div><div>Here is my rule file</div><div><br></div><div>rule "FrontAxle:Capacity|FrontSuspension:Capacity"</div><div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>when</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>b:Feature(featureClass.name=="FrontSuspension") </div><div><span class="Apple-tab-span" style="white-space:pre">                </span>c:Feature(featureClass.name=="FrontAxle")</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>//eval(b.getCapacity() >= c.getCapacity())</div><div><span class="Apple-tab-span" style="white-space:pre">                </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>then</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>System.out.println("These are compatible");</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>System.out.println(b.getFeatureClass().getName());</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>availablity.put(b.getFeatureClass().getName()+"-"+c.getFeatureClass().getName(),"12.35");</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>//availablity.put(b.getName()+"-"+c.getName(),new Double(b.getCapacity()));</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span> insert(availablity);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>end</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div>rule "FrontSuspension:Type|FrontAxle:Type"<span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>when</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>b:Feature(featureClass.name=="FrontSuspension") </div><div><span class="Apple-tab-span" style="white-space:pre">                </span>c:Feature(featureClass.name=="FrontAxle")</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>not Feature(b.attributes.Type=="I Beam" && c.attributes.Type=="Multi Link Air")</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>//NOT (FrontAxle.type = "I-Beam" AND FrontSuspension.type = "Multi-link Air") - mounting restriction<span class="Apple-tab-span" style="white-space:pre">                                                                                </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>then</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>System.out.println("I am in 2");</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>end</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div>rule "FrontAxle:FeatureCode|FrontSuspension:Type"</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>when</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>b:Feature(featureClass.name=="FrontSuspension") </div><div><span class="Apple-tab-span" style="white-space:pre">                </span>Feature(featureClass.name=="FrontAxle" && code=="002ASW")and not Feature(b.attributes.Type=="Multi Link Air" || b.attributes.Type=="Monoleaf Spring")</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>//FrontAxle.featureCode = "002ASW" AND NOT (FrontSuspension.type = "Multi-link Air" OR FrontSuspension.type = "Monoleaf Spring")</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>then</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>System.out.println("I am in 3");</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>end</div>
</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>now if these two objects named FrontAxle and FrontSuspension are compatible then it has to meet all the 3 rules, but if any combination of these objects does not meet one of the rule listed above then i have to store the rule for the displaying purpose that this combination didn't meet this rule thats why they are not compatible. any kind of help will be appreciated.</div>
<div><br></div><div><br></div><div><br></div><div>Thanks.</div>