Package org.drools.template.model
Class Rule
java.lang.Object
org.drools.template.model.DRLElement
org.drools.template.model.AttributedDRLElement
org.drools.template.model.Rule
- All Implemented Interfaces:
DRLJavaEmitter
Represents a rule.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCondition(Condition con) voidvoidaddMetadata(String meta) voidappendDescription(String value) getName()intvoidEach node can add its contribution to the outputvoidsetDescription(String value) voidMethods inherited from class org.drools.template.model.AttributedDRLElement
asStringLiteral, asTimerLiteral, getAttribute, getSalience, setActivationGroup, setAgendaGroup, setAutoFocus, setCalendars, setDateEffective, setDateExpires, setDuration, setEnabled, setLockOnActive, setNoLoop, setRuleFlowGroup, setSalience, setSalience, setTimerMethods inherited from class org.drools.template.model.DRLElement
setComment
-
Field Details
-
MAX_ROWS
public static final int MAX_ROWS- See Also:
-
-
Constructor Details
-
Rule
Create a new rule. Note that the rule name should be post-fixed with the row number, as one way of providing tracability for errors back to the originating spreadsheet.- Parameters:
name- The name of the rule. This may be used to calculate DRL row error to Spreadsheet row error (just need to keep track of output lines, and map spreadsheetRow to a start and end range in the rendered output).salience-spreadsheetRow- The phyical row number from the spreadsheet.
-
-
Method Details
-
addMetadata
-
addCondition
-
addConsequence
-
renderDRL
Description copied from interface:DRLJavaEmitterEach node can add its contribution to the output- Specified by:
renderDRLin interfaceDRLJavaEmitter- Overrides:
renderDRLin classAttributedDRLElement
-
getMetadata
-
getConditions
-
getConsequences
-
setName
-
getName
-
setDescription
-
appendDescription
-
getSpreadsheetRowNumber
public int getSpreadsheetRowNumber()- Returns:
- The row in the spreadsheet this represents. This can be handy when mapping a line error from Parser back to the rule row. Will need to have a map of ranges of line numbers that each rule covers. Then can find out the rule that cause it, and this will give the row number to report.
-