<div><br></div>Can I get the "drools" 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"><<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>></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<FactHandle>.<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<String> 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 <<a href="mailto:archier@gmail.com">archier@gmail.com</a>>:<br>
<div><div></div><div class="h5">><br>
> Hi,<br>
> I've tried to figure this out but haven't been able to.<br>
> How can I, from the RHS, figure out the details of what triggered a rule.<br>
> I can access the facts individually by name, but how do I do it in a<br>
> generic fashion that would work in the RHS of any rule?<br>
> I am using decisiontables and want to be able to have a function that is<br>
> something like printTriggeringDetails()<br>
> I came across drools.getTuple but am not sure if that's the correct path<br>
> to go on. From there I get InternalFactHandles but don't know how to turn<br>
> those into human-readable facts.<br>
> Thanks for any help,<br>
> Archie<br>
><br>
</div></div>> _______________________________________________<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>
><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>