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 &quot;FrontAxle:Capacity|FrontSuspension:Capacity&quot;</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==&quot;FrontSuspension&quot;) </div><div><span class="Apple-tab-span" style="white-space:pre">                </span>c:Feature(featureClass.name==&quot;FrontAxle&quot;)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>//eval(b.getCapacity() &gt;= 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(&quot;These are compatible&quot;);</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()+&quot;-&quot;+c.getFeatureClass().getName(),&quot;12.35&quot;);</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>//availablity.put(b.getName()+&quot;-&quot;+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 &quot;FrontSuspension:Type|FrontAxle:Type&quot;<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==&quot;FrontSuspension&quot;) </div><div><span class="Apple-tab-span" style="white-space:pre">                </span>c:Feature(featureClass.name==&quot;FrontAxle&quot;)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>not Feature(b.attributes.Type==&quot;I Beam&quot; &amp;&amp; c.attributes.Type==&quot;Multi Link Air&quot;)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>//NOT (FrontAxle.type = &quot;I-Beam&quot; AND FrontSuspension.type = &quot;Multi-link Air&quot;) - 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(&quot;I am in  2&quot;);</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 &quot;FrontAxle:FeatureCode|FrontSuspension:Type&quot;</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==&quot;FrontSuspension&quot;) </div><div><span class="Apple-tab-span" style="white-space:pre">                </span>Feature(featureClass.name==&quot;FrontAxle&quot; &amp;&amp; code==&quot;002ASW&quot;)and not Feature(b.attributes.Type==&quot;Multi Link Air&quot; || b.attributes.Type==&quot;Monoleaf Spring&quot;)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>//FrontAxle.featureCode = &quot;002ASW&quot; AND NOT (FrontSuspension.type = &quot;Multi-link  Air&quot; OR FrontSuspension.type = &quot;Monoleaf Spring&quot;)</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(&quot;I am in 3&quot;);</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&#39;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>