a.action = new ActionSetField( sf.getBoundName() ); } else { a.action = new ActionUpdateField( sf.getBoundName() ); ActionUpdateField update = new ActionUpdateField( sf.getBoundName() ); update.fieldValues = old.fieldValues; a.action = update;
a.action = new ActionSetField( sf.getBoundName() ); } else { a.action = new ActionUpdateField( sf.getBoundName() ); ActionUpdateField update = new ActionUpdateField( sf.getBoundName() ); update.fieldValues = old.fieldValues; a.action = update;
private void doAction(List<LabelledAction> actions, ActionSetFieldCol52 sf, String cell) { LabelledAction a = findByLabelledAction( actions, sf.getBoundName() ); if ( a == null ) { a = new LabelledAction(); a.boundName = sf.getBoundName(); if ( !sf.isUpdate() ) { a.action = new ActionSetField( sf.getBoundName() ); } else { a.action = new ActionUpdateField( sf.getBoundName() ); } actions.add( a ); } else if ( sf.isUpdate() && !(a.action instanceof ActionUpdateField) ) { // lets swap it out for an update as the user has asked for it. ActionSetField old = (ActionSetField) a.action; ActionUpdateField update = new ActionUpdateField( sf.getBoundName() ); update.fieldValues = old.fieldValues; a.action = update; } ActionSetField asf = (ActionSetField) a.action; ActionFieldValue val = new ActionFieldValue( sf.getFactField(), cell, sf.getType() ); asf.addFieldValue( val ); }
private void doAction(List<LabelledAction> actions, ActionSetFieldCol52 sf, String cell) { LabelledAction a = findByLabelledAction( actions, sf.getBoundName() ); if ( a == null ) { a = new LabelledAction(); a.boundName = sf.getBoundName(); if ( !sf.isUpdate() ) { a.action = new ActionSetField( sf.getBoundName() ); } else { a.action = new ActionUpdateField( sf.getBoundName() ); } actions.add( a ); } else if ( sf.isUpdate() && !(a.action instanceof ActionUpdateField) ) { // lets swap it out for an update as the user has asked for it. ActionSetField old = (ActionSetField) a.action; ActionUpdateField update = new ActionUpdateField( sf.getBoundName() ); update.fieldValues = old.fieldValues; a.action = update; } ActionSetField asf = (ActionSetField) a.action; ActionFieldValue val = new ActionFieldValue( sf.getFactField(), cell, sf.getType() ); asf.addFieldValue( val ); }
private ActionUpdateField visitActionFieldList(ActionUpdateField afl) { ActionUpdateField clone = new ActionUpdateField(); clone.variable = afl.variable; for ( ActionFieldValue afv : afl.fieldValues ) { ActionFieldValue afvClone = new ActionFieldValue(); afvClone.setField( afv.getField() ); afvClone.setNature( afv.getNature() ); afvClone.setType( afv.getType() ); afvClone.setValue( afv.getValue() ); clone.addFieldValue( afvClone ); } return clone; }
private ActionUpdateField visitActionFieldList(ActionUpdateField afl) { ActionUpdateField clone = new ActionUpdateField(); clone.variable = afl.variable; for ( ActionFieldValue afv : afl.fieldValues ) { ActionFieldValue afvClone = new ActionFieldValue(); afvClone.setField( afv.getField() ); afvClone.setNature( afv.getNature() ); afvClone.setType( afv.getType() ); afvClone.setValue( afv.getValue() ); clone.addFieldValue( afvClone ); } return clone; }
ActionUpdateField am = new ActionUpdateField( "$p" ); am.addFieldValue( new ActionFieldValue( "dob", "31-Jan-2000",
ActionUpdateField auf0 = new ActionUpdateField(); ActionFieldValue auf0f0 = new ActionFieldValue( "AUF0F0", "AUF0F0Value", ActionUpdateField auf1 = new ActionUpdateField(); ActionFieldValue auf1f0 = new ActionFieldValue( "AUF1F0", "AUF1F0Value",
private RuleModel getComplexModel() { final RuleModel m = new RuleModel(); m.addAttribute( new RuleAttribute( "no-loop", "true" ) ); final FactPattern pat = new FactPattern( "Person" ); pat.setBoundName( "p1" ); final SingleFieldConstraint con = new SingleFieldConstraint(); con.setFactType( "Person" ); con.setFieldBinding( "f1" ); con.setFieldName( "age" ); con.setOperator( "<" ); con.setValue( "42" ); pat.addConstraint( con ); m.addLhsItem( pat ); final CompositeFactPattern comp = new CompositeFactPattern( "not" ); comp.addFactPattern( new FactPattern( "Cancel" ) ); m.addLhsItem( comp ); final ActionUpdateField set = new ActionUpdateField(); set.variable = "p1"; set.addFieldValue( new ActionFieldValue( "status", "rejected", SuggestionCompletionEngine.TYPE_STRING ) ); m.addRhsItem( set ); final ActionRetractFact ret = new ActionRetractFact( "p1" ); m.addRhsItem( ret ); final DSLSentence sen = new DSLSentence(); sen.setDefinition( "Send an email to {administrator}" ); m.addRhsItem( sen ); return m; }
m.addLhsItem( comp ); final ActionUpdateField set = new ActionUpdateField(); set.variable = "p1"; set.addFieldValue( new ActionFieldValue( "status",
ActionUpdateField auf0 = new ActionUpdateField(); auf0.variable = "$t0"; ActionFieldValue auf0f0 = new ActionFieldValue( "AUF0F0", model.rhs[0] = auf0; ActionUpdateField auf1 = new ActionUpdateField(); auf1.variable = "$t1"; ActionFieldValue auf1f0 = new ActionFieldValue( "AUF1F0",