]
Toshiya Kobayashi updated DROOLS-5924:
--------------------------------------
Story Points: 4 (was: 3)
String vs Number Coercion behavior difference between standard-drl
and exec-model
---------------------------------------------------------------------------------
Key: DROOLS-5924
URL:
https://issues.redhat.com/browse/DROOLS-5924
Project: Drools
Issue Type: Bug
Components: core engine, executable model
Affects Versions: 7.47.0.Final
Reporter: Toshiya Kobayashi
Assignee: Toshiya Kobayashi
Priority: Major
If there is a constraint to compare String with Number, standard-drl (MvelConstraint)
coerces String to Number so the evaluation will be Number comparison (e.g. 10 > 5). But
exec-model coerces Number to String so the evaluation will be String comparison (e.g.
"10" < "5").
Note that we need to use Object or Map to test this because simple comparison String vs
Number causes a compilation error.
for example)
{noformat}
ObjectHolder($o : value)
StringHolder( value > $o )
{noformat}
or
{noformat}
$map : Map()
StringHolder( value > $map.get("key") )
{noformat}