<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    On 16/02/2011 20:47, Archie Russell wrote:
    <blockquote
      cite="mid:AANLkTimJDkqmDYdXd8-n0KEUzM6p+fJ1LDDPousxQbY1@mail.gmail.com"
      type="cite"><br>
      <div>Hi,</div>
      <div><br>
      </div>
      <div>I've tried to figure this out but haven't been able to.</div>
      <div><br>
      </div>
      <div>How can I, from the RHS, figure out the details of what
        triggered a rule.</div>
      <div>I can access the facts individually by name, &nbsp;but how do I do
        it in a</div>
      <div>generic fashion&nbsp;that would work in the RHS of any rule?</div>
    </blockquote>
    Look at RuleContext.getActivation()<br>
    <br>
    You can use either the deprecated "drools" identifier or the new
    kcontext to achieve this. getACtivation has the following methods:<br>
    &nbsp;&nbsp;&nbsp; /**<br>
    &nbsp;&nbsp;&nbsp;&nbsp; * <br>
    &nbsp;&nbsp;&nbsp;&nbsp; * @return <br>
    &nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp; The PropagationContext that created this Activation<br>
    &nbsp;&nbsp;&nbsp;&nbsp; */<br>
    &nbsp;&nbsp;&nbsp; PropagationContext getPropagationContext();<br>
    <br>
    &nbsp;&nbsp;&nbsp; /**<br>
    &nbsp;&nbsp;&nbsp;&nbsp; * <br>
    &nbsp;&nbsp;&nbsp;&nbsp; * @return<br>
    &nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp; The matched FactHandles for this activation<br>
    &nbsp;&nbsp;&nbsp;&nbsp; */<br>
    &nbsp;&nbsp;&nbsp; List&lt; ? extends FactHandle&gt; getFactHandles();<br>
    &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; /**<br>
    &nbsp;&nbsp;&nbsp;&nbsp; * Returns the list of objects that make the tuple that created<br>
    &nbsp;&nbsp;&nbsp;&nbsp; * this activation. The objects are in the proper tuple order.<br>
    &nbsp;&nbsp;&nbsp;&nbsp; * <br>
    &nbsp;&nbsp;&nbsp;&nbsp; * @return<br>
    &nbsp;&nbsp;&nbsp;&nbsp; */<br>
    &nbsp;&nbsp;&nbsp; List&lt; Object &gt; getObjects();<br>
    &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; /**<br>
    &nbsp;&nbsp;&nbsp;&nbsp; * Returns the list of declaration identifiers that are bound to
    the<br>
    &nbsp;&nbsp;&nbsp;&nbsp; * tuple that created this activation.<br>
    &nbsp;&nbsp;&nbsp;&nbsp; * <br>
    &nbsp;&nbsp;&nbsp;&nbsp; * @return<br>
    &nbsp;&nbsp;&nbsp;&nbsp; */<br>
    &nbsp;&nbsp;&nbsp; List&lt; String &gt; getDeclarationIDs();<br>
    &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; /**<br>
    &nbsp;&nbsp;&nbsp;&nbsp; * Returns the bound declaration value for the given declaration
    identifier.<br>
    &nbsp;&nbsp;&nbsp;&nbsp; * <br>
    &nbsp;&nbsp;&nbsp;&nbsp; * @param declarationId<br>
    &nbsp;&nbsp;&nbsp;&nbsp; * @return<br>
    &nbsp;&nbsp;&nbsp;&nbsp; */<br>
    &nbsp;&nbsp;&nbsp; Object getDeclarationValue( String declarationId );<br>
    <br>
    Mark<br>
    <blockquote
      cite="mid:AANLkTimJDkqmDYdXd8-n0KEUzM6p+fJ1LDDPousxQbY1@mail.gmail.com"
      type="cite">
      <div><br>
      </div>
      <div>I am using decisiontables and want to be able to have a
        function that is</div>
      <div>something like&nbsp;printTriggeringDetails()</div>
      <div><br>
      </div>
      <div>I came across drools.getTuple but am not sure if that's the
        correct path</div>
      <div>to go on. &nbsp; From there I get InternalFactHandles but don't
        know how to turn</div>
      <div>those into human-readable facts.</div>
      <div><br>
      </div>
      <div>Thanks for any help,</div>
      <div>Archie</div>
      <div><br>
      </div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
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>