Hi, Vincent,<div><br></div><div>No, it's actually a List<String> events that is a property of that GameStateController, not Event objects.</div><div>Ok I will workaround it, but I guess it may be a bug, because I think that varArgs feature was not supported in 5.2.1, and is something new...</div>
<div><br></div><div>Best regards,</div><div>Martin<br><br><div class="gmail_quote">2012/1/17 Vincent Legendre <span dir="ltr"><<a href="mailto:vincent.legendre@eurodecision.com">vincent.legendre@eurodecision.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
May be drool cannot support variable length arguments in methods.
But, seeing your rules, I think you should change the way you match
your events objects by exploiting drools syntax and RETE instead of
calling predicates.<br>
<br>
If I understand well, you are creating a game, and this rule should
trigger when the player achives some goals to pass him to next
level. <br>
So I guess that your GameStateController contains a set of Event
objects ?<br>
If yes, I recommend inserting directly the event in the session, and
write a rule like this :<br>
<br>
<div>
<div>rule "quest_reach_level_1_in_any_category_accomplished"</div>
<div> when</div>
<div> Event(id == "eventId") <br>
<b>not </b>Event(id == "otherEventId")<br>
<b>exists </b>Event(id == "param1" || "param2" ||
"param3" .... etc etc)<br>
$gsc : GameStateController() // if you still need it,
consider adding it as a global<br>
</div>
<div> $response : Response() // if you can, set
it as global<br>
</div><div class="im">
<div> then</div>
<div> ... some business logic</div>
<div>end</div>
</div></div>
<br>
Note that it is solving the problem of varaible length argument,
using the fact that you can add easily new terms to a boolean
expression.<br>
<br>
Le 17/01/2012 19:23, Martin A a écrit :
<blockquote type="cite"><div class="im">Hello, guys,
<div><br>
</div>
<div>I've got a rule which states:</div>
<div><br>
</div>
<div>
<div>rule "quest_reach_level_1_in_any_category_accomplished"</div>
<div> when</div>
<div> $gsc :
GameStateController(hasEventOccurred("eventId") &&
!hasEventOccurred("otherEventId") &&
hasAnyEventOccurred("param1", "param2", "param3", "param4",
"param5", "param6", "param7", "param8", "param9", "param10",
"param11", "param12"))</div>
<div> $response : Response()</div>
<div> then</div>
<div> ... some business logic</div>
<div>end</div>
</div>
<div><br>
</div>
<div>which ends up with:</div>
<div><br>
</div>
<div>
<div>Caused by: org.drools.RuntimeDroolsException: Exception
executing predicate hasA</div>
<div>nyEventOccurred("level1_love", "level1_friendship",
"level1_prosperity", "level1</div>
<div>_charisma", "level1_willpower", "level1_wisdom",
"level1_entertainment", "level1</div>
<div>_adventure", "level1_inspiration", "level1_harmony",
"level1_lightheartedness",</div>
<div>"level1_confidence")</div>
<div> at
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:298)</div>
<div> <br>
</div>
</div>
<br>
</div><div class="im"><div>I'm using Drools 5.3.0.Final and it fails when it comes to
evaluating the predicate hasAnyEventOccurred(String... varArgs).</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Martin</div>
<br>
<fieldset></fieldset>
<br>
</div><pre>_______________________________________________
rules-users mailing list
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
</div>
<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>
<br></blockquote></div><br></div>