I've a cgi task which takes some form data and then transitions the task. This is done in exactly the same way as I normally use for external tasks. The code works fine on a dev box but on a production box the code fails to transition the task.
Does any one know of any config issues when using the wftask callback function from a cgi script?
The script executes without error. the complete cgi is executed in its entirety. I've also place debug prints around the callbacks and the print before and after take place fine. No transition however.
I've printed the return values of the callbacks ie
($suc , $stufftask) = $task->CallBack(0, "Published");
$suc is empty (I'm expecting a 1)
I've printed out the task error object.
again the error object is empty.
What is happening ????
And here is the killer. if i run the callback code in a script from the command line (transitioning to 0 or 1 does not matter) the callback works fine. (I've even tries calling the .ipl script from the cgi task but to no avail the callback fails if it is the cgi running it)
For background we are running teamsite 5.5.2 on sun solaris. no service pack. the dev box is the same.
The script security is 775 (although I'm unsure what user runs the cgi script, can't need write surely ???)
My code is identical to:
#!/iw/iw-home/iw-perl/bin/iwperl
use CGI;
use TeamSite::WFtask;
use TeamSite::WFworkflow;
$page = new CGI; #Create CGI instance called page
$| = 1; # AutoFlush the buffer
#Set workflow stuff up
my $taskid = $page->param('task_id') ;
my $task = new TeamSite::WFtask($taskid);
my $wf_id = $task->GetWorkflowId();
my $workflow = new TeamSite::WFworkflow($wf_id);
my $area_vpath = $task->GetArea();
if (! $task->IsValid())
{
print "<br>Task ID missing or invalid task!<br>";
}
if ($page->param('submited') eq "")
{
# some html ...form etc
}
else
{
# a query was submitted
if ($page->param('publish') eq "Reject")
{
#
#transition task
$task->CallBack(1, "Rejected");
# tried using the clt but same result
#system("/iw/iw-home/bin/iwcallback $taskid 1");
# print message
print "<BR>";
print "<b>Publication has been rejected and sent back to the
approver</b>";
print "<BR>";
print "<BR>";
}
else
{
# set workflow variables pub_date, pub_time
$workflow->SetVariable("pub_date_var", $pub_date);
$workflow->SetVariable("pub_time_var", $pub_time);
$task->CallBack(0, "Published");
# print message
print "<BR>";
print "<b>Publication date and time Set</b>";
print "<BR>";
print "<BR>";
}
}
print $page->endform;
print $page->end_html;
# end of morph_search_meta.cgi
Edited by Lee on 01/16/03 11:29 PM (server time).