Description of problem:
A ClassCastException is thrown by trying to use OR condition in when part as follows:
rule "sample"
no-loop
when
$tx: (Text (id=='foo') or Text (id=='bar'))
$m: Message()
then
modify($m)
;
end
However, it works well if using "||". The exact same rule above works well in BRMS 6.2.x.
Version-Release number of selected component (if applicable):
6.3.0
How reproducible:
Always
Steps to Reproduce:
1. Create a sample rule like the one above;
2. Try to run it by using BRMS 6.3.0 libraries;
Actual results:
Caused by: java.lang.ClassCastException: com.sample.Message cannot be cast to org.drools.core.common.InternalFactHandle
at org.drools.core.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:398)
...
Expected results:
It should work well as it work in 6.2.
Additional info:
A workaround would be to split the rule or use "||" as follows:
$tx: Text (id=='foo' || id=='bar')
KCS Solution
"ClassCastException" when modifying a fact involved in an 'or' condition in BRMS 6.3.x
- is duplicated by
-
RHBRMS-2450 Drool Modify operator causing ClassCastException
- Closed