RuleModel model = new RuleModel();
model.name = "rule2";
FactPattern pattern = new FactPattern( "Person" );
pattern.setBoundName( "p" );
ActionSetField action = new ActionSetField( "p" );
ActionFieldValue value = new ActionFieldValue( "age",
"42",
SuggestionCompletionEngine.TYPE_NUMERIC_INTEGER );
action.addFieldValue( value );
model.addLhsItem( pattern );
model.addRhsItem( action );
DSLSentence dslCondition = new DSLSentence();
dslCondition.setDefinition( "This is a sentence" );
model.addLhsItem( dslCondition );
DSLSentence dslAction = new DSLSentence();
dslAction.setDefinition( "say {42}" );
model.addRhsItem( dslAction );
rule1.updateContent( BRXMLPersistence.getInstance().marshal( model ) );
rule1.checkin( "" );
repo.save();
//now add a rule with no DSL
model = new RuleModel();
model.name = "ruleNODSL";
pattern = new FactPattern( "Person" );
pattern.setBoundName( "p" );
action = new ActionSetField( "p" );
value = new ActionFieldValue( "age",
"42",
SuggestionCompletionEngine.TYPE_NUMERIC_INTEGER );
action.addFieldValue( value );
model.addLhsItem( pattern );