<!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, but how do I do
it in a</div>
<div>generic fashion 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>
/**<br>
* <br>
* @return <br>
* The PropagationContext that created this Activation<br>
*/<br>
PropagationContext getPropagationContext();<br>
<br>
/**<br>
* <br>
* @return<br>
* The matched FactHandles for this activation<br>
*/<br>
List< ? extends FactHandle> getFactHandles();<br>
<br>
/**<br>
* Returns the list of objects that make the tuple that created<br>
* this activation. The objects are in the proper tuple order.<br>
* <br>
* @return<br>
*/<br>
List< Object > getObjects();<br>
<br>
/**<br>
* Returns the list of declaration identifiers that are bound to
the<br>
* tuple that created this activation.<br>
* <br>
* @return<br>
*/<br>
List< String > getDeclarationIDs();<br>
<br>
/**<br>
* Returns the bound declaration value for the given declaration
identifier.<br>
* <br>
* @param declarationId<br>
* @return<br>
*/<br>
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 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. 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>