|
From: <jbo...@li...> - 2006-07-07 02:21:40
|
Author: mar...@jb...
Date: 2006-07-06 22:21:35 -0400 (Thu, 06 Jul 2006)
New Revision: 4938
Modified:
labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/LocalRuleExecutionSetProviderImpl.java
Log:
JBRULES-361 Allow DSL to be specify as a String and Reader value
Modified: labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/LocalRuleExecutionSetProviderImpl.java
===================================================================
--- labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/LocalRuleExecutionSetProviderImpl.java 2006-07-07 01:38:10 UTC (rev 4937)
+++ labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/LocalRuleExecutionSetProviderImpl.java 2006-07-07 02:21:35 UTC (rev 4938)
@@ -100,11 +100,11 @@
final Map properties) throws RuleExecutionSetCreateException {
try {
final PackageBuilder builder = new PackageBuilder();
- String dsl = null;
+ Object dsl = null;
String source = null;
if ( properties != null ) {
- dsl = ( String ) properties.get( "dsl" );
+ dsl = properties.get( "dsl" );
source = ( String ) properties.get( "source" );
}
@@ -124,8 +124,13 @@
// xml cannot specify a dsl
builder.addPackageFromXml( ruleExecutionSetReader );
} else {
- builder.addPackageFromDrl( ruleExecutionSetReader,
- new StringReader( dsl ) );
+ if ( dsl instanceof Reader ) {
+ builder.addPackageFromDrl( ruleExecutionSetReader,
+ (Reader) dsl );
+ } else {
+ builder.addPackageFromDrl( ruleExecutionSetReader,
+ new StringReader( (String) dsl ) );
+ }
}
}
|