Package org.drools.compiler.lang.api
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RuleDescrBuilder
extendsRule(String name)
Defines the name of the rule this rule extends.CEDescrBuilder<RuleDescrBuilder,AndDescr>
lhs()
Defines the LHS (condition) of the rule.RuleDescrBuilder
name(String name)
The name of the rule.RuleDescrBuilder
namedRhs(String name, String rhs)
An additional named right hand side (consequence) of the rule.RuleDescrBuilder
rhs(String rhs)
The default right hand side (consequence) of the rule.-
Methods inherited from interface org.drools.compiler.lang.api.AnnotatedDescrBuilder
newAnnotation
-
Methods inherited from interface org.drools.compiler.lang.api.AttributeSupportBuilder
attribute, attribute, attribute
-
Methods inherited from interface org.drools.compiler.lang.api.DescrBuilder
end, endCharacter, endLocation, getDescr, startCharacter, startLocation
-
-
-
-
Method Detail
-
name
RuleDescrBuilder name(String 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
RuleDescrBuilder extendsRule(String name)
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
RuleDescrBuilder rhs(String 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
RuleDescrBuilder namedRhs(String name, String rhs)
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
CEDescrBuilder<RuleDescrBuilder,AndDescr> lhs()
Defines the LHS (condition) of the rule.- Returns:
- a Conditional Element descriptor builder with the AND CE semantic.
-
-