Some of the comments are fine but there are a few which seem to just replicate a random comment (either from a CGI or external task) after going round the loop of tasks more than once..
I am going to try setting each transition comment to the taskID of the task I am transitioning from to see if there is any pattern.
sub main { my ($jobID, $taskID, $areavpath) = @_[0..2]; $task = TeamSite::WFtask->new($taskID); my ($transition, $comment) = process_task($task); my ($success, undef) = $task->CallBack(0, $comment);}sub process_task { my ($task) = shift; my $wa = $task->GetArea; my $st = ($wa =~ m|^(.*?)\/WORKAREA.*|)[0] . '/STAGING'; my $unlink = 0; foreach my $f ($task->GetFiles) { my $st_file = "$st/$f"; unless (-f $st_file) { my $wa_file = "$wa/$f"; $unlink += unlink($wa_file) or warn "$basename: failed to remove $wa_file"; } } my $plural = $unlink == 1 ? "" : "s"; return($wf_constants::TR_RMNVPL_RECUP, $task->GetId);