@Override public void addRhsItem(IAction action, boolean append) { model.addRhsItem(action, append); }
public void addRhsItem(final IAction action, boolean append) { this.addRhsItem(action, append ? this.rhs.length : 0); }
public RuleModelVisitor(IAction action, Map<InterpolationVariable, Integer> vars) { this.vars = vars; this.model.addRhsItem(action); }
public GeneratorContextRuleModelVisitor(final IAction action, final Set<InterpolationVariable> vars) { this.vars = vars; this.model.addRhsItem(action); }
@Override public void addRhsItem(IAction action, int position) { model.addRhsItem(action, position); }
@Override public void addRhsItem(IAction action, int position) { model.addRhsItem(action, position); }
@Override public void addRhsItem(IAction action, boolean append) { model.addRhsItem(action, append); }
private void addRetract(String var, int position) { this.model.addRhsItem(new ActionRetractFact(var), position); }
private void addNewDSLRhs(DSLSentence sentence, int position) { this.model.addRhsItem(sentence.copy(), position); }
private void addActionSetField(String itemText, int position) { this.model.addRhsItem(new ActionSetField(itemText), position); }
private void addCallMethod(String itemText, int position) { this.model.addRhsItem(new ActionCallMethod(itemText), position); }
private void addModify(String itemText, int position) { this.model.addRhsItem(new ActionUpdateField(itemText), position); } }
private void unmarshalUsingExtension(final RuleModel ruleModel, final RuleModelIActionPersistenceExtension extension, final String line) { try { ruleModel.addRhsItem(extension.unmarshal(line)); } catch (RuleModelDRLPersistenceException e) { FreeFormLine freeFormLine = new FreeFormLine(); freeFormLine.setText(line); ruleModel.addRhsItem(freeFormLine); } }
private boolean hasVariables(BRLActionColumn column) { Map<InterpolationVariable, Integer> ivs = new HashMap<InterpolationVariable, Integer>(); RuleModel rm = new RuleModel(); for (IAction action : column.getDefinition()) { rm.addRhsItem(action); } RuleModelVisitor rmv = new RuleModelVisitor(ivs); rmv.visit(rm); return ivs.size() > 0; }
public void execute() { model.addRhsItem(new ActionInsertLogicalFact(item), Integer.parseInt(positionCbo.getValue(positionCbo.getSelectedIndex()))); hide(); } });
public void execute() { model.addRhsItem(new ActionInsertFact(item), Integer.parseInt(positionCbo.getValue(positionCbo.getSelectedIndex()))); hide(); } });
public void execute() { model.addRhsItem(new FreeFormLine(), 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(); } });
@Test public void testValidateModifyScoreAction() throws Exception { final Path path = mock(Path.class); final FreeFormLine modifyAction = new FreeFormLine(); modifyAction.setText(MODIFY_SCORE_ACTION); final RuleModel model = new RuleModel(); model.addRhsItem(modifyAction); service.validate(path, model); final ArgumentCaptor<String> capturedFileContent = ArgumentCaptor.forClass(String.class); verify(genericValidator).validate(eq(path), capturedFileContent.capture()); Assertions.assertThat(capturedFileContent.getValue()).contains(MODIFY_SCORE_ACTION); }
@Test public void testValidateModifyScoreAction() throws Exception { final Path path = mock(Path.class); final FreeFormLine modifyAction = new FreeFormLine(); modifyAction.setText(MODIFY_SCORE_ACTION); final RuleModel model = new RuleModel(); model.addRhsItem(modifyAction); service.validate(path, model); final ArgumentCaptor<String> capturedFileContent = ArgumentCaptor.forClass(String.class); verify(genericValidator).validate(eq(path), capturedFileContent.capture()); Assertions.assertThat(capturedFileContent.getValue()).contains(MODIFY_SCORE_ACTION); }