Ok guys, I'm working on a pretty complicated workflow and am running across something I haven't been able to figure out.
The workflow has 2 configurable global variables
OEYear
OELastYear
The first task is an external task that calls a perl file. This file gathers a file list to auto attach a BUNCH of files and set variables.
I'm trying to set OEYear and OELastYear in the perl script, but its not working:
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year += 1901;
$lastyear = $year - 2;
print FILE "Last Year:$lastyear\n";
print FILE "Next Year:$year\n";
$workflow = new TeamSite::WFworkflow($jobid) or print FILE "Workflow: Can't create new Workflow Instance: $!\n";
$task = new TeamSite::WFtask($taskid); #This line is used below by the "AddFile" function.
$taskarea = $task->GetArea(); #Used for the iwextattr CLT in the filepath
$setYear = $workflow->SetVariable("$OEYear", $year) or print FILE "Can't Set Variable OEYear: $!\n";
$setLastYear = $workflow->SetVariable("$OELastYear", $lastyear) or print FILE "Can't Set Variable OELastYear: $!\n";
The log from $setYear and $setLastYear both say:
Can't Set Variable OEYear: No such file or directory
Can't Set Variable OELastYear: No such file or directory
And, of course, the variable is not being set in the workflow. Have I made a stupid mistake? The error trap doesn't make any sense.