private ActionGlobalCollectionAdd visitActionGlobalCollectionAdd(ActionGlobalCollectionAdd agca) { ActionGlobalCollectionAdd clone = new ActionGlobalCollectionAdd(); clone.setFactName(agca.getFactName()); clone.setGlobalName(agca.getGlobalName()); return clone; }
private ActionGlobalCollectionAdd visitActionGlobalCollectionAdd(ActionGlobalCollectionAdd agca) { ActionGlobalCollectionAdd clone = new ActionGlobalCollectionAdd(); clone.setFactName(agca.getFactName()); clone.setGlobalName(agca.getGlobalName()); return clone; }
public void execute() { ActionGlobalCollectionAdd gca = new ActionGlobalCollectionAdd(); gca.setGlobalName(glob); gca.setFactName(var); model.addRhsItem(gca, Integer.parseInt(positionCbo.getValue(positionCbo.getSelectedIndex()))); hide(); } });
public void execute() { ActionGlobalCollectionAdd gca = new ActionGlobalCollectionAdd(); gca.setGlobalName(glob); gca.setFactName(var); model.addRhsItem(gca, Integer.parseInt(positionCbo.getValue(positionCbo.getSelectedIndex()))); hide(); } });
String factName = line.substring(argStart + 1, line.lastIndexOf(')')).trim(); ActionGlobalCollectionAdd actionGlobalCollectionAdd = new ActionGlobalCollectionAdd(); actionGlobalCollectionAdd.setGlobalName(variable); actionGlobalCollectionAdd.setFactName(factName);
@Test public void testBasics() { final RuleTemplateModelPersistence p = RuleTemplateModelXMLPersistenceImpl.getInstance(); final TemplateModel m = new TemplateModel(); m.addLhsItem(new FactPattern("Person")); m.addLhsItem(new FactPattern("Accident")); m.addAttribute(new RuleAttribute("no-loop", "true")); m.addRhsItem(new ActionInsertFact("Report")); ActionGlobalCollectionAdd ag = new ActionGlobalCollectionAdd(); ag.setFactName("x"); ag.setGlobalName("g"); m.addRhsItem(ag); m.name = "my rule"; final String xml = p.marshal(m); System.out.println(xml); assertTrue(xml.indexOf("Person") > -1); assertTrue(xml.indexOf("Accident") > -1); assertTrue(xml.indexOf("no-loop") > -1); assertTrue(xml.indexOf("org.kie") == -1); assertTrue(xml.indexOf("addToGlobal") > -1); RuleModel rm_ = RuleTemplateModelXMLPersistenceImpl.getInstance().unmarshal(xml); assertEquals(2, rm_.rhs.length); }
model.addLhsItem( buildDslSentence() ); ActionGlobalCollectionAdd addGlobal = new ActionGlobalCollectionAdd(); addGlobal.setFactName( "MyFact" ); addGlobal.setGlobalName( "glist" );