-
1. Re: How to remove variable from process
tsurdilovic Oct 18, 2011 6:16 AM (in response to mnorsic)1 of 1 people found this helpfulSetting it to null is fine. Your process variable could be used in many other places in the process, for example data input/output associations, expressions etc. Removing it would mean a possibly cascating effect which could cause runtime issues. Could add a convenience method that set it to null as you are doing now but I would not call it "removeVariable".
Hope this helps.
-
2. Re: How to remove variable from process
mnorsic Oct 18, 2011 6:39 AM (in response to tsurdilovic)Hi Tihomir,
that makes sense, of course. I don't think we need a separate method for that, it's just that I wanted to know what's the best practice, because I'd like to control variable lifecyle.
For example, Drools has a different logic for that, where I can insert and retract an object from a knowledge session, so I thought can I use this mechanism in a workflow process scenario, for example to trigger some event when a variable is removed from a process instance.
Thanks,
Miljenko
-
3. Re: How to remove variable from process
tsurdilovic Oct 18, 2011 6:53 AM (in response to mnorsic)1 of 1 people found this helpfulYou should be able to use rule constraints to accomplish this behaviour.
-
4. Re: How to remove variable from process
mnorsic Oct 19, 2011 6:13 AM (in response to tsurdilovic)Hi Tihomir,
thanks for the tip, I can use rule task to retract variable from knowledge session, as well as for reset process instance variable.
Miljenko