[left]Workflow Tutorial[/left]
[left]210 Workflow Developer’s Guide[/left]
[left]There are times, within either an external task or CGI task script, that you may want to getnot only the list of files associated with the job, but also all the comments associated withthose files. Here’s how to do it:[/left]
[left]use TeamSite::WFtask;my($task) = new TeamSite::WFtask($ARGV[1]);my(%files);# notice – this is a hash variable$task->GetFilesAndComments(\%files);# notice, passed by reference (leading ‘\’)for my $file (sort(keys(%files))){print "File: '$file'\n";my(@vals) = @{$files{$file}};for my $data (@vals){# note: $data is a reference to another hash# to access use '$$data{key}'print "$$data{date}:$$data{user}: '$$data{body}'\n";# note: not printed is $$data{task} which is the ID of the task# when the comment was added.}}[/left]
[left]GetComments(\@list)
Gets the comments for the task. The result is anarray of hash refs, where each hash has keys of[/left]
[left]'date'
,
'task'
'user'
, and
'body'
.[/left]
[left]GetFileComments(\@list, $felement)[/left]
[left]Gets the file comments for the task. The result isan array of hash refs, where each hash has keys of[/left]
.
Or look at the workflow tutorial(PDF).
I want to use Getcomments and getfilecomments in my workflow to capture the review comments?Not really sure as to how it works. Can somebody help me?
[left]Workflow Tutorial[/left][left]210 Workflow Developer’s Guide[/left][left]Retrieving File Comments-----------------------------------[/left][left]There are times, within either an external task or CGI task script, that you may want to getnot only the list of files associated with the job, but also all the comments associated withthose files. Here’s how to do it:[/left][left]use TeamSite::WFtask;my($task) = new TeamSite::WFtask($ARGV[1]);my(%files);# notice – this is a hash variable$task->GetFilesAndComments(\%files);# notice, passed by reference (leading ‘\’)for my $file (sort(keys(%files))){print "File: '$file'\n";my(@vals) = @{$files{$file}};for my $data (@vals){# note: $data is a reference to another hash# to access use '$$data{key}'print "$$data{date}:$$data{user}: '$$data{body}'\n";# note: not printed is $$data{task} which is the ID of the task# when the comment was added.}}[/left]#######################################################[left]GetComments(\@list) Gets the comments for the task. The result is anarray of hash refs, where each hash has keys of[/left][left]'date', 'task', 'user', and 'body'.[/left][left]GetFileComments(\@list, $felement)[/left][left]Gets the file comments for the task. The result isan array of hash refs, where each hash has keys of[/left][left]'date', 'task', 'user', and 'body'. Or look at the workflow tutorial(PDF). [/left]
I got this error in the log fileTeamSite::WFtask=HASH(0x1ab2ed8) pls suggest stg