Examples of ConditionCol


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

  void doConditions(int numOfAttributesAndMeta, List<ConditionCol> conditionCols, String[] row, RuleModel rm) {

    List<FactPattern> patterns = new ArrayList<FactPattern>();

    for (int i = 0; i < conditionCols.size(); i++) {
      ConditionCol c = (ConditionCol) conditionCols.get(i);
      String cell = row[i + 2 + numOfAttributesAndMeta];
      if (validCell(cell)) {

        //get or create the pattern it belongs too
        FactPattern fp = find(patterns, c.boundName);
View Full Code Here

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

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

    ConditionCol con = new ConditionCol();
    con.boundName = "f1";
    con.constraintValueType = ISingleFieldConstraint.TYPE_LITERAL;
    con.factField = "age";
    con.factType = "Driver";
    con.header = "Driver f1 age";
    con.operator = "==";
    dt.conditionCols.add(con);

    ConditionCol con2 = new ConditionCol();
    con2.boundName = "f1";
    con2.constraintValueType = ISingleFieldConstraint.TYPE_LITERAL;
    con2.factField = "name";
    con2.factType = "Driver";
    con2.header = "Driver f1 name";
    con2.operator = "==";
    dt.conditionCols.add(con2);

    ConditionCol con3 = new ConditionCol();
    con3.boundName = "f1";
    con3.constraintValueType = ISingleFieldConstraint.TYPE_RET_VALUE;
    con3.factField = "rating";
    con3.factType = "Driver";
    con3.header = "Driver rating";
    con3.operator = "==";
    dt.conditionCols.add(con3);


    ConditionCol con4 = new ConditionCol();
    con4.boundName = "f2";
    con4.constraintValueType = ISingleFieldConstraint.TYPE_PREDICATE;
    con4.factType = "Driver";
    con4.header = "Driver 2 pimp";
    dt.conditionCols.add(con4);
View Full Code Here

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

  public void testLHS() {
    GuidedDTDRLPersistence p = new GuidedDTDRLPersistence();
    String[] row = new String[] {"1", "desc", "a", "mike", "33 + 1", "age > 6", "stilton"};

    List<ConditionCol> cols = new ArrayList<ConditionCol>();
    ConditionCol col = new ConditionCol();
    col.boundName = "p1";
    col.factType = "Person";
    col.factField = "name";
    col.constraintValueType = ISingleFieldConstraint.TYPE_LITERAL;
    col.operator = "==";
    cols.add(col);

    ConditionCol col2 = new ConditionCol();
    col2.boundName = "p1";
    col2.factType = "Person";
    col2.factField = "age";
    col2.constraintValueType = ISingleFieldConstraint.TYPE_RET_VALUE;
    col2.operator = "<";
    cols.add(col2);

    ConditionCol col3 = new ConditionCol();
    col3.boundName = "p1";
    col3.factType = "Person";
    col3.constraintValueType = ISingleFieldConstraint.TYPE_PREDICATE;
    cols.add(col3);

    ConditionCol col4 = new ConditionCol();
    col4.boundName = "c";
    col4.factType = "Cheese";
    col4.factField = "type";
    col4.operator = "==";
    col4.constraintValueType = ISingleFieldConstraint.TYPE_LITERAL;
View Full Code Here

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

  }

  public void testNoConstraints() {
    GuidedDecisionTable dt = new GuidedDecisionTable();
    ConditionCol c = new ConditionCol();
    c.boundName = "x";
    c.factType = "Context";
    c.constraintValueType = ISingleFieldConstraint.TYPE_LITERAL;
    dt.conditionCols.add(c);
    ActionSetFieldCol asf = new ActionSetFieldCol();
View Full Code Here

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

  }

  public void testUpdateModify() {
    GuidedDecisionTable dt = new GuidedDecisionTable();
    ConditionCol c = new ConditionCol();
    c.boundName = "x";
    c.factType = "Context";
    c.constraintValueType = ISingleFieldConstraint.TYPE_LITERAL;
    dt.conditionCols.add(c);
    ActionSetFieldCol asf = new ActionSetFieldCol();
View Full Code Here

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

    GuidedDTDRLPersistence p = new GuidedDTDRLPersistence();
    String[] row = new String[] {"1", "desc", "a", "> 42", "33 + 1", "age > 6", "stilton"};

    List<ConditionCol> cols = new ArrayList<ConditionCol>();

    ConditionCol col2 = new ConditionCol();
    col2.boundName = "p1";
    col2.factType = "Person";
    col2.factField = "age";
    col2.constraintValueType = ISingleFieldConstraint.TYPE_LITERAL;
    col2.operator = "";
View Full Code Here

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

  void doConditions(int numOfAttributesAndMeta, List<ConditionCol> conditionCols, String[] row, RuleModel rm) {

    List<FactPattern> patterns = new ArrayList<FactPattern>();

    for (int i = 0; i < conditionCols.size(); i++) {
      ConditionCol c = (ConditionCol) conditionCols.get(i);
      String cell = row[i + GuidedDecisionTable.INTERNAL_ELEMENTS + numOfAttributesAndMeta];

            if (!validCell(cell)) {
                //try default value
                cell = c.defaultValue;
View Full Code Here

Examples of org.drools.guvnor.models.guided.dtable.shared.model.legacy.ConditionCol

        //fields to a *sensible* default of String (as this matches legacy behaviour).
        List<Pattern52> patterns = new ArrayList<Pattern52>();
        Map<String, Pattern52> uniquePatterns = new HashMap<String, Pattern52>();
        if ( legacyDTModel.conditionCols != null ) {
            for ( int i = 0; i < legacyDTModel.conditionCols.size(); i++ ) {
                ConditionCol c = legacyDTModel.conditionCols.get( i );
                String boundName = c.boundName;
                Pattern52 p = uniquePatterns.get( boundName );
                if ( p == null ) {
                    p = new Pattern52();
                    p.setBoundName( boundName );
View Full Code Here

Examples of org.drools.guvnor.models.guided.dtable.shared.model.legacy.ConditionCol

        final int DATA_ROWS = model.data.length;

        // Copy conditions and related data into temporary groups
        for ( int iCol = 0; iCol < model.conditionCols.size(); iCol++ ) {

            ConditionCol col = model.conditionCols.get( iCol );
            String pattern = col.boundName + "";
            List<ConditionColData> groupCols = uniqueGroups.get( pattern );
            if ( groupCols == null ) {
                groupCols = new ArrayList<ConditionColData>();
                groups.add( groupCols );
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.dt.ConditionCol

        //Legacy decision tables did not have Condition field data-types. Set all Condition
        //fields to a *sensible* default of String (as this matches legacy behaviour).
        Map<String, Pattern52> patterns = new HashMap<String, Pattern52>();
        for ( int i = 0; i < legacyDTModel.conditionCols.size(); i++ ) {
            ConditionCol c = legacyDTModel.conditionCols.get( i );
            String boundName = c.boundName;
            Pattern52 p = patterns.get( boundName );
            if ( p == null ) {
                p = new Pattern52();
                p.setBoundName( boundName );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.