<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'm not sure what'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't assert the OutputObject from outside? (i.e. before rules fire) You're essentially doing lazy initialization, and that's always a bit more complex.<br>
<br>--- On Thu, 8/21/08, thomas kukofka <thomaskukofka at <a href="http://web.de">web.de</a>> wrote:<br><br>> From: thomas kukofka <thomaskukofka at <a href="http://web.de">web.de</a>><br>> Subject: [rules-users] object creation<br>
> To: "Rules Users List" <rules-users at <a href="http://lists.jboss.org">lists.jboss.org</a>><br>> Date: Thursday, August 21, 2008, 9:03 AM<br>> Hello,<br>> <br>> I have a rule which creates an object in the consequence<br>
> part and updates<br>> this object each time teh rule is executed. So the object<br>> has to be created<br>> only the first time.<br>> So I always need two rules, one init rule which creates the<br>> object if it<br>
> doesn't exist yet and one if it already exists and it<br>> should only be<br>> updated:<br>> <br>> rule "init rule"<br>> when<br>> "condition"<br>> AND<br>> not OutputObject()<br>
> then<br>> OutputObject oo = new OutputObject();<br>> insert(oo);<br>> <br>> rule "update rule"<br>> when<br>> "condition"<br>> AND<br>> oo: OutputObject()<br>
> then<br>> #do something with the object<br>> update(oo);<br>> <br>> But is it really neccessary to write an extra rule only to<br>> create the<br>> output-fact initially? Is it possible/good style to make<br>
> this in one single<br>> rule?<br>> <br>> Appreciate your help.<br>> <br>> Regards<br>> Thomas</font></font><br><br><i></i></pre></div>