I have a DMN model defined in the KIE Sandbox which executes as expected in the runner within the sandbox.
The same model saved locally, packaged into a kjar and executed with the org.kie.dmn.api.core.DMNRuntime produces errors and cascading nulls due to type errors:
WARN org.kie.dmn.core.ast.DMNFunctionWithReturnType -
Error while evaluating node 'AssignLineIndex': the declared result type is
but the actual value '{index=1, value=1000}' is not an instance of that type
I can "resolve" this issue by either:
1. Declaring the result types to be the Any type throughout the model
2. Disabling runtime type checking by not calling DMNRuntime.setOption(new RuntimeTypeCheckOption(true))
Neither of these feels satisfactory and it seems I'm missing something here.
What are the benefits and use cases of the RuntimeTypeCheckOption?
How can I define the types in the KIE Sandbox and have them correctly used/enforced at runtime?