Package org.drools.ide.common.client.modeldriven.dt

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


    return model;
  }
 
  @Override
  protected RuleModel createEmptyModel() {
    return new TemplateModel();
  }
View Full Code Here


        return INSTANCE;
    }
   
    @Override
    public String marshal(RuleModel model) {
      TemplateModel tplModel = (TemplateModel) model;
      String ruleTemplate = super.marshalRule(model);
      log.debug("ruleTemplate:\n{}", ruleTemplate);
      DataProviderCompiler tplCompiler = new DataProviderCompiler();
      DataProvider dataProvider;
      if (tplModel.getRowsCount() > 0) {
        dataProvider = new ArrayDataProvider(tplModel.getTableAsArray());
      } else {
        dataProvider = new ArrayDataProvider(generateEmptyIterator(tplModel));
      }
     
      String generatedDRl = tplCompiler.compile(dataProvider, new ByteArrayInputStream(ruleTemplate.getBytes()))
View Full Code Here

    return rows;
  }

  @Override
    protected void marshalHeader(RuleModel model, StringBuilder buf) {
      TemplateModel tplModel = (TemplateModel) model;
      buf.append("template header\n");
     
      String[] interpolationVariables = tplModel.getInterpolationVariablesList();
    if (interpolationVariables.length == 0) {
      buf.append("test_var").append('\n');
    } else {
      for (String var : interpolationVariables) {
        buf.append(var).append('\n');
View Full Code Here

        return super.marshal(model);
    }

    @Override
    public TemplateModel unmarshal(String xml) {
        TemplateModel model = (TemplateModel) super.unmarshal(xml);
        model.putInSync();
        return model;
    }
View Full Code Here

        return model;
    }

    @Override
    protected RuleModel createEmptyModel() {
        return new TemplateModel();
    }
View Full Code Here

        return generatedDRl;
    }

    private DataProvider chooseDataProvider(RuleModel model) {
        DataProvider dataProvider;
        TemplateModel tplModel = (TemplateModel) model;
        if ( tplModel.getRowsCount() > 0 ) {
            dataProvider = new ArrayDataProvider( tplModel.getTableAsArray() );
        } else {
            dataProvider = new ArrayDataProvider( generateEmptyIterator( tplModel ) );
        }
        return dataProvider;
    }
View Full Code Here

    }

    @Override
    protected void marshalHeader(RuleModel model,
                                 StringBuilder buf) {
        TemplateModel templateModel = (TemplateModel) model;
        buf.append( "template header\n" );

        InterpolationVariable[] interpolationVariables = templateModel.getInterpolationVariablesList();
        if ( interpolationVariables.length == 0 ) {
            buf.append( "test_var" ).append( '\n' );
        } else {
            for ( InterpolationVariable var : interpolationVariables ) {
                buf.append( var.getVarName() ).append( '\n' );
View Full Code Here

    return super.marshal(model);
  }
 
  @Override
  public TemplateModel unmarshal(String xml) {
    TemplateModel model = (TemplateModel) super.unmarshal(xml);
    model.putInSync();
    return model;
  }
View Full Code Here

    return model;
  }
 
  @Override
  protected RuleModel createEmptyModel() {
    return new TemplateModel();
  }
View Full Code Here

        return generatedDRl;
    }

    private DataProvider chooseDataProvider(RuleModel model) {
        DataProvider dataProvider;
        TemplateModel tplModel = (TemplateModel) model;
        if ( tplModel.getRowsCount() > 0 ) {
            dataProvider = new ArrayDataProvider( tplModel.getTableAsArray() );
        } else {
            dataProvider = new ArrayDataProvider( generateEmptyIterator( tplModel ) );
        }
        return dataProvider;
    }
View Full Code Here

TOP

Related Classes of org.drools.ide.common.client.modeldriven.dt.TemplateModel

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.