I have the following code in a CGI task:
open(QUERY,">$iwhome/tmp/activetasks.xml");
print QUERY "<taskquery><active/></taskquery>";
close(QUERY);
@activetasks = qx|$iwhome/bin/iwquerytasks < $iwhome/tmp/activetasks.xml|;
unlink("$iwhome/tmp/activetasks.xml");
foreach $lcl_taskid (@activetasks) {
chomp($lcl_taskid);
$lcl_task = TeamSite::WFtask->new($lcl_taskid);
$lcl_wfid = $lcl_task->GetWorkflowId();
print qq^
<tr>
<td align=left>$lcl_taskid</td>
</tr>^;
}
So, I'm trying to get the job ID that belongs to each in a list of obtained task ID's. The problem with my code above is that GetWorkflowId() is painfully slow when executed in a loop, as this is. There are currently about 25 active tasks and the cost of each GetWorkflowId is about a second. Any idea why this is? Or, if this is expected behavior, how can I optimize this?
Dave
Current Environment(s):
(1) TS 6.1 SP2 on W2K3
(2) TS 6.1 SP2 on W2K