The Drools component integration is an example of integrating business rules with your data. This example will demonstrate how a business rule can be triggered via a User Defined Function (UDF).
The UDF (RulesUDF.java) is written to load one or more drools .drl file(s) that is defined as a system property. An example is:
where: - value format is: POJO className:.drl file[,POJO className:.drl,…]
The format maps the POJO to the rule that will process it.
The caller to the UDF will call the following function method:
public static Object performRuleOnData(final String className, final String returnMethodName, final Object returnIfNull, final Object... arguments)
One of the goals of this example was to demonstrate that a UDF could be written generically to integrate with drools.