Re: [rules-users] SlidingTimeWindow$BehaviorExpireWMAction

2011-07-13 Thread Andre
of course, it is , what does it mean in the context of this rule?
the sliding windows expires, where ?  while processing the arraylist ?
rule Request counting analysed Resources By Id
when
$list: ArrayList()
from accumulate($neu : RequestCtx() over
window:time(1m),countMatchingAnalysedResourcesInRequest($neu) )
ResourceMatch( $id: uri, count  1 ) from $list
then
System.out.println( Id  + $id.toString() + :  );
System.out.println(Request counting Resources By Id Rule Workss);
channels[AuthZBlocking].send(new ItemCacheEntry(new
Item((String)$id.toString()), new Date(System.currentTimeMillis()+ 8000)));
end

--
View this message in context: 
http://drools.46999.n3.nabble.com/SlidingTimeWindow-BehaviorExpireWMAction-tp3163096p3164991.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] SlidingTimeWindow$BehaviorExpireWMAction

2011-07-13 Thread Wolfgang Laun
On 13 July 2011 08:24, Andre morpheusan...@web.de wrote:

 of course, it is , what does it mean in the context of this rule?
 the sliding windows expires, where ?  while processing the arraylist ?


No telling without the full stack dump and sufficient code and data to
reproduce. At least the accumulate function and ResourceMatch would be
required, and how events are inserted.

Short questions are bound to produce short answers.

-W




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

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/SlidingTimeWindow-BehaviorExpireWMAction-tp3163096p3164991.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] SlidingTimeWindow$BehaviorExpireWMAction

2011-07-13 Thread Andre
ok , i thought it would be easy to explain this exception,
the problem is, that it´s not time-invariant (so the reason it not really
the rule itself)
the first time running my unittests (plural! ) nothing occurs, the second
time , there is a chance that this exception occurs(an addition to
ReteooWorkingMemory$WorkingMemoryReteExpireAction), the third time im only
getting ReteooWorkingMemory$WorkingMemoryReteExpireAction
is there a possibility to configure the memory ? (havent found it yet)

--
View this message in context: 
http://drools.46999.n3.nabble.com/SlidingTimeWindow-BehaviorExpireWMAction-tp3163096p3165101.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] SlidingTimeWindow$BehaviorExpireWMAction

2011-07-13 Thread Andre
so the real problem seems to be that
[aultMessageListenerContainer-1] DefaultErrorHandlerERROR Failed
delivery for exchangeId:
ID:abiege.bonn.tarent.de-43198-1310542587996-4:5:2:1:1. Exhausted after
delivery attempt: 1 caught: org.drools.RuntimeDroolsException: Unexpected
exception executing action
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteExpireAction@7abf31
org.drools.RuntimeDroolsException: Unexpected exception executing action
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteExpireAction@7abf31
at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:996)[drools-core-5.2.0.Final.jar:5.2.0.Final]
at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:317)[drools-core-5.2.0.Final.jar:5.2.0.Final]
at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:293)[drools-core-5.2.0.Final.jar:5.2.0.Final]
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:905)[drools-core-5.2.0.Final.jar:5.2.0.Final]
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:864)[drools-core-5.2.0.Final.jar:5.2.0.Final]
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:255)[drools-core-5.2.0.Final.jar:5.2.0.Final]
at
org.drools.camel.component.DroolsInsertProducer$StatefulSessionInsertWorker.process(DroolsInsertProducer.java:126)[drools-camel-5.2.0.Final.jar:5.2.0.Final]
at
org.drools.camel.component.DroolsInsertProducer.process(DroolsInsertProducer.java:100)[drools-camel-5.2.0.Final.jar:5.2.0.Final]
at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at
org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:104)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at
org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:272)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:98)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:299)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:208)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:269)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at
org.apache.camel.processor.Pipeline.process(Pipeline.java:125)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at
org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at
org.apache.camel.processor.Pipeline.process(Pipeline.java:60)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at
org.drools.camel.component.DroolsPolicy$DroolsProcess.process(DroolsPolicy.java:344)[drools-camel-5.2.0.Final.jar:5.2.0.Final]
at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at

