Functions
functions are used to implement logic using Java constructions. We sometimes use functions in our DSLs to extend the Drools logic capability, or to perform calculations that are difficult to do directly in the Drools language.
Here is an example of a function that we use to logically remove the time portion of a date-time value, which is useful when you are doing things like counting the number of distinct dates when a particular event happened:
Most of the functions that we use for Drools were developed in the OpenCDS source code as java methods in the package opencds-guvnor-support/src/main/java/org/opencds/support/guvnor/GuvnorFunctionWorkup.java.