<html>

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 10 (filtered)">

<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
span.EmailStyle17
        {font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I tried that and it returned false, which
doesn&#8217;t make sense to me since the rule firing is to set the value to
true, and in the execution the rule does fire. &nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 color=black
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
StatefulKnowledgeSession session = kbase.newStatefulKnowledgeSession();</span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 color=black
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Product p = </span></font><b><font
size=2 color="#7f0055" face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New";color:#7F0055;font-weight:bold'>new</span></font></b><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:black'> Product();</span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 color=black
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p.setBrand(</span></font><font
size=2 color="#2a00ff" face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New";color:#2A00FF'>&quot;hoover&quot;</span></font><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:black'>);</span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 color=black
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='background:
silver'>session</span>.insert( p );</span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 color=black
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font><b><font
size=2 color="#7f0055" face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New";color:#7F0055;font-weight:bold'>int</span></font></b><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:black'> u = <span style='background:silver'>session</span>.fireAllRules();</span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 color=black
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 color=black
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.</span></font><i><font
size=2 color="#0000c0" face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New";color:#0000C0;font-style:italic'>out</span></font></i><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:black'>.println(u + </span></font><font size=2
color="#2a00ff" face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:#2A00FF'>&quot; many rules fired&quot;</span></font><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:black'>);</span></font></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
System.</span></font><i><font size=2 color="#0000c0" face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:#0000C0;font-style:
italic'>out</span></font></i><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:black'>.println(</span></font><font
size=2 color="#2a00ff" face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New";color:#2A00FF'>&quot;is brand good? &quot;</span></font><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:black'> + p.isGoodBrand());</span></font></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:black'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:black'>Here&#8217;s a
snippet of the rule (decision table)</span></font></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:black'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:black'>&nbsp;</span></font></p>

<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=436
 style='width:327.0pt;margin-left:-.65pt;border-collapse:collapse'>
 <tr height=17 style='height:12.75pt'>
  <td width=167 nowrap height=17 valign=bottom bgcolor=silver style='width:
  125.0pt;border:solid black 1.0pt;background:silver;padding:0in 5.4pt 0in 5.4pt;
  height:12.75pt'>
  <p class=MsoNormal><b><font size=1 face=Tahoma><span style='font-size:7.0pt;
  font-family:Tahoma;font-weight:bold'>&nbsp;</span></font></b></p>
  </td>
  <td width=113 nowrap height=17 valign=bottom bgcolor="#FFCC99"
  style='width:85.0pt;border:solid black 1.0pt;border-left:none;background:
  #FFCC99;padding:0in 5.4pt 0in 5.4pt;height:12.75pt'>
  <p class=MsoNormal><font size=1 face=Tahoma><span style='font-size:7.0pt;
  font-family:Tahoma'>CONDITION</span></font></p>
  </td>
  <td width=156 nowrap height=17 valign=bottom bgcolor="#FFCC99"
  style='width:117.0pt;border:solid black 1.0pt;border-left:none;background:
  #FFCC99;padding:0in 5.4pt 0in 5.4pt;height:12.75pt'>
  <p class=MsoNormal><font size=1 face=Tahoma><span style='font-size:7.0pt;
  font-family:Tahoma'>ACTION</span></font></p>
  </td>
 </tr>
 <tr height=18 style='height:13.5pt'>
  <td width=167 nowrap height=18 valign=bottom bgcolor=silver style='width:
  125.0pt;border:solid black 1.0pt;border-top:none;background:silver;
  padding:0in 5.4pt 0in 5.4pt;height:13.5pt'>
  <p class=MsoNormal><b><font size=1 face=Tahoma><span style='font-size:7.0pt;
  font-family:Tahoma;font-weight:bold'>&nbsp;</span></font></b></p>
  </td>
  <td width=269 nowrap colspan=2 height=18 valign=bottom bgcolor="#FFCC99"
  style='width:202.0pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;
  border-right:solid black 1.0pt;background:#FFCC99;padding:0in 5.4pt 0in 5.4pt;
  height:13.5pt'>
  <p class=MsoNormal><font size=1 face=Tahoma><span style='font-size:7.0pt;
  font-family:Tahoma'>Product</span></font></p>
  </td>
 </tr>
 <tr height=17 style='height:12.75pt'>
  <td width=167 height=17 valign=bottom bgcolor=silver style='width:125.0pt;
  border-top:none;border-left:solid black 1.0pt;border-bottom:none;border-right:
  solid black 1.0pt;background:silver;padding:0in 5.4pt 0in 5.4pt;height:12.75pt'>
  <p class=MsoNormal><b><font size=1 face=Tahoma><span style='font-size:7.0pt;
  font-family:Tahoma;font-weight:bold'>&nbsp;</span></font></b></p>
  </td>
  <td width=113 height=17 valign=bottom bgcolor="#FFCC99" style='width:85.0pt;
  border:none;border-right:solid black 1.0pt;background:#FFCC99;padding:0in 5.4pt 0in 5.4pt;
  height:12.75pt'>
  <p class=MsoNormal><font size=1 face=Tahoma><span style='font-size:7.0pt;
  font-family:Tahoma'>brand</span></font></p>
  </td>
  <td width=156 height=17 valign=bottom bgcolor="#FFCC99" style='width:117.0pt;
  border:none;border-right:solid black 1.0pt;background:#FFCC99;padding:0in 5.4pt 0in 5.4pt;
  height:12.75pt'>
  <p class=MsoNormal><font size=2 color=black face="Courier New"><span
  style='font-size:10.0pt;font-family:"Courier New";color:black'>setGoodBrand(true);</span></font></p>
  </td>
 </tr>
 <tr height=38 style='height:28.5pt'>
  <td width=167 height=38 bgcolor="#CCFFCC" style='width:125.0pt;border:solid black 1.0pt;
  border-bottom:none;background:#CCFFCC;padding:0in 5.4pt 0in 5.4pt;height:
  28.5pt'>
  <p class=MsoNormal align=center style='text-align:center'><b><font size=1
  face=Tahoma><span style='font-size:7.0pt;font-family:Tahoma;font-weight:bold'>Cases</span></font></b></p>
  </td>
  <td width=113 height=38 valign=bottom bgcolor="#CCFFFF" style='width:85.0pt;
  background:#CCFFFF;padding:0in 5.4pt 0in 5.4pt;height:28.5pt'>
  <p class=MsoNormal><font size=1 face=Tahoma><span style='font-size:7.0pt;
  font-family:Tahoma'>hoover match case</span></font></p>
  </td>
  <td width=156 height=38 valign=bottom bgcolor="#FFFF99" style='width:117.0pt;
  background:#FFFF99;padding:0in 5.4pt 0in 5.4pt;height:28.5pt'>
  <p class=MsoNormal><font size=1 face=Tahoma><span style='font-size:7.0pt;
  font-family:Tahoma'>&nbsp;</span></font></p>
  </td>
 </tr>
 <tr height=29 style='height:21.75pt'>
  <td width=167 height=29 style='width:125.0pt;padding:0in 5.4pt 0in 5.4pt;
  height:21.75pt'>
  <p class=MsoNormal align=center style='text-align:center'><b><font size=1
  color=black face=Tahoma><span style='font-size:7.0pt;font-family:Tahoma;
  color:black;font-weight:bold'>Brand Check</span></font></b></p>
  </td>
  <td width=113 nowrap height=29 style='width:85.0pt;padding:0in 5.4pt 0in 5.4pt;
  height:21.75pt'>
  <p class=MsoNormal align=center style='text-align:center'><font size=1
  face=Tahoma><span style='font-size:7.0pt;font-family:Tahoma'>hoover</span></font></p>
  </td>
  <td width=156 nowrap height=29 style='width:117.0pt;padding:0in 5.4pt 0in 5.4pt;
  height:21.75pt'>
  <p class=MsoNormal align=center style='text-align:center'><b><font size=1
  face=Tahoma><span style='font-size:7.0pt;font-family:Tahoma;font-weight:bold'>&nbsp;</span></font></b></p>
  </td>
 </tr>
</table>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>And the console returns:</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 color=black
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:black'>1 many rules fired</span></font></p>

<p class=MsoNormal><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:black'>is brand good? false</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<div>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
 10.0pt;font-family:Arial;color:navy'>Robert Costello</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Lead Systems Engineer</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>IMA Performance</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>E3-&nbsp;279A</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>847.286.0910</span></font></p>

<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>&nbsp;</span></font></p>

</div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>-----Original Message-----<br>
<b><span style='font-weight:bold'>From:</span></b> rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <b><span style='font-weight:bold'>On
Behalf Of </span></b>Edson Tirelli<br>
<b><span style='font-weight:bold'>Sent:</span></b> Monday, January 12, 2009
4:16 PM<br>
<b><span style='font-weight:bold'>To:</span></b> </span></font><font size=2
 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>Rules Users List</span></font><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'><br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [rules-users] How to
access data after rule fires</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

<p class=MsoNormal style='margin-right:0in;margin-bottom:12.0pt;margin-left:
.5in'><font size=3 face="Times New Roman"><span style='font-size:12.0pt'><br>
&nbsp;&nbsp; Can't you keep the reference to your object while firing the
rules?<br>
<br>
MyObject x = ...<br>
ksession.insert( x );<br>
ksession.fireAllRules();<br>
boolean result = x.getBooleanAttribute();<br>
<br>
&nbsp;&nbsp;&nbsp; []s<br>
&nbsp;&nbsp;&nbsp; Edson</span></font></p>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>2009/1/12 Costello, Robert &lt;<a
href="mailto:rcost10@searshc.com">rcost10@searshc.com</a>&gt;</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>So, how do I access data after the rules fire?<br>
<br>
If one has a rule which modifies a field on an object (a boolean, for<br>
example), and you want to return the object after the rules are<br>
complete, how do you do it?<br>
<br>
I tried this using a StatefulKnowledgeSession, getting an object<br>
collection after the rules fire, but I don't see that this works.<br>
<br>
Also googled the heck out of this and looked in all the documentation.<br>
I must be missing something, because the docs generally are pretty good.<br>
<br>
<br>
Any hints?<br>
<br>
Thanks in advance,<br>
<br>
Robert Costello<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></span></font></p>

</div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><br>
<br clear=all>
<br>
-- <br>
&nbsp;Edson Tirelli<br>
&nbsp;JBoss Drools Core Development<br>
&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a></span></font></p>

</div>

</body>

</html>