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)
Problem in Retry in workflow.Need help
Anujap
In workflow there is one external task "deploystaging" and this external task called an external scrpit($deploy_stag) through which both the OD/DD is happing(Open deployemnt is happing first and then data deployment is happing).I set a callback variable in external scrpit($deploy_stag) in case of OD/DD fails and its return the callback to workflow.
Please see attached external task file...
In workflow there is one user task "ErrorinDeploymenttoStaging" in case of OD/DD fail.If User Retry for the deployment again then its again goes to "DeployStaging" task and same external script running again.
Pls see attached Retry file...
But problem is that ...if open deployment is success and data deployment is fail ,then in the case of Retry ,same whole script($deploy_stag) is runnind again so its again doing open deployment even if OD success already and then data deployment.
So please suggest what should I do in my script so that in Retry case only data deployment run and its not go for Open deplopyment if OD already success.
External script:
##Open Deployment Command Run ####
my $cmd = qq($deploy_cmd);
my $results = qx($cmd 2>&1);
my $status = $? >> 8;
if ($status) {
$callback=1;
$comment1=" Open Deployment to Staging server Fail ";
}
else {
$callback=0;
$comment1=" Open Deployment Success on Staging server ";
}
###################OPEN DEPLOY END #################
###################DATA DEPLOY BEGINS ##############
if($callback==0)
{
##Data Deployment Command Run ####
my $cmd = qq($deploy_cmd2);
my $results = qx($cmd 2>&1);
my $status = $? >> 8;
if ($status) {
$callback=1;
$comment2= " Staging Data deployment Fail ";
$callbackcomment= $comment1." and ".$comment2;
}
else {
$callback=0;
$comment2= " Staging Data deployment Success ";
$callbackcomment= $comment1." and ".$comment2;
}
}
I dont want to go with the creation of separate task and separte IPl files for each deployment becoz I have one scrpit in which 8 commands is running.
Please suggest.
Thanks in Advance!!!!
Thanks
Anu
Find more posts tagged with
Comments
hitc
you could use a workflow variable. one for each deployment and in case of one of the deploy set the variable of that deploy to true.
And of course test the variable before the deploy using like 3 value.Not done,failed and success.
Anujap
If possible then Could you please explain more..
I have one more doubt here..
If I set the workflow variable and also get the previous status in external script , but how I can track out the taskid...means in case of retry I need to check out is this task(External task deploytostaging)already execute with same taskid or not?..
becoz lots of users are doing deployment with same file on same time...
Thanks
Anu
Adam Stoller
Usually, if one has both OD and DD - they tend to make the entire deployment process transactional - so it
should
re-run both parts if either part fails.
That being said - look at the perldoc's for TeamSite::WFtask and TeamSite::WFworkflow - they both have SetVariable() and GetVariable() methods - which your script can use to retrieve and set some state variable within the workflow so that if the script is called a second time, it can figure out which part of the script needs to run [again] - the OD part or the DD part (or both).