public static class KiePMMLDroolsRule.Builder extends Object
| Modifier and Type | Field and Description |
|---|---|
protected KiePMMLDroolsRule |
toBuild |
| Constructor and Description |
|---|
Builder(String name,
String statusToSet,
List<KiePMMLOutputField> outputFields) |
| Modifier and Type | Method and Description |
|---|---|
KiePMMLDroolsRule |
build() |
KiePMMLDroolsRule.Builder |
withAccumulation(Number toAccumulate)
Accumulate the given number to the
StatusHolder
(rhs)
$statusHolder.accumulate("_toAccumulate_"); |
KiePMMLDroolsRule.Builder |
withAccumulationResult(boolean accumulationResult)
If true, return the result of the overall accumulation
(rhs)
$pmml4Result.addResultVariable($pmml4Result.getResultObjectName(), $statusHolder.getAccumulator()); |
KiePMMLDroolsRule.Builder |
withActivationGroup(String activationGroup)
Set the Activation Group of the rule
(lhs)
activation-group "_activationGroup_" |
KiePMMLDroolsRule.Builder |
withAgendaGroup(String agendaGroup)
Set the Agenda Group of the rule
(lhs)
agenda-group "_agendaGroup_" |
KiePMMLDroolsRule.Builder |
withAndConstraints(List<KiePMMLFieldOperatorValue> constraints) |
KiePMMLDroolsRule.Builder |
withFocusedAgendaGroup(String focusedAgendaGroup)
Set the AgendaGroup to be focused
(rhs)
kcontext.getKieRuntime().getAgenda().getAgendaGroup( "_focusedAgendaGroup_").setFocus(); |
KiePMMLDroolsRule.Builder |
withIfBreak(String ifBreakField,
String ifBreakOperator,
Object ifBreakValue)
Add a break statement to the lhs of the rule
(e.g. ifBreakField = "SEPAL_WIDTH"; ifBreakOperator = ">="; ifBreakValue = 5.45 generates
$inputField: SEPAL_WIDTH()
if ($inputField.getValue() >= 5.45) break[match] |
KiePMMLDroolsRule.Builder |
withInConstraints(Map<String,List<Object>> constraints) |
KiePMMLDroolsRule.Builder |
withNotConstraints(List<KiePMMLFieldOperatorValue> constraints) |
KiePMMLDroolsRule.Builder |
withNotInConstraints(Map<String,List<Object>> constraints) |
KiePMMLDroolsRule.Builder |
withOrConstraints(List<KiePMMLFieldOperatorValue> constraints) |
KiePMMLDroolsRule.Builder |
withReasonCodeAndValue(KiePMMLReasonCodeAndValue reasonCodeAndValue)
Add the given reasonCode to the ordered map of matched reason codes.
|
KiePMMLDroolsRule.Builder |
withResult(Object result)
Set the result to be returned
(rhs)
$pmml4Result.addResultVariable($pmml4Result.getResultObjectName(), _result_); |
KiePMMLDroolsRule.Builder |
withResultCode(ResultCode resultCode)
Set the result code to be returned
(rhs)
$pmml4Result.setResultCode(_resultCode_); |
KiePMMLDroolsRule.Builder |
withStatusConstraint(String constraint)
The required status to fire the given rule
(lhs)
$statusHolder : KiePMMLStatusHolder( status == "_constraint_" ) |
KiePMMLDroolsRule.Builder |
withXorConstraints(List<KiePMMLFieldOperatorValue> constraints) |
protected KiePMMLDroolsRule toBuild
public Builder(String name, String statusToSet, List<KiePMMLOutputField> outputFields)
name - statusToSet - outputFields - public KiePMMLDroolsRule.Builder withStatusConstraint(String constraint)
(lhs)
$statusHolder : KiePMMLStatusHolder( status == "_constraint_" )
constraint - public KiePMMLDroolsRule.Builder withAndConstraints(List<KiePMMLFieldOperatorValue> constraints)
constraints - The key of the map is the name of the generated type, while the value is the List<KiePMMLOperatorValue>
to use for evaluation. Implicitly, the latter is evaluated with the value field of the former
(e.g entry "OUTLOOK"/List(KiePMMLOperatorValue("==", "sunny")) generates
OUTLOOK(value == "sunny")
(e.g entry "TEMPERATURE"/List(KiePMMLOperatorValue("<", 90), KiePMMLOperatorValue(">", 50)) generates
TEMPERATURE( value < 90 && value > 50 )
public KiePMMLDroolsRule.Builder withOrConstraints(List<KiePMMLFieldOperatorValue> constraints)
constraints - The key of the map is the name of the generated type, while the value is the List<KiePMMLOperatorValue>
to use for evaluation. Implicitly, the latter is evaluated with the value field of the former
(e.g entry "OUTLOOK"/List(KiePMMLOperatorValue("==", "sunny")) generates
OUTLOOK(value == "sunny")
(e.g entry "TEMPERATURE"/List(KiePMMLOperatorValue("<", 90), KiePMMLOperatorValue(">", 50)) generates
TEMPERATURE( value < 90 && value > 50 )
public KiePMMLDroolsRule.Builder withXorConstraints(List<KiePMMLFieldOperatorValue> constraints)
constraints - The List<KiePMMLOperatorValue>
to use for evaluation. Implicitly, the "operator" and the "value" fields are evaluated with the value field of the former
(e.g entry KiePMMLOperatorValue("OUTLOOK", "==", "sunny")) generates
OUTLOOK(value == "sunny")
(e.g entry KiePMMLOperatorValue("TEMPERATURE", "<", 90), KiePMMLOperatorValue("TEMPERATURE",">", 50)) generates
TEMPERATURE( value < 90) TEMPERATURE( value > 50 )
public KiePMMLDroolsRule.Builder withNotConstraints(List<KiePMMLFieldOperatorValue> constraints)
constraints - The key of the map is the name of the generated type, while the value is the List<KiePMMLOperatorValue>
to use for evaluation. Implicitly, the latter is evaluated with the value field of the former
(e.g entry "OUTLOOK"/List(KiePMMLOperatorValue("==", "sunny")) generates
not(OUTLOOK(value == "sunny")
(e.g entry "TEMPERATURE"/List(KiePMMLOperatorValue("<", 90), KiePMMLOperatorValue(">", 50)) generates
not(TEMPERATURE( value < 90 && value > 50 )
public KiePMMLDroolsRule.Builder withInConstraints(Map<String,List<Object>> constraints)
constraints - The key of the map is the name of the generated type, while the value is the List<Object>
to use for evaluation. Implicitly, the latter is evaluated with the value field of the former
(e.g entry "INPUT1"/List(-5, 0.5, 1, 10) generates
INPUT1(value in (-5, 0.5, 1, 10)
public KiePMMLDroolsRule.Builder withNotInConstraints(Map<String,List<Object>> constraints)
constraints - The key of the map is the name of the generated type, while the value is the List<Object>
to use for evaluation. Implicitly, the latter is evaluated with the value field of the former
(e.g entry "INPUT2"/List(3, 8.5) generates
not(INPUT2(value in(3, 8.5))
public KiePMMLDroolsRule.Builder withIfBreak(String ifBreakField, String ifBreakOperator, Object ifBreakValue)
$inputField: SEPAL_WIDTH()
if ($inputField.getValue() >= 5.45) break[match]
ifBreakField - ifBreakOperator - ifBreakValue - public KiePMMLDroolsRule.Builder withResultCode(ResultCode resultCode)
(rhs)
$pmml4Result.setResultCode(_resultCode_);
resultCode - public KiePMMLDroolsRule.Builder withResult(Object result)
(rhs)
$pmml4Result.addResultVariable($pmml4Result.getResultObjectName(), _result_);
result - public KiePMMLDroolsRule.Builder withAgendaGroup(String agendaGroup)
(lhs)
agenda-group "_agendaGroup_"
agendaGroup - public KiePMMLDroolsRule.Builder withActivationGroup(String activationGroup)
(lhs)
activation-group "_activationGroup_"
activationGroup - public KiePMMLDroolsRule.Builder withFocusedAgendaGroup(String focusedAgendaGroup)
(rhs)
kcontext.getKieRuntime().getAgenda().getAgendaGroup( "_focusedAgendaGroup_").setFocus();
focusedAgendaGroup - public KiePMMLDroolsRule.Builder withAccumulation(Number toAccumulate)
StatusHolder
(rhs)
$statusHolder.accumulate("_toAccumulate_");
toAccumulate - public KiePMMLDroolsRule.Builder withAccumulationResult(boolean accumulationResult)
(rhs)
$pmml4Result.addResultVariable($pmml4Result.getResultObjectName(), $statusHolder.getAccumulator());
accumulationResult - public KiePMMLDroolsRule.Builder withReasonCodeAndValue(KiePMMLReasonCodeAndValue reasonCodeAndValue)
(rhs)
reasonCodeAndValue - public KiePMMLDroolsRule build()
Copyright © 2001–2021 JBoss by Red Hat. All rights reserved.