![]() |
|
![]() |
AutoMate Discussion | ![]() |
Topic Title: Shared Variable Behavior Topic Summary: Created On: 07/26/2011 09:14 AM Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
||||||
I have created a very basic workflow, that contains another workflow. In both the parent and child workflows, I have defined shared variables of the same name, for the purpose of passing values to the child workflow (a running total of execution time that it will update) and receiving values from the child workflow back in the parent (any error information and the running total for execution time). While in the child workflow, the shared variables are properly referenced and updated. However, once back in the parent workflow, some of the shared variables are a) either being wiped out/re-initialized (not to the inital value, however - just to empty), or the values are being jumbled/switched between the variables. ie: variable #2 and variable #6 values are switched, #3 and #5 are switched, etc. Here are some additional notes: I have a total of 6 shared variables They are defined in the same order in both the parent and the child workflow I have tried making the variable types both Auto and value specific (number/text) If I remove shared variables (to where I only have 1), and then add them back, the behavior returns. I have tried renaming the variables I have tried all the combos of 'treat as parameter' vs not, defined locally as well vs. not, etc. that I can think of. Any insight would be greatly appreciated!
|
||||||
|
||||||
![]() |
||||||
Hi Deborah,
When I test this type of scenario, there are not unexpected results. Can you export the workflow in question and attach it to a reply to this post so I can analyze it?
------------------------- - Rick Johnson Network Automation |
||||||
|
||||||
![]() |
||||||
Rick - Thanks so much for taking a look. I have attached the exported workflow. This is the second workflow that I have started that I have experienced this in, fyi. Thanks! Deborah.
|
||||||
|
||||||
![]() |
||||||
Hi Deborah,
I see what you have been encountering now. i think my testing did not reveal this behavior as my sybworkflow was updating the shared vars, where yours does not. The behavior yuou encountered is a bug, and the usual workaround is to define the shared variable list exactly the same, with the same sequence on both the parent and child workflow. If your sub workflow does not use those variables, it should be safe to remove them from the sub workflow's shared variables. If you are not able to work around the issue, it has been resolved in version 8.
------------------------- - Rick Johnson Network Automation |
||||||
|
||||||
![]() |
||||||
Rick - Thanks for the explanation. The intent of the 'unused' shared variables in the sub workflow was to pass back error information to the parent where the common Error Handling task resided. Therefore, if there wasn't an error in the sub workflow, some shared variables would not be assigned any values there. But they need to remain defined in the sub workflow in the event an error is encountered. For the record, I tried changing my script to modify all the shared variables in the sub workflow, and the same ones are still getting jumbled. I am punting for now until we upgrade... I am, however, very glad to hear that a) it has been addressed in version 8 and b) I am not crazy! Being new to AutoMate, I wasn't sure about the latter. Thanks so much, Deborah.
|
||||||
|
||||||
![]() |
||||||
Deborah,
in the meantime, as a workaround, it could be safe to always update all shared variables in the subworkflow. This could be done at the very beginning of the subworkflow, by assigning all of them their own current value, which would be transparent to the rest of the workflow.
------------------------- Jean Delfosse - Automate Beta Tester Win7 Pro 64 bits -Win XP Pro SP3 32 bits - AM8, AM7, BPA10, BPA9, BPA8, BPA7, AM6 Enterprise, AM4 ![]() |
||||||
|
||||||
![]() |
||||||
Jean - Thanks so much - I will give that another try! Deborah.
|
||||||
|
||||||
![]() |
||||||
Deborah,
I tried your workflow, and somehow added some markers on it, so that the problem is better evidenced. In fact the problem lies in invoking the WrapItUp task. This tasks gets the SharedVars wrong, while they are still correct in the Workflow. And when WrapItUp ends, it returns the messed up SharedVars into the Workflow. Hereunder a picture of the situation during the "WrapItUp" execution : the SharedVars are still correct in the workflow, but are wrong in the "WrapItUp" I tried adding in "WrapItUp" declaration of the variables as parameters, and assigning new identical values, but nothing improved the mess. This is definitely a bug without a workaround.
------------------------- Jean Delfosse - Automate Beta Tester Win7 Pro 64 bits -Win XP Pro SP3 32 bits - AM8, AM7, BPA10, BPA9, BPA8, BPA7, AM6 Enterprise, AM4 ![]() |
||||||
|
||||||
![]() |
||||||
Jean - Thanks so much for confirming what I am still seeing as well. It does seem to be related to executing a task after returning from the execution of the sub workflow. I have been able to reproduce the problem several times from workflows and tasks that I have started from scratch. I hope this scenario has indeed been addressed in version 8. While I am still familarizing myself with AutoMate and its infinite possibilities, I was attempting to see if I could standardize an error handler task for any workflow (with or without a subworkflow), as well as a run statistics/log type task for summarization at the end. Might I also add that while I am new to this site, it is evident from my poking around that you are indeed one of the 'Supreme Gurus'! Thanks so much for looking at this further. Deborah.
|
||||||
|
||||||
![]() |
||||||
Deborah,
I installed your AMPKG into my BPA8 and it works nicely, without mixing up the Shared vars. For migration I had to install the Migration patch that support makes available to you upon request only.
------------------------- Jean Delfosse - Automate Beta Tester Win7 Pro 64 bits -Win XP Pro SP3 32 bits - AM8, AM7, BPA10, BPA9, BPA8, BPA7, AM6 Enterprise, AM4 ![]() |
||||||
|
||||||
![]() |
||||||
Jean - That's great news. Thanks so much! Deborah.
|
||||||
|
FuseTalk Enterprise Edition v4.0 - © 1999-2021 FuseTalk Inc. All rights reserved.