<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Thank you so much, Wolfgang. :)<br>
I'm so sorry. I don't know why I'm kind of forgetting all of Java while
using Drools. <br>
<br>
[Topic solved]<br>
<br>
Tina<br>
<br>
<blockquote
 cite="mid:AANLkTinc7gfpij4JXmeeX9XxaeLePmWrDo7MExbLHzcV@mail.gmail.com"
 type="cite"><br>
This is not an issue of exception handling.<br>
  <br>
If you use "declare" you'll have to initialize all collection-typed
fields properly<br>
before you can call any methods, e.g.<br>
  <br>
Set set = new HashSet&lt;?&gt;()<br>
watcher.setValueSet( set );<br>
set.add(...)<br>
  <br>
-W<br>
  <br>
  <br>
  <br>
  <div class="gmail_quote">2010/8/13 Tina Vie&szlig;mann <span dir="ltr">&lt;<a
 moz-do-not-send="true" href="mailto:tviessmann@stud.hs-bremen.de">tviessmann@stud.hs-bremen.de</a>&gt;</span><br>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
    <div bgcolor="#ffffff" text="#000000">
Hi Edson,<br>
    <br>
I can't provide a test case. But I've figured out what the exception
are about. It's not about the code I've posted before. It's about the
exceptions that the java.util.Set.add() method throws. I've attached
the concerned code at the end.<br>
That means for me I have to manage the exception handling. I've tried
to google the topic. The best I came up with is a mailing list entry:
    <a moz-do-not-send="true"
 href="http://drools-java-rules-engine.46999.n3.nabble.com/Exception-handling-policy-td113782.html"
 target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/Exception-handling-policy-td113782.html</a>&nbsp;
Would
that be the correct solution? If yes, how do I implement the
handler? I would be thankful for a code example.<br>
    <br>
The code that the exception references is:<br>
    <blockquote>declare Watcher<br>
&nbsp;&nbsp;&nbsp; @role ( event )<br>
      <br>
&nbsp;&nbsp;&nbsp; triggeringValue : Value<br>
&nbsp;&nbsp;&nbsp; numberOfContainedValues : int<br>
&nbsp;&nbsp;&nbsp; valueSet : Set&nbsp; // Set&lt;Value&gt;<br>
end<br>
      <br>
// ....<br>
      <br>
function Watcher generateWatcherEvent(Value firstValue) {<br>
&nbsp;&nbsp;&nbsp; Watcher watcher = new Watcher();<br>
&nbsp;&nbsp;&nbsp; watcher.setNumberOfContainedValues(1);<br>
&nbsp;&nbsp;&nbsp; watcher.setTriggeringValue(firstValue);<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; // add value to set<br>
&nbsp;&nbsp;&nbsp; Set set = watcher.getValueSet();<br>
&nbsp;&nbsp;&nbsp; set.add(firstValue);<br>
&nbsp;&nbsp;&nbsp; watcher.setValueSet(set);<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; return watcher;<br>
}<br>
    </blockquote>
    <br>
Thanks for your help! :)<br>
    <br>
Tina<br>
    <br>
    <br>
Am 13.08.2010 01:14, schrieb Edson Tirelli:
    <blockquote type="cite">&nbsp;&nbsp; Hi Tina,
      <div><br>
      </div>
      <div>&nbsp;&nbsp; Can you provide a test case?</div>
      <div><br>
      </div>
      <div>&nbsp;&nbsp; Edson<br>
      <br>
      <div class="gmail_quote">2010/8/12 Tina Vie&szlig;mann <span dir="ltr">&lt;<a
 moz-do-not-send="true" href="mailto:tviessmann@stud.hs-bremen.de"
 target="_blank">tviessmann@stud.hs-bremen.de</a>&gt;</span><br>
      <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi
again
...<br>
        <br>
I would like to insert a new generated object into the knowledge base.<br>
It seems that<br>
&nbsp; &nbsp; insert (new Watcher())<br>
&nbsp;is working. But<br>
&nbsp; &nbsp; Watcher watcher = new Watcher();<br>
&nbsp; &nbsp; insert (watcher);<br>
&nbsp;isn't working?<br>
        <br>
Why?<br>
        <br>
Thank you for any explanations. :)<br>
        <div>
        <div><br>
Tina<br>
_______________________________________________<br>
rules-users mailing list<br>
        <a moz-do-not-send="true"
 href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
        <a moz-do-not-send="true"
 href="https://lists.jboss.org/mailman/listinfo/rules-users"
 target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
        </div>
        </div>
      </blockquote>
      </div>
      <br>
      <br clear="all">
      <br>
-- <br>
&nbsp; Edson Tirelli<br>
&nbsp; JBoss Drools Core Development<br>
&nbsp; JBoss by Red Hat @ <a moz-do-not-send="true"
 href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
      </div>
      <pre><fieldset></fieldset>
_______________________________________________
rules-users mailing list
<a moz-do-not-send="true" href="mailto:rules-users@lists.jboss.org"
 target="_blank">rules-users@lists.jboss.org</a>
<a moz-do-not-send="true"
 href="https://lists.jboss.org/mailman/listinfo/rules-users"
 target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  </pre>
    </blockquote>
    <br>
    </div>
    <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"
 href="https://lists.jboss.org/mailman/listinfo/rules-users"
 target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
    <br>
  </blockquote>
  </div>
  <br>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
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>