05: Drools with rules in an excel spreadsheet – Global variables & variable capture

This extends 04: Drools with rules in an excel spreadsheet – Data validation .

Step 1: Enhance the Trade.java POJO with “actualValues” field and “getFieldValue(String fieldNames)” method.

Step 2: trades-rules.xls with “variables” column.

xls file with rules

xls file with rules

Step 3: The trades.drt template file invoking the “getFieldValues(…)” method & declaring global variables.

Step 4: Finally, the “DataProfiling .java” file. It declares a global variable named “result”, which is of type “Set”.

Modify the CSV file so so that the data fails rules validation


Java developer & architect Q&As

Java developers Q&As

Top