Examples of AttributeCol52


Examples of org.drools.ide.common.client.modeldriven.dt52.AttributeCol52

                     rm );

        assertSame( orig,
                    rm.attributes );

        AttributeCol52 col1 = new AttributeCol52();
        col1.setAttribute( "salience" );
        AttributeCol52 col2 = new AttributeCol52();
        col2.setAttribute( "agenda-group" );
        attributeCols.add( col1 );
        attributeCols.add( col2 );
        allColumns.addAll( attributeCols );

        p.doAttribs( allColumns,
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.dt52.AttributeCol52

    @Test
    public void testInOperator() {
        GuidedDecisionTable52 dt = new GuidedDecisionTable52();
        dt.setTableName( "michael" );

        AttributeCol52 attr = new AttributeCol52();
        attr.setAttribute( "salience" );
        attr.setDefaultValue( "66" );
        dt.getAttributeCols().add( attr );

        Pattern52 p1 = new Pattern52();
        p1.setBoundName( "f1" );
        p1.setFactType( "Driver" );
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.dt52.AttributeCol52

                tc.setWidth( column.getWidth() );
                tc.setHideColumn( !column.isVisible() );
                newMetaColumns.add( tc );

            } else if ( modelCol instanceof AttributeCol52 ) {
                AttributeCol52 tc = (AttributeCol52) modelCol;
                tc.setWidth( column.getWidth() );
                tc.setHideColumn( !column.isVisible() );
                newAttributeColumns.add( tc );

            } else if ( modelCol instanceof ConditionCol52 ) {
                ConditionCol52 tc = (ConditionCol52) modelCol;
                tc.setWidth( column.getWidth() );
                tc.setHideColumn( !column.isVisible() );

                Pattern52 p = model.getPattern( tc );
                Pattern52 newPattern = getExistingNewPattern( newPatterns,
                                                              p );
                if ( newPattern == null ) {
                    newPattern = clonePatternExcludingConditions( p );
                    newPatterns.add( newPattern );
                }
                newPattern.getConditions().add( tc );

            } else if ( modelCol instanceof ActionCol52 ) {
                ActionCol52 tc = (ActionCol52) modelCol;
                tc.setWidth( column.getWidth() );
                tc.setHideColumn( !column.isVisible() );
                newActionColumns.add( tc );
            }

        }
        model.setMetadataCols( newMetaColumns );
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.dt52.AttributeCol52

                                             col.getColumnIndex() );

            } else if ( modelColumn instanceof AttributeCol52 ) {

                // Update Salience values
                AttributeCol52 attrCol = (AttributeCol52) modelColumn;
                if ( attrCol.getAttribute().equals( RuleAttributeWidget.SALIENCE_ATTR ) ) {
                    if ( attrCol.isUseRowNumber() ) {
                        updateSalienceColumnValues( data,
                                                    col.getColumnIndex(),
                                                    attrCol.isReverseOrder() );
                    }

                    // Ensure Salience cells are rendered with the correct Cell
                    col.setCell( cellFactory.getCell( attrCol ) );
                    col.setSystemControlled( attrCol.isUseRowNumber() );
                    col.setSortable( !attrCol.isUseRowNumber() );
                }
            }
        }
    }
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.dt52.AttributeCol52

                } else {
                    cell = makeNewNumericCellValue( iRow,
                                                    iCol,
                                                    dcv.getNumericValue() );
                    if ( column instanceof AttributeCol52 ) {
                        AttributeCol52 at = (AttributeCol52) column;
                        if ( at.getAttribute().equals( RuleAttributeWidget.SALIENCE_ATTR ) ) {
                            if ( at.isUseRowNumber() ) {
                                cell = makeNewRowNumberCellValue( iRow,
                                                                  iCol );
                            }
                        }
                    }
                }
                break;
            default :
                cell = makeNewStringCellValue( iRow,
                                               iCol,
                                               dcv.getStringValue() );
                if ( column instanceof AttributeCol52 ) {
                    AttributeCol52 ac = (AttributeCol52) column;
                    if ( ac.getAttribute().equals( RuleAttributeWidget.DIALECT_ATTR ) ) {
                        cell = makeNewDialectCellValue( iRow,
                                                        iCol,
                                                        dcv.getStringValue() );
                    }
                }
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.dt52.AttributeCol52

        if ( column instanceof RowNumberCol52 ) {
            dataType = DTDataTypes52.NUMERIC;

        } else if ( column instanceof AttributeCol52 ) {
            AttributeCol52 attrCol = (AttributeCol52) column;
            String attrName = attrCol.getAttribute();
            if ( attrName.equals( RuleAttributeWidget.SALIENCE_ATTR ) ) {
                dataType = DTDataTypes52.NUMERIC;
            } else if ( attrName.equals( RuleAttributeWidget.ENABLED_ATTR ) ) {
                dataType = DTDataTypes52.BOOLEAN;
            } else if ( attrName.equals( RuleAttributeWidget.NO_LOOP_ATTR ) ) {
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.dt52.AttributeCol52

        if ( column instanceof RowNumberCol52 ) {
            cell = makeRowNumberCell();

        } else if ( column instanceof AttributeCol52 ) {
            AttributeCol52 attrCol = (AttributeCol52) column;
            String attrName = attrCol.getAttribute();
            if ( attrName.equals( RuleAttributeWidget.SALIENCE_ATTR ) ) {
                if ( attrCol.isUseRowNumber() ) {
                    cell = makeRowNumberCell();
                } else {
                    cell = makeNumericCell();
                }
            } else if ( attrName.equals( RuleAttributeWidget.ENABLED_ATTR ) ) {
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.dt52.AttributeCol52

        }
        return row;
    }

    private AttributeCol52 makeNewColumn(AttributeCol c) {
        AttributeCol52 nc = new AttributeCol52();
        nc.setAttribute( c.attr );
        nc.setDefaultValue( c.defaultValue );
        nc.setHideColumn( c.hideColumn );
        nc.setReverseOrder( c.reverseOrder );
        nc.setUseRowNumber( c.useRowNumber );
        nc.setWidth( c.width );
        return nc;
    }
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.dt52.AttributeCol52

                   List<AttributeCol52> attributeCols,
                   List<DTCellValue52> row,
                   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 );

            String cell = GuidedDTDRLUtilities.convertDTCellValueToString( row.get( index ) );

            if ( validCell( cell ) ) {

                //If instance of "otherwise" column then flag RuleModel as being negated
                if ( at.getAttribute().equals( GuidedDecisionTable52.NEGATE_RULE_ATTR ) ) {
                    rm.setNegated( Boolean.valueOf( cell ) );
                } else {
                    attribs.add( new RuleAttribute( at.getAttribute(),
                                                    cell ) );
                }
            } else if ( at.getDefaultValue() != null ) {
                attribs.add( new RuleAttribute( at.getAttribute(),
                                                at.getDefaultValue() ) );
            }
        }
        if ( attribs.size() > 0 ) {
            rm.attributes = attribs.toArray( new RuleAttribute[attribs.size()] );
        }
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.dt52.AttributeCol52

            }
        } );

        dt = new GuidedDecisionTable52();

        at1 = new AttributeCol52();
        at1.setAttribute( "salience" );
        at2 = new AttributeCol52();
        at2.setAttribute( "enabled" );

        dt.getAttributeCols().add( at1 );
        dt.getAttributeCols().add( at2 );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.