Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Total No of Tasks for a user
syzack
Can anybody tell me how to find the no of tasks created for a particular user under a particular role
eg: user: demouser
login as: author
how to find the total no of tasks created for demouser using openAPI or some other methodology
Find more posts tagged with
Comments
Migrateduser
Maybe something like this will help you. But it could be easier to use the iwquerytasks CLT than OpenAPI (this uses some custom classes to connect to the IW services which would not be required with the CLT).
String strTaskQuery = "<taskquery><and><active /><ownedby v='" + objIWJSPUtil.getUser().getFullLogin() + "' /></and></taskquery>";
IWTask.Selector objTaskSelector = new IWTask.QuerySelector( strTaskQuery );
Collection objTaskCollection = (Collection) IWTask.getAllCollection( objIWJSPUtil.getIWWorkFlowService(), objTaskSelector, IWTask.oNone );
Iterator objTaskIterator = objTaskCollection.iterator();
if ( ! objTaskIterator.hasNext())
{
throw( new CMSException( "No active task(s) owned by " + objIWJSPUtil.getUser().getFullLogin()));
}
boolean boolFoundJobs = false;
while ( objTaskIterator.hasNext())
{
IWTask objIWTask = (IWTask) objTaskIterator.next();
if ( objIWTask.isValid( objIWJSPUtil.getIWWorkFlowService()))
{
long id = objIWTask.getId();
JobTask objJobTask = new JobTask((int) id);
if ( objJobTask.getWorkarea().equals( objWorkarea ) && ! objJobTask.isReadOnly())
{
boolFoundJobs = true;
syzack
Thanx frnd,
The following line did all the trick....
"String myQuery = "<taskquery><and><active /><ownedby v='lnpauthor1' /></and></taskquery>";
Thanx again and looking forward to see ur posts in this forum
schemaversion.png
Migrateduser
Actually I stole it
http://devnet.interwoven.com/forums/cgi-bin/showthreaded.pl?Cat=&Board=PRODUCTS_TEAMSITE&Number=11467&page=&view=&sb=&o=&vc=1#Post11467