Pass the output of one rule as a Fact in Working Memory to the other.<br><br><span style="font-family: courier new,monospace;">when</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Something()</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">then</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> insert( new Output());</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">end</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">when</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> Output()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">then</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> //Whatever</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">end </span><br style="font-family: courier new,monospace;">
<br><div class="gmail_quote">On 15 November 2011 13:56, Zhao Yi <span dir="ltr"><<a href="mailto:zhaoyi0113@gmail.com">zhaoyi0113@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I write some rules to do some calculation. One rule's output is another<br>
rule's input. How can I define the output and input value? How can I let the<br>
value be transferred between rules?<br>
<br>
Thanks,<br>
<span class="HOEnZb"><font color="#888888">Zhao Yi<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/How-to-use-a-temp-variable-accorss-multiple-rules-tp3509713p3509713.html" target="_blank">http://drools.46999.n3.nabble.com/How-to-use-a-temp-variable-accorss-multiple-rules-tp3509713p3509713.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>
</font></span></blockquote></div><br>