Package org.drools.decisiontable.model

Examples of org.drools.decisiontable.model.SnippetBuilder.build()


    }

    String getSnippet(String cellValue)
    {
        SnippetBuilder builder = new SnippetBuilder( value );
        return builder.build( cellValue );
    }

    /**
     * Create a new action type that matches this cell, and add it to the map,
     * keyed on that column.
View Full Code Here


                             String value) {
        hasValues = true;
        String template = (String) this.templates.get( new Integer( col ) );
        SnippetBuilder snip = new SnippetBuilder(template);
       
        this.values.add(snip.build( value ));

    }
   
    public void clearValues() {
        this.hasValues = false;
View Full Code Here

        this.hasValues = true;
        Integer key = new Integer( col );
        String content = (String) this.constraints.get( key );

        SnippetBuilder snip = new SnippetBuilder( content );
        String result = snip.build( value );
        this.values.add( result );

    }

    public String getResult() {
View Full Code Here

    }
    conditionString.append("exists ");
    conditionString.append(column.getCondition(condition, index));
    SnippetBuilder snip = new SnippetBuilder(conditionString.toString());
    Condition condition = new Condition();
    condition.setSnippet(snip.build(columnName));
    rule.addCondition(condition);
  }

  private void createColumnCondition(final Rule rule, final String value) {
    SnippetBuilder colSnip = new SnippetBuilder(
View Full Code Here

  private void createColumnCondition(final Rule rule, final String value) {
    SnippetBuilder colSnip = new SnippetBuilder(
        "$param : Column(name == \"$param\")");
    Condition colCondition = new Condition();
    colCondition.setSnippet(colSnip.build(value));
    rule.addCondition(colCondition);
  }

  public void addCondition(Rule rule) {
    createColumnCondition(rule, columnName);
View Full Code Here

        rule.addConsequence( consequence );
    }

    private Consequence createConsequence(final String value) {
        final SnippetBuilder snip = new SnippetBuilder( _action );
        final String result = snip.build( value );
        final Consequence consequence = new Consequence();
        consequence.setSnippet( result );
        return consequence;
    }
View Full Code Here

    }

    private Condition createCondition(final String value,
                                      final String conditionTemplate) {
        SnippetBuilder snip = new SnippetBuilder( conditionTemplate );
        String result = snip.build( value );
        Condition condition = new Condition();
        condition.setSnippet( result );
        return condition;
    }
View Full Code Here

  }

  private Condition createCondition(final String value) {
    SnippetBuilder snip = new SnippetBuilder(
        "Cell(row == r, column == \"$param\")");
    String result = snip.build(value);
    Condition condition = new Condition();
    condition.setSnippet(result);
    return condition;
  }
View Full Code Here

  }

  private Condition createNotCondition(final String value) {
    SnippetBuilder snip = new SnippetBuilder(
        "not Cell(row == r, column == \"$param\")");
    String result = snip.build(value);
    Condition condition = new Condition();
    condition.setSnippet(result);
    return condition;
  }
  private RuleBase readRule(String drl) {
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.