I want to evaluate in Drools 7.21 FEEL-funtions that are new in DMN 1.2, like sqrt() or modulo(), but the method
dmnRuntime.evaluateAll(dmnModel,context)
is allways returning the value 'null' (just for the new functions) with status 'SUCCESS'. What do I do wrong or what is missing?
The DMN-File looks like this:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<semantic:definitions xmlns:semantic="http://www.omg.org/spec/DMN/20180521/MODEL/" xmlns="http://www.trisotech.com/definitions/_56fd6445-ff6a-4c28-8206-71fce7f80436" xmlns:feel="http://www.omg.org/spec/FEEL/20140401" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exporter="DMN Modeler" exporterVersion="6.0.1" id="_56fd6445-ff6a-4c28-8206-71fce7f80436" name="Sqrt-Function" namespace="http://www.trisotech.com/definitions/_56fd6445-ff6a-4c28-8206-71fce7f80436" >
<semantic:decision id="_cf6124bd-9907-4ac0-b4fd-59a962dbc502" name="square_root">
<semantic:variable id="_edaf978e-3634-4e52-8244-5fd4e16fd257" name="square_root" typeRef="feel:number"/>
<semantic:literalExpression id="_c990c3b2-e322-4ef9-931d-79bcdac99686">
<semantic:text>sqrt(81)</semantic:text>
</semantic:literalExpression>
</semantic:decision>
</semantic:definitions>
After importing the file in "dmnModel":
DMNMarshaller marshaller = new org.kie.dmn.backend.marshalling.v1x.XStreamMarshaller();
FileInputStream fis = new FileInputStream( dmnFile );
Definitions unmarshal = marshaller.unmarshal( new InputStreamReader( fis ) );
DMNCompiler compiler = DMNFactory.newCompiler();
DMNModel dmnModel = compiler.compile(unmarshal);
I call the Drools-evaluation like this:
KieContainer kieContainer = KieHelper.getKieContainer(ks.newReleaseId("org.kie", "dmn-test-"+UUID.randomUUID(), "1.2"));
DMNRuntime dmnRuntime = kieContainer.newKieSession().getKieRuntime(DMNRuntime.class);
((DMNRuntimeImpl) dmnRuntime).setOption(new RuntimeTypeCheckOption(true));
DMNResult result = dmnRuntime.evaluateAll(dmnModel, context);