<br> Eric, <br><br> Please do! Thanks,<br> <br> Edson<br><br><div><span class="gmail_quote">2007/7/26, Eric Miles <<a href="mailto:eric.miles@kronos.com">eric.miles@kronos.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Edson,<br><br>That certainly makes sense. However I'm fairly certain that in<br>referencing the inner class in rule definition, I always qualified it<br>with the outer class name, ie:<br><br>DataClass.AlternativeKey()
<br>or<br>AnotherClass.AlternativeKey()<br><br>I appreciate your explaination of the "merge" process. Rather than have<br>you spend any more time on this, I'll try to put together a test case to<br>ensure I was seeing the behavior I thought I was seeing. I probably
<br>won't get around to this until tonight or the weekend.<br><br>If I was mistaken, I'll let you (and the mailing list) know. If I was<br>not, would you like me to open a JIRA with the attached test case? I<br>
would assume that if the inner classes contain the qualified name that<br>the engine should be able to handle that?<br><br>Thanks,<br>Eric<br><br>Edson Tirelli wrote:<br>><br>> Eric,<br>><br>> Thanks, I understand now.
<br>><br>> What happens is that if both DRL files declare the same package<br>> name, all their contents will be merged. It means that you would end up<br>> with both imports in the same namespace:<br>>
<br>> import com.company.DataClass.AlternativeKey;<br>> import com.company.AnotherClass.AlternativeKey;<br>><br>> And so the engine will raise an error saying that it does not know<br>> which one you are refering to when you write simply:
<br>><br>> AlternativeKey<br>><br>> I think the engine behavior is correct, since the idea of loading<br>> two different files with the same name space into the same package<br>> builder is to merge them, or even replace (update) that eventually have
<br>> the same name.<br>><br>> What do you think?<br>><br>> Edson<br>><br>><br>> 2007/7/26, Eric Miles <<a href="mailto:eric.miles@kronos.com">eric.miles@kronos.com</a><br>> <mailto:
<a href="mailto:eric.miles@kronos.com">eric.miles@kronos.com</a>>>:<br>><br>> Edson,<br>><br>> I have since changed my schema but here was my issue:<br>><br>> rule1.drl:<br>> import
com.company.DataClass.AlternativeKey;<br>> import com.company.DataClass;<br>><br>> rule "Some rule"<br>> when<br>> DataClass.AlternativeKey(someParm == true)<br>> then
<br>> ...<br>> end<br>><br>> Different drlf file:<br>> rule2.drl<br>> import com.company.AnotherClass.AlternativeKey;<br>> import com.company.AnotherClass;<br>><br>> rule "Another rule"
<br>> when<br>> AnotherClass.AlternativeKey(diffParm == 1)<br>> then<br>> ...<br>> end<br>><br>><br>> This was the gist of what I was doing. The outer classes' names
<br>> were different, it was the INNER class of each of these classes that<br>> had the same name. I was actually getting compile errors on the<br>> import statements. Like I said, these rules worked fine if loaded
<br>> separately, but once I tried to put them all int he same rule base,<br>> I was getting the import collision error. Later on this evening<br>> (when I'm not at work), I'll try to put together a small test case
<br>> and upload it. In the meantime, you can look skim over this and let<br>> me know if something jumps out at you.<br>><br>> Thanks,<br>> Eric<br>><br>><br>> On Thu, 2007-07-26 at 10:32 -0300, Edson Tirelli wrote:
<br>>> Eric,<br>>><br>>> Not sure if I understood your problem, but if you have<br>>> multiple classes with the same name, and the only difference is<br>>> that they are inner classes of different classes, I guess what you
<br>>> need to do is to fully qualify your class names in your rules...<br>>><br>>> rule xxx<br>>> when<br>>> my.package.MyClass.MyInnerClass( ... )<br>>> ...<br>
>> end<br>>><br>>> If this is not your problem, can you please show us an example<br>>> so we understand it better?<br>>><br>>> Edson<br>>><br>>><br>>> 2007/7/25, Eric Miles <
<a href="mailto:eric.miles@kronos.com">eric.miles@kronos.com</a><br>>> <mailto:<a href="mailto:eric.miles@kronos.com">eric.miles@kronos.com</a>>>:<br>>><br>>> Due to how JAXB treats anonymous inner complex types, I ended
<br>>> up with a public static inner classes named AlternativeKey in<br>>> several of my data classes I have several rules written to<br>>> deal with each data class individually that all work ok.
<br>>> However, when I attempt to put them all in the same rule base<br>>> (all belong to the same package), I get an import collision<br>>> exception on the AlternativeKey inner class. Depending on
<br>>> where in the builder I add the resource depends on which<br>>> AlternativeKey the compiler bitches about (validity). I'm not<br>>> familiar with the source at all, so I'm unsure as to where to
<br>>> look for this. However, this sounds like a bug to me? There<br>>> is an easy workaround for this as I I just don't use anonymous<br>>> types and define them in my schema explicitly. Just thought
<br>>> I'd identify this as a possi ble issue.<br>>><br>>> Thanks,<br>>> Eric<br>>><br>>><br>>> _______________________________________________
<br>>> rules-users mailing list<br>>> <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a> <mailto:<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">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>>><br>>><br>>><br>>><br>>> --<br>>> Edson Tirelli
<br>>> Software Engineer - JBoss Rules Core Developer<br>>> Office: +55 11 3529-6000<br>>> Mobile: +55 11 9287-5646<br>>> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">
www.jboss.com</a> <<a href="http://www.jboss.com">http://www.jboss.com</a>><br>><br>><br>><br>><br>> --<br>> Edson Tirelli<br>> Software Engineer - JBoss Rules Core Developer<br>> Office: +55 11 3529-6000
<br>> Mobile: +55 11 9287-5646<br>> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a> <<a href="http://www.jboss.com">http://www.jboss.com</a>><br>><br>><br>> ------------------------------------------------------------------------
<br>><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">
https://lists.jboss.org/mailman/listinfo/rules-users</a><br><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">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> Software Engineer - JBoss Rules Core Developer
<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>