@Anatoly,
tolitius wrote:
If WorkitemHandler has a reference to "getGlobal(String name)", that
means that there is a chance for workitem to change those globals, and
just by looking at the process definition ( since these variables are not
mapped visually [ XML ] ), there is no way to track that change.
That's true - but exactly the same, I believe, as in code under the
right-hand-side of rules. The engine doesn't know if a rule mucks with the
internals of a global either. "Don't run with scissors in your hand"
shouldn't lead to the abolition of scissors on alternate Saturdays.
tolitius wrote:
And in your case, depending on what design you adhere to (DDD or
Service -> DAO), I would create a service that would be able ( through
specific DAO(s) ) to access DB, and _inject_ that service into workitem
handler [ or in case of DDD, if that is a behavior of the entity, workitem
handler will have a reference to that entity ].
Sorry, but I'm not sure what you're getting at... in the case I
described,
the credentials are supplied by the initiator of the process. Where exactly
are you envisioning them being stored? In my case, the data is analogous to
database credentials - not actually them - so specific design idioms that
are specific to them aren't relevant. The credentials are for access to a
thick access library that has its own data-access architecture.
Touma wrote:
One method of reading external data and outputting data would be to use
the 'Parameter Mapping' and 'Result Mapping' feature of handlers.
This only provides mapping to and from variables. What you're suggesting
is, I think, exactly what I was asking for!
-Ed
--
View this message in context:
http://n3.nabble.com/Access-to-globals-from-WorkItemHandlers-tp732460p732...
Sent from the Drools - User mailing list archive at
Nabble.com.