<div dir="ltr"><pre><font size="4"><font face="arial,helvetica,sans-serif">Hello<br><br>the created OutputObjects should be used by the GUI to be displayed and only reasonable filled </font></font><font><font><font size="4"><font face="arial,helvetica,sans-serif">OutputObjects </font></font></font></font><font size="4"><font face="arial,helvetica,sans-serif">should be displayed. Furthermore an OutputObject of one type can be input for another rule to create output of another type.<br>
I&#39;m not sure what&#39;s better and easier to handle in my case, lazy initialisation or insert from outside.<br>Is there anything more to consider using lazy initialisation?<br><br>Regards<br>Thomas<br><br>Any reason you can&#39;t assert the OutputObject from outside? (i.e. before rules fire)  You&#39;re essentially doing lazy initialization, and that&#39;s always a bit more complex.<br>
<br>--- On Thu, 8/21/08, thomas kukofka &lt;thomaskukofka at <a href="http://web.de">web.de</a>&gt; wrote:<br><br>&gt; From: thomas kukofka &lt;thomaskukofka at <a href="http://web.de">web.de</a>&gt;<br>&gt; Subject: [rules-users] object creation<br>
&gt; To: &quot;Rules Users List&quot; &lt;rules-users at <a href="http://lists.jboss.org">lists.jboss.org</a>&gt;<br>&gt; Date: Thursday, August 21, 2008, 9:03 AM<br>&gt; Hello,<br>&gt; <br>&gt; I have a rule which creates an object in the consequence<br>
&gt; part and updates<br>&gt; this object each time teh rule is executed. So the object<br>&gt; has to be created<br>&gt; only the first time.<br>&gt; So I always need two rules, one init rule which creates the<br>&gt; object if it<br>
&gt; doesn&#39;t exist yet and one if it already exists and it<br>&gt; should only be<br>&gt; updated:<br>&gt; <br>&gt; rule &quot;init rule&quot;<br>&gt; when<br>&gt;    &quot;condition&quot;<br>&gt;    AND<br>&gt;    not OutputObject()<br>
&gt; then<br>&gt;    OutputObject oo = new OutputObject();<br>&gt;    insert(oo);<br>&gt; <br>&gt; rule &quot;update rule&quot;<br>&gt; when<br>&gt;    &quot;condition&quot;<br>&gt;    AND<br>&gt;    oo: OutputObject()<br>
&gt; then<br>&gt;    #do something with the object<br>&gt;    update(oo);<br>&gt; <br>&gt; But is it really neccessary to write an extra rule only to<br>&gt; create the<br>&gt; output-fact initially? Is it possible/good style to make<br>
&gt; this in one single<br>&gt; rule?<br>&gt; <br>&gt; Appreciate your help.<br>&gt; <br>&gt; Regards<br>&gt; Thomas</font></font><br><br><i></i></pre></div>