How to define generic event in TIBCO BusinessEvents Rule's scope.

How to define generic event in TIBCO BusinessEvents Rule's scope.

book

Article ID: KB0080996

calendar_today

Updated On:

Products Versions
TIBCO BusinessEvents Enterprise Edition 5.x

Description


The declaration section in the rule defines the scope of the rule. When generic Event is defined in the declaration section of any rule , TIBCO BusinessEvents will through the below exceptions.

Example :
rule Rules.<Rule_Name>{
        attribute {
                priority = 5;
                forwardChain = true;
        }
        declare {
                Concept instance;
                Event event;

        }


##########    Error Logs ##############
java.lang.ClassNotFoundException:
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at com.tibco.cep.util.CodegenFunctions.classForName(CodegenFunctions.java:436)
    at be.gen.Rules.DeleteAll.<init>(DeleteAll.java:11)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at com.tibco.cep.kernel.core.base.RuleLoaderImpl.loadRule(RuleLoaderImpl.java:119)
    at com.tibco.cep.kernel.core.base.RuleLoaderImpl.loadRule(RuleLoaderImpl.java:181)
    at com.tibco.cep.runtime.session.impl.RuleSessionImpl.loadRules(RuleSessionImpl.java:516)
    at com.tibco.cep.runtime.session.impl.RuleSessionImpl.init(RuleSessionImpl.java:473)
    at com.tibco.cep.runtime.session.impl.RuleSessionImpl.init(RuleSessionImpl.java:457)
    at com.tibco.cep.runtime.session.impl.RuleSessionManagerImpl.init(RuleSessionManagerImpl.java:136)
    at com.tibco.cep.runtime.session.impl.RuleServiceProviderImpl.initRuleSessions(RuleServiceProviderImpl.java:1197)
    at com.tibco.cep.runtime.session.impl.RuleServiceProviderImpl.initAll(RuleServiceProviderImpl.java:621)
    at com.tibco.cep.runtime.session.impl.RuleServiceProviderImpl.configure(RuleServiceProviderImpl.java:265)
    at com.tibco.cep.container.standalone.BEMain.jumpStart(BEMain.java:172)
    at com.tibco.cep.container.standalone.BEMain.main(BEMain.java:71)
##########    

##########    
Error performing initAll()
java.lang.NullPointerException
    at java.lang.Class.isAssignableFrom(Native Method)
    at com.tibco.cep.kernel.core.rete.ReteNetwork.pickIdentifier(ReteNetwork.java:393)
    at com.tibco.cep.kernel.core.rete.ReteNetwork.addRule(ReteNetwork.java:286)
    at com.tibco.cep.kernel.core.rete.ReteWM.addRule(ReteWM.java:1013)
    at com.tibco.cep.kernel.core.base.RuleLoaderImpl.deployRuleToWM(RuleLoaderImpl.java:232)
    at com.tibco.cep.kernel.core.rete.ReteWM._init(ReteWM.java:194)
    at com.tibco.cep.kernel.core.rete.ReteWM.init(ReteWM.java:180)
    at com.tibco.cep.runtime.session.impl.RuleSessionImpl.init(RuleSessionImpl.java:473)
    at com.tibco.cep.runtime.session.impl.RuleSessionImpl.init(RuleSessionImpl.java:457)
    at com.tibco.cep.runtime.session.impl.RuleSessionManagerImpl.init(RuleSessionManagerImpl.java:136)
    at com.tibco.cep.runtime.session.impl.RuleServiceProviderImpl.initRuleSessions(RuleServiceProviderImpl.java:1197)
    at com.tibco.cep.runtime.session.impl.RuleServiceProviderImpl.initAll(RuleServiceProviderImpl.java:621)
    at com.tibco.cep.runtime.session.impl.RuleServiceProviderImpl.configure(RuleServiceProviderImpl.java:265)
    at com.tibco.cep.container.standalone.BEMain.jumpStart(BEMain.java:172)
    at com.tibco.cep.container.standalone.BEMain.main(BEMain.java:71)
2018 Aug 28 13:42:56:688 GMT -5 FDCache Fatal [main] - [container.standalone] null
##########


Declaring as an 'Event' is not allowed in TIBCO BusinessEvents and during runtime BE will have difficulty to pick the correct identifier to deploy the corresponding rules to working memory.

 

Issue/Introduction

Defining generic event in BusinessEvents Rule's scope.

Environment

TIBCO BusinessEvents 5.x All Operating Systems

Resolution

Change the declaration from generic 'Event'  to 'SimpleEvent' or 'TimeEvent' or any other event type that is predefined in the project.
For example :

Modify the rule

From :
rule Rules.<Rule_Name>{
        attribute {
                priority = 5;
                forwardChain = true;
        }
        declare {
                Concept instance;
                Event event;

        }

To:
 
rule Rules.DeleteAll {
        attribute {
                priority = 5;
                forwardChain = true;
        }
        declare {
                Concept instance;
                SimpleEvent event;

        }


Note : Defining generic concept in rule's scope is still allowed and does not have any impact in deploying the rule to working memory.