Quoting Garrett Conaty <garrett(a)conaty.net>:
Question on JPAProcessInstanceManager.getProcessInstances. I see
that
it returns an empty array, which I suppose makes sense otherwise it
would load every process instance from the db?
Yes, in that case it doesn't
make sense to fetch all instances from db
(performance wise that could be very bad, so you shouldn't do this), so
returning an empty set there.
What is the recommended strategy for keeping track of active
processes
that need to be loaded into a WorkingMemory for example on
application
startup? An enhancement perhaps with different named queries through
JPA or ?
In theory, you shouldn't worry about loading process instances, the
engine should worry for you. Whenever you send a trigger, it will
determine which instances need to be loaded.
It would seem that to perform some kind of reporting based on the
active nodes, that using the WorkingMemoryDbLogger would be the best
(and most inexpensive) choice. Querying them dynamically has the
potential to load them from the db on each query.
If you can do it using the db
logger, do it ! If you can't do it, first
consider extending the db logger ;) As that should be the preferred way,
as it doesn't impact runtime performance and shields you from internal
details.
Kris
Disclaimer:
http://www.kuleuven.be/cwis/email_disclaimer.htm