----- Original Message ----
From: Kumaran S <kumaran.shanmuhan@gmail.com>
To: Joel G. Rivera-González <el_pio@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@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");endpart 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_08062 [main] DEBUG
org.apache.commons.jci.compilers.JaninoJavaCompiler - compiled com.prtc.struts.rules.Rule_cancel_menu_08062 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler
- compiling com.prtc.struts.rules.Rule_cancel_menu_0ConsequenceInvoker8072 [main] DEBUG org.apache.commons.jci.compilers.JaninoJavaCompiler - compile
com.prtc.struts.rules.Rule_cancel_menu_0ConsequenceInvoker8092 [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.NullPointerException8102 [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@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Give me a lever long enough... Single-handed, I shall move the world!