" Person fact0 = new Person();\n" +
" fact0.setAge( 34 );\n" +
" insert(fact0 );\n" +
"end";
TemplateModel m = new TemplateModel();
m.name = "with composite";
m.lhs = new IPattern[2];
m.rhs = new IAction[1];
FactPattern fp = new FactPattern("Person");
fp.boundName = "$p";
SingleFieldConstraint sfc = new SingleFieldConstraint("name");
sfc.setFieldName("name");
sfc.setValue("name");
sfc.setOperator("==");
sfc.setConstraintValueType(BaseSingleFieldConstraint.TYPE_TEMPLATE);
fp.addConstraint(sfc);
m.lhs[0] = fp;
FreeFormLine ffl = new FreeFormLine();
ffl.text = "Cheese(type == @{type}, price < @{price})";
m.lhs[1] = ffl;
ActionInsertFact aif = new ActionInsertFact("Person");
ActionFieldValue afv = new ActionFieldValue("age", "age", "");
afv.nature = ActionFieldValue.TYPE_TEMPLATE;
aif.addFieldValue(afv);
m.rhs[0] = aif;
m.addRow(new String[] {"\"baunax\"", "\"Cheddar\"", "23", "34"});
m.addRow(new String[] {"\"diegoll\"", "\"Gouda\"", "17", "87"});
final String drl = p.marshal(m);
log.info("drl :\n{}", drl);
assertNotNull(drl);
assertEquals(expected, drl);