[rules-users] Persist JPA Entity fact in session

Alberto R. Galdo argaldo at gmail.com
Thu May 24 13:49:22 EDT 2012


That was really fast! Thank you.

Maybe I'm not getting this properly ... let me extend this thing a bit...
what we are trying to get is to store the state of a set of facts living in
the knowledge session in the database, one tuple for each update of it's
state along ( or at least syncronized ) with the updates of SessionInfo
persistence that drools executes during the fireUntilHalt loop.

It's some sort of historic log of the different states of given variables
inside certain facts when they are alive ( as in not retracted ) in the
knowledge session.

Does this makes sense to you given the persistence strategy you've defined
in your previous message?


Alberto R. Galdo
argaldo at gmail.com



On Thu, May 24, 2012 at 6:34 PM, Mauricio Salatino <salaboy at gmail.com>wrote:

> You can use the Variable Persistency Strategies, that will store your
> facts in the database for you.
> You need to configure in the environment the strategies for example:
>
> https://github.com/droolsjbpm/jbpm/blob/master/jbpm-human-task/jbpm-human-task-core/src/test/java/org/jbpm/task/service/persistence/variable/VariablePersistenceStrategiesSyncHTTest.java
>
> Notice that you will need to provide your domain specific entityManager to
> the JPAPlaceholderResolverStrategy
>
> Cheers
>
> On Thu, May 24, 2012 at 1:30 PM, Alberto R. Galdo <argaldo at gmail.com>wrote:
>
>> Hi,
>>
>>    We are in a fireUntilHalt during a persistent StatefulKnowledgeSession
>> using JTA & JPA with Hibernate ... Our session consists in a series of
>> facts ( well, we are not different of anyone else for that matter ... xD )
>> but some of our facts are also JPA @Entity . What we want is to persist
>> those entities on their own database tables as well as the SessionInfo each
>> time Drools considers the knowledge session needs to be persisted.
>>
>>    We are aware that Drools uses
>> org.drools.persistence.jpa.persist(SessionInfo) .... What would be the best
>> approach to get certain facts that are JPA Entities persisted along with
>> the Session taking advantage of the Drool's SessionInfo persistence loop?
>>
>> Best regards,
>>
>>
>> Alberto R. Galdo
>> argaldo at gmail.com
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>
>
> --
>  - MyJourney @ http://salaboy.wordpress.com
>  - Co-Founder @ http://www.jugargentina.org
>  - Co-Founder @ http://www.jbug.com.ar
>
>  - Salatino "Salaboy" Mauricio -
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120524/cc98688c/attachment.html 


More information about the rules-users mailing list