Package org.drools.guvnor.client.modeldriven.brl

Examples of org.drools.guvnor.client.modeldriven.brl.ActionFieldValue


            ActionInsertFact ins = new ActionInsertFact(ac.factType);
            a.action = ins;
            actions.add(a);
          }
          ActionInsertFact ins = (ActionInsertFact) a.action;
          ActionFieldValue val = new ActionFieldValue(ac.factField, cell, ac.type);
          ins.addFieldValue(val);
        } else if (c instanceof ActionRetractFactCol) {
          ActionRetractFactCol rf = (ActionRetractFactCol)c;
          LabelledAction a = find(actions, rf.boundName);
          if (a == null) {
            a = new LabelledAction();
            a.action = new ActionRetractFact(rf.boundName);
            a.boundName = rf.boundName;
            actions.add(a);
          }
        } else if (c instanceof ActionSetFieldCol) {
          ActionSetFieldCol sf = (ActionSetFieldCol)c;
          LabelledAction a = find(actions, sf.boundName);
          if (a == null) {
            a = new LabelledAction();
            a.boundName = sf.boundName;
            a.action = new ActionSetField(sf.boundName);
            actions.add(a);
          }
          ActionSetField asf = (ActionSetField) a.action;
          ActionFieldValue val = new ActionFieldValue(sf.factField, cell, sf.type);
          asf.addFieldValue(val);
        }
      }
    }
View Full Code Here


            Object _typeField = dataEnumLookupFields.get( type + "." + field );

            if ( _typeField instanceof String ) {
                String typeField = (String) dataEnumLookupFields.get( type + "." + field );
                for ( int i = 0; i < currentValues.length; i++ ) {
                    ActionFieldValue val = currentValues[i];
                    if ( val.field.equals( typeField ) ) {
                        String key = type + "." + field + "[" + typeField + "=" + val.value + "]";
                        return DropDownData.create( (String[]) this.dataEnumLists.get( key ) );
                    }
                }
            } else if ( _typeField != null ) {
                String[] fieldsNeeded = (String[]) _typeField;
                String queryString = getQueryString( type,
                                                     field,
                                                     this.dataEnumLists );
                String[] valuePairs = new String[fieldsNeeded.length];

                // collect all the values of the fields needed, then return it
                // as a string...
                for ( int i = 0; i < fieldsNeeded.length; i++ ) {
                    for ( int j = 0; j < currentValues.length; j++ ) {
                        ActionFieldValue con = currentValues[j];
                        if ( con.field.equals( fieldsNeeded[i] ) ) {
                            valuePairs[i] = fieldsNeeded[i] + "=" + con.value;
                        }
                    }
                }
View Full Code Here

            ActionInsertFact ins = new ActionInsertFact(ac.factType);
            a.action = ins;
            actions.add(a);
          }
          ActionInsertFact ins = (ActionInsertFact) a.action;
          ActionFieldValue val = new ActionFieldValue(ac.factField, cell, ac.type);
          ins.addFieldValue(val);
        } else if (c instanceof ActionRetractFactCol) {
          ActionRetractFactCol rf = (ActionRetractFactCol)c;
          LabelledAction a = find(actions, rf.boundName);
          if (a == null) {
            a = new LabelledAction();
            a.action = new ActionRetractFact(rf.boundName);
            a.boundName = rf.boundName;
            actions.add(a);
          }
        } else if (c instanceof ActionSetFieldCol) {
          ActionSetFieldCol sf = (ActionSetFieldCol)c;
          LabelledAction a = find(actions, sf.boundName);
          if (a == null) {
            a = new LabelledAction();
            a.boundName = sf.boundName;
            if (!sf.update) {
              a.action = new ActionSetField(sf.boundName);
            } else {
              a.action = new ActionUpdateField(sf.boundName);
            }
            actions.add(a);
          } else if (sf.update && !(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.boundName);
            update.fieldValues = old.fieldValues;
            a.action = update;
          }
          ActionSetField asf = (ActionSetField) a.action;
          ActionFieldValue val = new ActionFieldValue(sf.factField, cell, sf.type);
          asf.addFieldValue(val);
        }
      }
    }
View Full Code Here

            Object _typeField = dataEnumLookupFields.get( type + "." + field );

            if ( _typeField instanceof String ) {
                String typeField = (String) dataEnumLookupFields.get( type + "." + field );
                for ( int i = 0; i < currentValues.length; i++ ) {
                    ActionFieldValue val = currentValues[i];
                    if ( val.field.equals( typeField ) ) {
                        String key = type + "." + field + "[" + typeField + "=" + val.value + "]";
                        return DropDownData.create( (String[]) this.dataEnumLists.get( key ) );
                    }
                }
            } else if ( _typeField != null ) {
                String[] fieldsNeeded = (String[]) _typeField;
                String queryString = getQueryString( type,
                                                     field,
                                                     this.dataEnumLists );
                String[] valuePairs = new String[fieldsNeeded.length];

                // collect all the values of the fields needed, then return it
                // as a string...
                for ( int i = 0; i < fieldsNeeded.length; i++ ) {
                    for ( int j = 0; j < currentValues.length; j++ ) {
                        ActionFieldValue con = currentValues[j];
                        if ( con.field.equals( fieldsNeeded[i] ) ) {
                            valuePairs[i] = fieldsNeeded[i] + "=" + con.value;
                        }
                    }
                }
View Full Code Here

            ActionInsertFact ins = new ActionInsertFact(ac.factType);
            a.action = ins;
            actions.add(a);
          }
          ActionInsertFact ins = (ActionInsertFact) a.action;
          ActionFieldValue val = new ActionFieldValue(ac.factField, cell, ac.type);
          ins.addFieldValue(val);
        } else if (c instanceof ActionRetractFactCol) {
          ActionRetractFactCol rf = (ActionRetractFactCol)c;
          LabelledAction a = findByLabelledAction(actions, rf.boundName);
          if (a == null) {
            a = new LabelledAction();
            a.action = new ActionRetractFact(rf.boundName);
            a.boundName = rf.boundName;
            actions.add(a);
          }
        } else if (c instanceof ActionSetFieldCol) {
          ActionSetFieldCol sf = (ActionSetFieldCol)c;
          LabelledAction a = findByLabelledAction(actions, sf.boundName);
          if (a == null) {
            a = new LabelledAction();
            a.boundName = sf.boundName;
            if (!sf.update) {
              a.action = new ActionSetField(sf.boundName);
            } else {
              a.action = new ActionUpdateField(sf.boundName);
            }
            actions.add(a);
          } else if (sf.update && !(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.boundName);
            update.fieldValues = old.fieldValues;
            a.action = update;
          }
          ActionSetField asf = (ActionSetField) a.action;
          ActionFieldValue val = new ActionFieldValue(sf.factField, cell, sf.type);
          asf.addFieldValue(val);
        }
      }
    }
