Description
This article discusses how to find parameters and their values for a parent job step.
Solution
Because parameters are stored as properties on the job, use the getProperties
command to access them.
Code
Use the following code:
use ElectricCommander;
my $ec = ElectricCommander->new();
my $xpath = $ec->getProperties( { jobId => $[/myJob/jobId], jobStepId => $ENV{COMMANDER_JOBSTEPID} } );
my $props = $xpath->find('//property');
foreach my $prop ($props->get_nodelist) {
my $name = $prop->findvalue('propertyName');
my $value = $prop->findvalue('value');
if ($value eq 'error' or $value eq 'warning') {
print "name=$name, value=$value\n";
}
}
0 Comments