public void visitActionRetractFact(final ActionRetractFact action) { buf.append(indentation); if (isDSLEnhanced) { buf.append(">"); } buf.append("retract( "); buf.append(action.getVariableName()); buf.append(" );\n"); }
/** * @param binding The name of the LHS fact binding. * @return Returns true if the specified binding is used on the RHS. */ public boolean isBoundFactUsed(final String binding) { if (this.rhs == null) { return false; } for (int i = 0; i < this.rhs.length; i++) { if (this.rhs[i] instanceof ActionSetField) { final ActionSetField set = (ActionSetField) this.rhs[i]; if (set.getVariable().equals(binding)) { return true; } } else if (this.rhs[i] instanceof ActionRetractFact) { final ActionRetractFact ret = (ActionRetractFact) this.rhs[i]; if (ret.getVariableName().equals(binding)) { return true; } } } return false; }
private ActionRetractFact visitActionRetractFact(ActionRetractFact arf) { ActionRetractFact clone = new ActionRetractFact(); clone.setVariableName(arf.getVariableName()); return clone; }
private ActionRetractFact visitActionRetractFact(ActionRetractFact arf) { ActionRetractFact clone = new ActionRetractFact(); clone.setVariableName(arf.getVariableName()); return clone; }
final String var = arf.getVariableName(); final Set<String> templateKeys = parameterUtilities.extractTemplateKeys(var); final String templateKey = templateKeys.isEmpty() ? var : templateKeys.iterator().next(); final String binding = pvbRow.get(pvbIndex).getStringValue(); if (!(binding == null || binding.isEmpty())) { if (!arf.getVariableName().equals(binding)) { final int _rowIndex = ruleRowStartIndex + iRowIndex + 1; final int _columnIndex = ruleColumnStartIndex + valueBuilders.indexOf(pvb) + 1;
public ActionRetractFactWidget( RuleModeller modeller, EventBus eventBus, ActionRetractFact model, Boolean readOnly ) { super( modeller, eventBus ); HorizontalPanel layout = new HorizontalPanel(); layout.setWidth( "100%" ); this.isFactTypeKnown = modeller.getDataModelOracle().isFactTypeRecognized( modeller.getModel().getLHSBindingType( model.getVariableName() ) ); if ( readOnly == null ) { this.readOnly = !this.isFactTypeKnown; } else { this.readOnly = readOnly; } if ( this.readOnly ) { layout.addStyleName( "editor-disabled-widget" ); } String desc = modeller.getModel().getLHSBindingType( model.getVariableName() ) + " [" + model.getVariableName() + "]"; layout.add( new SmallLabel( HumanReadable.getActionDisplayName( "delete" ) + " <b>" + desc + "</b>" ) ); //This widget couldn't be modified. this.setModified( false ); initWidget( layout ); }
public ActionRetractFactWidget( RuleModeller modeller, EventBus eventBus, ActionRetractFact model, Boolean readOnly ) { super( modeller, eventBus ); HorizontalPanel layout = new HorizontalPanel(); layout.setWidth( "100%" ); this.isFactTypeKnown = modeller.getDataModelOracle().isFactTypeRecognized( modeller.getModel().getLHSBindingType( model.getVariableName() ) ); if ( readOnly == null ) { this.readOnly = !this.isFactTypeKnown; } else { this.readOnly = readOnly; } if ( this.readOnly ) { layout.addStyleName( "editor-disabled-widget" ); } String desc = modeller.getModel().getLHSBindingType( model.getVariableName() ) + " [" + model.getVariableName() + "]"; layout.add( new SmallLabel( HumanReadable.getActionDisplayName( "delete" ) + " <b>" + desc + "</b>" ) ); //This widget couldn't be modified. this.setModified( false ); initWidget( layout ); }
if (a instanceof ActionRetractFact) { final ActionRetractFact arf = (ActionRetractFact) a; final String binding = arf.getVariableName(); for (TypeNode tn : types) { if (tn.isBound()) {
ActionRetractFact actionCol1arf = (ActionRetractFact) actionCol1definition.get(0); assertEquals("$bonus", actionCol1arf.getVariableName()); ActionRetractFact actionCol2arf = (ActionRetractFact) actionCol2definition.get(0); assertEquals("$b", actionCol2arf.getVariableName());
ActionRetractFact actionCol1arf = (ActionRetractFact) actionCol1definition.get(0); assertEquals("$bonus", actionCol1arf.getVariableName()); ActionRetractFact actionCol2arf = (ActionRetractFact) actionCol2definition.get(0); assertEquals("$b", actionCol2arf.getVariableName());