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.
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:
http://drools-java-rules-engine.46999.n3.nabble.com/Exception-handling-policy-td113782.html
Would that be the correct solution? If yes, how do I implement the
handler? I would be thankful for a code example.
The code that the exception references is:
declare Watcher
@role ( event )
triggeringValue : Value
numberOfContainedValues : int
valueSet : Set // Set<Value>
end
// ....
function Watcher generateWatcherEvent(Value firstValue) {
Watcher watcher = new Watcher();
watcher.setNumberOfContainedValues(1);
watcher.setTriggeringValue(firstValue);
// add value to set
Set set = watcher.getValueSet();
set.add(firstValue);
watcher.setValueSet(set);
I would like to insert a new generated object into the knowledge base.
It seems that
insert (new Watcher())
is working. But
Watcher watcher = new Watcher();
insert (watcher);
isn't working?