rtvb
(Robert)
January 24, 2017, 9:54pm
5
Still no change in results. I have applied the suggestion from @rlkoshak to use equals
and will see what happened tomorrow morning (I will be asleep at midnight ).
Not a bug.
DateTime is a complicated type and complicated types rarely work with ==. Try
if(dt1.equals(dt2))
It’s a long explanation which I won’t go into here. Suffice to say it is what many consider to be a design flaw in Java and therefore a design flaw inherited by the Rules DSL which runs on Java.
For a rule of thumb, you can only use == for:
Number
BigDecimal
primitives
Strings
Boolean
Enums (e.g ON, OFF, OPEN, CLOSED)
All other types such as DateTime must either be converted to on…