<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body 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>&nbsp; &nbsp; when</div>
      <div>&nbsp; &nbsp; &nbsp; &nbsp; Event(id == "eventId") <br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <b>not </b>Event(id == "otherEventId")<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>exists </b>Event(id == "param1" || "param2" ||
        "param3" .... etc etc)<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $gsc : GameStateController()&nbsp;&nbsp; // if you still need it,
        consider adding it as a global<br>
      </div>
      <div>&nbsp; &nbsp; &nbsp; &nbsp; $response : Response()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // if you can, set
        it as global<br>
      </div>
      <div>&nbsp; &nbsp; then</div>
      <div>&nbsp; &nbsp; &nbsp; &nbsp; ... some business logic</div>
      <div>end</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 &eacute;crit&nbsp;:
    <blockquote
cite="mid:CAB27Hf2S8joHY68-uw0tNZXXe-GrNV1T3uRk=FAMf_3OsG4CKA@mail.gmail.com"
      type="cite">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>&nbsp; &nbsp; when</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; $gsc :
          GameStateController(hasEventOccurred("eventId") &amp;&amp;
          !hasEventOccurred("otherEventId") &amp;&amp;
          hasAnyEventOccurred("param1", "param2", "param3", "param4",
          "param5", "param6", "param7", "param8", "param9", "param10",
          "param11", "param12"))</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; $response : Response()</div>
        <div>&nbsp; &nbsp; then</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; ... 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>&nbsp; &nbsp; &nbsp; &nbsp; at
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:298)</div>
        <div>&nbsp; &nbsp; &nbsp; <br>
        </div>
      </div>
      <br>
      <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 class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>