-
1. Re: Set global variable for all process instances
swiderski.maciej Nov 23, 2012 1:55 AM (in response to artem.astafyev)maybe using global that is inserted into knowledge session could be an option for you
HTH
-
2. Re: Set global variable for all process instances
artem.astafyev Nov 23, 2012 8:51 AM (in response to swiderski.maciej)Unfortunately Globals are used only in Rules, but they are not consulted in evaluating expressions in Tasks.
-
3. Re: Set global variable for all process instances
swiderski.maciej Nov 23, 2012 10:44 AM (in response to artem.astafyev)I think you can access globals via kcontext in script tasks and on-entry/on-exit scripts so maybe that could be used to get what is needed from that global and set it as process variable
HTH
-
4. Re: Set global variable for all process instances
artem.astafyev Nov 23, 2012 10:54 AM (in response to swiderski.maciej)Yes, that might work. But then I have to add such script node after each savepoint which is a bit redundant. Second thing is that process variables are persisted to datatase and Spring beans are not intended to be persisted at all.
-
5. Re: Set global variable for all process instances
swiderski.maciej Nov 23, 2012 10:57 AM (in response to artem.astafyev)you could add simple on-exit script to each node that requires it. I meant to only persist/use the value not the bean itself but maybe that's not the case
HTH
-
6. Re: Set global variable for all process instances
artem.astafyev Nov 23, 2012 11:32 AM (in response to swiderski.maciej)Yep, got it. But this will require modification in nodes and developers not to forget to add that scipt for new nodes. And I need Spring bean or some service that I can use in expression to fetch value from database for example.