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

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


        //Upgrade DTModel to new class
        Object model = xt.fromXML( xml );
        GuidedDecisionTable52 newDTModel;
        if ( model instanceof GuidedDecisionTable ) {
            GuidedDecisionTable legacyDTModel = (GuidedDecisionTable) model;
            newDTModel = UPGRADER.upgrade( legacyDTModel );
        } else {
            newDTModel = (GuidedDecisionTable52) model;
        }
        return newDTModel;
View Full Code Here


    private GuidedDecisionTableModelUpgradeHelper upgrader = new GuidedDecisionTableModelUpgradeHelper();

    @Test
    public void testConversion() {

        GuidedDecisionTable dt = new GuidedDecisionTable();
        dt.tableName = "michael";

        MetadataCol md = new MetadataCol();
        md.attr = "legacy";
        md.defaultValue = "yes";
        dt.getMetadataCols().add( md );

        AttributeCol attr = new AttributeCol();
        attr.attr = "salience";
        attr.defaultValue = "66";
        dt.attributeCols.add( attr );
View Full Code Here

    }

    @Test
    public void testConversionPatternGrouping() {

        GuidedDecisionTable dt = new GuidedDecisionTable();
        dt.tableName = "michael";

        MetadataCol md = new MetadataCol();
        md.attr = "legacy";
        md.defaultValue = "yes";
        dt.getMetadataCols().add( md );

        AttributeCol attr = new AttributeCol();
        attr.attr = "salience";
        attr.defaultValue = "66";
        dt.attributeCols.add( attr );
View Full Code Here

        asset.checkin("");


        asset = pkg.addAsset("testLoadSaveEventDT", "");
        asset.updateFormat(AssetFormats.DECISION_TABLE_GUIDED);
        GuidedDecisionTable gt = new GuidedDecisionTable();
        asset.updateContent(GuidedDTXMLPersistence.getInstance().marshal(gt));
        asset.checkin("");


       
View Full Code Here

    public void testEmptyDT() throws Exception {
        RulesRepository repo = new RulesRepository( TestEnvironmentSessionHelper.getSession() );
        PackageItem pkg = repo.loadDefaultPackage();
        AssetItem asset = pkg.addAsset( "testEmptyDT", "" );
        asset.updateFormat(AssetFormats.DECISION_TABLE_GUIDED);
        GuidedDecisionTable gt = new GuidedDecisionTable();
        asset.updateContent(GuidedDTXMLPersistence.getInstance().marshal(gt));
        asset.checkin("");

        GuidedDTContentHandler ch = new GuidedDTContentHandler();
        ch.compile(null, asset, null);
View Full Code Here

public class DecisionTableHandlerTest extends TestCase {

    public void testMoveAttribute() {

        GuidedDecisionTable dt = new GuidedDecisionTable();

        dt.attributeCols.add( TestData.newAttributeCol( "date-effective" ) );
        dt.attributeCols.add( TestData.newAttributeCol( "date-expires" ) );
        dt.conditionCols.add( TestData.newConditionCol( "amount max" ) );
        dt.conditionCols.add( TestData.newConditionCol( "amount min" ) );
View Full Code Here

    }

    public void testMoveCondition() {
       
        GuidedDecisionTable dt = new GuidedDecisionTable();
       
        dt.attributeCols.add( TestData.newAttributeCol( "date-effective" ) );
        dt.attributeCols.add( TestData.newAttributeCol( "date-expires" ) );
        dt.conditionCols.add( TestData.newConditionCol( "amount max" ) );
        dt.conditionCols.add( TestData.newConditionCol( "amount min" ) );
View Full Code Here

       
    }

    public void testMoveAction() {
       
        GuidedDecisionTable dt = new GuidedDecisionTable();
       
        dt.attributeCols.add( TestData.newAttributeCol( "date-effective" ) );
        dt.attributeCols.add( TestData.newAttributeCol( "date-expires" ) );
        dt.conditionCols.add( TestData.newConditionCol( "amount max" ) );
        dt.conditionCols.add( TestData.newConditionCol( "amount min" ) );
View Full Code Here

        rule1.updateFormat( AssetFormats.DRL );
        rule1.updateContent( "rule 'rule1' \n when \np : Person() \n then \np.setAge(42); \n end" );
        rule1.checkin( "" );
        repo.save();

        GuidedDecisionTable dt = new GuidedDecisionTable();
        ConditionCol col = new ConditionCol();
        col.boundName = "p";
        col.constraintValueType = BaseSingleFieldConstraint.TYPE_LITERAL;
        col.factField = "hair";
        col.factType = "Person";
View Full Code Here

    IRuleAsset {

    public void retrieveAssetContent(RuleAsset asset,
                                     PackageItem pkg,
                                     AssetItem item) throws SerializableException {
        GuidedDecisionTable model = GuidedDTXMLPersistence.getInstance().unmarshal( item.getContent() );

        asset.content = model;

    }
View Full Code Here

TOP

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

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.