[jboss-jira] [JBoss JIRA] (DROOLS-243) CEP Operators in Rules failing to compile when getting PKG

Demian Calcaprina (JIRA) jira-events at lists.jboss.org
Tue Aug 27 15:14:26 EDT 2013


     [ https://issues.jboss.org/browse/DROOLS-243?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Demian Calcaprina updated DROOLS-243:
-------------------------------------

    Description: 
The issue is described in the following community post:
http://drools.46999.n3.nabble.com/Problem-with-PKG-from-guvnor-tc4025687.html

This code can reproduce it:
    	KnowledgeBaseConfiguration config = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
    	config.setOption( EventProcessingOption.STREAM );
    	KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(config);
    	
    	KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory
				.newKnowledgeAgentConfiguration();

		aconf.setProperty("drools.agent.scanDirectories", "true");
		aconf.setProperty("drools.agent.scanResources", "true");
		aconf.setProperty("drools.agent.newInstance", "false");
        KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("MortgageAgent", kbase, aconf);
        Resource changeset = ResourceFactory.newClassPathResource(
                "cs.xml");
        kagent.applyChangeSet(changeset);
        KnowledgeBase kbase2 = kagent.getKnowledgeBase();

Creating a changeset that points to a binary package in guvnor, with a rules which uses the temporal operator. For example, somthing like this:
when 
        myfact: EventA( main > 21 ) over window:length (1) 
        myfact2 : EventA( main <= 21 , this before myfact ) over window:length (2) 

What is happening in that when it tries to compare the temporal distance, it will throw a NPE:
Caused by: java.lang.NullPointerException 
        at org.drools.base.evaluators.BeforeEvaluatorDefinition$BeforeEvaluator.getInterval(BeforeEvaluatorDefinition.java:268) [drools-core-5.5.0.Final.jar:5.5.0.Final] 
        at org.drools.rule.constraint.EvaluatorConstraint.getInterval(EvaluatorConstraint.java:100) [drools-core-5.5.0.Final.jar:5.5.0.Final] 
        at org.drools.reteoo.builder.BuildUtils.gatherTemporalRelationships(BuildUtils.java:326) [drools-core-5.5.0.Final.jar:5.5.0.Final] 
        at org.drools.reteoo.builder.BuildUtils.calculateTemporalDistance(BuildUtils.java:292) [drools-core-5.5.0.Final.jar:5.5.0.Final] 
        at org.drools.reteoo.builder.ReteooRuleBuilder.addRule(ReteooRuleBuilder.java:119) [drools-core-5.5.0.Final.jar:5.5.0.Final] 
        at org.drools.reteoo.ReteooBuilder.addRule(ReteooBuilder.java:113) [drools-core-5.5.0.Final.jar:5.5.0.Final] 
        at org.drools.reteoo.ReteooRuleBase.addRule(ReteooRuleBase.java:445) [drools-core-5.5.0.Final.jar:5.5.0.Final] 


  was:
The issue is described in the following community post:
http://drools.46999.n3.nabble.com/Problem-with-PKG-from-guvnor-tc4025687.html

This code can reproduce it:
    	KnowledgeBaseConfiguration config = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
    	config.setOption( EventProcessingOption.STREAM );
    	KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(config);
    	
    	KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory
				.newKnowledgeAgentConfiguration();

		aconf.setProperty("drools.agent.scanDirectories", "true");
		aconf.setProperty("drools.agent.scanResources", "true");
		aconf.setProperty("drools.agent.newInstance", "false");
        KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("MortgageAgent", kbase, aconf);
        Resource changeset = ResourceFactory.newClassPathResource(
                "cs.xml");
        kagent.applyChangeSet(changeset);
        KnowledgeBase kbase2 = kagent.getKnowledgeBase();

Creating a changeset that points to a binary package in guvnor, with a rules which uses the temporal operator. For example, somthing like this:
when 
        myfact: EventA( main > 21 ) over window:length (1) 
        myfact2 : EventA( main <= 21 , this before myfact ) over window:length (2) 

What is happening in that when it tries to compare the temporal distance, it will throw a NPE:
when 
        myfact: EventA( main > 21 ) over window:length (1) 
        myfact2 : EventA( main <= 21 , this before myfact ) over window:length (2) 




    
> CEP Operators in Rules failing to compile when getting PKG
> ----------------------------------------------------------
>
>                 Key: DROOLS-243
>                 URL: https://issues.jboss.org/browse/DROOLS-243
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 5.5.0.Final
>            Reporter: Demian Calcaprina
>            Assignee: Mark Proctor
>            Priority: Critical
>
> The issue is described in the following community post:
> http://drools.46999.n3.nabble.com/Problem-with-PKG-from-guvnor-tc4025687.html
> This code can reproduce it:
>     	KnowledgeBaseConfiguration config = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
>     	config.setOption( EventProcessingOption.STREAM );
>     	KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(config);
>     	
>     	KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory
> 				.newKnowledgeAgentConfiguration();
> 		aconf.setProperty("drools.agent.scanDirectories", "true");
> 		aconf.setProperty("drools.agent.scanResources", "true");
> 		aconf.setProperty("drools.agent.newInstance", "false");
>         KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("MortgageAgent", kbase, aconf);
>         Resource changeset = ResourceFactory.newClassPathResource(
>                 "cs.xml");
>         kagent.applyChangeSet(changeset);
>         KnowledgeBase kbase2 = kagent.getKnowledgeBase();
> Creating a changeset that points to a binary package in guvnor, with a rules which uses the temporal operator. For example, somthing like this:
> when 
>         myfact: EventA( main > 21 ) over window:length (1) 
>         myfact2 : EventA( main <= 21 , this before myfact ) over window:length (2) 
> What is happening in that when it tries to compare the temporal distance, it will throw a NPE:
> Caused by: java.lang.NullPointerException 
>         at org.drools.base.evaluators.BeforeEvaluatorDefinition$BeforeEvaluator.getInterval(BeforeEvaluatorDefinition.java:268) [drools-core-5.5.0.Final.jar:5.5.0.Final] 
>         at org.drools.rule.constraint.EvaluatorConstraint.getInterval(EvaluatorConstraint.java:100) [drools-core-5.5.0.Final.jar:5.5.0.Final] 
>         at org.drools.reteoo.builder.BuildUtils.gatherTemporalRelationships(BuildUtils.java:326) [drools-core-5.5.0.Final.jar:5.5.0.Final] 
>         at org.drools.reteoo.builder.BuildUtils.calculateTemporalDistance(BuildUtils.java:292) [drools-core-5.5.0.Final.jar:5.5.0.Final] 
>         at org.drools.reteoo.builder.ReteooRuleBuilder.addRule(ReteooRuleBuilder.java:119) [drools-core-5.5.0.Final.jar:5.5.0.Final] 
>         at org.drools.reteoo.ReteooBuilder.addRule(ReteooBuilder.java:113) [drools-core-5.5.0.Final.jar:5.5.0.Final] 
>         at org.drools.reteoo.ReteooRuleBase.addRule(ReteooRuleBase.java:445) [drools-core-5.5.0.Final.jar:5.5.0.Final] 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list