Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-450

Cannot use decimal formatters for integers in an excel decision table

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 6.1.0.Beta2
    • 6.0.1.Final
    • None
    • None

      When I use decimal formatter in an excel action column for numbers that are in fact integers, I am getting this exception :

      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)
      

      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 :

      if ( num - Math.round( num ) != 0 )
      

      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.

            manstis@redhat.com Michael Anstis
            mfalaize_jira Maxime Falaize (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: