Hi All,Thanks in advance. My question is that whenever, we select a file and trigger a workflow, does the workflow automatically attaches the selected file to itself or should we have a madatory task to attach the file?In my current workflow that I am developing, I don't see the selected file attaching to the WF.TS 6.7.1 WindowsThanks,Jenni
# Declare required referencesmy ($attached_files, $file_comments) = ([], []);# Retrieve Pre-Selected files if any. Sort Files in unencoded form, # then html-encode via CGI_liteif (__ELEM__('iw_file')) {@$attached_files = map { push(@$file_comments, 'Pre-Selected File'); TeamSite::CGI_lite::escape_html_data($_); } sort __VALUE__('iw_file');}...# If you DO NOT use WF Constructor you woud have to process '$attached_files' to# generate files/file XML Tags within your starting Task XML.# If you use WF Constructor (I would recommend it), it's simpler:declare_workflow( name => 'Your WF Name ', owner => $iw_user, creator => $iw_user, description => __VALUE__('iw_desc'), files => $attached_files, file_comments => $file_comments,);
Thanks a lot for the replies.Here is the external script that gets invoked by the WF in order to attach the file to WF. Looks like the perl script is getting executed, but the file is not getting attached to the workflow. Any pointers please?Thanks.[html]use strict;use TeamSite::Config;use TeamSite::WFtask;use TeamSite::WFworkflow;use CGI;use XML:OM;(my $iwhome = TeamSite::Config::iwgethome()) =~ tr|\\|/|;(my $iwmount= TeamSite::Config::iwgetmount()) =~ tr|\\|/|;my ($wfid, $taskid, $workarea, @files) = @ARGV;my $job = new TeamSite::WFworkflow($wfid);my $task = new TeamSite::WFtask($taskid);#my @files = $task->GetFiles();my $dcrfile_to_submit = 'Y:/default/main/Safari/WORKAREA/default/templatedata/safari/weather/data/test1';$task->AddFile($dcrfile_to_submit, "Approved for submission");$task->CallBack(0, "Done");exit(0);[/html]
my $dcrfile_to_submit = 'templatedata/safari/weather/data/test1';$task->AddFile($dcrfile_to_submit, "Approved for submission");
So this is the file I select before I hit submit ?
you need to use the vpath of the file in the AddFile function and not the actual path.. ;-)
That's incorrect. "Path" parameter should be relative to 'iw_workarea'. As pointed by Andy, it's all clearly documented
You are right.
I am using WFT