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; }
am.addFieldValue( new ActionFieldValue( "dob", "31-Jan-2000", SuggestionCompletionEngine.TYPE_DATE ) );
SuggestionCompletionEngine.TYPE_STRING ); auf0f0.setNature( BaseSingleFieldConstraint.TYPE_TEMPLATE ); auf0.addFieldValue( auf0f0 ); ActionFieldValue auf0f1 = new ActionFieldValue( "AUF0F1", "AUF0F1Value", SuggestionCompletionEngine.TYPE_STRING ); auf0f1.setNature( BaseSingleFieldConstraint.TYPE_TEMPLATE ); auf0.addFieldValue( auf0f1 ); model.rhs[0] = auf0; SuggestionCompletionEngine.TYPE_STRING ); auf1f0.setNature( BaseSingleFieldConstraint.TYPE_TEMPLATE ); auf1.addFieldValue( auf1f0 ); ActionFieldValue auf1f1 = new ActionFieldValue( "AUF1F1", "AUF1F1Value", SuggestionCompletionEngine.TYPE_STRING ); auf1f1.setNature( BaseSingleFieldConstraint.TYPE_LITERAL ); auf1.addFieldValue( auf1f1 ); model.rhs[1] = auf1;
SuggestionCompletionEngine.TYPE_STRING ); auf0f0.setNature( BaseSingleFieldConstraint.TYPE_LITERAL ); auf0.addFieldValue( auf0f0 ); ActionFieldValue auf0f1 = new ActionFieldValue( "AUF0F1", "AUF0F1Value", SuggestionCompletionEngine.TYPE_STRING ); auf0f1.setNature( BaseSingleFieldConstraint.TYPE_LITERAL ); auf0.addFieldValue( auf0f1 ); model.rhs[0] = auf0; SuggestionCompletionEngine.TYPE_STRING ); auf1f0.setNature( BaseSingleFieldConstraint.TYPE_LITERAL ); auf1.addFieldValue( auf1f0 ); ActionFieldValue auf1f1 = new ActionFieldValue( "AUF1F1", "AUF1F1Value", SuggestionCompletionEngine.TYPE_STRING ); auf1f1.setNature( BaseSingleFieldConstraint.TYPE_LITERAL ); auf1.addFieldValue( auf1f1 ); model.rhs[1] = auf1;
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; }
set.addFieldValue( new ActionFieldValue( "status", "rejected", SuggestionCompletionEngine.TYPE_STRING ) );