Re: [rules-users] SlidingTimeWindow$BehaviorExpireWMAction

2011-07-13 Thread Wolfgang Laun
I currently suspect that this occurs when an event is removed from the WM
due to the automatic fact expiry. Is the accumulate function for reverse
correct and according to the IF spec for accumulate functions? But it's also
possible that the expiry handling has a flaw.

Varying with time could be due to different timestamps w.r.t. to the
sliding window, etc.

-W

On 13 July 2011 09:40, Andre morpheusan...@web.de wrote:

 so the real problem seems to be that
 [aultMessageListenerContainer-1] DefaultErrorHandlerERROR
 Failed
 delivery for exchangeId:
 ID:abiege.bonn.tarent.de-43198-1310542587996-4:5:2:1:1. Exhausted after
 delivery attempt: 1 caught: org.drools.RuntimeDroolsException: Unexpected
 exception executing action
 org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteExpireAction@7abf31
 org.drools.RuntimeDroolsException: Unexpected exception executing action
 org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteExpireAction@7abf31
at

 org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:996)[drools-core-5.2.0.Final.jar:5.2.0.Final]
at

 org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:317)[drools-core-5.2.0.Final.jar:5.2.0.Final]
at

 org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:293)[drools-core-5.2.0.Final.jar:5.2.0.Final]
at

 org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:905)[drools-core-5.2.0.Final.jar:5.2.0.Final]
at

 org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:864)[drools-core-5.2.0.Final.jar:5.2.0.Final]
at

 org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:255)[drools-core-5.2.0.Final.jar:5.2.0.Final]
at

 org.drools.camel.component.DroolsInsertProducer$StatefulSessionInsertWorker.process(DroolsInsertProducer.java:126)[drools-camel-5.2.0.Final.jar:5.2.0.Final]
at

 org.drools.camel.component.DroolsInsertProducer.process(DroolsInsertProducer.java:100)[drools-camel-5.2.0.Final.jar:5.2.0.Final]
at

 org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at

 org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at

 org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:104)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at

 org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:272)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at

 org.apache.camel.processor.SendProcessor.process(SendProcessor.java:98)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at

 org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at

 org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at

 org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at

 org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at

 org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at

 org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:299)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at

 org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:208)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at

 org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:269)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at

 org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at

 org.apache.camel.processor.Pipeline.process(Pipeline.java:125)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at

 org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at

 org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at

 org.apache.camel.processor.Pipeline.process(Pipeline.java:60)[camel-core-2.6.0-fuse-00-00.jar:2.6.0-fuse-00-00]
at

 org.drools.camel.component.DroolsPolicy$DroolsProcess.process(DroolsPolicy.java:344)[drools-camel-5.2.0.Final.jar:5.2.0.Final]
at

 

Re: [rules-users] SlidingTimeWindow$BehaviorExpireWMAction

2011-07-13 Thread Andre
the functions should do it ,.. 
which spec are you speaking of ? 

public void accumulate(Serializable context , Object request) {
ListResourceMatch counts = (ListResourceMatch) context;
RequestCtx xacml = (RequestCtx) request;
for (IteratorAttribute iterator = 
xacml.getResourceAsList().iterator();
iterator.hasNext();) {
Attribute resource = (Attribute) iterator.next();
if (counts.size() == 0 
resource.getId().toString().equalsIgnoreCase(urn:oasis:names:tc:xacml:1.0:resource:resource-id))
{
try {
counts.add(new ResourceMatch(new
URI(DroolsUtils.getAttributeIDValue(resource)),0));
} catch (URISyntaxException e) {
// shouldnt appear cause the method 
from DroolsUtils has casted the
returning String from an URI!
e.printStackTrace();
}
}

for (int i = 0; i  counts.size(); i++) {

ResourceMatch resourcematch = counts.get(i);
try {
if (resourcematch.matches(new
URI(DroolsUtils.getAttributeIDValue(resource)))

resource.getId().toString().equalsIgnoreCase(urn:oasis:names:tc:xacml:1.0:resource:resource-id)
) {
resourcematch.increment();
}else if (counts.size() == i-1 
resource.getId().toString().equalsIgnoreCase(urn:oasis:names:tc:xacml:1.0:resource:resource-id))
{
counts.add(new ResourceMatch(new
URI(DroolsUtils.getAttributeIDValue(resource)),1));
}
} catch (URISyntaxException e) {
// shouldnt appear cause the method 
from DroolsUtils has casted the
returning String from an URI!
e.printStackTrace();
}
}
}
}

