Package org.drools.workbench.models.guided.dtable.shared.model

Examples of org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52


        assertNotNull( dtables );
        assertEquals( 1,
                      dtables.size() );

        GuidedDecisionTable52 dtable = dtables.get( 0 );

        assertEquals( "AttributesTest",
                      dtable.getTableName() );
        assertEquals( GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY,
                      dtable.getTableFormat() );

        //Check expanded columns
        List<BaseColumn> columns = dtable.getExpandedColumns();
        assertNotNull( columns );
        assertEquals( 13,
                      columns.size() );
        assertTrue( columns.get( 0 ) instanceof RowNumberCol52 );
        assertTrue( columns.get( 1 ) instanceof DescriptionCol52 );
        assertTrue( columns.get( 2 ) instanceof AttributeCol52 );
        assertTrue( columns.get( 3 ) instanceof AttributeCol52 );
        assertTrue( columns.get( 4 ) instanceof AttributeCol52 );
        assertTrue( columns.get( 5 ) instanceof AttributeCol52 );
        assertTrue( columns.get( 6 ) instanceof AttributeCol52 );
        assertTrue( columns.get( 7 ) instanceof AttributeCol52 );
        assertTrue( columns.get( 8 ) instanceof AttributeCol52 );
        assertTrue( columns.get( 9 ) instanceof AttributeCol52 );
        assertTrue( columns.get( 10 ) instanceof AttributeCol52 );
        assertTrue( columns.get( 11 ) instanceof AttributeCol52 );
        assertTrue( columns.get( 12 ) instanceof AnalysisCol52 );

        //Check individual attributes
        AttributeCol52 attrCol2 = ( (AttributeCol52) columns.get( 2 ) );
        assertEquals( GuidedDecisionTable52.SALIENCE_ATTR,
                      attrCol2.getAttribute() );
        assertFalse( attrCol2.isUseRowNumber() );
        assertFalse( attrCol2.isReverseOrder() );

        AttributeCol52 attrCol3 = ( (AttributeCol52) columns.get( 3 ) );
        assertEquals( GuidedDecisionTable52.ACTIVATION_GROUP_ATTR,
                      attrCol3.getAttribute() );

        AttributeCol52 attrCol4 = ( (AttributeCol52) columns.get( 4 ) );
        assertEquals( GuidedDecisionTable52.DURATION_ATTR,
                      attrCol4.getAttribute() );

        AttributeCol52 attrCol5 = ( (AttributeCol52) columns.get( 5 ) );
        assertEquals( GuidedDecisionTable52.TIMER_ATTR,
                      attrCol5.getAttribute() );

        AttributeCol52 attrCol6 = ( (AttributeCol52) columns.get( 6 ) );
        assertEquals( GuidedDecisionTable52.CALENDARS_ATTR,
                      attrCol6.getAttribute() );

        AttributeCol52 attrCol7 = ( (AttributeCol52) columns.get( 7 ) );
        assertEquals( GuidedDecisionTable52.NO_LOOP_ATTR,
                      attrCol7.getAttribute() );

        AttributeCol52 attrCol8 = ( (AttributeCol52) columns.get( 8 ) );
        assertEquals( GuidedDecisionTable52.LOCK_ON_ACTIVE_ATTR,
                      attrCol8.getAttribute() );

        AttributeCol52 attrCol9 = ( (AttributeCol52) columns.get( 9 ) );
        assertEquals( GuidedDecisionTable52.AUTO_FOCUS_ATTR,
                      attrCol9.getAttribute() );

        AttributeCol52 attrCol10 = ( (AttributeCol52) columns.get( 10 ) );
        assertEquals( GuidedDecisionTable52.AGENDA_GROUP_ATTR,
                      attrCol10.getAttribute() );

        AttributeCol52 attrCol11 = ( (AttributeCol52) columns.get( 11 ) );
        assertEquals( GuidedDecisionTable52.RULEFLOW_GROUP_ATTR,
                      attrCol11.getAttribute() );

        //Check data
        assertEquals( 2,
                      dtable.getData().size() );
        assertTrue( isRowEquivalent( new String[]{ "1", "Specific rule 1", "1", "g1", "100", "T1", "CAL1", "TRUE", "TRUE", "TRUE", "AG1", "RFG1" },
                                     dtable.getData().get( 0 ) ) );
        assertTrue( isRowEquivalent( new String[]{ "2", "Specific rule 2", "2", "g2", "200", "T2", "CAL2", "FALSE", "FALSE", "FALSE", "AG2", "RFG2" },
                                     dtable.getData().get( 1 ) ) );
    }
