is "==" case sensitive
by rules-users@lists.jboss.org
I dont find anything on the documentation...and i think it is important to know...
thanks !
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
17 years, 11 months
Re: Fw: [rules-users] rules questions...
by Joel G. Rivera-González
i tried that...
this is the error
28703 [main] FATAL com.prtc.struts.util.ConstructServiceAssuranceTreeMenu - org.drools.rule.InvalidRulePackage: Rule Compilation error Redefinition of formal parameter "arrayList" Exception:1 errors while compiling unit "com/prtc/struts/rules/Rule_pos_baja_feature_menu_0.java"
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
----- Original Message ----
From: Steven Williams <stevenw(a)objectconsulting.com.au>
To: Joel G. Rivera-González <el_pio(a)yahoo.com>
Cc: drools <rules-users(a)lists.jboss.org>
Sent: Sunday, January 7, 2007 8:50:06 PM
Subject: Re: Fw: [rules-users] rules questions...
try
global java.util.ArrayList arrayList;
or
global java.util.List arrayList;
On 1/8/07, Joel G. Rivera-González <
el_pio(a)yahoo.com> wrote:
setting an ArrayList on a global value like this workingMemory.setGlobal("arrayList", menuArray); on the java code and like this on the rule
global ArrayList arrayList;
cause the following error:
23304 [main] FATAL com.prtc.struts.util.ConstructServiceAssuranceTreeMenu - Exception in ShowIspServiceAssuranceAction.execute --> org.drools.rule.InvalidRulePackage: Rule Compilation error Redefinition of formal parameter "arrayList" Exception:1 errors while compiling unit "com/prtc/struts/rules/Rule_pos_baja_feature_menu_0.java"
Joel
G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
----- Original Message ----
From: Steven Williams <
stevenw(a)objectconsulting.com.au>
To: Joel G. Rivera-González <el_pio(a)yahoo.com>
Cc: drools <rules-users(a)lists.jboss.org>
Sent: Sunday, January 7, 2007 6:00:41 PM
Subject: Re: Fw: [rules-users] rules questions...
Hi Joel,
The whole point of globals is that you don't need to assert them you just set them from the calling code, ie:
workingMemory.setGlobal("myList", arrayList);
You can then use myList in your consequence.
There is no way to use an asserted object in a consequence without binding it to a variable in one of the conditions.
cheers
Steve
On 1/8/07,
Joel G. Rivera-González <el_pio(a)yahoo.com> wrote:
ok..after playing a while with this global thing...i found out that global variables cant be asserted...
any other idea of how to use an asserted arrayList on the consequence without writing it on the conditions?
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
----- Original Message ----
From: Joel G. Rivera-González <
el_pio(a)yahoo.com>
To: drools <
rules-users(a)lists.jboss.org>
Sent: Sunday, January 7, 2007 10:48:50 AM
Subject: Re: Fw: [rules-users] rules questions...
thanks for your input...this is exactly what i was looking for !
:)
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
----- Original Message ----
From: Steven Williams <
stevenw(a)objectconsulting.com.au>
To: Joel G. Rivera-González <
el_pio(a)yahoo.com>
Cc: rules-users(a)lists.jboss.org
Sent: Sunday, January 7, 2007 3:53:34 AM
Subject: Re: Fw: [rules-users] rules questions...
Hi Joel,
I think you should rather use a global for the ArrayList:
global java.util.List myList
rule
"cancel_menu"
when
MegaTransferObject(other_EffectiveOrderTypeDsl != null, other_EffectiveOrderTypeDsl ==
Constants.NEW_OPEN_ORDER_TYPE)
not MegaTransferObject(orders_FkOrderStatusId != null, orders_FkOrderStatusId == Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS)
then
myList.add(new String[]{
Constants.SERVICE_ASSURANCE_TREE_MENU_DSL
, Constants.SERVICE_ASSURANCE_MENU_CANCEL});
end
btw - you don't need to put "and" at the end of each constraint.
cheers
Steve
On 1/7/07,
Joel G. Rivera-González <el_pio(a)yahoo.com> wrote:
this is a one of my rules...
rule "cancel_menu"
when
arrayList : ArrayList()
MegaTransferObject(other_EffectiveOrderTypeDsl != null, other_EffectiveOrderTypeDsl ==
Constants.NEW_OPEN_ORDER_TYPE) and
not MegaTransferObject(orders_FkOrderStatusId != null, orders_FkOrderStatusId == Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS
)
then
arrayList.add(new String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL
, Constants.SERVICE_ASSURANCE_MENU_CANCEL});
end
i do an assert of an empty arrayList...
when i use this
arrayList : ArrayList() on the when the rule fire an error...why?
will the ArrayList be the same on all the rules (i think it will but want to make sure)
Joel G.
Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
----- Original Message ----
From: Kumaran S <
kumaran.shanmuhan(a)gmail.com>
To: Joel G. Rivera-González <el_pio(a)yahoo.com>
Sent: Friday, January 5, 2007 5:42:01 PM
Subject: Re: [rules-users] rules questions...
getResourceAsStream(ruleDrl) expects to find a drl file based on the location represented by "
ruleDrl".
It should be noted that the location should be accessible from the CLASSPATH. You could get a null pointer exception, if the location is not accessible from your CLASSPATH.
On 1/5/07, Joel G. Rivera-González <el_pio(a)yahoo.com> wrote:
Trying to figure out the new rule system...
but it doesnt work...
This is my rule:
package com.prtc.struts.rules
import com.prtc.db.MegaTransferObject
import java.util.ArrayList
import com.prtc.struts.Constants
rule "cancel_menu"
when
megaTO : MegaexistMegaTransferObject()
megaTO(other_EffectiveOrderTypeDsl != null) and
megaTO(other_EffectiveOrderTypeDsl == Constants.NEW_OPEN_ORDER_TYPE
) and
megaTO(orders_FkOrderStatusId != null) and
megaTO(orders_FkOrderStatusId ==
Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS)
then
System.out.println("Hello");
end
part of my
code:
InputStreamReader ir = new InputStreamReader(RuleBuilderMgr.class.getClassLoader().getResourceAsStream(ruleDrl)); //the null pointer is from this line.
builder.addPackageFromDrl(ir);
this is the result:
7661 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler - compiling com.prtc.struts.rules.Rule_cancel_menu_0
7942 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler - compile com.prtc.struts.rules.Rule_cancel_menu_0
8062 [main] DEBUG
org.apache.commons.jci.compilers.JaninoJavaCompiler - compiled com.prtc.struts.rules.Rule_cancel_menu_0
8062 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler
- compiling com.prtc.struts.rules.Rule_cancel_menu_0ConsequenceInvoker
8072 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler - compile
com.prtc.struts.rules.Rule_cancel_menu_0ConsequenceInvoker
8092 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler - compiled com.prtc.struts.rules.Rule_cancel_menu_0ConsequenceInvoker
8102 [main] FATAL com.prtc.struts.util.ConstructServiceAssuranceTreeMenu - Exception in
ShowIspServiceAssuranceAction.execute --> java.lang.NullPointerException
8102 [main] FATAL com.prtc.struts.util.ConstructServiceAssuranceTreeMenu
- java.lang.NullPointerException
at com.prtc.struts.util.ConstructServiceAssuranceTreeMenu.construct(ConstructServiceAssuranceTreeMenu.java:74)
at com.prtc.lc.rules.managers.RuleTester.test1(RuleTester.java:299)
at
com.prtc.lc.rules.managers.RuleTester.main(RuleTester.java:54)
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's
Law
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Give me a lever long enough... Single-handed, I shall move the world!
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Steven Williams
Supervising Consultant
Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
stevenw(a)objectconsulting.com.au
www.objectconsulting.com.au
consulting | development | training | support
our experience makes the difference
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Steven Williams
Supervising Consultant
Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
stevenw(a)objectconsulting.com.au
www.objectconsulting.com.au
consulting | development | training | support
our experience makes the difference
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Steven Williams
Supervising Consultant
Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
stevenw(a)objectconsulting.com.au
www.objectconsulting.com.au
consulting | development | training | support
our experience makes the difference
17 years, 11 months
Re: Fw: [rules-users] rules questions...
by Joel G. Rivera-González
setting an ArrayList on a global value like this workingMemory.setGlobal("arrayList", menuArray); on the java code and like this on the rule global ArrayList arrayList;
cause the following error:
23304 [main] FATAL com.prtc.struts.util.ConstructServiceAssuranceTreeMenu - Exception in ShowIspServiceAssuranceAction.execute --> org.drools.rule.InvalidRulePackage: Rule Compilation error Redefinition of formal parameter "arrayList" Exception:1 errors while compiling unit "com/prtc/struts/rules/Rule_pos_baja_feature_menu_0.java"
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
----- Original Message ----
From: Steven Williams <stevenw(a)objectconsulting.com.au>
To: Joel G. Rivera-González <el_pio(a)yahoo.com>
Cc: drools <rules-users(a)lists.jboss.org>
Sent: Sunday, January 7, 2007 6:00:41 PM
Subject: Re: Fw: [rules-users] rules questions...
Hi Joel,
The whole point of globals is that you don't need to assert them you just set them from the calling code, ie:
workingMemory.setGlobal("myList", arrayList);
You can then use myList in your consequence.
There is no way to use an asserted object in a consequence without binding it to a variable in one of the conditions.
cheers
Steve
On 1/8/07,
Joel G. Rivera-González <el_pio(a)yahoo.com> wrote:
ok..after playing a while with this global thing...i found out that global variables cant be asserted...
any other idea of how to use an asserted arrayList on the consequence without writing it on the conditions?
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
----- Original Message ----
From: Joel G. Rivera-González <
el_pio(a)yahoo.com>
To: drools <
rules-users(a)lists.jboss.org>
Sent: Sunday, January 7, 2007 10:48:50 AM
Subject: Re: Fw: [rules-users] rules questions...
thanks for your input...this is exactly what i was looking for !
:)
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
----- Original Message ----
From: Steven Williams <
stevenw(a)objectconsulting.com.au>
To: Joel G. Rivera-González <
el_pio(a)yahoo.com>
Cc: rules-users(a)lists.jboss.org
Sent: Sunday, January 7, 2007 3:53:34 AM
Subject: Re: Fw: [rules-users] rules questions...
Hi Joel,
I think you should rather use a global for the ArrayList:
global java.util.List myList
rule
"cancel_menu"
when
MegaTransferObject(other_EffectiveOrderTypeDsl != null, other_EffectiveOrderTypeDsl ==
Constants.NEW_OPEN_ORDER_TYPE)
not MegaTransferObject(orders_FkOrderStatusId != null, orders_FkOrderStatusId == Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS)
then
myList.add(new String[]{
Constants.SERVICE_ASSURANCE_TREE_MENU_DSL
, Constants.SERVICE_ASSURANCE_MENU_CANCEL});
end
btw - you don't need to put "and" at the end of each constraint.
cheers
Steve
On 1/7/07,
Joel G. Rivera-González <el_pio(a)yahoo.com> wrote:
this is a one of my rules...
rule "cancel_menu"
when
arrayList : ArrayList()
MegaTransferObject(other_EffectiveOrderTypeDsl != null, other_EffectiveOrderTypeDsl ==
Constants.NEW_OPEN_ORDER_TYPE) and
not MegaTransferObject(orders_FkOrderStatusId != null, orders_FkOrderStatusId == Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS
)
then
arrayList.add(new String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL
, Constants.SERVICE_ASSURANCE_MENU_CANCEL});
end
i do an assert of an empty arrayList...
when i use this
arrayList : ArrayList() on the when the rule fire an error...why?
will the ArrayList be the same on all the rules (i think it will but want to make sure)
Joel G.
Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
----- Original Message ----
From: Kumaran S <
kumaran.shanmuhan(a)gmail.com>
To: Joel G. Rivera-González <el_pio(a)yahoo.com>
Sent: Friday, January 5, 2007 5:42:01 PM
Subject: Re: [rules-users] rules questions...
getResourceAsStream(ruleDrl) expects to find a drl file based on the location represented by "
ruleDrl".
It should be noted that the location should be accessible from the CLASSPATH. You could get a null pointer exception, if the location is not accessible from your CLASSPATH.
On 1/5/07, Joel G. Rivera-González <el_pio(a)yahoo.com> wrote:
Trying to figure out the new rule system...
but it doesnt work...
This is my rule:
package com.prtc.struts.rules
import com.prtc.db.MegaTransferObject
import java.util.ArrayList
import com.prtc.struts.Constants
rule "cancel_menu"
when
megaTO : MegaexistMegaTransferObject()
megaTO(other_EffectiveOrderTypeDsl != null) and
megaTO(other_EffectiveOrderTypeDsl == Constants.NEW_OPEN_ORDER_TYPE
) and
megaTO(orders_FkOrderStatusId != null) and
megaTO(orders_FkOrderStatusId ==
Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS)
then
System.out.println("Hello");
end
part of my
code:
InputStreamReader ir = new InputStreamReader(RuleBuilderMgr.class.getClassLoader().getResourceAsStream(ruleDrl)); //the null pointer is from this line.
builder.addPackageFromDrl(ir);
this is the result:
7661 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler - compiling com.prtc.struts.rules.Rule_cancel_menu_0
7942 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler - compile com.prtc.struts.rules.Rule_cancel_menu_0
8062 [main] DEBUG
org.apache.commons.jci.compilers.JaninoJavaCompiler - compiled com.prtc.struts.rules.Rule_cancel_menu_0
8062 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler
- compiling com.prtc.struts.rules.Rule_cancel_menu_0ConsequenceInvoker
8072 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler - compile
com.prtc.struts.rules.Rule_cancel_menu_0ConsequenceInvoker
8092 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler - compiled com.prtc.struts.rules.Rule_cancel_menu_0ConsequenceInvoker
8102 [main] FATAL com.prtc.struts.util.ConstructServiceAssuranceTreeMenu - Exception in
ShowIspServiceAssuranceAction.execute --> java.lang.NullPointerException
8102 [main] FATAL com.prtc.struts.util.ConstructServiceAssuranceTreeMenu
- java.lang.NullPointerException
at com.prtc.struts.util.ConstructServiceAssuranceTreeMenu.construct(ConstructServiceAssuranceTreeMenu.java:74)
at com.prtc.lc.rules.managers.RuleTester.test1(RuleTester.java:299)
at
com.prtc.lc.rules.managers.RuleTester.main(RuleTester.java:54)
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's
Law
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Give me a lever long enough... Single-handed, I shall move the world!
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Steven Williams
Supervising Consultant
Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
stevenw(a)objectconsulting.com.au
www.objectconsulting.com.au
consulting | development | training | support
our experience makes the difference
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Steven Williams
Supervising Consultant
Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
stevenw(a)objectconsulting.com.au
www.objectconsulting.com.au
consulting | development | training | support
our experience makes the difference
17 years, 11 months
Re: Fw: [rules-users] rules questions...
by Joel G. Rivera-González
ok..after playing a while with this global thing...i found out that global variables cant be asserted...
any other idea of how to use an asserted arrayList on the consequence without writing it on the conditions?
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
----- Original Message ----
From: Joel G. Rivera-González <el_pio(a)yahoo.com>
To: drools <rules-users(a)lists.jboss.org>
Sent: Sunday, January 7, 2007 10:48:50 AM
Subject: Re: Fw: [rules-users] rules questions...
thanks for your input...this is exactly what i was looking for !
:)
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
----- Original Message ----
From: Steven Williams <stevenw(a)objectconsulting.com.au>
To: Joel G. Rivera-González <el_pio(a)yahoo.com>
Cc: rules-users(a)lists.jboss.org
Sent: Sunday, January 7, 2007 3:53:34 AM
Subject: Re: Fw: [rules-users] rules questions...
Hi Joel,
I think you should rather use a global for the ArrayList:
global java.util.List myList
rule
"cancel_menu"
when
MegaTransferObject(other_EffectiveOrderTypeDsl != null, other_EffectiveOrderTypeDsl ==
Constants.NEW_OPEN_ORDER_TYPE)
not MegaTransferObject(orders_FkOrderStatusId != null, orders_FkOrderStatusId == Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS)
then
myList.add(new String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL
, Constants.SERVICE_ASSURANCE_MENU_CANCEL});
end
btw - you don't need to put "and" at the end of each constraint.
cheers
Steve
On 1/7/07,
Joel G. Rivera-González <el_pio(a)yahoo.com> wrote:
this is a one of my rules...
rule "cancel_menu"
when
arrayList : ArrayList()
MegaTransferObject(other_EffectiveOrderTypeDsl != null, other_EffectiveOrderTypeDsl ==
Constants.NEW_OPEN_ORDER_TYPE) and
not MegaTransferObject(orders_FkOrderStatusId != null, orders_FkOrderStatusId == Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS
)
then
arrayList.add(new String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL
, Constants.SERVICE_ASSURANCE_MENU_CANCEL});
end
i do an assert of an empty arrayList...
when i use this
arrayList : ArrayList() on the when the rule fire an error...why?
will the ArrayList be the same on all the rules (i think it will but want to make sure)
Joel G.
Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
----- Original Message ----
From: Kumaran S <
kumaran.shanmuhan(a)gmail.com>
To: Joel G. Rivera-González <el_pio(a)yahoo.com>
Sent: Friday, January 5, 2007 5:42:01 PM
Subject: Re: [rules-users] rules questions...
getResourceAsStream(ruleDrl) expects to find a drl file based on the location represented by "
ruleDrl".
It should be noted that the location should be accessible from the CLASSPATH. You could get a null pointer exception, if the location is not accessible from your CLASSPATH.
On 1/5/07, Joel G. Rivera-González <el_pio(a)yahoo.com> wrote:
Trying to figure out the new rule system...
but it doesnt work...
This is my rule:
package com.prtc.struts.rules
import com.prtc.db.MegaTransferObject
import java.util.ArrayList
import com.prtc.struts.Constants
rule "cancel_menu"
when
megaTO : MegaexistMegaTransferObject()
megaTO(other_EffectiveOrderTypeDsl != null) and
megaTO(other_EffectiveOrderTypeDsl == Constants.NEW_OPEN_ORDER_TYPE
) and
megaTO(orders_FkOrderStatusId != null) and
megaTO(orders_FkOrderStatusId ==
Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS)
then
System.out.println("Hello");
end
part of my
code:
InputStreamReader ir = new InputStreamReader(RuleBuilderMgr.class.getClassLoader().getResourceAsStream(ruleDrl)); //the null pointer is from this line.
builder.addPackageFromDrl(ir);
this is the result:
7661 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler - compiling com.prtc.struts.rules.Rule_cancel_menu_0
7942 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler - compile com.prtc.struts.rules.Rule_cancel_menu_0
8062 [main] DEBUG
org.apache.commons.jci.compilers.JaninoJavaCompiler - compiled com.prtc.struts.rules.Rule_cancel_menu_0
8062 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler
- compiling com.prtc.struts.rules.Rule_cancel_menu_0ConsequenceInvoker
8072 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler - compile
com.prtc.struts.rules.Rule_cancel_menu_0ConsequenceInvoker
8092 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler - compiled com.prtc.struts.rules.Rule_cancel_menu_0ConsequenceInvoker
8102 [main] FATAL com.prtc.struts.util.ConstructServiceAssuranceTreeMenu - Exception in
ShowIspServiceAssuranceAction.execute --> java.lang.NullPointerException
8102 [main] FATAL com.prtc.struts.util.ConstructServiceAssuranceTreeMenu
- java.lang.NullPointerException
at com.prtc.struts.util.ConstructServiceAssuranceTreeMenu.construct(ConstructServiceAssuranceTreeMenu.java:74)
at com.prtc.lc.rules.managers.RuleTester.test1(RuleTester.java:299)
at
com.prtc.lc.rules.managers.RuleTester.main(RuleTester.java:54)
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's
Law
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Give me a lever long enough... Single-handed, I shall move the world!
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Steven Williams
Supervising Consultant
Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
stevenw(a)objectconsulting.com.au
www.objectconsulting.com.au
consulting | development | training | support
our experience makes the difference
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
17 years, 11 months
Re: Fw: [rules-users] rules questions...
by Joel G. Rivera-González
thanks for your input...this is exactly what i was looking for !
:)
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
----- Original Message ----
From: Steven Williams <stevenw(a)objectconsulting.com.au>
To: Joel G. Rivera-González <el_pio(a)yahoo.com>
Cc: rules-users(a)lists.jboss.org
Sent: Sunday, January 7, 2007 3:53:34 AM
Subject: Re: Fw: [rules-users] rules questions...
Hi Joel,
I think you should rather use a global for the ArrayList:
global java.util.List myList
rule "cancel_menu"
when
MegaTransferObject(other_EffectiveOrderTypeDsl != null, other_EffectiveOrderTypeDsl ==
Constants.NEW_OPEN_ORDER_TYPE)
not MegaTransferObject(orders_FkOrderStatusId != null, orders_FkOrderStatusId == Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS)
then
myList.add(new String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL
, Constants.SERVICE_ASSURANCE_MENU_CANCEL});
end
btw - you don't need to put "and" at the end of each constraint.
cheers
Steve
On 1/7/07,
Joel G. Rivera-González <el_pio(a)yahoo.com> wrote:
this is a one of my rules...
rule "cancel_menu"
when
arrayList : ArrayList()
MegaTransferObject(other_EffectiveOrderTypeDsl != null, other_EffectiveOrderTypeDsl ==
Constants.NEW_OPEN_ORDER_TYPE) and
not MegaTransferObject(orders_FkOrderStatusId != null, orders_FkOrderStatusId == Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS
)
then
arrayList.add(new String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL
, Constants.SERVICE_ASSURANCE_MENU_CANCEL});
end
i do an assert of an empty arrayList...
when i use this
arrayList : ArrayList() on the when the rule fire an error...why?
will the ArrayList be the same on all the rules (i think it will but want to make sure)
Joel G.
Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
----- Original Message ----
From: Kumaran S <
kumaran.shanmuhan(a)gmail.com>
To: Joel G. Rivera-González <el_pio(a)yahoo.com>
Sent: Friday, January 5, 2007 5:42:01 PM
Subject: Re: [rules-users] rules questions...
getResourceAsStream(ruleDrl) expects to find a drl file based on the location represented by "
ruleDrl".
It should be noted that the location should be accessible from the CLASSPATH. You could get a null pointer exception, if the location is not accessible from your CLASSPATH.
On 1/5/07, Joel G. Rivera-González <el_pio(a)yahoo.com> wrote:
Trying to figure out the new rule system...
but it doesnt work...
This is my rule:
package com.prtc.struts.rules
import com.prtc.db.MegaTransferObject
import java.util.ArrayList
import com.prtc.struts.Constants
rule "cancel_menu"
when
megaTO : MegaexistMegaTransferObject()
megaTO(other_EffectiveOrderTypeDsl != null) and
megaTO(other_EffectiveOrderTypeDsl == Constants.NEW_OPEN_ORDER_TYPE
) and
megaTO(orders_FkOrderStatusId != null) and
megaTO(orders_FkOrderStatusId ==
Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS)
then
System.out.println("Hello");
end
part of my
code:
InputStreamReader ir = new InputStreamReader(RuleBuilderMgr.class.getClassLoader().getResourceAsStream(ruleDrl)); //the null pointer is from this line.
builder.addPackageFromDrl(ir);
this is the result:
7661 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler - compiling com.prtc.struts.rules.Rule_cancel_menu_0
7942 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler - compile com.prtc.struts.rules.Rule_cancel_menu_0
8062 [main] DEBUG
org.apache.commons.jci.compilers.JaninoJavaCompiler - compiled com.prtc.struts.rules.Rule_cancel_menu_0
8062 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler
- compiling com.prtc.struts.rules.Rule_cancel_menu_0ConsequenceInvoker
8072 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler - compile
com.prtc.struts.rules.Rule_cancel_menu_0ConsequenceInvoker
8092 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler - compiled com.prtc.struts.rules.Rule_cancel_menu_0ConsequenceInvoker
8102 [main] FATAL com.prtc.struts.util.ConstructServiceAssuranceTreeMenu - Exception in
ShowIspServiceAssuranceAction.execute --> java.lang.NullPointerException
8102 [main] FATAL com.prtc.struts.util.ConstructServiceAssuranceTreeMenu
- java.lang.NullPointerException
at com.prtc.struts.util.ConstructServiceAssuranceTreeMenu.construct(ConstructServiceAssuranceTreeMenu.java:74)
at com.prtc.lc.rules.managers.RuleTester.test1(RuleTester.java:299)
at
com.prtc.lc.rules.managers.RuleTester.main(RuleTester.java:54)
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's
Law
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Give me a lever long enough... Single-handed, I shall move the world!
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Steven Williams
Supervising Consultant
Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
stevenw(a)objectconsulting.com.au
www.objectconsulting.com.au
consulting | development | training | support
our experience makes the difference
17 years, 11 months
Re: [rules-users] about "not"
by Joel G. Rivera-González
great...
thanks
btw...
there is something wierd with the list...
when i do a reply it will just do a reply to the person who sent the emial...
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
----- Original Message ----
From: Edson Tirelli <tirelli(a)post.com>
To: Joel G. Rivera-González <el_pio(a)yahoo.com>
Sent: Sunday, January 7, 2007 10:48:29 AM
Subject: Re: [rules-users] about "not"
Joel,
This is not possible in 3.0.x version. It is under development and
will be avaible for the next release.
[]s
Edson
Joel G. Rivera-González wrote:
> Why i cant use not on a whole group?
> something like
> not ( this or that)
>
>
> Joel G. Rivera-Gonzalez
> PRT
>
> "The first 90% of a project takes 90% of the time, the last 10% takes
> the other 90% of the time" - Murphy's Law
>
>------------------------------------------------------------------------
>
>_______________________________________________
>rules-users mailing list
>rules-users(a)lists.jboss.org
>https://lists.jboss.org/mailman/listinfo/rules-users
>
>
--
Edson Tirelli
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3124-6000
Mobile: +55 11 9218-4151
JBoss, a division of Red Hat @ www.jboss.com
17 years, 11 months
Fw: [rules-users] rules questions...
by Joel G. Rivera-González
this is a one of my rules...
rule "cancel_menu"
when
arrayList : ArrayList()
MegaTransferObject(other_EffectiveOrderTypeDsl != null, other_EffectiveOrderTypeDsl == Constants.NEW_OPEN_ORDER_TYPE) and
not MegaTransferObject(orders_FkOrderStatusId != null, orders_FkOrderStatusId == Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS)
then
arrayList.add(new String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL, Constants.SERVICE_ASSURANCE_MENU_CANCEL});
end
i do an assert of an empty arrayList...
when i use this arrayList : ArrayList() on the when the rule fire an error...why?
will the ArrayList be the same on all the rules (i think it will but want to make sure)
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
----- Original Message ----
From: Kumaran S <kumaran.shanmuhan(a)gmail.com>
To: Joel G. Rivera-González <el_pio(a)yahoo.com>
Sent: Friday, January 5, 2007 5:42:01 PM
Subject: Re: [rules-users] rules questions...
getResourceAsStream(ruleDrl) expects to find a drl file based on the location represented by "ruleDrl".
It should be noted that the location should be accessible from the CLASSPATH. You could get a null pointer exception, if the location is not accessible from your CLASSPATH.
On 1/5/07, Joel G. Rivera-González <el_pio(a)yahoo.com> wrote:
Trying to figure out the new rule system...
but it doesnt work...
This is my rule:
package com.prtc.struts.rules
import com.prtc.db.MegaTransferObject
import java.util.ArrayList
import com.prtc.struts.Constants
rule "cancel_menu"
when
megaTO : MegaexistMegaTransferObject()
megaTO(other_EffectiveOrderTypeDsl != null) and
megaTO(other_EffectiveOrderTypeDsl == Constants.NEW_OPEN_ORDER_TYPE
) and
megaTO(orders_FkOrderStatusId != null) and
megaTO(orders_FkOrderStatusId ==
Constants.PENDING_TO_BE_SUBMITTED_ORDER_STATUS)
then
System.out.println("Hello");
end
part of my
code:
InputStreamReader ir = new InputStreamReader(RuleBuilderMgr.class.getClassLoader().getResourceAsStream(ruleDrl)); //the null pointer is from this line.
builder.addPackageFromDrl(ir);
this is the result:
7661 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler - compiling com.prtc.struts.rules.Rule_cancel_menu_0
7942 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler - compile com.prtc.struts.rules.Rule_cancel_menu_0
8062 [main] DEBUG
org.apache.commons.jci.compilers.JaninoJavaCompiler - compiled com.prtc.struts.rules.Rule_cancel_menu_0
8062 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler
- compiling com.prtc.struts.rules.Rule_cancel_menu_0ConsequenceInvoker
8072 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler - compile
com.prtc.struts.rules.Rule_cancel_menu_0ConsequenceInvoker
8092 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler - compiled com.prtc.struts.rules.Rule_cancel_menu_0ConsequenceInvoker
8102 [main] FATAL com.prtc.struts.util.ConstructServiceAssuranceTreeMenu - Exception in
ShowIspServiceAssuranceAction.execute --> java.lang.NullPointerException
8102 [main] FATAL com.prtc.struts.util.ConstructServiceAssuranceTreeMenu
- java.lang.NullPointerException
at com.prtc.struts.util.ConstructServiceAssuranceTreeMenu.construct(ConstructServiceAssuranceTreeMenu.java:74)
at com.prtc.lc.rules.managers.RuleTester.test1(RuleTester.java:299)
at
com.prtc.lc.rules.managers.RuleTester.main(RuleTester.java:54)
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's
Law
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Give me a lever long enough... Single-handed, I shall move the world!
17 years, 11 months
about "not"
by Joel G. Rivera-González
Why i cant use not on a whole group?
something like
not ( this or that)
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
17 years, 11 months
performance difference between janino and eclise core 3.2?
by Joel G. Rivera-González
i'm using janino to keep the package smaller...
any significant advantage in using one or the other?
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
17 years, 11 months
Strings and null values...
by Joel G. Rivera-González
if i want to check a string value on a condition
will i have to do a "!= null" and then the "==" to avoid a null pointer exception?
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
17 years, 11 months