<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I've found the issue, its removing the item twice. I'll fix this for
the point release next week.<br>
<a class="moz-txt-link-freetext" href="http://jira.jboss.org/jira/browse/JBRULES-1033">http://jira.jboss.org/jira/browse/JBRULES-1033</a><br>
<br>
Thanks<br>
<br>
Mark<br>
Mark Proctor wrote:
<blockquote cite="mid:46A900BA.1050305@codehaus.org" type="cite">
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
hmm that looks like a bug, I'll look into it. We do have
unit/integration tests for this, so I'd be interested to know what you
are doing to kick this off. Are you just adding a clear agenda after
the fireAllRules() in that example?<br>
  <br>
Mark<br>
  <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:tom@bergstein-soraic.de">tom@bergstein-soraic.de</a>
wrote:
  <blockquote
 cite="mid:2403109.840701185461753482.JavaMail.servlet@pustefix154.kundenserver.de"
 type="cite"><span style="font-family: Verdana;">
    <p>Thank you for the hint. I've tried to use clearAgenda() but I've
following error:</p>
    <p> </p>
    <p><font color="#ff0000" size="2">Exception in thread "main" </font><u><font
 color="#000080" size="2">java.lang.NullPointerException</font></u></p>
    <font color="#ff0000" size="2">
    <p align="left">at org.drools.util.LinkedList.remove(<u><font
 color="#000080" size="2">LinkedList.java:97</font></u><font
 color="#ff0000" size="2">)
    <p align="left">at
org.drools.common.DefaultAgenda.removeScheduleItem(<u><font
 color="#000080" size="2">DefaultAgenda.java:150</font></u><font
 color="#ff0000" size="2">)
    <p align="left">at org.drools.common.ScheduledAgendaItem.remove(<u><font
 color="#000080" size="2">ScheduledAgendaItem.java:159</font></u><font
 color="#ff0000" size="2">)
    <p align="left">at org.drools.common.DefaultAgenda.clearAgenda(<u><font
 color="#000080" size="2">DefaultAgenda.java:362</font></u><font
 color="#ff0000" size="2">)
    <p left="" align="!">at
org.drools.common.AbstractWorkingMemory.clearAgenda(<u><font
 color="#000080" size="2">AbstractWorkingMemory.java:363</font></u><font
 color="#ff0000" size="2">)
    <p>at org.drools.examples.TroubleTicketExample.main(<u><font
 color="#000080" size="2">TroubleTicketExample.java:58</font></u><font
 color="#ff0000" size="2">)</font></p>
    </font></p>
    </font></p>
    </font></p>
    </font></p>
    </font></p>
    </font>
    <p><br>
  </p>
    <p>Is there anything special to consider when using clearAgenda()?</p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p>----- Edison wrote:  </p>
    <p> Technically it is possible and supported to serialize working
memories. Although, we did faced problems with large serializations due
to a known recursion issue in JDK. There is a JIRA for that, but I
don't have the link right now. <br>
    <br>
    Now, if you want to reassert objects without firing rules, maybe
what you can do is call WorkingMemory.clearAgenda() after reasserting
the ob! jects. Not sure if that will give you the results you expect.<br>
    <br>
    []s<br>
    Edson<br>
    <br>
    </p>
    <div><span class="gmail_quote">2007/7/25, Arjun Dhar &lt;<a
 moz-do-not-send="true" href="mailto:dhar_ar@yahoo.com">dhar_ar@yahoo.com</a>&gt;:</span>
    <blockquote
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"
 class="gmail_quote"><tom></tom><a moz-do-not-send="true"
 target="_blank" href="/xml/deref?link=http%3A%2F%2Fbergstein-soraic.de">bergstein-soraic.de</a>&gt;
writes:<br>
      <br>
&gt;<br>
&gt;<br>
&gt; I've a use case that is similar to the TroubleTicketExample that
is part of<br>
the drools examples. <br>
&gt; In this examples new tickets are inserted via
workingMemory.assertObject<br>
(ticket). However, tickets are usually managed and stored in a
ticketing system<br>
(Remedy, Peregrine, etc). When I stop the drools engine, I assume that
the <br>
state of the working memory is lost. When I start the engine again, I'd
like to<br>
load the working memory with the tickets that are stored in the tic!
keting<br>
system, but I don't want to fire all rules, since I'd to avoid that
rules are <br>
executed again (e.g., rule "Escalate" -&gt; send a e-mail), which have
been<br>
already executed before the drools engine has<br>
&gt;   been stopped. Existing tickets in the ticketing system are
important facts <br>
for the rules!<br>
&gt;   and therefore the need to be loaded into the morking memory.<br>
&gt;<br>
&gt; <br>
&gt; Is there a way to build up the working memory with initial facts?<br>
&gt; Can I persist the state of the working memory and load it later
again? <br>
&gt;<br>
&gt; <br>
&gt; Many thanks in advance,<br>
&gt; Tom<br>
&gt;<br>
      <br>
Hey my two bits,<br>
      <br>
Assuming I dont know much about StatefulSessions holding objects I
wanted to<br>
check with you, is this safe? I'm not sure over a period of time if
your <br>
objects would be released with a StatefulSession/WorkingMemory, would
recommend<br !="">
you 'soak test' (test over a period of time with consistent l
oad)<br>
      <br>
But here is the possibility:<br>
Well the interface WorkinfgMemory -- extends --&gt; Eventmanager which
extends <br>
Serializable.<br>
      <br>
You could try serializing the object, or query your WorkingMemory for
its state<br>
and save it to a database. Am assuming you are using StatefulSession so
you<br>
will have access to WorkingMemory. <br>
      <br>
Conceptually I just think its worng to use a Rule Engine to persist
state over<br>
a such a long period of time. Any expert opinion?<br>
      <br>
regards,<br>
Arjun<br>
      <br>
_______________________________________________<br>
rules-users mailing list<br>
      <a moz-do-not-send="true"
 href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
      <a moz-do-not-send="true" target="_blank"
 href="/xml/deref?link=https%3A%2F%2Flists.jboss.org%2Fmailman%2Flistinfo%2Frules-users">https://lists.jboss.org/mailman/listinfo/rules-users
      </a><br>
    </blockquote>
    </div>
    <br>
    <br clear="all">
    <br>
-- <br>
  Edson Tirelli<br>
  Soft! ware Engineer - JBoss Rules Core Developer<br>
  Office: +55 11 3529-6000<br>
  Mobile: +55 11 9287-5646<br>
  JBoss, a division of Red Hat @ <a moz-do-not-send="true"
 target="_blank" href="/xml/deref?link=http%3A%2F%2Fwww.jboss.com">www.jboss.com</a>
    </span>
    <pre wrap=""><hr size="4" width="90%">
_______________________________________________
rules-users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  </pre>
  </blockquote>
  <br>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  </pre>
</blockquote>
<br>
</body>
</html>