use TeamSite::WFtask; my ($jobid, $taskid) = @_; my $task = new TeamSite::WFtask($taskid); my $rc = 0; my $comment = ""; if(some logic here to determine which branch to take) { $rc = 0; # Show that we want the first branch (task3) $comment = "A comment saying that we chose task 3. The system doesn't care about this - it's for users reading the job info"; } else { $rc = 1; # Show that we want the second branch (task4) $comment = "A comment saying that we chose task 4. The system doesn't care about this - it's for users reading the job info"; } $task->CallBack($rc, $comment); exit 0;