Package org.drools.ide.common.client.modeldriven.brl.templates

Examples of org.drools.ide.common.client.modeldriven.brl.templates.TemplateModel


        return super.marshal( model );
    }

    @Override
    public TemplateModel unmarshal(String xml) {
        TemplateModel model = (TemplateModel) super.unmarshal( xml );
        model.putInSync();

        //Upgrade model changes to legacy artifacts
        UPGRADER.upgrade( model );

        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

    }

    public void onSetModel(SetModelEvent<TemplateModel> event) {

        DynamicData data = new DynamicData();
        TemplateModel model = event.getModel();
        List<DynamicColumn<TemplateDataColumn>> columns = new ArrayList<DynamicColumn<TemplateDataColumn>>();

        setupInternalModel( model,
                            columns,
                            data );
View Full Code Here

    @Before
    public void setup() {

        //---Setup model---
        model = new TemplateModel();

        //Setup LHS
        model.lhs = new IPattern[3];

        //Both fields are Template Keys
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

                "\tdialect \"mvel\"\n" +
                "\twhen\n" +
                "\tthen\n" +
                "end";

        final String drl = p.marshal(new TemplateModel());
        log.info("drl :\n{}", drl);

        assertNotNull(drl);
        assertEquals(expected, drl);
    }
View Full Code Here

                "\tdialect \"mvel\"\n" +
                "\twhen\n" +
                "\t\t$p : Person( name == \"name_na\" )\n" +
                "\tthen\n" +
                "end";
        TemplateModel m = new TemplateModel();
        m.name = "with composite";
        m.lhs = new IPattern[1];
        m.rhs = new IAction[0];

        FactPattern fp = new FactPattern("Person");
View Full Code Here

TOP

Related Classes of org.drools.ide.common.client.modeldriven.brl.templates.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.