[jboss-jira] [JBoss JIRA] (DROOLS-450) Cannot use decimal formatters for integers in an excel decision table

Michael Anstis (JIRA) issues at jboss.org
Thu Mar 13 06:28:10 EDT 2014


    [ https://issues.jboss.org/browse/DROOLS-450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12952590#comment-12952590 ] 

Michael Anstis commented on DROOLS-450:
---------------------------------------

Hello,

Perhaps you can guide me here. 

If your JRE locale is FRENCH then would parsing of numeric values expect them to be formatted "1,000" (instead of "1.000" that the PNG seems to show)? AFAIK using a period as a decimal separator is reserved for other Locales (Spain, Norway and othersd). Are the values in the XLS in fact numeric or Strings? Can you can include a couple of Unit Tests in your PR with both FR and EN locales - and suitable XLS files?   





                
> Cannot use decimal formatters for integers in an excel decision table
> ---------------------------------------------------------------------
>
>                 Key: DROOLS-450
>                 URL: https://issues.jboss.org/browse/DROOLS-450
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 6.0.1.Final
>            Reporter: Maxime Falaize
>            Assignee: Mark Proctor
>            Priority: Minor
>         Attachments: issue_example.png
>
>
> When I use decimal formatter in an excel action column for numbers that are in fact integers, I am getting this exception :
> {noformat}
> Exception in thread "main" java.lang.RuntimeException: Error while creating KieBase[Message [id=1, level=ERROR, path=com/sample/my_decision_table.xls, line=5, column=0
>    text=Rule Compilation error The method setParameter(double) in the type MyObject is not applicable for the arguments (int, int)]]
> 	at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:260)
> 	at org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:400)
> 	at org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:375)
> {noformat}
> Actually, the system uses the format number "1,00000" (with comma in french) instead of "1.00000" like it should use.
> This is causing by the line 174 in org.drools.decisiontable.parser.xls.ExcelParser :
> {code:java}
> if ( num - Math.round( num ) != 0 )
> {code}
> I don't understand why we use the formatted value when this test is not passed.
> I think the end users should have the possibility to keep the same formatter for the same column, with integers or not.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list