Re: [rules-users] Temporal reasoning with external persistence not working

2011-07-12 Thread rp2
Could someone please provide an answer?

--
View this message in context: 
http://drools.46999.n3.nabble.com/Temporal-reasoning-with-external-persistence-not-working-tp3158399p3163063.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] Temporal reasoning with external persistence not working

2011-07-12 Thread Wolfgang Laun
Objects produced by a from clause that haven't been inserted into Working
Memory previously are not facts, let alone events.

As the presented code shows, the timestamp of event User should be set by
Drools when the fact is inserted. Frist, with from it isn't inserted at
all, and second, if it were inserted, what timestamp would it receive - the
time it was taken from session.getUserByIndex(0)?

Not knowing why you do what you do it's difficult to suggest alternatives.

-W


On 12 July 2011 18:46, rp2 amant...@gmail.com wrote:

 Could someone please provide an answer?

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Temporal-reasoning-with-external-persistence-not-working-tp3158399p3163063.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] Temporal reasoning with external persistence not working

2011-07-12 Thread rp2
Thanks. 
Basically I am trying to retrieve (and store) events from an external store
like in http://magazine.redhat.com/2008/07/11/jboss-drools-meets-hibernate/
expect that the backing store in not a relational db but a custom key-value
store. 

This example also does not show the facts/events being inserted. Is this
incorrect?

All it does is 
... ...
workingMemory.setGlobal(hibernateSession, session); // sets a hibernate
session
workingMemory.fireAllRules();



--
View this message in context: 
http://drools.46999.n3.nabble.com/Temporal-reasoning-with-external-persistence-not-working-tp3158399p3163303.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] Temporal reasoning with external persistence not working

2011-07-12 Thread Wolfgang Laun
On 12 July 2011 19:47, rp2 amant...@gmail.com wrote:

 Thanks.
 Basically I am trying to retrieve (and store) events from an external store
 like in
 http://magazine.redhat.com/2008/07/11/jboss-drools-meets-hibernate/
 expect that the backing store in not a relational db but a custom key-value
 store.

 This example also does not show the facts/events being inserted. Is this
 incorrect?


The example does not use events, as in @role(event). You can maintain
a value of type java.util.Date in your hibernated facts, but don't make
them events the way you do.

-W



 All it does is
 ... ...
 workingMemory.setGlobal(hibernateSession, session); // sets a hibernate
 session
 workingMemory.fireAllRules();



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Temporal-reasoning-with-external-persistence-not-working-tp3158399p3163303.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] Temporal reasoning with external persistence not working

2011-07-12 Thread rp2

Wolfgang Laun-2 wrote:
 
 The example does not use events, as in @role(event). You can maintain
 a value of type java.util.Date in your hibernated facts, but don't make
 them events the way you do.
 
 
It is important for me to use temporal reasoning and CEP, and hence HAD to
define these as @events. 

In addition I wanted to load and persist these events from/in a custom non
JPA compliant key-value store because I will be running multiple instances
of drools as opposed to only one server. Therefore relying on  RAM based
working memory is not enough.

What would be your suggestion in that regard?  

--
View this message in context: 
http://drools.46999.n3.nabble.com/Temporal-reasoning-with-external-persistence-not-working-tp3158399p3164267.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] Temporal reasoning with external persistence not working

2011-07-12 Thread Wolfgang Laun
First of all, don't use automated time stamping of events; add a field
carrying the (original) event time. I think you could also run the session
in CLOUD mode.

Also, it may not be advisable to pull in facts and reason over them in the
same rule. Perhaps retrieval and proper insertion of facts should even be
coded in Java, kept separate from the rule logic.

Much depends on the required use cases for running those multiple sessions,
and how canned events relate to other data.

-W


On 13 July 2011 02:13, rp2 amant...@gmail.com wrote:


 Wolfgang Laun-2 wrote:
 
  The example does not use events, as in @role(event). You can maintain
  a value of type java.util.Date in your hibernated facts, but don't make
  them events the way you do.
 
 
 It is important for me to use temporal reasoning and CEP, and hence HAD to
 define these as @events.

 In addition I wanted to load and persist these events from/in a custom non
 JPA compliant key-value store because I will be running multiple instances
 of drools as opposed to only one server. Therefore relying on  RAM based
 working memory is not enough.

 What would be your suggestion in that regard?

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Temporal-reasoning-with-external-persistence-not-working-tp3158399p3164267.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