[rules-users] Problem with package names and declare section

Joaquín Díaz Vélez joaquin.diazvelez at fluxit.com.ar
Thu Feb 9 14:30:51 EST 2012


Hi guys,

            we are currently working with Drools Fusion in order to build a
complex event processing solution. We've modelled our events using and
object (Event) and this object is shared with everyone that needs to
publish and event.

            Our scenario goes this way

1) Our shared class, located in *ar.com.fluxit.Event*

2) An example of our cep rules declared in package *rules.flux*

    package *rules.flux*

    import *ar.com.fluxit.Event;*

    declare *Event*
@role (event)
@expires(1m)
    end

    rule "hello world"
when
    $event:Event( eventName == "Hello World") from entry-point "*rules.flux*
"
then
    System.out.println("Hello world");
        end


3) When we try to insert a *ar.com.fluxit.Event *as a fact in entry point
"rules.flux" Drools Fusion throws a NullPointerException. If you read
Drools Expert documentation (
http://docs.jboss.org/drools/release/5.2.0.Final/drools-expert-docs/html/ch05.html#d0e3661
 -
Accessing Declared Types from the Application Code) you find this paragraph:
"The first important thing to realize is that a declared fact will belong
to the package where it was declared. So, for instance, in the example
below, Person will belong to the org.drools.examples package, and so the
fully qualified name of the generated class will be
org.drools.examples.Person."

When we change package declaration to *package ar.com.fluxit *everything
works like a charm. But in our cep scenario we need that our
ar.com.fluxit.Event object to be user by all rules declared in any package.

So, there goes the question. There is a workaround for this? This is a bug?

Any help would be very appreciated


Cheers


-- 
Joaquín Díaz Vélez

Flux IT SA
Calle 9 N° 865 - Paseo La Panadería - Planta Alta
La Plata - Buenos Aires - Argentina
Teléfono (+54) 221 553 2980 int 306
Móvil (+54) 9221 5863322
    www.fluxit.com.ar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120209/92b090dd/attachment.html 


More information about the rules-users mailing list