Skip to main content
1-Visitor
May 4, 2016
Question

How to fetch the subtypes of Project in ProjectLink?

  • May 4, 2016
  • 3 replies
  • 1918 views

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

3 replies

16-Pearl
May 4, 2016

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

jselvaraj1-VisitorAuthor
1-Visitor
May 5, 2016

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

15-Moonstone
August 29, 2017

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.