Hi, Vincent,<div><br></div><div>No, it&#39;s actually a List&lt;String&gt; 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">&lt;<a href="mailto:vincent.legendre@eurodecision.com">vincent.legendre@eurodecision.com</a>&gt;</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 &quot;quest_reach_level_1_in_any_category_accomplished&quot;</div>
      <div>    when</div>
      <div>        Event(id == &quot;eventId&quot;) <br>
                <b>not </b>Event(id == &quot;otherEventId&quot;)<br>
                <b>exists </b>Event(id == &quot;param1&quot; || &quot;param2&quot; ||
        &quot;param3&quot; .... 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&#39;ve got a rule which states:</div>
      <div><br>
      </div>
      <div>
        <div>rule &quot;quest_reach_level_1_in_any_category_accomplished&quot;</div>
        <div>    when</div>
        <div>        $gsc :
          GameStateController(hasEventOccurred(&quot;eventId&quot;) &amp;&amp;
          !hasEventOccurred(&quot;otherEventId&quot;) &amp;&amp;
          hasAnyEventOccurred(&quot;param1&quot;, &quot;param2&quot;, &quot;param3&quot;, &quot;param4&quot;,
          &quot;param5&quot;, &quot;param6&quot;, &quot;param7&quot;, &quot;param8&quot;, &quot;param9&quot;, &quot;param10&quot;,
          &quot;param11&quot;, &quot;param12&quot;))</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(&quot;level1_love&quot;, &quot;level1_friendship&quot;,
          &quot;level1_prosperity&quot;, &quot;level1</div>
        <div>_charisma&quot;, &quot;level1_willpower&quot;, &quot;level1_wisdom&quot;,
          &quot;level1_entertainment&quot;, &quot;level1</div>
        <div>_adventure&quot;, &quot;level1_inspiration&quot;, &quot;level1_harmony&quot;,
          &quot;level1_lightheartedness&quot;,</div>
        <div>&quot;level1_confidence&quot;)</div>
        <div>        at
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:298)</div>
        <div>      <br>
        </div>
      </div>
      <br>
      </div><div class="im"><div>I&#39;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>