Package org.drools.decisiontable.parser
Class RuleMatrixSheetListener
- java.lang.Object
-
- org.drools.decisiontable.parser.DefaultRuleSheetListener
-
- org.drools.decisiontable.parser.RuleMatrixSheetListener
-
- All Implemented Interfaces:
RuleSheetListener,org.drools.template.parser.DataListener
public class RuleMatrixSheetListener extends DefaultRuleSheetListener
href="mailto:michael.neale@gmail.com"> Michael Neale Define a ruleset spreadsheet which contains a matrix style decision tables. This is an example of a custom RuleSheetListener. It differs from the standard decision table in the following ways: - AgendaGroup property so that all rules fall within the same agenda-group - Precondition property which specifies a condition that is always included if a rule is being generated - Action property. Each cell within the decision table causes this action to be triggered - HorizontalCondition property. Each column header in the matrix applies this condition - VerticalCondition property. Each row header in the matrix applies this condition A table is identifed by a cell beginning with the text "RuleTable". The cells after RuleTable in the same row identify the Horizontal Conditions. The cells after RuleTable in the same column identify the Vertical Conditions. The cells with the matrix identify the actions. Wherever an action cell exists for a Vertical/Horizontal condition intersection the following rule is created: rule "rule_row_col" agenda-group AgendaGroup when Precondition VerticalCondition HorizontalCondition then Action end
-
-
Field Summary
Fields Modifier and Type Field Description static StringACTION_TAGstatic StringAGENDAGROUP_TAGstatic StringHORIZONTALCONDITION_TAGstatic StringPRECONDITION_TAGstatic StringVERTICALCONDITION_TAG-
Fields inherited from class org.drools.decisiontable.parser.DefaultRuleSheetListener
DECLARES_TAG, DIALECT_TAG, ESCAPE_QUOTES_FLAG, FUNCTIONS_TAG, IGNORE_NUMERIC_FORMAT_FLAG, IMPORT_TAG, MAX_SALIENCE_TAG, MIN_SALIENCE_TAG, NUMERIC_DISABLED_FLAG, QUERIES_TAG, RULE_TABLE_TAG, RULESET_TAG, SEQUENTIAL_FLAG, UNIT_TAG, VARIABLES_TAG
-
-
Constructor Summary
Constructors Constructor Description RuleMatrixSheetListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinishSheet()voidnewCell(int row, int column, String value, int mergedColStart)voidnewRow(int rowNumber, int columns)protected voidpostInitRuleTable(int row, int column, String value)Called after rule table initialisation.protected voidpreInitRuleTable(int row, int column, String value)This gets called each time a "new" rule table is found.-
Methods inherited from class org.drools.decisiontable.parser.DefaultRuleSheetListener
addRule, doesIgnoreNumericFormat, getCurrentRule, getProperties, getRuleSet, isNumericDisabled, setWorksheetName, startSheet
-
-
-
-
Field Detail
-
AGENDAGROUP_TAG
public static final String AGENDAGROUP_TAG
- See Also:
- Constant Field Values
-
PRECONDITION_TAG
public static final String PRECONDITION_TAG
- See Also:
- Constant Field Values
-
ACTION_TAG
public static final String ACTION_TAG
- See Also:
- Constant Field Values
-
HORIZONTALCONDITION_TAG
public static final String HORIZONTALCONDITION_TAG
- See Also:
- Constant Field Values
-
VERTICALCONDITION_TAG
public static final String VERTICALCONDITION_TAG
- See Also:
- Constant Field Values
-
-
Method Detail
-
newCell
public void newCell(int row, int column, String value, int mergedColStart)- Specified by:
newCellin interfaceorg.drools.template.parser.DataListener- Overrides:
newCellin classDefaultRuleSheetListener
-
newRow
public void newRow(int rowNumber, int columns)- Specified by:
newRowin interfaceorg.drools.template.parser.DataListener- Overrides:
newRowin classDefaultRuleSheetListener
-
finishSheet
public void finishSheet()
- Specified by:
finishSheetin interfaceorg.drools.template.parser.DataListener- Overrides:
finishSheetin classDefaultRuleSheetListener
-
postInitRuleTable
protected void postInitRuleTable(int row, int column, String value)Description copied from class:DefaultRuleSheetListenerCalled after rule table initialisation. Subclasses may override this method to do additional processing.- Overrides:
postInitRuleTablein classDefaultRuleSheetListener
-
preInitRuleTable
protected void preInitRuleTable(int row, int column, String value)This gets called each time a "new" rule table is found.- Overrides:
preInitRuleTablein classDefaultRuleSheetListener
-
-