return m;
}
private RuleModel getComplexModel() {
final RuleModel m = new RuleModel();
m.name = "Complex Rule";
m.addAttribute( new RuleAttribute( "no-loop",
"true" ) );
m.addAttribute( new RuleAttribute( "salience",
"-10" ) );
m.addAttribute( new RuleAttribute( "agenda-group",
"aGroup" ) );
final FactPattern pat = new FactPattern();
pat.boundName = "p1";
pat.factType = "Person";
final SingleFieldConstraint con = new SingleFieldConstraint();
con.fieldBinding = "f1";
con.fieldName = "age";
con.operator = "<";
con.value = "42";
pat.addConstraint( con );
m.addLhsItem( pat );
final CompositeFactPattern comp = new CompositeFactPattern( "not" );
comp.addFactPattern( new FactPattern( "Cancel" ) );
m.addLhsItem( comp );
final ActionUpdateField set = new ActionUpdateField();
set.variable = "p1";
set.addFieldValue( new ActionFieldValue( "status",
"rejected",
SuggestionCompletionEngine.TYPE_STRING ) );
m.addRhsItem( set );
final ActionRetractFact ret = new ActionRetractFact( "p1" );
m.addRhsItem( ret );
final DSLSentence sen = new DSLSentence();
sen.sentence = "Send an email to {administrator}";
m.addRhsItem( sen );
return m;
}