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

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


            Object _typeField = dataEnumLookupFields.get( pat.factType + "." + field );
            if ( _typeField instanceof String ) {
                String typeField = (String) _typeField;
                FieldConstraint[] cons = pat.constraintList.constraints;
                for ( int i = 0; i < cons.length; i++ ) {
                    FieldConstraint con = cons[i];
                    if ( con instanceof SingleFieldConstraint ) {
                        SingleFieldConstraint sfc = (SingleFieldConstraint) con;
                        if ( sfc.fieldName.equals( typeField ) ) {
                            String key = pat.factType + "." + field + "[" + typeField + "=" + sfc.value + "]";
                            return DropDownData.create( (String[]) this.dataEnumLists.get( key ) );
                        }
                    }
                }
            } else if ( _typeField != null ) {
                // these enums are calculated on demand, server side...
                String[] fieldsNeeded = (String[]) _typeField;
                String queryString = getQueryString( pat.factType,
                                                     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 < pat.constraintList.constraints.length; j++ ) {
                        FieldConstraint con = pat.constraintList.constraints[j];
                        if ( con instanceof SingleFieldConstraint ) {
                            SingleFieldConstraint sfc = (SingleFieldConstraint) con;
                            if ( sfc.fieldName.equals( fieldsNeeded[i] ) ) {
                                valuePairs[i] = fieldsNeeded[i] + "=" + sfc.value;
                            }
View Full Code Here


                String[] splitTypeFields = typeFields.split( "," );
                for ( int j = 0; j < splitTypeFields.length; j++ ) {
                    String typeField = splitTypeFields[j];

                    for ( int i = 0; i < cons.length; i++ ) {
                        FieldConstraint con = cons[i];
                        if ( con instanceof SingleFieldConstraint ) {
                            SingleFieldConstraint sfc = (SingleFieldConstraint) con;

                            if ( sfc.fieldName.trim().equals( typeField.trim() ) ) {
                                if ( addOpeninColumn ) {
                                    key += "[";
                                    addOpeninColumn = false;
                                }
                                key += typeField + "=" + sfc.value;

                                if ( j != (splitTypeFields.length - 1) ) {
                                    key += ",";
                                }
                            }
                        }
                    }
                }

                if ( !addOpeninColumn ) {
                    key += "]";
                }

                return DropDownData.create( (String[]) this.dataEnumLists.get( key ) );

            } else if ( _typeFields != null ) {
                // these enums are calculated on demand, server side...
                String[] fieldsNeeded = (String[]) _typeFields;
                String queryString = getQueryString( pat.factType,
                                                     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 < pat.constraintList.constraints.length; j++ ) {
                        FieldConstraint con = pat.constraintList.constraints[j];
                        if ( con instanceof SingleFieldConstraint ) {
                            SingleFieldConstraint sfc = (SingleFieldConstraint) con;
                            if ( sfc.fieldName.equals( fieldsNeeded[i] ) ) {
                                valuePairs[i] = fieldsNeeded[i] + "=" + sfc.value;
                            }
View Full Code Here

      Object _typeField = dataEnumLookupFields.get(pat.factType + "." + field );
      if (_typeField instanceof String) {
        String typeField = (String) _typeField;
        FieldConstraint[] cons = pat.constraintList.constraints;
        for (int i = 0; i < cons.length; i++) {
          FieldConstraint con = cons[i];
          if (con instanceof SingleFieldConstraint) {
            SingleFieldConstraint sfc = (SingleFieldConstraint) con;
            if ( sfc.fieldName.equals(typeField)) {
              String key = pat.factType + "." + field + "[" + typeField + "=" + sfc.value + "]";
              return DropDownData.create((String[]) this.dataEnumLists.get(key));
            }
          }
        }
      } else if (_typeField != null ){
        //these enums are calculated on demand, server side...
        String[] fieldsNeeded = (String[]) _typeField;
        String queryString = getQueryString(pat.factType, 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 < pat.constraintList.constraints.length; j++) {
            FieldConstraint con = pat.constraintList.constraints[j];
            if (con instanceof SingleFieldConstraint) {
              SingleFieldConstraint sfc = (SingleFieldConstraint) con;
              if (sfc.fieldName.equals(fieldsNeeded[i])) {
                valuePairs[i] = fieldsNeeded[i] + "=" + sfc.value;
              }
View Full Code Here

        layout.setWidget( 1, 0, table );
        List parents = new ArrayList();

        for (int i = 0; i < sortedConst.size(); i++) {
            int tabs = -1;
            FieldConstraint current = (FieldConstraint) sortedConst.get(i);
            if (current instanceof SingleFieldConstraint) {
                SingleFieldConstraint single = (SingleFieldConstraint) current;
                FieldConstraint parent = single.parent;

                for (int j = 0; j < parents.size(); j++) {
                    FieldConstraint storedParent = (FieldConstraint) parents.get(j);
                    if (storedParent != null && storedParent.equals(parent)) {
                        tabs = j + 1;
                        for(int k = j + 1; k < parents.size(); k++) {
                            parents.remove(j + 1);
                        }
                        parents.add(current);
View Full Code Here

     * @return a sorted list of constraints ready for display.
     * */
    private ArrayList sortConstraints(FieldConstraint[] constraints) {
        ArrayList sortedConst = new ArrayList(constraints.length);
        for (int i = 0; i < constraints.length; i++) {
            FieldConstraint current = constraints[i];
            if (current instanceof SingleFieldConstraint) {
                SingleFieldConstraint single = (SingleFieldConstraint) current;
                int index = sortedConst.indexOf(single.parent);
                if (single.parent == null) {
                    sortedConst.add(single);
View Full Code Here

      Object _typeField = dataEnumLookupFields.get(pat.factType + "." + field );
      if (_typeField instanceof String) {
        String typeField = (String) _typeField;
        FieldConstraint[] cons = pat.constraintList.constraints;
        for (int i = 0; i < cons.length; i++) {
          FieldConstraint con = cons[i];
          if (con instanceof SingleFieldConstraint) {
            SingleFieldConstraint sfc = (SingleFieldConstraint) con;
            if ( sfc.fieldName.equals(typeField)) {
              String key = pat.factType + "." + field + "[" + typeField + "=" + sfc.value + "]";
              return DropDownData.create((String[]) this.dataEnumLists.get(key));
            }
          }
        }
      } else if (_typeField != null ){
        //these enums are calculated on demand, server side...
        String[] fieldsNeeded = (String[]) _typeField;
        String queryString = getQueryString(pat.factType, 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 < pat.constraintList.constraints.length; j++) {
            FieldConstraint con = pat.constraintList.constraints[j];
            if (con instanceof SingleFieldConstraint) {
              SingleFieldConstraint sfc = (SingleFieldConstraint) con;
              if (sfc.fieldName.equals(fieldsNeeded[i])) {
                valuePairs[i] = fieldsNeeded[i] + "=" + sfc.value;
              }
View Full Code Here

TOP

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

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.