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

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


    List<RuleAttribute> attribs = new ArrayList<RuleAttribute>();
    for (int j = 0; j < attributeCols.size(); j++) {
      AttributeCol at = attributeCols.get(j);
      String cell = row[j + 2 + numOfMeta];
      if (validCell(cell)) {
        attribs.add(new RuleAttribute(at.attr, cell));
      }
    }
    if (attribs.size() > 0) {
      rm.attributes = attribs.toArray(new RuleAttribute[attribs.size()]);
    }
View Full Code Here


    List<RuleAttribute> attribs = new ArrayList<RuleAttribute>();
    for (int j = 0; j < attributeCols.size(); j++) {
      AttributeCol at = attributeCols.get(j);
      String cell = row[j + GuidedDecisionTable.INTERNAL_ELEMENTS + numOfMeta];
      if (validCell(cell)) {
        attribs.add(new RuleAttribute(at.attr, cell));
      } else if (at.defaultValue != null) {
                attribs.add(new RuleAttribute(at.attr, at.defaultValue));               
            }
    }
    if (attribs.size() > 0) {
      rm.attributes = attribs.toArray(new RuleAttribute[attribs.size()]);
    }
View Full Code Here

    List<RuleAttribute> attribs = new ArrayList<RuleAttribute>();
    for (int j = 0; j < attributeCols.size(); j++) {
      AttributeCol at = attributeCols.get(j);
      String cell = row[j + GuidedDecisionTable.INTERNAL_ELEMENTS + numOfMeta];
      if (validCell(cell)) {
        attribs.add(new RuleAttribute(at.attr, cell));
      } else if (at.defaultValue != null) {
                attribs.add(new RuleAttribute(at.attr, at.defaultValue));               
            }
    }
    if (attribs.size() > 0) {
      rm.attributes = attribs.toArray(new RuleAttribute[attribs.size()]);
    }
View Full Code Here

    List<RuleAttribute> attribs = new ArrayList<RuleAttribute>();
    for (int j = 0; j < attributeCols.size(); j++) {
      AttributeCol at = attributeCols.get(j);
      String cell = row[j + GuidedDecisionTable.INTERNAL_ELEMENTS + numOfMeta];
      if (validCell(cell)) {
        attribs.add(new RuleAttribute(at.attr, cell));
      }
    }
    if (attribs.size() > 0) {
      rm.attributes = attribs.toArray(new RuleAttribute[attribs.size()]);
    }
View Full Code Here

  }

  public void testAttributes() {
    final RuleModel m = new RuleModel();
    final RuleAttribute at = new RuleAttribute("salience", "42");
    m.addAttribute(at);
    assertEquals(1, m.attributes.length);
    assertEquals(at, m.attributes[0]);

    final RuleAttribute at2 = new RuleAttribute("agenda-group", "x");
    m.addAttribute(at2);
    assertEquals(2, m.attributes.length);
    assertEquals(at2, m.attributes[1]);

    m.removeAttribute(0);
View Full Code Here

      hp.add(new SmallLabel(constants.Attributes1()));
      //attributeConfigWidget.add(hp);
      layout.addRow(hp);
    }
        for ( int i = 0; i < attrs.length; i++ ) {
            RuleAttribute at = attrs[i];
            layout.addAttribute( at.attributeName, getEditorWidget(at, i));
        }


        initWidget( layout );
View Full Code Here

     */
    private void marshalAttributes(StringBuffer buf,
                                   RuleModel model) {
        boolean hasDialect = false;
        for ( int i = 0; i < model.attributes.length; i++ ) {
            RuleAttribute attr = model.attributes[i];

            buf.append( "\t" );
            buf.append( attr );

            buf.append( "\n" );
            if (attr.attributeName.equals( "dialect" )) {
                hasDialect = true;
            }
        }
//Un comment below for mvel
        if (!hasDialect) {
            RuleAttribute attr = new RuleAttribute("dialect", "mvel");
            buf.append( "\t" );
            buf.append( attr );
            buf.append( "\n" );
        }
    }
View Full Code Here

    List<RuleAttribute> attribs = new ArrayList<RuleAttribute>();
    for (int j = 0; j < attributeCols.size(); j++) {
      AttributeCol at = attributeCols.get(j);
      String cell = row[j + GuidedDecisionTable.INTERNAL_ELEMENTS + numOfMeta];
      if (validCell(cell)) {
        attribs.add(new RuleAttribute(at.attr, cell));
      }
    }
    if (attribs.size() > 0) {
      rm.attributes = attribs.toArray(new RuleAttribute[attribs.size()]);
    }
View Full Code Here

TOP

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

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.