[rules-users] Problem with PKG from guvnor

Genene Geda ggeda at ghx.com
Tue Aug 27 11:26:44 EDT 2013


Hi-,
I think I had similar issue and resolved by looking at one of these:

1. How the changes set is loaded:

Resource changeset = ResourceFactory.newFileResource(changeSetFilePath);
        		//.newClassPathResource(changeSetPath);

2.If the package not yet built,  In GUVNOR, I go to 'knowledgebase'/ click on you package/click on the 'edit' tab on the right/ click build package  ( I also do create snapshot but may not be necessary ).

See if it helps.

G-

-----Original Message-----
From: rules-users-bounces at lists.jboss.org [mailto:rules-users-bounces at lists.jboss.org] On Behalf Of calcacuervo
Sent: Monday, August 26, 2013 10:26 PM
To: rules-users at lists.jboss.org
Subject: [rules-users] Problem with PKG from guvnor

Hi Guys,

I am having a problem using Drools 5.5.

Basically, I have a ksession in stream mode.

I have a rule with an event, like this

when
        myfact: EventA( main > 21 ) over window:length (1)
	myfact2 : EventA( main <= 21 , this before myfact ) over window:length (2)

I also use a KnowledgeAgent and apply a changeset.

If I declare this rule directly from the changeset, as a Classpath resource, with resource type DRL, it seems to work fine (the kbase compiles!).

But If I have the rule in a guvnor package, and I put the PKG link in my changeset, I am getting an error:

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]

It seems that that getOperator() is null in this evaluation:
            if ( this.getOperator().isNegated() ) {

I debugged a bit, and it seems the evaluator comes in serialized from guvnor's package.But in case of getting directly the classpath resource, it compiles the package and it gets the real operator ok (Operator = 'before')

Do you have any idea of why it could be happening? May I be doing something wrong? Is this a bug in guvnor?

Thanks in advance!

Demian



--
View this message in context: http://drools.46999.n3.nabble.com/Problem-with-PKG-from-guvnor-tp4025687.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



More information about the rules-users mailing list