Guided Rule throws "Unable to Analyse Expression" error with Date field if used with OR and temporal operator (before)
Issue
- If a user tries to create a rule using
Guided Rule
editor inBusiness Central
, where the condition section includes aTemporal Operator
like (before
) with anOR (||)
condition on a fact field of typejava.util.Date
it throws themUnable to Analyse Expression
exception during validation of the rule .
Here is a sample rule for reference.
when
EnrolmentInformation( enrolledDate != null || enrolledDate before "29-Apr-2017" )
then
That is causing them following error while validating the rule and even causes trouble while building the project too.
17:42:47,403 ERROR [org.drools.compiler.kie.builder.impl.AbstractKieModule] (http-127.0.0.1:8080-3) Unable to build KieBaseModel:defaultKieBase
Unable to Analyse Expression enrolledDate != null || enrolledDate before new java.util.Date(1493404200000):
[Error: unknown class or illegal statement: org.mvel2.ParserContext@22a9f74]
[Near :
{... enrolledDate before new java.util.Date(1493404200 ....}
]
^
[Line: 9, Column: 2] : [Rule name='DateEvaluateRule']
How to fix this issue?
Environment
- Red Hat JBoss BRMS (BRMS)
- 6.4.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.