Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
parent job variables
Ottawa_IWOV
Is there an easy way to add all the JOB variables from a parent workflow to a nested (sub) workflow. What I am looking for is a quick hash loop or something like that.
Thanks,
Find more posts tagged with
Comments
Adam Stoller
I don't believe there is any [supported] mechanism for retrieving all the variables associated with a job - other than possibly parsing the output of iwgetwfobj
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Migrateduser
Why do you want to do that?
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
Ottawa_IWOV
Certain variables set in the parent job need to go to the nested job. Just though, instead of specifying which ones to bring down, I could grab them all. Just wanted to make the code a little lighter ...
Thanks,
Migrateduser
But you can easily manipulate the parent job's variables from the child job. They don't need to be redefined as variables in the child job. Besides, when you go back to the parent, the values would be what they were before you executed the child if you merely tried to re-use the same variable names in the child job. Am I missing something here? You only would ever want one set of variables that are shared between parent and child jobs, and those should be defined in the parent.
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
awizardly
Wfworkflow
$workflow-> GetVariables() Returns a hash which can be interated over in several ways
my $workflow = new TeamSite::WFworkflow($jobid);
my $variables = $workflow -> GetVariables();
%variable_ref = %$variables;
while (my ($key, $value) = each (%variable_ref)){
print "$key => $value\n";
}
The while synatx works and so does a for loop syntax.
Lee
Organic Inc
http://www.organic.com
Bill Klish
Not sure if you are doing this in Java or Perl since all you said was hash, but the CSWorkflow.getVariables() method will return you an array of CSNameValue pairs that you could iterate through as well.