[rules-users] Problem with PKG from guvnor

Genene Geda ggeda at ghx.com
Wed Aug 28 15:59:52 EDT 2013


Good to hear that. Thanks Demian.
Question - I am new to drools/guvnor so never used the EventProcessingOption.STREAM processing mode.
>From the drools 5.5 api,  I read the following , could you discuss the benefits of the STREAM processing mode from your experience?

It says .... When STRAEM mode used the engine performs a few optimisations like:

> reasoning over absence of events (NOT CE), automatically adds an appropriate duration attribute to the rule in order to avoid early rule firing.
> memory management techniques may be employed when an event no longer can match other events due to session clock continuous increment.

Thanks,
Genene


From: rules-users-bounces at lists.jboss.org [mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Demian Calcaprina
Sent: Tuesday, August 27, 2013 1:17 PM
To: Rules Users List
Subject: Re: [rules-users] Problem with PKG from guvnor

Thanks Genene.

In fact I was able to get the cause of my issue. I created a ticket with the explanation and a pull request with a possible solution.

https://issues.jboss.org/browse/DROOLS-243

Thanks,

Demian

On Tue, Aug 27, 2013 at 12:26 PM, Genene Geda <ggeda at ghx.com<mailto:ggeda at ghx.com>> wrote:
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> [mailto: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<mailto: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<mailto:rules-users at lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/rules-users

_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org<mailto:rules-users at lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/rules-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20130828/dcbae10c/attachment.html 


More information about the rules-users mailing list