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)
Method for determining if file is in workflow
System
I can't seem to find a CSSDK method (2.5) that will tell me for a given file, whether or not it is already attached to a workflow. In most cases, I can just check to see if it's locked and that will tell me what I need to know, but there are certain places in one workflow where the file is unlocked, but I still need to know if it is attached to a job. It looks to me like I have to approach this backwards, by iterating over all the workflows and checking for the file. I would think that would get ugly from a performance standpoint very quickly. Any thoughts....
Find more posts tagged with
Comments
Bill Klish
You are correct. There is no easy way to get at this information. The code to do what you are talking about is included with TeamSite though. Check the customer_samples_src toolkit for the Tasks_for_File servlet and JSP code. I believe the code does what you are asking about.
-Bill
Migrateduser
Hey Bill -
Where do those examples live. It sounds like something other than the samples that ship in the big CSSDK zip file.
Thanks
Rob
Bill Klish
Sorry for not being clearer. Check the customer_samples_src toolkit that lives in the same place as your customer_src toolkit. It is shipped with TeamSite and not the CS SDK ZIP file.
-Bill
Bowker
Bill -
How about:
CSFile csFile = csClient.getFile(new CSVPath(filename));
int relatedTasks[] = csFile.getRelatedTaskIds();
if ( (relatedTasks !- null) && (relatedTasks.length > 0) )
... already in the workflows listed in the relatedTasks array.
Dan Bowker
Northern Trust
Web Publishing Technology
Bill Klish
Yeah, that exact code is in the customer_samples toolkit tasks_for_file.jsp file I mentioned above.