rule &quot;Assert new Target Records&quot;<br> &nbsp; &nbsp; &nbsp; &nbsp;when<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$one &nbsp; : RKEM_TARGET ( EQPNO == &quot;1&quot;) &amp;&amp;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$three : RKEM_TARGET ( EQPNO == &quot;3&quot;)<br><br> &nbsp; &nbsp; &nbsp; &nbsp;then<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Assert the missing Equipment number record
<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; RKEM_TARGET $two = new RKEM_TARGET();<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$two.setEQPNO(&quot;2&quot;); &nbsp;// Set attribute<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;assert( $two ); &nbsp;&lt;-- This does NOT work...<br>end<br><br>Then &quot;then&quot; section is just normal java with a few methods and objects provided for you.
<br><br>cheers<br>Steve<br><br><div><span class="gmail_quote">On 4/20/07, <b class="gmail_sendername">jdepaul</b> &lt;<a href="mailto:jjdepaul@us.ibm.com">jjdepaul@us.ibm.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>I&#39;m trying to assert a new Fact based on a condition, but I dont know how to<br>assert a new Fact with a specific attribute in it.&nbsp;&nbsp;I&#39;m trying this - why<br>doesn&#39;t this syntax work:<br><br>rule &quot;Assert new Target Records&quot;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$one&nbsp;&nbsp; : RKEM_TARGET ( EQPNO == &quot;1&quot;) &amp;&amp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$three : RKEM_TARGET ( EQPNO == &quot;3&quot;)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Assert the missing Equipment number record
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$two : new RKEM_TARGET();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$two.setEQPNO(&quot;2&quot;);&nbsp;&nbsp;// Set attribute<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert( $two );&nbsp;&nbsp;&lt;-- This does NOT work...<br>end<br><br>How do you assert a new Fact with a specific value in the attribute(s)?
<br><br>THanks,<br>James<br><br><br>--<br>View this message in context: <a href="http://www.nabble.com/Asserting-new-Facts-in-RHS...-tf3609763.html#a10086922">http://www.nabble.com/Asserting-new-Facts-in-RHS...-tf3609763.html#a10086922
</a><br>Sent from the drools - user mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<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">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>Steven Williams
<br><br>Supervising Consultant<br><br>Object Consulting<br>Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501<br><a href="mailto:stevenw@objectconsulting.com.au">stevenw@objectconsulting.com.au</a><br><a href="http://www.objectconsulting.com.au">
www.objectconsulting.com.au</a><br><br>consulting | development | training | support<br>our experience makes the difference