h1. Drools Component Integration |
The Drools component integration is an example of integrating business rules with your data. This example will demonstrate demonstrates 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: |
- <property name="org.teiid.drools.UDF" value="org.jboss.teiid.quickstart.data.MarketData:MyBusinessRules.drl"/> |
... |
So all the arguments will be passed in when the "className" is instantiated. |
One of the goals of this example was to demonstrate that a UDF could be written generically to integrate with drools. |
Other integration scenarios, such as using Teiid as a data integration engine under Drools or interacting with live knowledge base, are of course also possible. |
The Drools component integration is an example of integrating business rules with your data. This example demonstrates 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 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) ...
where:
Other integration scenarios, such as using Teiid as a data integration engine under Drools or interacting with live knowledge base, are of course also possible.