View Full Code Here


        assertNotNull( dtables );
        assertEquals( 1,
                      dtables.size() );

        GuidedDecisionTable52 dtable = dtables.get( 0 );

        assertEquals( "SequentialSalienceTest",
                      dtable.getTableName() );
        assertEquals( GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY,
                      dtable.getTableFormat() );

        //Check expanded columns
        List<BaseColumn> columns = dtable.getExpandedColumns();
        assertNotNull( columns );
        assertEquals( 4,
                      columns.size() );
        assertTrue( columns.get( 0 ) instanceof RowNumberCol52 );
        assertTrue( columns.get( 1 ) instanceof DescriptionCol52 );
        assertTrue( columns.get( 2 ) instanceof AttributeCol52 );
        assertTrue( columns.get( 3 ) instanceof AnalysisCol52 );

        //Check attribute column
        AttributeCol52 attrCol2 = ( (AttributeCol52) columns.get( 2 ) );
        assertEquals( GuidedDecisionTable52.SALIENCE_ATTR,
                      attrCol2.getAttribute() );
        assertTrue( attrCol2.isUseRowNumber() );
        assertTrue( attrCol2.isReverseOrder() );

        //Check data
        assertEquals( 2,
                      dtable.getData().size() );
        assertTrue( isRowEquivalent( new String[]{ "1", "Created from row 8", "2" },
                                     dtable.getData().get( 0 ) ) );
        assertTrue( isRowEquivalent( new String[]{ "2", "Created from row 9", "1" },
                                     dtable.getData().get( 1 ) ) );
    }
View Full Code Here

        assertNotNull( dtables );
        assertEquals( 1,
                      dtables.size() );

        GuidedDecisionTable52 dtable = dtables.get( 0 );

        assertEquals( "SalienceWarningsTest",
                      dtable.getTableName() );
        assertEquals( GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY,
                      dtable.getTableFormat() );

        //Check expanded columns
        List<BaseColumn> columns = dtable.getExpandedColumns();
        assertNotNull( columns );
        assertEquals( 4,
                      columns.size() );
        assertTrue( columns.get( 0 ) instanceof RowNumberCol52 );
        assertTrue( columns.get( 1 ) instanceof DescriptionCol52 );
        assertTrue( columns.get( 2 ) instanceof AttributeCol52 );
        assertTrue( columns.get( 3 ) instanceof AnalysisCol52 );

        //Check attribute column
        AttributeCol52 attrCol2 = ( (AttributeCol52) columns.get( 2 ) );
        assertEquals( GuidedDecisionTable52.SALIENCE_ATTR,
                      attrCol2.getAttribute() );
        assertFalse( attrCol2.isUseRowNumber() );
        assertFalse( attrCol2.isReverseOrder() );

        //Check data
        assertEquals( 2,
                      dtable.getData().size() );
        assertTrue( isRowEquivalent( new String[]{ "1", "Created from row 7", "" },
                                     dtable.getData().get( 0 ) ) );
        assertTrue( isRowEquivalent( new String[]{ "2", "Created from row 8", "" },
                                     dtable.getData().get( 1 ) ) );
    }
View Full Code Here

        assertNotNull( dtables );
        assertEquals( 1,
                      dtables.size() );

        GuidedDecisionTable52 dtable = dtables.get( 0 );

        assertEquals( "DurationWarningsTest",
                      dtable.getTableName() );
        assertEquals( GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY,
                      dtable.getTableFormat() );

        //Check expanded columns
        List<BaseColumn> columns = dtable.getExpandedColumns();
        assertNotNull( columns );
        assertEquals( 4,
                      columns.size() );
        assertTrue( columns.get( 0 ) instanceof RowNumberCol52 );
        assertTrue( columns.get( 1 ) instanceof DescriptionCol52 );
        assertTrue( columns.get( 2 ) instanceof AttributeCol52 );
        assertTrue( columns.get( 3 ) instanceof AnalysisCol52 );

        //Check attribute column
        AttributeCol52 attrCol2 = ( (AttributeCol52) columns.get( 2 ) );
        assertEquals( GuidedDecisionTable52.DURATION_ATTR,
                      attrCol2.getAttribute() );
        assertFalse( attrCol2.isUseRowNumber() );
        assertFalse( attrCol2.isReverseOrder() );

        //Check data
        assertEquals( 2,
                      dtable.getData().size() );
        assertTrue( isRowEquivalent( new String[]{ "1", "Created from row 7", "" },
                                     dtable.getData().get( 0 ) ) );
        assertTrue( isRowEquivalent( new String[]{ "2", "Created from row 8", "" },
                                     dtable.getData().get( 1 ) ) );
    }
