<div dir="ltr">I'm unaware of any mechanism that will allow you to identify what portions of the rete node triggered the activation directly as you've described. Ultimately, they resolve to booleans and having multiple conditions would further complicate your situation. However, I suspect that there's another approach to solving the issue at hand. Can you better describe the problem you're needing to solve that you'd want access to that information within the consequence?<div>
<br></div><div style>- jary</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jan 5, 2013 at 11:17 AM, bdolbeare <span dir="ltr"><<a href="mailto:bdolbeare@yahoo.com" target="_blank">bdolbeare@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is there a way to determine (in the rule consequence) which condition in a<br>
composite constraint caused a rule to succeed?<br>
<br>
I am working on a system that allows users to create rules via a custom UI<br>
and when one of their rules fires, I want to be able to create a message<br>
that describes why their rule fired. In a real example, they might have a<br>
list of a few hundred conditions in a composite constraint.<br>
<br>
An example rule with just two conditions in a composite constraint follows:<br>
<br>
rule "test rule"<br>
when<br>
MyObject( (myfield str[startsWith] "a" || myfield str[startsWith] "b") )<br>
then<br>
System.out.prinltn(kcontext.getRule().getName() + " fired because myfield<br>
started with ???");<br>
end<br>
<br>
Is this exposed somewhere in the variables like kcontext that are available<br>
to each rule in their consequence?<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Finding-matching-values-in-composite-constraint-tp4021343.html" target="_blank">http://drools.46999.n3.nabble.com/Finding-matching-values-in-composite-constraint-tp4021343.html</a><br>
Sent from the Drools: User forum mailing list archive at Nabble.com.<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>