[BE] Decision Tables - input of type Integer not validated
Steps to reproduce the problem:
Create a new Decision Table with a rule having an input field of type integer and use a string value
The Validate/Save action should detect the error
The Validate/Save action doesn't detect the error
The Pull Request had to be re-written from the scratch due to limitations with use of w3c dom library vs camunda’s dmn library (as it provide native methods to extract decisions information). Also, instead of grouping all the data types in one method, this was refactored via an interface with boolean, date, integer, long and double data type implementations.
During the work few other tools/external libraries were also investigated to ease the validation process like:
dmn-check: But, this was not catching any data type mismatch exceptions.
DMN Engine’s parseDecisions and .isDecisionTable() , but this too was not fruitful in catching invalid data type values.
We should be in a good position as multiple decisions inside a single dmn file can now be validated.
I tried exploring drools: DMNValidatorImpl but it seems there is an issue with drools expectation from provided perfectly valid Decision Model with regards to Decision node 'Decision_XXXXXX' is missing the variable declaration.
The above was a valid DMN model. I also noted something around drool validation with camunda library dmn model.
Covering all the data types allowed in Decision Table to validate against their provided values.
It seems a third-party library Camunda is handling all the validation of Decision Table and in order to further validate for data types we need to perform it separately.
Currently, am in the process of adding a new method after Camunda library’s validation here which is the exit point where the XML file and it’s schema is being validated.