private DataProvider chooseDataProvider( final RuleModel model ) {
DataProvider dataProvider;
TemplateModel tplModel = (TemplateModel) model;
if ( tplModel.getRowsCount() > 0 ) {
dataProvider = new ArrayDataProvider( tplModel.getTableAsArray() );
} else {
dataProvider = new ArrayDataProvider( generateEmptyIterator( tplModel ) );
}
return dataProvider;
}