[rules-users] accumulate Functions with self coded classes as result type

2011-07-12 Thread Andre
i implemented  an accumulate function which uses Datatypes, which i coded my
self  , see example 
the function return a list of ResourceMatch Objects, but when i try access
that objects i get an NullPointerrException (nothing more) (yes i imported
that class in the DRL)
so it seems that there has to be some kind of registration, so drools, can
handle these objectsm right ? 
or what did i forget? 

rule Request counting analysed Resources By Id
when
$list: List()
from accumulate($neu : RequestCtx() over
window:time(1m),countMatchingAnalysedResourcesInRequest($neu) )
ResourceMatch( $id: uri.toString(), count  1 ) from $list
then
System.out.println( Id  + $id + :  );
System.out.println(Request counting Resources By Id Rule Workss);
channels[AuthZBlocking].send(new ItemCacheEntry(new Item((String)$id),
new Date(System.currentTimeMillis()+ 8000)));
end


--
View this message in context: 
http://drools.46999.n3.nabble.com/accumulate-Functions-with-self-coded-classes-as-result-type-tp3162593p3162593.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] accumulate Functions with self coded classes as result type

2011-07-12 Thread Wolfgang Laun
On 12 July 2011 16:30, Andre morpheusan...@web.de wrote:


 rule Request counting analysed Resources By Id
 when
$list: List()
from accumulate($neu : RequestCtx() over
 window:time(1m),countMatchingAnalysedResourcesInRequest($neu) )
ResourceMatch( $id: uri.toString(), count  1 ) from $list


This uri.toString() looks suspicious. Try binding just uri and call
toString() in the consequence.
-W


 then
System.out.println( Id  + $id + :  );
System.out.println(Request counting Resources By Id Rule Workss);
channels[AuthZBlocking].send(new ItemCacheEntry(new Item((String)$id),
 new Date(System.currentTimeMillis()+ 8000)));
 end


 --
 View this message in context:
 http://drools.46999.n3.nabble.com/accumulate-Functions-with-self-coded-classes-as-result-type-tp3162593p3162593.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 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


Re: [rules-users] accumulate Functions with self coded classes as result type

2011-07-12 Thread Andre
THX
what is that ? 
VM memory ? or something special to drools ?
ERROR Caused by: [org.apache.camel.RuntimeCamelException -
org.drools.RuntimeDroolsException: Unexpected exception executing action
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteExpireAction@1f66f50]

thats my config
drools:grid-node id=node1/  
   drools:kbase id=kbase1 node=node1
   drools:resources
drools:resource type=DRL
source=classpath:META-INF/spring/test.drl/ 
/drools:resources
drools:configuration
 drools:mbeans enabled=true / 
 drools:event-processing-mode mode=STREAM / 
 drools:accumulate-functions
drools:accumulate-function
name=countMatchingSubjectIdsInRequest ref=countsubjectIds/
drools:accumulate-function
name=countMatchingResourcesInRequest ref=countResourceID/
drools:accumulate-function
name=countMatchingAnalysedResourcesInRequest ref=analyseResources/
 /drools:accumulate-functions
/drools:configuration
  /drools:kbase
  drools:ksession id=ksession1 type=stateful kbase=kbase1
node=node1
  
drools:configuration
drools:keep-reference enabled=false/
drools:clock-type type=REALTIME/
/drools:configuration
 drools:script
 drools:fire-until-halt/
   /drools:script
   /drools:ksession

--
View this message in context: 
http://drools.46999.n3.nabble.com/accumulate-Functions-with-self-coded-classes-as-result-type-tp3162593p3162868.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users