Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
task->GetFiles() problem
smigster
Using OD5.5.1, I can NOT get an array of files added to a workflow using task->GetFiles(). Thus, I can't create a filelist in my externaltask to feed to my iwodstart command.
Interestingly, the OD docs for GetFiles says it "Returns a (possibly empty) array of file names."
What does one have to do to make GetFiles return a filelist array with reasonable certainty?
THANKS
Find more posts tagged with
Comments
Migrateduser
You're talking about apples and oranges. The WFtask->GetFiles() method is not an OD feature. It's a workflow feature. Perhaps you are using this method in the wrong context in your externaltask script, or are not passing the file info correctly to your iwodstart CLT. Provide your script.
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
smigster
Hi Dave-
The relevant parts of the script follow. Thanks!
-Gene
use TeamSite::WFtask;
# Get the value of the job ID, task ID, areavpath.
my ($jobId, $taskId, $areavpath) = (shift, shift, shift);
my $task = TeamSite::WFtask->new($taskId);
my $filelist = "/tmp/$taskId.txt";
open FILELIST, ">$filelist";
# get the filelist a make a disk file for iwodstart
my
@files
= $task->GetFiles();
foreach $file (
@files)
{
print FILELIST "$file\n";
}
close FILELIST;
Migrateduser
Does your "/tmp/$taskId.txt" file get created during this process and it's just empty? It seems silly, but are you absolutely certain you have files attached to your job at this point?
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
smigster
Yup. There is a file attached to the workflow. F'sure!
Since GetFiles "Returns a (possibly empty) array of file names" -- emphasis on "possibly empty" -- Interwoven knows that GetFiles Won'tGetFiles sometimes so I was hoping that someone would chime in with an approach that ALWAYS makes GetFiles work.
Migrateduser
I'm pretty sure they say that because if no files are attached to your job, it would return an empty array. I don't think they meant that to imply that sometimes it returns you the correct list of files and sometimes it doesn't. You didn't answer my first question - is it creating your file in the /tmp directory? If so, what are the permissions on that file? You might try writing some other stuff into that file (like the Job ID, Task ID, etc.) to make sure stuff can be written to that file from your script. Stranger things have happened.
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
smigster
Sorry... it does create file in /tmp. Test output shows up there as well when I generate test junk.
Which is all moot, now, anyway. I took the same chunk of code and had it executed in an initialization externaltask and the filelist was generated correctly.
Thanks for chiming in.