Hi,
how can we extend JUL with Java functions so that they can be used from different DMNs in a shared camunda server. I have tried the example (AzimoLabs/extend-camunda-dmn-jul-with-java-functions) but the extended functions are not accessable from DMNs not deployed in this war. Our goal is to provide a set of functions to provide complex business functions in an easy way to our users.
Is this possible?
Any help will be appreciated.
public class DateHelper {
public static Date addDays(Date date, Integer days) {
if (date == null) {
return new Date();
}
LocalDateTime dt = new LocalDateTime(date.getTime(), DateTimeZone.getDefault());
dt = dt.plusDays(days);
return dt.toDate();
}
}
I registered this FunctionMapper inside the ProcessEngine as a plugin as described in the DmnDecisionChainingPlugin.java example.
I can now access the custom function from inside the Dmn using ex:addDays(date, days) and it works fine but now I am struggling with testing. How can I register this plugin in the embedded DmnEngine for executing JUnit-Tests. I can only find examples with Spring Beans.
Any help will be appreciated?
Has anyone an idea how to register this plugin in the embedded DmnEngine for execution of JUnit-Tests?
It doesn’t matter what I try nothing works, the custom functions are not recognized during the JUnit-Test.