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)
TeamSite::WFtask::isActive
System
Other than calling iwgetwfobj and parsing the output, is there any way to determine if a task is active? I would like to use the TeamSite::WFtask module but it doesn't seem to have an isActive member. As an alternative I was thinking iwquerytasks but I can't figure out the syntax. Basically I have an external task ID, I just want to know if that task has made a valid callback or if it's still active.
Find more posts tagged with
Comments
Migrateduser
In Perl, reading the XML from iwgetwfobj is probably the easiest way, in general. If you know that the external task is not within a loop, then you could test WFtask->GetUnactivationTime.
Brinko Kobrin
Interwoven Staff Engineer
Adam Stoller
You can use
TeamSite::WFsystem::GetActiveTasks()
which returns a reference to a list of active tasks and then you can loop through that to see if the taskid you have matches any of them.
use TeamSite::WFsystem;
my $taskid = shift;
# get taskid to search for from command line
my $tasks = TeamSite::WFsystem::GetActiveTasks();
foreach(
@$tasks){
if ($_->GetId() == $taskid){
print "$taskid is active\n";
exit(0);
}
}
die "$taskid is NOT active\n";
You can do pretty much the same thing with iwquerytasks - first create a little XML file (e.g. taskq.xml) that looks like this:
<taskquery><active/></taskquery>
then run a command like this:
~>
iwquerytasks < taskq.xml
or:
~>
iwquerytasks < taskq.xml | grep
taskid
(the latter assumes Unix)
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com