<br><br> Drools 5 implements a completely new propagation algorithm that allowed us to get rid of shadow proxies from the core engine. So, you will not have the problem. <br> <br> But for 4.0.x, if you are a community user, best you can do is open a JIRA with a test case to reproduce your problem. If we release a 4.0.8 version, we can fix your issue there, but at this moment we don't know if there will be a 4.0.8 release or if the next release will be 5.0.<br>
If you are a Drools subscriber at Red Hat, then you can simply open a support case there and they will fix and provide a patch for you.<br><br> []s<br> Edson<br><br><br><br><div class="gmail_quote">2008/6/6 Sibylle Duerr <sibylle.duerr@mymail.ch>:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Thanks Edson,<br>
<br>
but the collections do return an empty collection. hm, I just tested this ones again and it worked fine. no exception when the set was empty. I will keep an eye on this and test some more but seems to work now for me.<br>
<br>
and for the other problem I then hope for 5.0 :).<br>
<br>
and what about the last problem I described before?<br>
<br>
best regards<br>
Sibylle<br>
<br>
<br>
<br>
Edson Tirelli wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c">
<br>
<br>
Sibylle,<br>
<br>
Unfortunately, this is the way it was implemented to be, under a kind-of "fail-fast" philosophy we were following. I do think there is value in changing things in 5.0 so that, for instance:<br>
<br>
ProcessModel($activities : activities) from $models<br>
<br>
Simply does not match, instead of raises a CCE, in case the model is a TypeModel.<br>
But for 4.0.x, that is how things work.<br>
<br>
The only suggestion I can give you is, in your second problem, to not return null on your collections. Simply return empty collections:<br>
<br>
class Project {<br>
...<br>
public List getModels() {<br>
if( this.models == null ) {<br>
return Collections.emptyList();<br>
}<br>
return this.models;<br>
}<br>
...<br>
}<br>
This is usually a good thing, unless you have a specific semantics for null collections in your domain model.<br>
<br>
[]s<br>
Edson<br>
<br>
2008/6/6 Sibylle Duerr <sibylle.duerr@mymail.ch>:<br>
<br>
Hi there,<br>
<br>
I have three issues, where I'm not sure if these are bugs in<br>
drools, or if this is just the way it has to be.<br>
<br>
the used classes in this case are:<br>
<br>
Project<br>
Model<br>
ProcessModel extends Model<br>
<br>
only the Project is in the working memory, because I didn't want<br>
to load all elements due to performance issues (there can be<br>
thousends of elements to load at startup).<br>
<br>
if I have the following rule:<br>
<br>
Project($models : models)<br>
ProcessModel($activities : activities) from $models<br>
<br>
there happen to be two problems. if the project does not only<br>
contain ProcessModels but also TypeModels or others (all extend<br>
Model), this leads to a ClassCastException.<br>
I can solve this by writing the rule as follows:<br>
<br>
Project($models : models)<br>
$m : Model(eval($m instanceof ProcessModel)) from $models<br>
ProcessModel($activities : activities) from $m<br>
<br>
but this is not really nice and I hope there is a better solution<br>
for this, is there?<br>
<br>
the second problem this rule gives me, is when the set 'models' is<br>
empty. that will also throw an exception. to solve this I write:<br>
<br>
$p : Project(eval($p.hasModels()), $models : models)<br>
$m : Model(eval($m instanceof ProcessModel)) from $models<br>
ProcessModel($activities : activities) from $m<br>
<br>
and I need to use this in each case where I have possible empty sets.<br>
<br>
<br>
the last problem I encountered when I tried to load all elements<br>
to the working memory and then redefine some rules. used classes:<br>
<br>
Aggregation extends DomainElement<br>
<br>
rule:<br>
<br>
Aggregation(owner.owner != type.owner)<br>
<br>
causes some exception. the root exception is a ClassCastException:<br>
ProxyShadowProxy cannot be cast to Aggregation.<br>
when I rewrite the rule as:<br>
<br>
$element : DomainElement(eval($element instanceof Aggregation))<br>
Aggregation(owner.owner != type.owner) from $element<br>
<br>
everything works fine. but that again is not a nice solution.<br>
<br>
any help?<br>
<br>
best regards<br>
sibylle<br>
_______________________________________________<br>
rules-users mailing list<br></div></div>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a> <mailto:<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>><div class="Ih2E3d">
<br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
<br>
<br>
<br>
-- <br>
Edson Tirelli<br>
JBoss Drools Core Development<br>
Office: +55 11 3529-6000<br>
Mobile: +55 11 9287-5646<br></div>
JBoss, a division of Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a> <<a href="http://www.jboss.com" target="_blank">http://www.jboss.com</a>><br>
------------------------------------------------------------------------<div class="Ih2E3d"><br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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>
<br>
</div></blockquote><div><div></div><div class="Wj3C7c">
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<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>