List<AttributeCol> attributeCols,
List<DTCellValue> row,
RuleModel rm) {
List<RuleAttribute> attribs = new ArrayList<RuleAttribute>();
for ( int j = 0; j < attributeCols.size(); j++ ) {
AttributeCol at = attributeCols.get( j );
int index = allColumns.indexOf( at );
String cell = GuidedDTDRLOtherwiseHelper.convertDTCellValueToString( row.get( index ) );
if ( validCell( cell ) ) {
//If instance of "otherwise" column then flag RuleModel as being negated
if ( at.getAttribute().equals( TypeSafeGuidedDecisionTable.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()] );
}