[rules-users] configuring drools timers (and persistence)

Jordi Alvarez jalvarezc at gmail.com
Wed May 4 03:14:07 EDT 2011


Hello, I am involved in a project in which we are using Drools Flow 5.1.1.
as the underlying BPM.

We have drools integration with Spring. We are using JPA+Spring+Drools
integration, and have setup the knowledge base and stateful session as
indicated in the drools spring integration documentation. Our BPM has
external clients that call adaptor methods for Drools. That is, drools is
never used in a direct way from an external client. We use this strategy in
order to provide some additional behaviour and also in order to provide
transactional behaviour as it is usually made with Spring.

We needed to partially apply the patch reported at the end of:
http://drools.46999.n3.nabble.com/5-1-0-CR1-Drools-Spring-Configuration-Changed-td997130.html
"3. Interesting thing is that I have to recreate "Environment" now every
time before reloading the Session, otherwise the entityManager is closed,
and it does not respond to a simple Spring AOP TM wrapping... But that is
another issue.. "
We still have some persistence problems when using drools Timers. The
problems arise when drools creates the transaction itself (the timers
execution is the only situation in our scenario where this happens). We do
have some listeners which persist some information in our own tables. These
listeners are not prepared to use drools-created transaction (a different
entity manager is used). For this reason and also some others (as reported
in
http://drools.46999.n3.nabble.com/Drools-5-1-Flow-in-a-quot-Clustered-quot-environment-td1780463.html),
we would like to configure the timer service used
internally by Drools.
Looking at drools source code, it seems that it should be possible, since a
defult implementation is provided by drools (
JDKTimerService and JpaJDKTimerService if persistence is used). For example,
class KnowledgeStoreServiceImpl seems to define a set of default services
(which could pressumably be overriden someway). Nevertheless, after looking
to that for a while we have found no specific documentation and no clear way
to do that for our Spring integration.
Is there a way to change the TimerService implementation provided by Drools?
Any help is appreciated.
Thanks very much in advance!
Jordi Alvarez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110504/8a227b00/attachment.html 


More information about the rules-users mailing list