Hi,We have two workflows. One is for submitting files to staging. It occurs when user clicks on submit button. The second one is for deploying data to database and deploying HTML files to web servers. It executes when user clicks on Action -> New Job.We also have an IPL which calls data deploy command.When we call this IPL from submit workflow it gets required parameter like DCR name and path but if we are calling the same IPL from deploy workflow it’s not getting required parameters. We are calling this IPL from an external task and in both cases the IPL is getting called. Rest other codes are same in both workflows only there are some difference in tasks. Can anybody tell me what are we missing here? Thanks & Regards,Ambuj
Hi Ambuj,The only thing comes to my mind is that, when you run a workflow from Submit command it takes the filename selected on its own as per iw_file command. However, from new_job the file does not get attached on its own.The way out for this is to attach/take the files explicitly to the job and then call the IPL without any parameter.
[left]iwaddtaskfile try this to add file to the task., regarding file to be attached you have to identify which files needs to be attached (e.g all modified etc)
[left]iwaddtaskfile try this to add file to the task., regarding file to be attached you have to identify which files needs to be attached (e.g all modified etc) [/left]
Can you give me an example code as how this CLT is added to an external task in windows environment?I tried to look into CLT docs but didn't get the details.
[left]iwaddtaskfile [-h|-v] [-s
]
Haven't used myself but here is how it is mentioned in the document. [left]iwaddtaskfile [-h|-v] [-s servername] taskID path comment[/left][left]>iwaddtaskfile -s production.example.com 7734 content.txt “This needs reviewed”[/left]
You need to execute the CLT by passing the taskid ,the file to be attached and a comment.iwaddtaskfile ( "$taskid $output dcr" )you can try this..$cmd = "iwaddtaskfile";$args = "$taskid $file textfile";my $cmd_output = qx!$cmd $args!;you need to specify the complete path of the command in the $cmd if the PATH Environment variable is not set.~Mohan
...use TeamSite::WFtask;...my $task = TeamSite::WFtask->new($taskid);...$task->AddFile($file);...
Or - if you are writing a script - like an externaltask script - anyway - why not just use the TeamSite::WFtask module? ...use TeamSite::WFtask;...my $task = TeamSite::WFtask->new($taskid);...$task->AddFile($file);...
my ($jobid, $taskid, $area) = (shift, shift, shift);$area =~ s,\\,/,g;
foreach $element (@ARGV){ print LOG "element found in attached files : $element\n"; $element =~ s/\\/\//g;
use TeamSite::WFtask;...my $task = TeamSite::WFtask->new($taskid);...$task->AddFile($file);
In IPL i'm using my ($jobid, $taskid, $area) = (shift, shift, shift);$area =~ s,\\,/,g; and I'm getting area correctly
...my ($jobid, $taskid) = (shift, shift);my $task = TeamSite::WFtask->new($taskid);if (!$task->IsValid()){ # ERROR - DIE}my $area = $task->GetArea();...
but If I use foreach $element (@ARGV){ print LOG "element found in attached files : $element\n"; $element =~ s/\\/\//g; I'm not getting arguments currectly
I also tried using.. use TeamSite::WFtask;...my $task = TeamSite::WFtask->new($taskid);...$task->AddFile($file); but I'm not getting selected files.. can you tell me how to get selected files in above code. I mean from $task ?
I recommend removing $area (and its associated shift) and using something more like:...my ($jobid, $taskid) = (shift, shift);my $task = TeamSite::WFtask->new($taskid);if (!$task->IsValid()){ # ERROR - DIE}my $area = $task->GetArea();...Presumably you were doing this after the previously documented code which shift'ed @ARGV for the jobid, taskid, [and area] - yes?And presumably LOG is a valid file handle - yes?Thus far, all the code is written with the assumption that you are not passing any command line parameters to the script and just letting the workflow engine pass its own parameters. If this is not the case, then the previous code would need to be changed. As for this code (just above) - you shouldn't bother parsing @ARGV for anything after you get the jobid and taskid from it - and best still, you should configure things in the iw.cfg file to ensure that the workflow engine does not pass job-associated files on the command line to the externaltask script.The above code was to add files to the task - not to get a list of files already associated with the task.I suggest you spend some time reading the perldoc for TeamSite::WFtask - because it's pretty self-evident from reading that documentation how to get a list of the files associated with the task.
c:/iw-home/iw-perl/bin/iwperl.exe C:/iw-home/local/config/wft/../datadeploy.ipl @submit_file