[jboss-svn-commits] JBL Code SVN: r24265 - in labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools: rule/builder/dialect/java and 1 other directory.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Sat Dec 6 00:48:34 EST 2008
Author: mark.proctor at jboss.com
Date: 2008-12-06 00:48:34 -0500 (Sat, 06 Dec 2008)
New Revision: 24265
Modified:
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/compiler/PackageBuilder.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/compiler/ProcessBuilder.java
labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/rule/builder/dialect/java/JavaDialect.java
Log:
JBRULES-1885 Update KnowledgeAgent to use new Resource api
- only add Resource to KnowledgeDefintions if it has a URL.
JBRULES-1874 Create Resource Framework
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/compiler/PackageBuilder.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/compiler/PackageBuilder.java 2008-12-06 05:42:04 UTC (rev 24264)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/compiler/PackageBuilder.java 2008-12-06 05:48:34 UTC (rev 24265)
@@ -927,7 +927,7 @@
}
TypeDeclaration type = new TypeDeclaration( typeDescr.getTypeName() );
- if ( ((InternalResource)resource).hasURL() ) {
+ if ( resource != null && ((InternalResource)resource).hasURL() ) {
type.setResource( this.resource );
}
@@ -1147,7 +1147,7 @@
this.results.addAll( context.getErrors() );
- if ( (( InternalResource ) resource).hasURL() ) {
+ if ( resource != null && (( InternalResource ) resource).hasURL() ) {
context.getRule().setResource( resource );
}
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/compiler/ProcessBuilder.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/compiler/ProcessBuilder.java 2008-12-06 05:42:04 UTC (rev 24264)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/compiler/ProcessBuilder.java 2008-12-06 05:48:34 UTC (rev 24265)
@@ -92,7 +92,7 @@
}
public void buildProcess(final Process process, Resource resource) {
- if ( ((InternalResource)resource).hasURL() ) {
+ if ( resource != null && ((InternalResource)resource).hasURL() ) {
((org.drools.process.core.Process) process).setResource( resource );
}
boolean hasErrors = false;
Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/rule/builder/dialect/java/JavaDialect.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/rule/builder/dialect/java/JavaDialect.java 2008-12-06 05:42:04 UTC (rev 24264)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/rule/builder/dialect/java/JavaDialect.java 2008-12-06 05:48:34 UTC (rev 24265)
@@ -592,7 +592,7 @@
Function function = new Function( functionDescr.getName(),
this.ID );
- if ( ((InternalResource)resource).hasURL() ) {
+ if ( resource != null && ((InternalResource)resource).hasURL() ) {
function.setResource( resource );
}
this.pkg.addFunction( function );
More information about the jboss-svn-commits
mailing list