<div dir="ltr">Hello,<br><br>I have a rule which creates an object in the consequence part and updates this object each time teh rule is executed. So the object has to be created only the first time.<br>So I always need two rules, one init rule which creates the object if it doesn&#39;t exist yet and one if it already exists and it should only be updated:<br>
<br>rule &quot;init rule&quot;<br>when<br>&nbsp;&nbsp; &quot;condition&quot;<br>&nbsp;&nbsp; AND <br>&nbsp;&nbsp; not OutputObject()<br>then<br>&nbsp;&nbsp; OutputObject oo = new OutputObject();<br>&nbsp;&nbsp; insert(oo);<br><br>rule &quot;update rule&quot;<br>when<br>
&nbsp;&nbsp; &quot;condition&quot;<br>
&nbsp;&nbsp; AND <br>
&nbsp;&nbsp; oo: OutputObject()<br>
then<br>&nbsp;&nbsp; #do something with the object<br>
&nbsp;&nbsp; update(oo);<br><br>But is it really neccessary to write an extra rule only to create the output-fact initially? Is it possible/good style to make this in one single rule? <br><br>Appreciate your help.<br><br>Regards<br>
Thomas<br></div>