I am utilizing Business Central 7.40.0. When calling the static Java method std from a Drools Business Central DMN project or model, the following error is generated:
DMN: Error compiling Java function 'stdev' on node 'stdev': Error resolving external function as defined by: function(val) external { java: { class: ""com.sample.StandardDeviation"", method signature: ""std(java.lang.Number)"" }}...
Error compiling the referenced FEEL expression
I have:
Created Maven jar with static Java method-
package com.sample;
import java.math.BigDecimal;
public class StandardDeviation {
public static BigDecimal std(Number val) {
return new BigDecimal(val.doubleValue() * 2);
}
}
2. Imported Jar as Artifacts to Drools Business Central,
3. Added Dependency to DMN project
4. In my DMN model, I am calling static Java method inside 'stdev' BKM (business knowledge model) element. BKM with class and method signature
class: "com.sample.StandardDeviation"
method signature: "std(java.lang.Number)"
5. Saving BKM/DMN or building the model gives above error
What could be the issue? Am I doing anything incorrectly? How to check the logs in Drools Business Central?
Here's a link that may help you.
Calling Java from DMN - KIE Community