View Full Code Here

        assertNotNull( dtables );
        assertEquals( 1,
                      dtables.size() );

        GuidedDecisionTable52 dtable = dtables.get( 0 );

        assertEquals( "MetadataTest",
                      dtable.getTableName() );
        assertEquals( GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY,
                      dtable.getTableFormat() );

        //Check expanded columns
        List<BaseColumn> columns = dtable.getExpandedColumns();
        assertNotNull( columns );
        assertEquals( 4,
                      columns.size() );
        assertTrue( columns.get( 0 ) instanceof RowNumberCol52 );
        assertTrue( columns.get( 1 ) instanceof DescriptionCol52 );
        assertTrue( columns.get( 2 ) instanceof MetadataCol52 );
        assertTrue( columns.get( 3 ) instanceof AnalysisCol52 );

        //Check metadata column
        MetadataCol52 mdCol2 = ( (MetadataCol52) columns.get( 2 ) );
        assertEquals( "cheese",
                      mdCol2.getMetadata() );

        //Check data
        assertEquals( 2,
                      dtable.getData().size() );
        assertTrue( isRowEquivalent( new String[]{ "1", "Created from row 7", "cheddar" },
                                     dtable.getData().get( 0 ) ) );
        assertTrue( isRowEquivalent( new String[]{ "2", "Created from row 8", "edam" },
                                     dtable.getData().get( 1 ) ) );
    }
