RoleTypes.PACKAGE_DEVELOPER );
}
String drl = "package " + asset.metaData.packageName + "\n" + getDroolsHeader( repository.loadPackage( asset.metaData.packageName ) ) + "\n" + this.buildAssetSource( asset );
VerifierRunner runner = new VerifierRunner();
runner.setUseDefaultConfig( useVerifierDefaultConfig );
RuleAsset[] workingSets = loadRuleAssets( activeWorkingSets );
List<String> constraintRules = new LinkedList<String>();
if ( workingSets != null ) {
for ( RuleAsset ws : workingSets ) {
WorkingSetConfigData wsConfig = (WorkingSetConfigData) ws.content;
if ( wsConfig.constraints != null ) {
for ( ConstraintConfiguration config : wsConfig.constraints ) {
constraintRules.add( ConstraintsFactory.getInstance().getVerifierRule( config ) );
}
}
}
}
if ( log.isDebugEnabled() ) {
log.debug( "constraints rules: " + constraintRules );
}
try{
if ( AssetFormats.DECISION_TABLE_GUIDED.equals( asset.metaData.format ) || AssetFormats.DECISION_SPREADSHEET_XLS.equals( asset.metaData.format ) ) {
return runner.verify( drl,
VerifierConfiguration.VERIFYING_SCOPE_DECISION_TABLE,
constraintRules );
} else {
return runner.verify( drl,
VerifierConfiguration.VERIFYING_SCOPE_SINGLE_RULE,
constraintRules );
}
} catch (Throwable t){
throw new SerializableException( t.getMessage() );