Package org.drools.drl.ast.dsl
Interface RuleDescrBuilder
- All Superinterfaces:
AnnotatedDescrBuilder<RuleDescrBuilder>,AttributeSupportBuilder<RuleDescrBuilder>,DescrBuilder<PackageDescrBuilder,RuleDescr>
- All Known Implementing Classes:
RuleDescrBuilderImpl
public interface RuleDescrBuilder
extends AnnotatedDescrBuilder<RuleDescrBuilder>, AttributeSupportBuilder<RuleDescrBuilder>, DescrBuilder<PackageDescrBuilder,RuleDescr>
A descriptor builder for rules
-
Method Summary
Modifier and TypeMethodDescriptionextendsRule(String name) Defines the name of the rule this rule extends.lhs()Defines the LHS (condition) of the rule.The name of the rule.An additional named right hand side (consequence) of the rule.The default right hand side (consequence) of the rule.Methods inherited from interface org.drools.drl.ast.dsl.AnnotatedDescrBuilder
newAnnotationMethods inherited from interface org.drools.drl.ast.dsl.AttributeSupportBuilder
attribute, attribute, attributeMethods inherited from interface org.drools.drl.ast.dsl.DescrBuilder
end, endCharacter, endLocation, getDescr, getParent, startCharacter, startLocation
-
Method Details
-
name
The name of the rule. Best practice is to keep rule names relatively short, i.e. under 60 characters.- Parameters:
name- name of the rule- Returns:
- itself
-
extendsRule
Defines the name of the rule this rule extends. It will cause the rule to inherit the LHS from the parent rule.- Parameters:
name- name of the parent rule- Returns:
- itself
-
rhs
The default right hand side (consequence) of the rule. This is a code block that must be valid according to the used dialect (java or MVEL). In particular, the deprecated '#' character, that was used for one line comments is not supported. For one line comments, please use standard '//'.- Parameters:
rhs- the code block- Returns:
- itself
-
namedRhs
An additional named right hand side (consequence) of the rule. This is a code block that must be valid according to the used dialect (java or MVEL). In particular, the deprecated '#' character, that was used for one line comments is not supported. For one line comments, please use standard '//'.- Parameters:
name- the name of the consequencerhs- the code block- Returns:
- itself
-
lhs
Defines the LHS (condition) of the rule.- Returns:
- a Conditional Element descriptor builder with the AND CE semantic.
-