Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
WFTask.pm problem
Hazzie
Hi,
Its always the way but berfore Christmas this worked, after christmas when i get back it doesnt work. Can anyone shed some light on it. I have some perl code which uses WFtask.pm. However Some of the Inbuilt functions within the module are not working. The following code is used within a CGI task and i am (for testing) hardcoding a valid Task ID into the script.
Code
$TaskID = 16097;
print "Taskid = $TaskID<br>";
$Task = new TeamSite::WFtask($TaskID);
print "Task = $Task<br>";
$id = $Task->GetId();
print "id = $id<br>";
$JobID = $Task->GetWorkflowId();
print "Jobid = $JobID<br>";
$workarea = $Task->GetArea();
print "workarea = $workarea<br>";
output
Taskid = 16097
Task = TeamSite::WFtask=HASH(0x348c98)
id = 16097
Jobid =
workarea =
So as you can see I am getting a task object and i can return the Taskid of this new object using Task->GetId() however when i try to find its Workflow id using GetWorkflowId() or the area using GetArea() nothnig is returned.
Can anyone suggest why this might be?
Hazzie
TS 5.5.2 on NT.
Find more posts tagged with
Comments
Hazzie
Here is the script
Hazzie
TS 5.5.2 on NT.
Adam Stoller
Are you sure that task 16097 is a valid and active task?
You might try adding the following for debugging purposes at least (perhaps even keeping it in afterwards too):
$Task = new TeamSite::WFtask($TaskID);
print "$Task
";
if ($Task->IsValid()){
$id = $Task->GetId();
print "id = $id
";
my $JobID = $Task->GetWorkflowId();
print "Jobid = $JobID
";
my $workarea = $Task->GetArea();
print "workarea = $workarea
";
}
else {
print "Whoops - got an invalid task!
";
}
There are other aspects of your script that deserve more scrutiny too - but we'll hold off on that until you get this part working.
By the way - how is this script getting called? Are you calling it from a workflow right now, or are you trying to call it from the command line?
--fish
(Interwoven Senior Technical Consultant)
Hazzie
Thanks for that.
In fact its a very good idea to keep it in.
It highlighted that it was a invalid Task. I deleted the manual inputted task id and retyped it in. and hey presto it works. Maybe an invisible control charicter got into it?? Still strange how $task->Id worked and $Task->GetWorkflowId didnt.
Thanks.
Hazzie
TS 5.5.2 on NT.
Hazzie
ok forget the bit where i said its strange. Its not strange its perfectly understandable why $task->Id worrks and $task->GetWorkflowId doesnt. sheesh.
Hazzie
TS 5.5.2 on NT.
ProfessorX
Ugg..
Ok I have a problem....I want to create a new workflow task
$Task = new TeamSite::WFtask($TaskID);
But I dont' know what the last task ID was.
How do I do this
Thanks in advance!
The Professor-
Adam Stoller
Just to make sure we're talking about the same thing - You cannot create a new task, you can create a new task object that references an already existing task in an already instantiated workflow.
Does that "answer" your question? If not - what are you referring to when you say you "don't know what the last task ID was" ?
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
ProfessorX
Got ya fish...
I relized it now...
I had(a consultant created) and ext task (perl script) that was calling other perl script(s) and at certain points when a proccess/routine/piece of code completed in those other perl script(s) it wanted to let the task know it was complete $task->CallBack(0," Datadeploy Success");
This was causing a problem in the primary perl script because when it did fail $task->CallBack(1," Opendeploy Failed"); it seemed (I'm pretty sure that's how it works) that the task had already been called back prior in the secondary perl script of success.
So I assume the beast work around would be to write to a temp file a flag of (Yo...over here....we did our part..weees just wanted to let you know that.) and have the primary perl script read that file (You guys finished but we missed him Tony he got away....we're calling back to headquarters) with $task->CallBack(1," Opendeploy Failed");
Thanks in advance!
The Professor-
Adam Stoller
It's generally better, if you have the ability to control it - to create perl modules rather than perl scripts that call perl scripts, etc.
That way - everything is controlled from the script you called and you don't have to worry about some other piece of code sending a callback. It also provides better performance since you don't have to fork a new process for each of the scripts.
I still regret not turning iwsend_mail.ipl into iwsend_mail.pm for that very reason.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com