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