<div><br></div>Can I get the &quot;drools&quot; variable from my java code?   Or is this only available inside<div>rules?</div><div><br></div><div>A</div><div><br><br><div class="gmail_quote">On Thu, Feb 17, 2011 at 1:26 AM, Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">This may be more conveniently done from an event listener but<br>
drools.getActivation() should give you the Activation. Then you get<br>
the Collection&lt;FactHandle&gt;.<br>
<br>
For each of them,<br>
org.drools.runtime.KnowledgeRuntime.getObject(<br>
org.drools.runtime.rule.FactHandle )<br>
gives you the fact objects that participates.<br>
<br>
You can also access bindings:<br>
  List&lt;String&gt; declIds = activation.getDeclarationIDs();<br>
  Object declVal = activation.getDeclarationValue( declId );<br>
Be careful, things may have passed away, i.e., you can get nulls.<br>
<br>
-W<br>
<br>
2011/2/16 Archie Russell &lt;<a href="mailto:archier@gmail.com">archier@gmail.com</a>&gt;:<br>
<div><div></div><div class="h5">&gt;<br>
&gt; Hi,<br>
&gt; I&#39;ve tried to figure this out but haven&#39;t been able to.<br>
&gt; How can I, from the RHS, figure out the details of what triggered a rule.<br>
&gt; I can access the facts individually by name,  but how do I do it in a<br>
&gt; generic fashion that would work in the RHS of any rule?<br>
&gt; I am using decisiontables and want to be able to have a function that is<br>
&gt; something like printTriggeringDetails()<br>
&gt; I came across drools.getTuple but am not sure if that&#39;s the correct path<br>
&gt; to go on.   From there I get InternalFactHandles but don&#39;t know how to turn<br>
&gt; those into human-readable facts.<br>
&gt; Thanks for any help,<br>
&gt; Archie<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
&gt;<br>
<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>
</blockquote></div><br></div>