Hello, I am working for an organization for which we have adopted
Drools flow as the BPM solution. We are making use also of Drools
Expert, which results in a nice combination.
We have stateful sessions persisted in a database in order to record
the state of long-time running processes (which are the goal of our
BPM).
In order to make changes to the knowledge-base associated to the
stateful sessions that we have, we always redeploy the whole system
(ear application + rules + process definitions).
This is where we have the problem. Depending on the changes performed
to the database, the system is not able to reload the persisted
sessions (the change could be for example a change in the condition of
a rule). This results in problems and stack traces similar to the
following one:
[...]
Caused by: java.lang.RuntimeException: Unable to load session snapshot
at
org.drools.persistence.session.JPASessionMarshallingHelper.loadSnapshot(JPASessionMarshallingHelper.java:96)
at
org.drools.persistence.session.SingleSessionCommandService.initKsession(SingleSessionCommandService.java:196)
at
org.drools.persistence.session.SingleSessionCommandService.<init>(SingleSessionCommandService.java:159)
... 95 more
Caused by: java.lang.ClassCastException: org.drools.reteoo.ObjectTypeNode
at org.drools.marshalling.impl.InputMarshaller.readRightTuple(InputMarshaller.java:401)
at org.drools.marshalling.impl.InputMarshaller.readRightTuples(InputMarshaller.java:391)
at org.drools.marshalling.impl.InputMarshaller.readFactHandles(InputMarshaller.java:326)
at org.drools.marshalling.impl.InputMarshaller.readSession(InputMarshaller.java:205)
at org.drools.marshalling.impl.DefaultMarshaller.unmarshall(DefaultMarshaller.java:91)
at
org.drools.persistence.session.JPASessionMarshallingHelper.loadSnapshot(JPASessionMarshallingHelper.java:91)
... 97 more
According to some posts, if we were using the knowledge agent we could
update the already loaded sessions, which would allow to migrate
in-memory sessions from the old database to the new database:
http://drools.46999.n3.nabble.com/Dynamic-updates-of-stateful-sessions-td...
http://stackoverflow.com/questions/4368148/is-it-possible-to-add-a-new-ru...
Nevertheless, we absolutely need a way to migrate persisted sessions
from the old database to the new one. Even in the situation in which
we would allow hot modification of the knowledge base, we cannot have
all the stateful sessions loaded in memory when this would happen.
Is there any facility provided by Drools Expert/Flow that allows to
perform this operations easily? Is there a way/configuration to
load/save sessions without the need to store/retrieve the rete-tree
(and instead recomputing it), which seems to be the problem for these
situations.
Many thanks in advance,
Jordi Alvarez