-
1. Re: RE: how to set parent process variable in call-activity (sub-process) (not at the end) but in the middle
SANJAY GAUTAM Jan 29, 2015 1:23 PM (in response to . .)Hi Sai.
Lets say you have Process A with a "Sub Process Activity SP" whose called element is "Sub Process B". You have to take the Process A's Sub Process Activity and assign the input and output variables. Now looks like that to me this Input and Output variables are in the kcontext before the control is passed to the Sub Process Inside the Process B, retrieve them via getVariable Method in kcontext and it will work. I hope this helps.
Thanks
Sanjay Gautam,
(If you think answer was helpful please mark it so )
-
2. Re: RE: how to set parent process variable in call-activity (sub-process) (not at the end) but in the middle
. . Jan 30, 2015 12:39 AM (in response to SANJAY GAUTAM)There's a correction to my question. I didn't phrase it properly:
I would like the data i got in sub-process (in a script task) to be assigned to a variable in parent process. It would work when sub-process ends but i need the data at that instant of time. I'm not able to do that. kcontext.setVariable - to access parent process variable return with "error - process variable does not exist" as it appears to look only at the sub-process level
Regards,
Sai -
3. Re: RE: how to set a value to a parent process variable in call-activity (sub-process) (not at the end) but in the middle
Maciej Swiderski Feb 2, 2015 1:34 AM (in response to . .)you can either use signal events with event data being the variable and then your parent process would need to listen to that event or you can load parent process from within you child process and manually set variable on it. My recommendation would be to use signals for that as it goes via standard api - note that by default signals are broadcasts so it will signal all process isntances listening to given signal. But you can direct it to given instance as well by using:
kcontext.getKieRuntime().signalEvent(name, data, pInstanceId)
and you can do that from child process script task.
HTH
-
4. Re: RE: how to set a value to a parent process variable in call-activity (sub-process) (not at the end) but in the middle
SANJAY GAUTAM Feb 2, 2015 2:32 AM (in response to . .). . wrote:
There's a correction to my question. I didn't phrase it properly:
I would like the data i got in sub-process (in a script task) to be assigned to a variable in parent process. It would work when sub-process ends but i need the data at that instant of time. I'm not able to do that. kcontext.setVariable - to access parent process variable return with "error - process variable does not exist" as it appears to look only at the sub-process level
Regards,
SaiHi Sai ,
I am not sure what will be benefit to update the parent process variable even before the sub process finishes ? what is the scenario you want to accomplish. ?
-
5. Re: RE: how to set a value to a parent process variable in call-activity (sub-process) (not at the end) but in the middle
. . Feb 6, 2015 10:11 AM (in response to SANJAY GAUTAM)we use our own database for our application and we talk to BPM for stateful processes (for now with wait states). Claim, start, complete (if human) is accomplished using our database and storing process instance id's. Since, we spawn child processes, we couldn't signal or complete human tasks using parent process id alone. Hence, this workaround.
Thanks