Today I've reported a similar (?) problem with KnowledgeAgent ind combination with declare: the type of the inserted wasn't recognized, and rules didn't fire.
W, thanks for your reply. The Event fields are all complete and initialized. If I change the rule package to the one in Event (let's say "package-name(rule) == package-name(Event)") everything works like a charm. I'll give you more details about the NPE.Happends in this class: org.drools.reteoo.ReteooFactHandleFactory, method:protected final InternalFactHandle newFactHandle(final int id,final Object object,final long recency,final ObjectTypeConf conf,final InternalWorkingMemory workingMemory,final WorkingMemoryEntryPoint wmEntryPoint) {if ( conf != null && conf.isEvent() ) {TypeDeclaration type = conf.getTypeDeclaration();long timestamp;if ( type.getTimestampExtractor() != null ) { --> NPE here, because type is nullif ( Date.class.isAssignableFrom( type.getTimestampExtractor().getExtractToClass() ) ) {timestamp = ((Date) type.getTimestampExtractor().getValue( workingMemory,object )).getTime();(...) etc}So, type is null (shouldn't be). I debugged the execution and I found that ObjectTypeConfigurationRegistry is holding this instance of conf.Any ideas?Thanks in advance2012/2/9 Wolfgang Laun <wolfgang.laun@gmail.com>
The NPE during insertion is highly suggestive of another problem. Even if there were two Event classes (one the pojo, the other one the declared one) there should not be a NPE; the "hello world" rule simply would not fire. Are all fields - especially eventName - properly initialized before that fact is inserted?
-W2012/2/9 Joaquín Díaz Vélez <joaquin.diazvelez@fluxit.com.ar>
_______________________________________________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 way1) Our shared class, located in ar.com.fluxit.Event2) An example of our cep rules declared in package rules.fluxpackage rules.fluximport ar.com.fluxit.Event;declare Event@role (event)@expires(1m)endrule "hello world"when$event:Event( eventName == "Hello World") from entry-point "rules.flux"thenSystem.out.println("Hello world");end3) 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:
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 appreciatedCheers
--www.fluxit.com.arJoaquín Díaz Vélez
Flux IT SA
Calle 9 N° 865 - Paseo La Panadería - Planta AltaLa Plata - Buenos Aires - ArgentinaTeléfono (+54) 221 553 2980 int 306Móvil (+54) 9221 5863322
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--www.fluxit.com.arJoaquín Díaz Vélez
Flux IT SA
Calle 9 N° 865 - Paseo La Panadería - Planta AltaLa Plata - Buenos Aires - ArgentinaTeléfono (+54) 221 553 2980 int 306Móvil (+54) 9221 5863322
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users