Search code examples
droolsrule-enginekie-workbench

Decision Table can't do normal convertions. Not automatically converting int/double to BigDecimal


I'm trying to upload a Decision Table via workbench (6.2.0) but it fails validation because:

Rule Compilation error The method setCost(BigDecimal) in the type MyType is not applicable for the arguments (double)

It seems that normally you can solve this by adding dialect "mvel" to the rule. But I can't find a way to do this with a spreadsheet (.xls). Can anyone please help? I'm hoping for a better solution than writing an overload for setCost on the POJO!


Solution

  • You can define all rule attributes outside rules as well. An attribute remains valid until countermanded by another attribute value.

    This means that you can use the spreadsheet's feature for defining a function to specify the dialect.

    To clarify, this means that you can just write:

        ----------------------- 
        |RuleSet   | package 
        ----------------------- 
        |Functions | dialect "mvel" 
        ...
    

    and voila.