[jboss-svn-commits] JBL Code SVN: r17824 - in labs/jbossrules/branches/4.0.x: drools-compiler/src/main/resources/org/drools/rule/builder/dialect/java and 1 other directory.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Jan 14 12:17:39 EST 2008
Author: fmeyer
Date: 2008-01-14 12:17:39 -0500 (Mon, 14 Jan 2008)
New Revision: 17824
Modified:
labs/jbossrules/branches/4.0.x/drools-compiler/src/main/resources/org/drools/rule/builder/dialect/java/javaFunction.mvel
labs/jbossrules/branches/4.0.x/drools-compiler/src/main/resources/org/drools/rule/builder/dialect/java/javaInvokers.mvel
labs/jbossrules/branches/4.0.x/drools-compiler/src/main/resources/org/drools/rule/builder/dialect/java/javaRule.mvel
labs/jbossrules/branches/4.0.x/pom.xml
Log:
JBRULES-1420 update mvel and mvel templates
Modified: labs/jbossrules/branches/4.0.x/drools-compiler/src/main/resources/org/drools/rule/builder/dialect/java/javaFunction.mvel
===================================================================
--- labs/jbossrules/branches/4.0.x/drools-compiler/src/main/resources/org/drools/rule/builder/dialect/java/javaFunction.mvel 2008-01-14 17:08:15 UTC (rev 17823)
+++ labs/jbossrules/branches/4.0.x/drools-compiler/src/main/resources/org/drools/rule/builder/dialect/java/javaFunction.mvel 2008-01-14 17:17:39 UTC (rev 17824)
@@ -11,7 +11,7 @@
public class @{className} {
private static final long serialVersionUID = 400L;
- public static @{returnType} @{methodName}(@foreach{parameterTypes, parameterNames as type, name}@{type} @{name}@end{","}) throws Exception {
+ public static @{returnType} @{methodName}(@foreach{parameterTypes as type, parameterNames as name}@{type} @{name}@end{","}) throws Exception {
@{text}
}
}
\ No newline at end of file
Modified: labs/jbossrules/branches/4.0.x/drools-compiler/src/main/resources/org/drools/rule/builder/dialect/java/javaInvokers.mvel
===================================================================
--- labs/jbossrules/branches/4.0.x/drools-compiler/src/main/resources/org/drools/rule/builder/dialect/java/javaInvokers.mvel 2008-01-14 17:08:15 UTC (rev 17823)
+++ labs/jbossrules/branches/4.0.x/drools-compiler/src/main/resources/org/drools/rule/builder/dialect/java/javaInvokers.mvel 2008-01-14 17:17:39 UTC (rev 17824)
@@ -64,22 +64,22 @@
org.drools.rule.Declaration[] localDeclarations,
org.drools.WorkingMemory workingMemory) throws Exception {
- @foreach{declarationTypes, declarations as type, declr} @{type} @{declr.identifier} = ( @{type} ) previousDeclarations[@{i0}].@{declr.nativeReadMethod.name}( (org.drools.common.InternalWorkingMemory) workingMemory, ( (org.drools.common.InternalFactHandle) tuple.get( previousDeclarations[@{i0}] ) ).getObject() );
+ @foreach{declarationTypes as type, declarations as declr} @{type} @{declr.identifier} = ( @{type} ) previousDeclarations[@{i0}].@{declr.nativeReadMethod.name}( (org.drools.common.InternalWorkingMemory) workingMemory, ( (org.drools.common.InternalFactHandle) tuple.get( previousDeclarations[@{i0}] ) ).getObject() );
@end{}
@if{readLocalsFromTuple}
- @foreach{localDeclarationTypes, localDeclarations as type, declr} @{type} @{declr.identifier} = ( @{type} ) localDeclarations[@{i0}].@{declr.nativeReadMethod.name}( (org.drools.common.InternalWorkingMemory) workingMemory, ( (org.drools.common.InternalFactHandle) tuple.get( localDeclarations[@{i0}] ) ).getObject() );
+ @foreach{localDeclarationTypes as type, localDeclarations as declr} @{type} @{declr.identifier} = ( @{type} ) localDeclarations[@{i0}].@{declr.nativeReadMethod.name}( (org.drools.common.InternalWorkingMemory) workingMemory, ( (org.drools.common.InternalFactHandle) tuple.get( localDeclarations[@{i0}] ) ).getObject() );
@end{}
@else{}
- @foreach{localDeclarationTypes, localDeclarations as type, declr} @{type} @{declr.identifier} = ( @{type} ) localDeclarations[@{i0}].@{declr.nativeReadMethod.name}( (org.drools.common.InternalWorkingMemory) workingMemory, object );
+ @foreach{localDeclarationTypes as type, localDeclarations as declr} @{type} @{declr.identifier} = ( @{type} ) localDeclarations[@{i0}].@{declr.nativeReadMethod.name}( (org.drools.common.InternalWorkingMemory) workingMemory, object );
@end{}
@end{}
- @foreach{globalTypes, globals as type, identifier} @{type} @{identifier} = ( @{type} ) workingMemory.getGlobal( "@{identifier}" );
+ @foreach{globalTypes as type, globals as identifier} @{type} @{identifier} = ( @{type} ) workingMemory.getGlobal( "@{identifier}" );
@end{}
return @{ruleClassName}.@{methodName}(
- @foreach{declarations as declr} @{declr.identifier}
+ @foreach{declarations as declr} @{declr.identifier}
@end{","} @if{localDeclarations != empty && declarations != empty}, at end{}
- @foreach{localDeclarations as declr} @{declr.identifier}
+ @foreach{localDeclarations as declr} @{declr.identifier}
@end{","}@if{globals != empty && (localDeclarations != empty || declarations != empty)}, at end{}
@foreach{globals as identifier}@{identifier}
@end{","} );
@@ -106,11 +106,11 @@
org.drools.rule.Declaration[] localDeclarations,
org.drools.WorkingMemory workingMemory) throws Exception {
- @foreach{declarationTypes, declarations as type, declr} @{type} @{declr.identifier} = ( @{type} ) previousDeclarations[@{i0}].@{declr.nativeReadMethod.name}( (org.drools.common.InternalWorkingMemory) workingMemory, ( (org.drools.common.InternalFactHandle) tuple.get( previousDeclarations[@{i0}] ) ).getObject() );
+ @foreach{declarationTypes as type, declarations as declr} @{type} @{declr.identifier} = ( @{type} ) previousDeclarations[@{i0}].@{declr.nativeReadMethod.name}( (org.drools.common.InternalWorkingMemory) workingMemory, ( (org.drools.common.InternalFactHandle) tuple.get( previousDeclarations[@{i0}] ) ).getObject() );
@end{}
- @foreach{localDeclarationTypes, localDeclarations as type, declr} @{type} @{declr.identifier} = ( @{type} ) localDeclarations[@{i0}].@{declr.nativeReadMethod.name}( (org.drools.common.InternalWorkingMemory) workingMemory, object );
+ @foreach{localDeclarationTypes as type, localDeclarations as declr} @{type} @{declr.identifier} = ( @{type} ) localDeclarations[@{i0}].@{declr.nativeReadMethod.name}( (org.drools.common.InternalWorkingMemory) workingMemory, object );
@end{}
- @foreach{globalTypes, globals as type, identifier} @{type} @{identifier} = ( @{type} ) workingMemory.getGlobal( "@{identifier}" );
+ @foreach{globalTypes as type, globals as identifier} @{type} @{identifier} = ( @{type} ) workingMemory.getGlobal( "@{identifier}" );
@end{}
return @{ruleClassName}.@{methodName}(
@@ -141,9 +141,9 @@
org.drools.rule.Declaration[] declarations,
org.drools.WorkingMemory workingMemory) throws Exception {
- @foreach{declarationTypes, declarations as type, declr} @{type} @{declr.identifier} = ( @{type} ) declarations[@{i0}].@{declr.nativeReadMethod.name}( (org.drools.common.InternalWorkingMemory) workingMemory, ( (org.drools.common.InternalFactHandle) tuple.get( declarations[@{i0}] ) ).getObject() );
+ @foreach{declarationTypes as type, declarations as declr} @{type} @{declr.identifier} = ( @{type} ) declarations[@{i0}].@{declr.nativeReadMethod.name}( (org.drools.common.InternalWorkingMemory) workingMemory, ( (org.drools.common.InternalFactHandle) tuple.get( declarations[@{i0}] ) ).getObject() );
@end{}
- @foreach{globalTypes, globals as type, identifier} @{type} @{identifier} = ( @{type} ) workingMemory.getGlobal( "@{identifier}" );
+ @foreach{globalTypes as type, globals as identifier} @{type} @{identifier} = ( @{type} ) workingMemory.getGlobal( "@{identifier}" );
@end{}
return @{ruleClassName}.@{methodName}(
@@ -181,9 +181,9 @@
org.drools.spi.Tuple leftTuple,
org.drools.rule.Declaration[] declarations,
org.drools.WorkingMemory workingMemory) throws Exception {
- @foreach{declarationTypes, declarations as type, declr} @{type} @{declr.identifier} = ( @{type} ) declarations[@{i0}].@{declr.nativeReadMethod.name}( (org.drools.common.InternalWorkingMemory) workingMemory, ( (org.drools.common.InternalFactHandle) leftTuple.get( declarations[@{i0}] ) ).getObject() );
+ @foreach{declarationTypes as type, declarations as declr} @{type} @{declr.identifier} = ( @{type} ) declarations[@{i0}].@{declr.nativeReadMethod.name}( (org.drools.common.InternalWorkingMemory) workingMemory, ( (org.drools.common.InternalFactHandle) leftTuple.get( declarations[@{i0}] ) ).getObject() );
@end{}
- @foreach{globalTypes, globals as type, identifier} @{type} @{identifier} = ( @{type} ) workingMemory.getGlobal( "@{identifier}" );
+ @foreach{globalTypes as type, globals as identifier} @{type} @{identifier} = ( @{type} ) workingMemory.getGlobal( "@{identifier}" );
@end{}
((@{ruleClassName}.@{className})context).init(
@@ -199,9 +199,9 @@
org.drools.rule.Declaration[] declarations,
org.drools.rule.Declaration[] innerDeclarations,
org.drools.WorkingMemory workingMemory) throws Exception {
- @foreach{declarationTypes, declarations as type, declr} @{type} @{declr.identifier} = ( @{type} ) declarations[@{i0}].@{declr.nativeReadMethod.name}( (org.drools.common.InternalWorkingMemory) workingMemory, ( (org.drools.common.InternalFactHandle) leftTuple.get( declarations[@{i0}] ) ).getObject() );
+ @foreach{declarationTypes as type, declarations as declr} @{type} @{declr.identifier} = ( @{type} ) declarations[@{i0}].@{declr.nativeReadMethod.name}( (org.drools.common.InternalWorkingMemory) workingMemory, ( (org.drools.common.InternalFactHandle) leftTuple.get( declarations[@{i0}] ) ).getObject() );
@end{}
- @foreach{globalTypes, globals as type, identifier} @{type} @{identifier} = ( @{type} ) workingMemory.getGlobal( "@{identifier}" );
+ @foreach{globalTypes as type, globals as identifier} @{type} @{identifier} = ( @{type} ) workingMemory.getGlobal( "@{identifier}" );
@end{}
@if{isMultiPattern}
@foreach{innerDeclarations as declr} @{declr.extractor.extractToClassName} @{declr.identifier} = (@{declr.extractor.extractToClassName}) innerDeclarations[@{i0}].@{declr.nativeReadMethod.name}( (org.drools.common.InternalWorkingMemory) workingMemory, ( (org.drools.common.InternalFactHandle) leftTuple.get( innerDeclarations[@{i0}] ) ).getObject() );
@@ -226,9 +226,9 @@
org.drools.rule.Declaration[] declarations,
org.drools.rule.Declaration[] innerDeclarations,
org.drools.WorkingMemory workingMemory) throws Exception {
- @foreach{declarationTypes, declarations as type, declr} @{type} @{declr.identifier} = ( @{type} ) declarations[@{i0}].@{declr.nativeReadMethod.name}( (org.drools.common.InternalWorkingMemory) workingMemory, ( (org.drools.common.InternalFactHandle) leftTuple.get( declarations[@{i0}] ) ).getObject() );
+ @foreach{declarationTypes as type, declarations as declr} @{type} @{declr.identifier} = ( @{type} ) declarations[@{i0}].@{declr.nativeReadMethod.name}( (org.drools.common.InternalWorkingMemory) workingMemory, ( (org.drools.common.InternalFactHandle) leftTuple.get( declarations[@{i0}] ) ).getObject() );
@end{}
- @foreach{globalTypes, globals as type, identifier} @{type} @{identifier} = ( @{type} ) workingMemory.getGlobal( "@{identifier}" );
+ @foreach{globalTypes as type, globals as identifier} @{type} @{identifier} = ( @{type} ) workingMemory.getGlobal( "@{identifier}" );
@end{}
@if{isMultiPattern}
@foreach{innerDeclarations as declr} @{declr.extractor.extractToClassName} @{declr.identifier} = (@{declr.extractor.extractToClassName}) innerDeclarations[@{i0}].@{declr.nativeReadMethod.name}( (org.drools.common.InternalWorkingMemory) workingMemory, ( (org.drools.common.InternalFactHandle) leftTuple.get( innerDeclarations[@{i0}] ) ).getObject() );
@@ -252,9 +252,9 @@
org.drools.spi.Tuple leftTuple,
org.drools.rule.Declaration[] declarations,
org.drools.WorkingMemory workingMemory) throws Exception {
- @foreach{declarationTypes, declarations as type, declr} @{type} @{declr.identifier} = ( @{type} ) declarations[@{i0}].@{declr.nativeReadMethod.name}( (org.drools.common.InternalWorkingMemory) workingMemory, ( (org.drools.common.InternalFactHandle) leftTuple.get( declarations[@{i0}] ) ).getObject() );
+ @foreach{declarationTypes as type, declarations as declr} @{type} @{declr.identifier} = ( @{type} ) declarations[@{i0}].@{declr.nativeReadMethod.name}( (org.drools.common.InternalWorkingMemory) workingMemory, ( (org.drools.common.InternalFactHandle) leftTuple.get( declarations[@{i0}] ) ).getObject() );
@end{}
- @foreach{globalTypes, globals as type, identifier} @{type} @{identifier} = ( @{type} ) workingMemory.getGlobal( "@{identifier}" );
+ @foreach{globalTypes as type, globals as identifier} @{type} @{identifier} = ( @{type} ) workingMemory.getGlobal( "@{identifier}" );
@end{}
return ((@{ruleClassName}.@{className})context).getResult(
@@ -309,13 +309,13 @@
org.drools.rule.Rule rule = knowledgeHelper.getRule();
org.drools.rule.Declaration[] declarations = rule.getDeclarations();
- @foreach{declarationTypes, declarations, indexes, notPatterns as type, declr, index, notPattern}
+ @foreach{declarationTypes as type, declarations as declr ,indexes as index, notPatterns as notPattern}
org.drools.common.InternalFactHandle @{declr.identifier}__Handle__ = ( org.drools.common.InternalFactHandle ) tuple.get( knowledgeHelper.getDeclaration( declarations[@{index}].getIdentifier() ) );
@{type} @{declr.identifier} = ( @{type} ) declarations[@{index}].@{declr.nativeReadMethod.name}( (org.drools.common.InternalWorkingMemory) workingMemory, @{declr.identifier}__Handle__.getObject() );
@if{notPattern}@{declr.identifier}__Handle__ = (org.drools.common.InternalFactHandle) knowledgeHelper.getWorkingMemory().getFactHandle( @{declr.identifier} );@end{}
@end{}
- @foreach{globalTypes, globals as type, identifier} @{type} @{identifier} = ( @{type} ) workingMemory.getGlobal( "@{identifier}" );
+ @foreach{globalTypes as type, globals as identifier} @{type} @{identifier} = ( @{type} ) workingMemory.getGlobal( "@{identifier}" );
@end{}
@{ruleClassName}.@{methodName} (
Modified: labs/jbossrules/branches/4.0.x/drools-compiler/src/main/resources/org/drools/rule/builder/dialect/java/javaRule.mvel
===================================================================
--- labs/jbossrules/branches/4.0.x/drools-compiler/src/main/resources/org/drools/rule/builder/dialect/java/javaRule.mvel 2008-01-14 17:08:15 UTC (rev 17823)
+++ labs/jbossrules/branches/4.0.x/drools-compiler/src/main/resources/org/drools/rule/builder/dialect/java/javaRule.mvel 2008-01-14 17:17:39 UTC (rev 17824)
@@ -1,22 +1,22 @@
returnValueMethod() ::=<<
-public static org.drools.spi.FieldValue @{methodName}(@foreach{declarationTypes, declarations as type, declr} @{type} @{declr.identifier} @end{","} @if{localDeclarations != empty && declarations != empty}, at end{}
- @foreach{localDeclarationTypes, localDeclarations as type, declr } @{type} @{declr.identifier} @end{","} @if{globals != empty && (localDeclarations != empty || declarations != empty)}, at end{}
- @foreach{globalTypes, globals as type, identifier} @{type} @{identifier} @end{","} ) throws Exception {
+public static org.drools.spi.FieldValue @{methodName}(@foreach{declarationTypes as type, declarations as declr} @{type} @{declr.identifier} @end{","} @if{localDeclarations != empty && declarations != empty}, at end{}
+ @foreach{localDeclarationTypes as type, localDeclarations as declr } @{type} @{declr.identifier} @end{","} @if{globals != empty && (localDeclarations != empty || declarations != empty)}, at end{}
+ @foreach{globalTypes as type, globals as identifier} @{type} @{identifier} @end{","} ) throws Exception {
return org.drools.base.FieldFactory.getFieldValue( @{text} );
}
>>=::
predicateMethod() ::=<<
-public static boolean @{methodName}(@foreach{declarationTypes, declarations as type, declr} @{type} @{declr.identifier} @end{","} @if{localDeclarations != empty && declarations != empty}, at end{}
- @foreach{localDeclarationTypes, localDeclarations as type, declr } @{type} @{declr.identifier} @end{","} @if{globals != empty && (localDeclarations != empty || declarations != empty)}, at end{}
- @foreach{globalTypes, globals as type, identifier} @{type} @{identifier} @end{","} ) throws Exception {
+public static boolean @{methodName}(@foreach{declarationTypes as type, declarations as declr} @{type} @{declr.identifier} @end{","} @if{localDeclarations != empty && declarations != empty}, at end{}
+ @foreach{localDeclarationTypes as type, localDeclarations as declr } @{type} @{declr.identifier} @end{","} @if{globals != empty && (localDeclarations != empty || declarations != empty)}, at end{}
+ @foreach{globalTypes as type, globals as identifier} @{type} @{identifier} @end{","} ) throws Exception {
return ( @{text} );
}
>>=::
evalMethod() ::=<<
-public static boolean @{methodName}(@foreach{declarationTypes, declarations as type, declr} @{type} @{declr.identifier} @end{","} @if{globals != empty && declarations != empty}, at end{}
- @foreach{globalTypes, globals as type, identifier} @{type} @{identifier} @end{","} ) throws Exception {
+public static boolean @{methodName}(@foreach{declarationTypes as type, declarations as declr} @{type} @{declr.identifier} @end{","} @if{globals != empty && declarations != empty}, at end{}
+ @foreach{globalTypes as type, globals as identifier} @{type} @{identifier} @end{","} ) throws Exception {
return ( @{text} );
}
>>=::
@@ -24,14 +24,14 @@
accumulateInnerClass() ::=<<
public static class @{className} {
- @foreach{attributesTypes, attributes as type, attr} private @{type} @{attr};
+ @foreach{attributesTypes as type, attributes as attr} private @{type} @{attr};
@end{}
public @{className}() {
}
- public void init(@foreach{declarationTypes, declarations as type, declr} @{type} @{declr.identifier}@end{","}@if{globals != empty}, at end{}
- @foreach{globalTypes, globals as type, identifier} @{type} @{identifier} @end{","}
+ public void init(@foreach{declarationTypes as type, declarations as declr} @{type} @{declr.identifier}@end{","}@if{globals != empty}, at end{}
+ @foreach{globalTypes as type, globals as identifier} @{type} @{identifier} @end{","}
) throws Exception {
@{initCode}
}
@@ -39,8 +39,8 @@
public void accumulate(org.drools.WorkingMemory workingMemory,
org.drools.rule.Declaration[] innerDeclarations,
Object object @if{declarations != empty}, @end{}
- @foreach{declarationTypes, declarations as type, declr} @{type} @{declr.identifier}@end{","}@if{globals != empty}, at end{}
- @foreach{globalTypes, globals as type, identifier} @{type} @{identifier} @end{","}@if{innerDeclarations != empty}, at end{}
+ @foreach{declarationTypes as type, declarations as declr} @{type} @{declr.identifier}@end{","}@if{globals != empty}, at end{}
+ @foreach{globalTypes as type, globals as identifier} @{type} @{identifier} @end{","}@if{innerDeclarations != empty}, at end{}
@foreach{innerDeclarations as declr}@{declr.extractor.extractToClassName} @{declr.identifier}@end{","}
) throws Exception {
@{actionCode}
@@ -49,15 +49,15 @@
public void reverse(org.drools.WorkingMemory workingMemory,
org.drools.rule.Declaration[] innerDeclarations,
Object object @if{declarations != empty}, @end{}
- @foreach{declarationTypes, declarations as type, declr} @{type} @{declr.identifier}@end{","}@if{globals != empty}, at end{}
- @foreach{globalTypes, globals as type, identifier} @{type} @{identifier} @end{","}@if{innerDeclarations != empty}, at end{}
+ @foreach{declarationTypes as type, declarations as declr} @{type} @{declr.identifier}@end{","}@if{globals != empty}, at end{}
+ @foreach{globalTypes as type, globals as identifier} @{type} @{identifier} @end{","}@if{innerDeclarations != empty}, at end{}
@foreach{innerDeclarations as declr}@{declr.extractor.extractToClassName} @{declr.identifier}@end{","}
) throws Exception {
@{reverseCode}
}
- public Object getResult(@foreach{declarationTypes, declarations as type, declr} @{type} @{declr.identifier}@end{","}@if{globals != empty}, at end{}
- @foreach{globalTypes, globals as type, identifier}@{type} @{identifier} @end{","}
+ public Object getResult(@foreach{declarationTypes as type, declarations as declr} @{type} @{declr.identifier}@end{","}@if{globals != empty}, at end{}
+ @foreach{globalTypes as type, globals as identifier}@{type} @{identifier} @end{","}
) throws Exception {
return ( @{resultCode} );
}
@@ -69,7 +69,7 @@
>>=::
consequenceMethod() ::=<<
-public static void @{methodName}(org.drools.spi.KnowledgeHelper drools at if{declarations != empty}, at end{} @foreach{declarationTypes, declarations as type, declr} @{type} @{declr.identifier}, org.drools.FactHandle @{declr.identifier}__Handle__ @end{","}@if{globals != empty}, at end{} @foreach{globalTypes, globals as type, identifier} @{type} @{identifier} @end{","} ) throws Exception {
+public static void @{methodName}(org.drools.spi.KnowledgeHelper drools at if{declarations != empty}, at end{} @foreach{declarationTypes as type, declarations as declr} @{type} @{declr.identifier}, org.drools.FactHandle @{declr.identifier}__Handle__ @end{","}@if{globals != empty}, at end{} @foreach{globalTypes as type, globals as identifier} @{type} @{identifier} @end{","} ) throws Exception {
@{text}
}
>>=::
\ No newline at end of file
Modified: labs/jbossrules/branches/4.0.x/pom.xml
===================================================================
--- labs/jbossrules/branches/4.0.x/pom.xml 2008-01-14 17:08:15 UTC (rev 17823)
+++ labs/jbossrules/branches/4.0.x/pom.xml 2008-01-14 17:17:39 UTC (rev 17824)
@@ -734,7 +734,7 @@
<dependency>
<groupId>org.mvel</groupId>
<artifactId>mvel14</artifactId>
- <version>1.2.20</version>
+ <version>1.2.21</version>
</dependency>
<!-- drools-compiler -->
More information about the jboss-svn-commits
mailing list