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

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


            return false;
        }

        //Column values
        for ( int i = 0; i < expected.length; i++ ) {
            DTCellValue52 dcv = actual.get( i );
            switch ( dcv.getDataType() ) {
                case NUMERIC:
                    final BigDecimal numeric = (BigDecimal) dcv.getNumericValue();
                    if ( !expected[ i ].equals( numeric.toPlainString() ) ) {
                        return false;
                    }
                    break;
                case NUMERIC_BIGDECIMAL:
                    final BigDecimal numericBigDecimal = (BigDecimal) dcv.getNumericValue();
                    if ( !expected[ i ].equals( numericBigDecimal.toPlainString() ) ) {
                        return false;
                    }
                    break;
                case NUMERIC_BIGINTEGER:
                    final BigInteger numericBigInteger = (BigInteger) dcv.getNumericValue();
                    if ( !expected[ i ].equals( numericBigInteger.toString() ) ) {
                        return false;
                    }
                    break;
                case NUMERIC_BYTE:
                    final Byte numericByte = (Byte) dcv.getNumericValue();
                    if ( !expected[ i ].equals( numericByte.toString() ) ) {
                        return false;
                    }
                    break;
                case NUMERIC_DOUBLE:
                    final Double numericDouble = (Double) dcv.getNumericValue();
                    if ( !expected[ i ].equals( numericDouble.toString() ) ) {
                        return false;
                    }
                    break;
                case NUMERIC_FLOAT:
                    final Float numericFloat = (Float) dcv.getNumericValue();
                    if ( !expected[ i ].equals( numericFloat.toString() ) ) {
                        return false;
                    }
                    break;
                case NUMERIC_INTEGER:
                    final Integer numericInteger = (Integer) dcv.getNumericValue();
                    if ( !expected[ i ].equals( numericInteger.toString() ) ) {
                        return false;
                    }
                    break;
                case NUMERIC_LONG:
                    final Long numericLong = (Long) dcv.getNumericValue();
                    if ( !expected[ i ].equals( numericLong.toString() ) ) {
                        return false;
                    }
                    break;
                case NUMERIC_SHORT:
                    final Short numericShort = (Short) dcv.getNumericValue();
                    if ( !expected[ i ].equals( numericShort.toString() ) ) {
                        return false;
                    }
                    break;
                case BOOLEAN:
                    if ( Boolean.parseBoolean( expected[ i ] ) != dcv.getBooleanValue() ) {
                        return false;
                    }
                    break;
                default:
                    if ( !expected[ i ].equals( dcv.getStringValue() ) ) {
                        return false;
                    }
            }
        }
        return true;
View Full Code Here


                          rm );

            } else {

                int index = allColumns.indexOf( c );
                DTCellValue52 dcv = row.get( index );
                String cell = "";

                if ( c instanceof LimitedEntryCol ) {
                    if ( dcv.getBooleanValue() == true ) {
                        LimitedEntryCol lec = (LimitedEntryCol) c;
                        cell = GuidedDTDRLUtilities.convertDTCellValueToString( lec.getValue() );
                    }
                } else {
                    cell = GuidedDTDRLUtilities.convertDTCellValueToString( dcv );
                }

                if ( validCell( cell,
                                dcv.getDataType() ) ) {
                    if ( c instanceof ActionWorkItemInsertFactCol52 ) {
                        doAction( actions,
                                  (ActionWorkItemInsertFactCol52) c,
                                  cell );
View Full Code Here

                           List<LabelledAction> actions,
                           TemplateDataProvider rowDataProvider,
                           List<DTCellValue52> row,
                           RuleModel rm ) {
        final int index = allColumns.indexOf( column );
        final DTCellValue52 dcv = row.get( index );
        if ( dcv.getBooleanValue() ) {
            for ( IAction action : column.getDefinition() ) {
                addAction( action,
                           actions );
            }
        }
View Full Code Here

        //Check whether the parameter-less BRL fragment needs inclusion
        if ( !hasVariables( column ) ) {
            final BRLActionVariableColumn variableColumn = column.getChildColumns().get( 0 );
            final int index = allColumns.indexOf( variableColumn );
            final DTCellValue52 dcv = row.get( index );
            if ( dcv.getBooleanValue() ) {
                for ( IAction action : column.getDefinition() ) {
                    addAction( action,
                               actions );
                }
            }
View Full Code Here

                              List<IPattern> patterns,
                              TemplateDataProvider rowDataProvider,
                              List<DTCellValue52> row,
                              RuleModel rm ) {
        final int index = allColumns.indexOf( column );
        final DTCellValue52 dcv = row.get( index );
        if ( dcv.getBooleanValue() ) {
            for ( IPattern pattern : column.getDefinition() ) {
                patterns.add( pattern );
            }
        }
    }
View Full Code Here

        //Check whether the parameter-less BRL fragment needs inclusion
        if ( !hasVariables( column ) ) {
            final BRLConditionVariableColumn variableColumn = column.getChildColumns().get( 0 );
            final int index = allColumns.indexOf( variableColumn );
            final DTCellValue52 dcv = row.get( index );
            if ( dcv != null && dcv.getBooleanValue() ) {
                for ( IPattern pattern : column.getDefinition() ) {
                    patterns.add( pattern );
                }
            }
View Full Code Here

        for ( ConditionCol52 c : cols ) {

            int index = allColumns.indexOf( c );

            DTCellValue52 dcv = row.get( index );
            String cell = "";

            if ( c instanceof LimitedEntryCol ) {
                if ( Boolean.TRUE.equals( dcv.getBooleanValue() ) ) {
                    LimitedEntryCol lec = (LimitedEntryCol) c;
                    DTCellValue52 value = lec.getValue();
                    if ( value != null ) {
                        cell = GuidedDTDRLUtilities.convertDTCellValueToString( value );
                    }
                }
            } else {
View Full Code Here

                    RuleModel rm ) {
        List<RuleAttribute> attribs = new ArrayList<RuleAttribute>();
        for ( int j = 0; j < attributeCols.size(); j++ ) {
            AttributeCol52 at = attributeCols.get( j );
            int index = allColumns.indexOf( at );
            final DTCellValue52 dcv = row.get( index );
            String cell = GuidedDTDRLUtilities.convertDTCellValueToString( dcv );

            if ( validateAttributeCell( cell ) ) {

                //If instance of "otherwise" column then flag RuleModel as being negated
View Full Code Here

        List<RuleMetadata> metadataList = new ArrayList<RuleMetadata>();

        for ( int j = 0; j < metadataCols.size(); j++ ) {
            MetadataCol52 meta = metadataCols.get( j );
            int index = allColumns.indexOf( meta );
            final DTCellValue52 dcv = row.get( index );
            String cell = GuidedDTDRLUtilities.convertDTCellValueToString( dcv );

            if ( validateMetadataCell( cell ) ) {
                metadataList.add( new RuleMetadata( meta.getMetadata(),
                                                    cell ) );
View Full Code Here

                          rm );

            } else {

                int index = allColumns.indexOf( c );
                DTCellValue52 dcv = row.get( index );
                String cell = "";

                if ( c instanceof LimitedEntryCol ) {
                    if ( dcv.getBooleanValue() == true ) {
                        LimitedEntryCol lec = (LimitedEntryCol) c;
                        cell = GuidedDTDRLUtilities.convertDTCellValueToString( lec.getValue() );
                    }
                } else {
                    cell = GuidedDTDRLUtilities.convertDTCellValueToString( dcv );
View Full Code Here

TOP

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

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.