numRows );
}
// TODO: Very hard to unit test -> needs refactoring
protected String buildAssetSource(RuleAsset asset) throws SerializationException {
ContentHandler handler = ContentManager.getHandler( asset.getMetaData().getFormat() );
StringBuilder stringBuilder = new StringBuilder();
if ( handler.isRuleAsset() ) {
BRMSPackageBuilder builder = new BRMSPackageBuilder();
// now we load up the DSL files
PackageItem packageItem = getRulesRepository().loadPackage( asset.getMetaData().getPackageName() );
builder.setDSLFiles( DSLLoader.loadDSLMappingFiles( packageItem ) );
if ( asset.getMetaData().isBinary() ) {
AssetItem item = getRulesRepository().loadAssetByUUID(
asset.getUuid() );
handler.storeAssetContent( asset,
item );
((IRuleAsset) handler).assembleDRL( builder,
item,
stringBuilder );
} else {