@Override protected BRLColumn<IPattern, BRLConditionVariableColumn> cloneBRLColumn( BRLColumn<IPattern, BRLConditionVariableColumn> col ) { BRLConditionColumn clone = new BRLConditionColumn(); clone.setHeader( col.getHeader() ); clone.setHideColumn( col.isHideColumn() ); clone.setDefinition( cloneDefinition( col.getDefinition() ) ); clone.setChildColumns( cloneVariables( col.getChildColumns() ) ); return clone; }
if ( !origColumn.getHeader().equals( editColumn.getHeader() ) ) { bUpdateColumnDefinition = true; for ( BRLConditionVariableColumn variable : origColumn.getChildColumns() ) { int iCol = model.getExpandedColumns().indexOf( variable ); List<DTCellValue52> columnData = new ArrayList<DTCellValue52>(); final int index = model.getExpandedColumns().indexOf( editColumn.getChildColumns().get( 0 ) ); final List<BaseColumn> columns = new ArrayList<BaseColumn>(); final List<List<DTCellValue52>> columnsData = new ArrayList<List<DTCellValue52>>(); columns.addAll( editColumn.getChildColumns() ); for ( BaseColumn column : columns ) { final BRLConditionVariableColumn variable = (BRLConditionVariableColumn) column; BRLConditionVariableColumn firstColumn = origColumn.getChildColumns().get( 0 ); int firstColumnIndex = model.getExpandedColumns().indexOf( firstColumn ); int numberOfColumns = origColumn.getChildColumns().size(); deleteColumns( firstColumnIndex, numberOfColumns,
private boolean canConditionBeDeleted( BRLConditionColumn col ) { for ( IPattern p : col.getDefinition() ) { if ( p instanceof FactPattern ) { FactPattern fp = (FactPattern) p; if ( fp.isBound() ) { if ( isBindingUsed( fp.getBoundName() ) ) { return false; } } } } return true; }
BRLConditionColumn brl1 = new BRLConditionColumn(); brl1.setDefinition( brl1Definition ); brl1.getChildColumns().add( brl1Variable1 );
dt.getConditions().add( p1 ); BRLConditionColumn brlCondition = new BRLConditionColumn(); FactPattern fp = new FactPattern( "Driver" ); fp.setBoundName( "$brl1" ); brlCondition.getDefinition().add( fp ); dt.getConditions().add( brlCondition );
final BRLConditionColumn brl = model.getBRLColumn( baseBRLConditionColumn ); final RuleModel rm = new RuleModel(); IPattern[] lhs = new IPattern[ brl.getDefinition().size() ]; brl.getDefinition().toArray( lhs ); rm.lhs = lhs; switch ( valueHolder.getType() ) { case TEMPLATE_KEY: final BRLConditionVariableColumn vc = getConditionVariableColumnIndex( brl.getChildColumns(), valueHolder.getValue() ); final int iCol = model.getExpandedColumns().indexOf( vc );
/** * Delete the given column * @param modelColumn */ public void deleteColumn( BRLConditionColumn modelColumn ) { if ( modelColumn == null ) { throw new IllegalArgumentException( "modelColumn cannot be null." ); } BRLConditionVariableColumn firstColumn = modelColumn.getChildColumns().get( 0 ); int firstColumnIndex = model.getExpandedColumns().indexOf( firstColumn ); int numberOfColumns = modelColumn.getChildColumns().size(); deleteColumns( firstColumnIndex, numberOfColumns, true ); model.getConditions().remove( modelColumn ); //Log deletion of column model.getAuditLog().add( new DeleteColumnAuditLogEntry( identity.getName(), modelColumn ) ); }
private BRLConditionColumn makeNewConditionBRLFragment() { switch ( model.getTableFormat() ) { case LIMITED_ENTRY: return new LimitedEntryBRLConditionColumn(); default: return new BRLConditionColumn(); } }
private Label makePatternLabel( BRLConditionColumn brl ) { StringBuilder sb = new StringBuilder(); sb.append( brl.getHeader() ); return new Label( sb.toString() ); }
BRLConditionColumn brl1 = new BRLConditionColumn(); brl1.setDefinition( brl1Definition ); "Person", "name" ); brl1.getChildColumns().add( brl1Variable1 ); BRLConditionVariableColumn brl1Variable2 = new BRLConditionVariableColumn( "$age", DataType.TYPE_NUMERIC_INTEGER, "Person", "age" ); brl1.getChildColumns().add( brl1Variable2 );
dt.getConditions().add( p1 ); BRLConditionColumn brlCondition = new BRLConditionColumn(); FactPattern fp = new FactPattern( "Driver" ); fp.setBoundName( "$brl1" ); brlCondition.getDefinition().add( fp ); dt.getConditions().add( brlCondition );
final BRLConditionColumn brl = model.getBRLColumn( baseBRLConditionColumn ); final RuleModel rm = new RuleModel(); IPattern[] lhs = new IPattern[ brl.getDefinition().size() ]; brl.getDefinition().toArray( lhs ); rm.lhs = lhs; baseBRLConditionColumn.getFactField(), valueHolder.getFieldName() ) ) { final BRLConditionVariableColumn vc = getConditionVariableColumnIndex( brl.getChildColumns(), valueHolder.getValue() ); final int iCol = model.getExpandedColumns().indexOf( vc );
/** * Add a column to the table. * @param modelColumn The Decision Table column to insert */ public void addColumn( BRLConditionColumn modelColumn ) { if ( modelColumn == null ) { throw new IllegalArgumentException( "modelColumn cannot be null." ); } model.getConditions().add( modelColumn ); addBRLConditionVariableColumns( modelColumn.getChildColumns(), true ); //Log addition of column model.getAuditLog().add( new InsertColumnAuditLogEntry( identity.getName(), modelColumn ) ); }
BRLConditionColumn brl1 = new BRLConditionColumn(); brl1.setDefinition( brl1Definition ); "Person", "name" ); brl1.getChildColumns().add( brl1Variable1 ); BRLConditionVariableColumn brl1Variable2 = new BRLConditionVariableColumn( "$age", DataType.TYPE_NUMERIC_INTEGER, "Person", "age" ); brl1.getChildColumns().add( brl1Variable2 );
dt.getConditions().add( p1 ); BRLConditionColumn brlCondition = new BRLConditionColumn(); FactPattern fp = new FactPattern( "Driver" ); fp.setBoundName( "$brl1" ); brlCondition.getDefinition().add( fp ); dt.getConditions().add( brlCondition );
for ( BRLConditionVariableColumn variable : brl.getChildColumns() ) { DynamicColumn<BaseColumn> column = new DynamicColumn<BaseColumn>( variable, cellFactory.getCell( variable ),
BRLConditionColumn brl1 = new BRLConditionColumn(); brl1.setDefinition( brl1Definition ); "Person", "name" ); brl1.getChildColumns().add( brl1Variable1 ); BRLConditionVariableColumn brl1Variable2 = new BRLConditionVariableColumn( "$age", DataType.TYPE_NUMERIC_INTEGER, "Person", "age" ); brl1.getChildColumns().add( brl1Variable2 );
dt.getConditions().add( p1 ); BRLConditionColumn brlCondition = new BRLConditionColumn(); FactPattern fp1 = new FactPattern( "Driver" ); fp1.setBoundName( "$brl1" ); brlCondition.getDefinition().add( fp1 ); dt.getConditions().add( brlCondition );