HiI have a series of tasks to be performed like this :-(1)External Task :: deploy to Branch B from Branch A and submit to staging ------>(2)External Task :: Build Edition --------->(3)External Task :: deploy edition----------->(4) User Task abc --------->(5) EndNow I want to create a workflow level variable editionNo . This variable will be passed on to (2) task to build edition , later it will be passed on to (3) task to deploy this edition.I am building the workflow level variable based on the timestamp. I will have to loopback from (4) to (3) as per the requirement. How can I make sure that when I loop back from (4) to (3) , the edition number that was used the first time by task (3) is used the second time as well incase of loop back ? I fear that it might change as per the timestamp assigned to the workflow level variable .How do I resolve the problem?Thanks in advance
Please post your code as how you are creating the editionNo and how you are transferring / passing it to next external task...
I have attached my WFT file.Thanks
I dont think it should get changed once your workflow got initiated. I hope you have the understanding of the difference between a Workflow and a Job.So, dont fear... and try to run the workflow. Also if needed, use the CLT iwgetwfob {jobid/taskid} to see as what is the value of the variable at any point of time (When you job is activated).
If yes then u can first fetch the value of the variable in the beginning
How do I achieve it?
my $editionNo = $job->GetVariable("editionNo);if(!$editionNo){ $job->SetVariable("editionNo",$desiredEditionNo); where $desiredEditionNo will be the edition no which u want to set with the timestamp.}
lets say the variable name is editionNo my $editionNo = $job->GetVariable("editionNo);if(!$editionNo){$job->SetVariable("editionNo",$desiredEditionNo);where $desiredEditionNo will be the edition no which u want to set with the timestamp.} This u can write at the beginning of the script and I guess there wont be any issues regarding the variable being set again and again on the call of the file.Thanks,Natasha.
my $editionNo = $job->GetVariable("editionNo);if(!$editionNo){$job->SetVariable("editionNo",$desiredEditionNo);where $desiredEditionNo will be the edition no which u want to set with the timestamp.}
Hey Natasha,Could you pls explain as from where you can get the value for $desiredEditionNo??
I guess that will be set as per the requirement i.e the edition which the user wants to deploy.I have mentioned it as for giving the example that how the user can avoid setting it again and again on the call of the script.I hope I have made myself clear.Thanks,Natasha.
Hey if you look at the file attached above . the editionNo. is generated on timely basis and passed on to a WF variable . All this happens in the wft. and then using get variable it is fetched in the ipl.
Buddy,As suggested earlier, run your workflow and when it is in active state, just run a CLT - iwgetwfobj {jobid} through command line and read as what value is being defined for your job variable.You can cross-verify your value with the value you had received in any of the external task from its logs.HTH
use Date::Format;...my $editionNo = $job->GetVariable("editionNo);if(!$editionNo){my $desiredEditionNo = time2str("%Y%d%m_%H%M%S", time); my $result = qx($iwhome/bin/iwpublish $vpath STAGING $desiredEditionNo "wf-automated edition" 2>&1); if ($?) { # handle potential error } $job->SetVariable("editionNo",$desiredEditionNo); where $desiredEditionNo will be the edition no which u want to set with the timestamp.}