View Full Code Here

    }

    @Test
    public void testLimitedEntryActionInsert() {
        GuidedDecisionTable52 dt = new GuidedDecisionTable52();
        dt.setTableFormat( GuidedDecisionTable52.TableFormat.LIMITED_ENTRY );
        dt.setTableName( "limited-entry" );

        Pattern52 p1 = new Pattern52();
        p1.setBoundName( "p1" );
        p1.setFactType( "Smurf" );
        dt.getConditions().add( p1 );

        LimitedEntryActionInsertFactCol52 asf1 = new LimitedEntryActionInsertFactCol52();
        asf1.setFactType( "Smurf" );
        asf1.setBoundName( "s1" );
        asf1.setFactField( "colour" );
        asf1.setValue( new DTCellValue52( "Blue" ) );

        dt.getActionCols().add( asf1 );

        dt.setData( DataUtilities.makeDataLists( new Object[][]{
                new Object[]{ 1l, "desc", true },
                new Object[]{ 2l, "desc", false }
        } ) );

        GuidedDTDRLPersistence p = GuidedDTDRLPersistence.getInstance();
View Full Code Here

        assertFalse( indexRule2 > -1 );
    }

    @Test
    public void testLHSIsNullOperator() {
        GuidedDecisionTable52 dt = new GuidedDecisionTable52();
        dt.setTableFormat( GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY );
        dt.setTableName( "extended-entry" );

        Pattern52 p1 = new Pattern52();
        p1.setBoundName( "p1" );
        p1.setFactType( "Smurf" );
        dt.getConditions().add( p1 );

        ConditionCol52 cc1 = new ConditionCol52();
        cc1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        cc1.setFieldType( DataType.TYPE_STRING );
        cc1.setFactField( "name" );
        cc1.setOperator( "== null" );
        p1.getChildColumns().add( cc1 );

        ConditionCol52 cc2 = new ConditionCol52();
        cc2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        cc2.setFieldType( DataType.TYPE_NUMERIC_INTEGER );
        cc2.setFactField( "age" );
        cc2.setOperator( "== null" );
        p1.getChildColumns().add( cc2 );

        ConditionCol52 cc3 = new ConditionCol52();
        cc3.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        cc3.setFieldType( DataType.TYPE_DATE );
        cc3.setFactField( "dateOfBirth" );
        cc3.setOperator( "== null" );
        p1.getChildColumns().add( cc3 );

        dt.setData( DataUtilities.makeDataLists( new Object[][]{
                new Object[]{ 1l, "desc", true, true, true },
                new Object[]{ 2l, "desc", false, false, false }
        } ) );

        GuidedDTDRLPersistence p = GuidedDTDRLPersistence.getInstance();
View Full Code Here

        assertFalse( index > -1 );
    }

    @Test
    public void testLHSIsNullOperatorWithNullValues() {
        GuidedDecisionTable52 dt = new GuidedDecisionTable52();
        dt.setTableFormat( GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY );
        dt.setTableName( "extended-entry" );

        Pattern52 p1 = new Pattern52();
        p1.setBoundName( "p1" );
        p1.setFactType( "Smurf" );
        dt.getConditions().add( p1 );

        ConditionCol52 cc1 = new ConditionCol52();
        cc1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        cc1.setFieldType( DataType.TYPE_STRING );
        cc1.setFactField( "name" );
        cc1.setOperator( "== null" );
        p1.getChildColumns().add( cc1 );

        ConditionCol52 cc2 = new ConditionCol52();
        cc2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        cc2.setFieldType( DataType.TYPE_NUMERIC_INTEGER );
        cc2.setFactField( "age" );
        cc2.setOperator( "== null" );
        p1.getChildColumns().add( cc2 );

        ConditionCol52 cc3 = new ConditionCol52();
        cc3.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        cc3.setFieldType( DataType.TYPE_DATE );
        cc3.setFactField( "dateOfBirth" );
        cc3.setOperator( "== null" );
        p1.getChildColumns().add( cc3 );

        dt.setData( DataUtilities.makeDataLists( new Object[][]{
                new Object[]{ 1l, "desc", true, true, true },
                new Object[]{ 2l, "desc", null, null, null }
        } ) );

        GuidedDTDRLPersistence p = GuidedDTDRLPersistence.getInstance();
View Full Code Here

        assertFalse( index > -1 );
    }

    @Test
    public void testLHSIsNotNullOperator() {
        GuidedDecisionTable52 dt = new GuidedDecisionTable52();
        dt.setTableFormat( GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY );
        dt.setTableName( "extended-entry" );

        Pattern52 p1 = new Pattern52();
        p1.setBoundName( "p1" );
        p1.setFactType( "Smurf" );
        dt.getConditions().add( p1 );

        ConditionCol52 cc1 = new ConditionCol52();
        cc1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        cc1.setFieldType( DataType.TYPE_STRING );
        cc1.setFactField( "name" );
        cc1.setOperator( "!= null" );
        p1.getChildColumns().add( cc1 );

        ConditionCol52 cc2 = new ConditionCol52();
        cc2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        cc2.setFieldType( DataType.TYPE_NUMERIC_INTEGER );
        cc2.setFactField( "age" );
        cc2.setOperator( "!= null" );
        p1.getChildColumns().add( cc2 );

        ConditionCol52 cc3 = new ConditionCol52();
        cc3.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        cc3.setFieldType( DataType.TYPE_DATE );
        cc3.setFactField( "dateOfBirth" );
        cc3.setOperator( "!= null" );
        p1.getChildColumns().add( cc3 );

        dt.setData( DataUtilities.makeDataLists( new Object[][]{
                new Object[]{ 1l, "desc", true, true, true },
                new Object[]{ 2l, "desc", false, false, false }
        } ) );

        GuidedDTDRLPersistence p = GuidedDTDRLPersistence.getInstance();
View Full Code Here

        assertFalse( index > -1 );
    }

    @Test
    public void testLHSIsNotNullOperatorWithNullValues() {
        GuidedDecisionTable52 dt = new GuidedDecisionTable52();
        dt.setTableFormat( GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY );
        dt.setTableName( "extended-entry" );

        Pattern52 p1 = new Pattern52();
        p1.setBoundName( "p1" );
        p1.setFactType( "Smurf" );
        dt.getConditions().add( p1 );

        ConditionCol52 cc1 = new ConditionCol52();
        cc1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        cc1.setFieldType( DataType.TYPE_STRING );
        cc1.setFactField( "name" );
        cc1.setOperator( "!= null" );
        p1.getChildColumns().add( cc1 );

        ConditionCol52 cc2 = new ConditionCol52();
        cc2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        cc2.setFieldType( DataType.TYPE_NUMERIC_INTEGER );
        cc2.setFactField( "age" );
        cc2.setOperator( "!= null" );
        p1.getChildColumns().add( cc2 );

        ConditionCol52 cc3 = new ConditionCol52();
        cc3.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        cc3.setFieldType( DataType.TYPE_DATE );
        cc3.setFactField( "dateOfBirth" );
        cc3.setOperator( "!= null" );
        p1.getChildColumns().add( cc3 );

        dt.setData( DataUtilities.makeDataLists( new Object[][]{
                new Object[]{ 1l, "desc", true, true, true },
                new Object[]{ 2l, "desc", null, null, null }
        } ) );

        GuidedDTDRLPersistence p = GuidedDTDRLPersistence.getInstance();
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52

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.