Package org.drools.guvnor.client.modeldriven.dt

Examples of org.drools.guvnor.client.modeldriven.dt.AttributeCol


  }

  void doAttribs(int numOfMeta, List<AttributeCol> attributeCols, String[] row, RuleModel rm) {
    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));
      }
    }
View Full Code Here


  public void test2Rules() throws Exception {
    GuidedDecisionTable dt = new GuidedDecisionTable();
    dt.tableName = "michael";

    AttributeCol attr = new AttributeCol();
    attr.attr = "salience";
    dt.attributeCols.add(attr);

    ConditionCol con = new ConditionCol();
    con.boundName = "f1";
View Full Code Here

    RuleAttribute[] orig = rm.attributes;
    p.doAttribs(0,attributeCols, row, rm);

    assertSame(orig, rm.attributes);

    AttributeCol col1 = new AttributeCol();
    col1.attr = "salience";
    AttributeCol col2 = new AttributeCol();
    col2.attr = "agenda-group";
    attributeCols.add(col1);
    attributeCols.add(col2);

    p.doAttribs(0, attributeCols, row, rm);
View Full Code Here

  }

  void doAttribs(int numOfMeta, List<AttributeCol> attributeCols, String[] row, RuleModel rm) {
    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));               
View Full Code Here

  }

  void doAttribs(int numOfMeta, List<AttributeCol> attributeCols, String[] row, RuleModel rm) {
    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));               
View Full Code Here

  }

  void doAttribs(int numOfMeta, List<AttributeCol> attributeCols, String[] row, RuleModel rm) {
    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));
      }
    }
View Full Code Here

    assertEquals(3, r.length);
    assertEquals("one", r[0]);
    assertEquals("two", r[1]);
    assertEquals("three", r[2]);

    AttributeCol at = new AttributeCol();
    at.attr = "no-loop";
    dt.attributeCols.add(at);

    r = dt.getValueList(at, sce);
    assertEquals(2, r.length);
View Full Code Here

    sce.fieldTypes.put("Driver.age", SuggestionCompletionEngine.TYPE_NUMERIC);
    sce.fieldTypes.put("Driver.name", SuggestionCompletionEngine.TYPE_STRING);

    GuidedDecisionTable dt = new GuidedDecisionTable();

    AttributeCol at = new AttributeCol();
    at.attr = "salience";
    AttributeCol at_ = new AttributeCol();
    at_.attr = "enabled";

    dt.attributeCols.add(at);
    dt.attributeCols.add(at_);
View Full Code Here

  public void test2Rules() throws Exception {
    GuidedDecisionTable dt = new GuidedDecisionTable();
    dt.tableName = "michael";

    AttributeCol attr = new AttributeCol();
    attr.attr = "salience";
        attr.defaultValue = "66";
    dt.attributeCols.add(attr);

    ConditionCol con = new ConditionCol();
View Full Code Here

    RuleAttribute[] orig = rm.attributes;
    p.doAttribs(0,attributeCols, row, rm);

    assertSame(orig, rm.attributes);

    AttributeCol col1 = new AttributeCol();
    col1.attr = "salience";
    AttributeCol col2 = new AttributeCol();
    col2.attr = "agenda-group";
    attributeCols.add(col1);
    attributeCols.add(col2);

    p.doAttribs(0, attributeCols, row, rm);
View Full Code Here

TOP

Related Classes of org.drools.guvnor.client.modeldriven.dt.AttributeCol

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.