[jboss-jira] [JBoss JIRA] (DROOLS-3880) Bug when parsing fact from String to Double in Drools

Mario Fusco (Jira) issues at jboss.org
Wed Apr 17 02:22:00 EDT 2019


     [ https://issues.jboss.org/browse/DROOLS-3880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mario Fusco updated DROOLS-3880:
--------------------------------
    Sprint: 2019 Week 14-16


> Bug when parsing fact from String to Double in Drools
> -----------------------------------------------------
>
>                 Key: DROOLS-3880
>                 URL: https://issues.jboss.org/browse/DROOLS-3880
>             Project: Drools
>          Issue Type: Bug
>          Components: core engine
>    Affects Versions: 7.0.0.Final
>         Environment: Ubuntu, Intellij Idea
>            Reporter: Almas Toimbekov
>            Assignee: Mario Fusco
>            Priority: Major
>
> When one inserts a new object in drl file and afterward wants to compare its String representation of a number with another number in next rules Drools gives an exception. It is much clearer with an example (below in code section)
> Interesting that when you compare it as a String (amount == "10") - it works fine. But when you try to parse "amount" to Double then Java doesn't know that there is any value at all (thinks amount == null and therefore cannot parse it). The second interesting thing is that if you created this object (resource) in java and inserted it before "fireAllRules()" - "amount" field become visible to the parser and it works.
> But the matter is that I cannot create this object before firing rules because I don't know wheter there will be a need of it. And my fields must be String as well. And I have to compare it like "more than" or "less than", so comparing strings doesn't apply. 



--
This message was sent by Atlassian Jira
(v7.12.1#712002)


More information about the jboss-jira mailing list