View Full Code Here

      Object _typeField = dataEnumLookupFields.get(type + "." + field );

      if (_typeField instanceof String) {
        String typeField = (String) dataEnumLookupFields.get(type + "." + field );
        for (int i = 0; i < currentValues.length; i++) {
          ActionFieldValue val = currentValues[i];
          if (val.field.equals(typeField)) {
            String key = type + "." + field + "[" + typeField + "=" + val.value + "]";
            return DropDownData.create((String[]) this.dataEnumLists.get(key));
          }
        }
      } else if (_typeField != null) {
        String[] fieldsNeeded = (String[]) _typeField;
        String queryString = getQueryString(type, field, this.dataEnumLists);
        String[] valuePairs = new String[fieldsNeeded.length];

        //collect all the values of the fields needed, then return it as a string...
        for (int i = 0; i < fieldsNeeded.length; i++) {
          for (int j = 0; j < currentValues.length; j++) {
            ActionFieldValue con = currentValues[j];
              if (con.field.equals(fieldsNeeded[i])) {
                valuePairs[i] = fieldsNeeded[i] + "=" + con.value;
              }
          }
        }
View Full Code Here

            ActionInsertFact ins = new ActionInsertFact(ac.factType);
            a.action = ins;
            actions.add(a);
          }
          ActionInsertFact ins = (ActionInsertFact) a.action;
          ActionFieldValue val = new ActionFieldValue(ac.factField, cell, ac.type);
          ins.addFieldValue(val);
        } else if (c instanceof ActionRetractFactCol) {
          ActionRetractFactCol rf = (ActionRetractFactCol)c;
          LabelledAction a = find(actions, rf.boundName);
          if (a == null) {
            a = new LabelledAction();
            a.action = new ActionRetractFact(rf.boundName);
            a.boundName = rf.boundName;
            actions.add(a);
          }
        } else if (c instanceof ActionSetFieldCol) {
          ActionSetFieldCol sf = (ActionSetFieldCol)c;
          LabelledAction a = find(actions, sf.boundName);
          if (a == null) {
            a = new LabelledAction();
            a.boundName = sf.boundName;
            if (!sf.update) {
              a.action = new ActionSetField(sf.boundName);
            } else {
              a.action = new ActionUpdateField(sf.boundName);
            }
            actions.add(a);
          } else if (sf.update && !(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.boundName);
            update.fieldValues = old.fieldValues;
            a.action = update;
          }
          ActionSetField asf = (ActionSetField) a.action;
          ActionFieldValue val = new ActionFieldValue(sf.factField, cell, sf.type);
          asf.addFieldValue(val);
        }
      }
    }
View Full Code Here

      assertEquals("sex", result[0]);
      assertEquals("colour", result[1]);


      ActionFieldValue[] vals = new ActionFieldValue[2];
      vals[0] = new ActionFieldValue("type", "sex", "blah");
      vals[1] = new ActionFieldValue("value", null, "blah");
      result = sce.getEnums("Fact", vals, "value").fixedList;
      assertNotNull(result);
      assertEquals(2, result.length);
      assertEquals("M", result[0]);
      assertEquals("F", result[1]);
View Full Code Here

      assertEquals("f2=f2val", dd.valuePairs[1]);


      //and now for the RHS
      ActionFieldValue[] vals = new ActionFieldValue[2];
      vals[0] = new ActionFieldValue("f1", "f1val", "blah");
      vals[1] = new ActionFieldValue("f2", "f2val", "blah");
      dd = sce.getEnums("Fact", vals, "value");
      assertNull(dd.fixedList);
      assertNotNull(dd.queryExpression);
      assertNotNull(dd.valuePairs);
      assertEquals(2, dd.valuePairs.length);
View Full Code Here

public class ActionSetFieldTest extends TestCase {

    public void testRemove() {
        final ActionSetField set = new ActionSetField();
        set.fieldValues = new ActionFieldValue[2];
        final ActionFieldValue v0 = new ActionFieldValue( "x",
                                                          "42",
                                                          SuggestionCompletionEngine.TYPE_NUMERIC );
        final ActionFieldValue v1 = new ActionFieldValue( "y",
                                                          "43",
                                                          SuggestionCompletionEngine.TYPE_NUMERIC );
        set.fieldValues[0] = v0;
        set.fieldValues[1] = v1;
View Full Code Here

TOP

Related Classes of org.drools.guvnor.client.modeldriven.brl.ActionFieldValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.