Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Hello,
I have a requirement that I need to fetch all the subtypes of the Project type.
can you please let me know the available API for this?
Thanks in advance.
Best Regards,
John
Hi John,
Are you looking to query all the projects created using sub-type or just list all the sub-types of Project?
Regards,
Bhushan
Hi Bhushan,
Thanks for your reply.
I would like to list all subtypes of the project that we see from type and attributes management...
Regards,
John
You can use Infoengine.
Copy the attached file in $WT_HOME/tasks.
You can test it from the browser with this URL, and you can change the type parameter
http://pdmlinkServer/Windchill/servlet/IE/tasks/TypeHierarchy.xml?type=wt.projmgmt.admin.Project
An infoengine task can be called from java.
import com.infoengine.SAK.Task import com.infoengine.object.factory.Group import wt.session.SessionHelper Task task = new Task("TypeHierarchy.xml"); task.setUsername(SessionHelper.manager.getPrincipal().getName()); task.setParam("type", "wt.projmgmt.admin.Project"); task.invoke(); Group group = task.getGroup("types"); for (int i = 0; i < group.getElementCount(); i++) { String type = group.getAttributeValue(i,"type") //..... }
Hope it helps.