/* (non-Javadoc)
 * @see
org.drools.runtime.rule.AccumulateFunction#reverse(java.io.Serializable,
java.lang.Object)
 */
public void reverse(Serializable context, Object request) throws 
Exception
{
ListResourceMatch counts = (ListResourceMatch) context;
RequestCtx xacml = (RequestCtx) request;
for (Iteratorlt;Listlt;Attributegt; iterator =
xacml.getResourceAsList().iterator(); iterator.hasNext();) {
ListAttribute resource = (ListAttribute) 
iterator.next();
for (int i = 0; i  counts.size(); i++) {
ResourceMatch resourcematch = counts.get(i);
try {
if (resourcematch.matches(new
URI(DroolsUtils.getResourceID(resource {
resourcematch.decrement();
}   
} catch (URISyntaxException e) {
// shouldnt appear cause the method 
from DroolsUtils has casted the
returning String from an URI!
e.printStackTrace();
}
}
}
}

--
View this message in context: 
http://drools.46999.n3.nabble.com/SlidingTimeWindow-BehaviorExpireWMAction-tp3163096p3165597.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] SlidingTimeWindow$BehaviorExpireWMAction

2011-07-13 Thread Wolfgang Laun
On 13 July 2011 13:15, Andre morpheusan...@web.de wrote:

 the functions should do it ,..


You shouldn't have any problems finding these lines in accumulate and
reverse, respectively:

   RequestCtx xacml = (RequestCtx) request;
   for (Iterator  Attribute iterator =
xacml.getResourceAsList().iterator(); iterator.hasNext();) {
 Attribute resource = (  Attribute) iterator.next();

   RequestCtx xacml = (RequestCtx) request;
   for (IteratorListAttribute iterator =
xacml.getResourceAsList().iterator(); iterator.hasNext(); ) {
 ListAttribute resource = (ListAttribute) iterator.next();

-W
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] SlidingTimeWindow$BehaviorExpireWMAction

2011-07-13 Thread Andre
oooh what the

you right, i swear i studied it several times.. but i didnt saw that
ListAttribute which is definitely wrong 
thx for the review, now also the second run of the tests ends green
thx u very much 

--
View this message in context: 
http://drools.46999.n3.nabble.com/SlidingTimeWindow-BehaviorExpireWMAction-tp3163096p3165913.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] SlidingTimeWindow$BehaviorExpireWMAction

2011-07-13 Thread Andre
it should actually throw a exception when trying that reverse, why does it
end in such weird exceptions ?

--
View this message in context: 
http://drools.46999.n3.nabble.com/SlidingTimeWindow-BehaviorExpireWMAction-tp3163096p3165917.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] SlidingTimeWindow$BehaviorExpireWMAction

2011-07-13 Thread Wolfgang Laun
This is very deep down in the intestines and not considered to be a user
error, i.e., user being the one that uses the extensions. But I'm cc-ing
Edson, asking him whether more info can be hiccuped.

Non-trivial accumulate functions like yours warrant a unit test which can be
written quite easily.

-W

On 13 July 2011 15:21, Andre morpheusan...@web.de wrote:

 it should actually throw a exception when trying that reverse, why does it
 end in such weird exceptions ?

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/SlidingTimeWindow-BehaviorExpireWMAction-tp3163096p3165917.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] SlidingTimeWindow$BehaviorExpireWMAction

2011-07-12 Thread Michael Anstis
Looks like some form of exception to me.

On 12 July 2011 17:54, Andre morpheusan...@web.de wrote:

 ERROR Caused by: [org.apache.camel.RuntimeCamelException -
 org.drools.RuntimeDroolsException: Unexpected exception executing action
 org.drools.rule.SlidingTimeWindow$BehaviorExpireWMAction@1414306]
 whats that?

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/SlidingTimeWindow-BehaviorExpireWMAction-tp3163096p3163096.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