<p dir="ltr">The guided rule editors really, really, I mean really, do not handle multiple classes with the same simple name in different packages at all well.</p>
<p dir="ltr">Even if you only use a single class in a single rule (I.e. do not attempt to use x.y.z.MyClass and a.b.c.MyClass) the overall DRL being compiled can lead to issues as you're effectively creating:</p>
<p dir="ltr">"import x.y.z.MyClass</p>
<p dir="ltr">rule a<br>
when<br>
MyClass (...)<br>
...<br>
end"</p>
<p dir="ltr">and</p>
<p dir="ltr">"import a.b.c.MyClass</p>
<p dir="ltr">rule b<br>
when<br>
MyClass (...)<br>
...<br>
end"</p>
<p dir="ltr">I suspect issues to arise with class FQCN resolution in at least one of those rules.</p>
<p dir="ltr">If you cannot use different simple names then my advice is to use free-form DRL for these classes; using the FQCN in the rule and exclude the imports (from the "Config" tab).</p>
<p dir="ltr">Sent on the move</p>
<div class="gmail_quote">On 11 Jul 2014 18:37, "Sumit Dhaniya" <<a href="mailto:sumitdhaniya@gmail.com">sumitdhaniya@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I've two classes with same name but in different packages.<br>
I created several guided rules which use these classes when I validate<br>
individual rules they get validated but when I try to Build and Deploy the<br>
project it fails cause it try to find a field in another class.<br>
<br>
Unable to create Field Extractor for 'isPH'Field/method 'isPH' not found for<br>
cla<br>
ss 'com.****.****.db.user.TmSlot'<br>
: [Rule name='ProducerHour']<br>
org.drools.core.RuntimeDroolsException: Field/method 'isPH' not found for<br>
class<br>
'com.****.****.db.user.TmSlot'<br>
<br>
Unable to Analyse Expression isPH == true:<br>
[Error: unable to resolve method using strict-mode:<br>
com.****.****.db.user.TmSlot.isPH()]<br>
[Near : {... isPH == true ....}]<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Error-due-to-same-class-name-tp4030304.html" target="_blank">http://drools.46999.n3.nabble.com/Error-due-to-same-class-name-tp4030304.html</a><br>
Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div>