Hi, In my work flow I have a "CGITask" to deploy files.Iam using the script for this task as============================================= my $od_command="G:/Interwoven/OpenDeployNG/bin/iwodcmd start Files_to_Production";my $transition_message;my $result = qx($od_command 2>&1);my $rc = ($? >> 8);if ($rc == 0) { $transition_message = "Successfully Deployed";}else { $transition_message = "Deployment Failed, Return Code = $rc ($result)";}print $transition_message; ===============================================
my $od_command="G:/Interwoven/OpenDeployNG/bin/iwodcmd start Files_to_Production";my $transition_message;my $result = qx($od_command 2>&1);my $rc = ($? >> 8);if ($rc == 0) { $transition_message = "Successfully Deployed";}else { $transition_message = "Deployment Failed, Return Code = $rc ($result)";}print $transition_message;
I suggest a few modifications to your code (highlighted below) which should then make it easier for you to figure out what's going wrong (additionally, change from a CGITask to an ExternalTask)If it fails, you'll get a bit more information in the printed message - and you should use that along with information in the deployment log file to determine what's going on.Note - the code above does not actually perform a transition - so regardless of whether it prints out a success or failure message, it won't work properly within the context of a workflow because there's no transition being made.
If you are using external task, then you don't need to use the TeamSite::CGI_lite; and get the task_id from there. In the external task the workflow passes the three variables to the external script which are taskid, jobid & areavpath.Below code might help you.use TeamSite::Config;use TeamSite::WFtask;use TeamSite::WFworkflow;ARGV;my $job = TeamSite::WFworkflow->new($jobId);die "Invalid jobid '$jobId'\n" if (! $job->IsValid());my $task = TeamSite::WFtask->new($taskId);die "Invalid taskid '$taskId'\n" if (! $task->IsValid());[color=brown]# the following are optional, as they may not be needed though they usually are(my $areavpath = $task->GetArea()) =~ tr|\\|/|;my @files = $task->GetFiles();tr|\\|/| foreach (@files);[/color]my $od_command="G:/Interwoven/OpenDeployNG/bin/iwodcmd start Files_to_Production";my $transition_message;my $result = qx($od_command 2>1);my $rc = ($? >> 8);if ($rc == 0) { $transition_message = "Successfully Deployed"; $task->CallBack(0,$transition_message);}else { $transition_message = "Deployment Failed, Return Code = $rc ($result)"; $task->CallBack(1,$transition_message);}
use TeamSite::Config;use TeamSite::WFtask;use TeamSite::WFworkflow;ARGV;my $job = TeamSite::WFworkflow->new($jobId);die "Invalid jobid '$jobId'\n" if (! $job->IsValid());my $task = TeamSite::WFtask->new($taskId);die "Invalid taskid '$taskId'\n" if (! $task->IsValid());[color=brown]# the following are optional, as they may not be needed though they usually are(my $areavpath = $task->GetArea()) =~ tr|\\|/|;my @files = $task->GetFiles();tr|\\|/| foreach (@files);[/color]my $od_command="G:/Interwoven/OpenDeployNG/bin/iwodcmd start Files_to_Production";my $transition_message;my $result = qx($od_command 2>1);my $rc = ($? >> 8);if ($rc == 0) { $transition_message = "Successfully Deployed"; $task->CallBack(0,$transition_message);}else { $transition_message = "Deployment Failed, Return Code = $rc ($result)"; $task->CallBack(1,$transition_message);}
I would go a step further and only process the first two arguments from ARGV (changes highlighted below) - but other than that, this should work where the old code did not work because the change in task type requires a change to coding.