cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Finding context template usage, finding project template usage fails

CJL
4-Participant
4-Participant

Finding context template usage, finding project template usage fails

We are reviewing our current system and looking at which contexts use which context templates. I successfully used an Info*Engine task with query webject to find products with their associated product template.

<%
String instance = wt.util.WTProperties.getLocalProperties().getProperty("wt.federation.ie.VMName");
%>
<ie:webject name="Query-Objects" type="OBJ">
<ie:param name="INSTANCE" data="&lt;%=instance%">"/>
<ie:param name="ATTRIBUTE" data="name,containerTemplateReference.name" delim=","/">
<ie:param name="WHERE" data="()"/">
<ie:param name="TYPE" data="wt.pdmlink.PDMLinkProduct"/">
<ie:param name="GROUP_OUT" data="productContainers"/">
</ie:webject>

This approach also works for libraries (wt.inf.library.WTLibrary) and their associated library templates. However, a similar query webject searching for projects only returns the project name and fails to return a value for containerTemplateReference.name. If .name is removed and the task is run the task returns the project name and project template OID.A separate search using the template OID returns the template name.

<ie:webject name="Query-Objects" type="OBJ">
<ie:param name="INSTANCE" data="&lt;%=instance%">"/>
<ie:param name="ATTRIBUTE" data="name,containerTemplateReference.name" delim=","/">
<ie:param name="WHERE" data="()"/">
<ie:param name="TYPE" data="wt.projmgmt.admin.Project2"/">
<ie:param name="GROUP_OUT" data="projectContainers"/">
</ie:webject>

Is there a way of getting the project template name without using a loop and does anyone know why containerTemplateReference behaves differently for projects?

Thanks

Chris

1 REPLY 1
CJL
4-Participant
4-Participant
(To:CJL)

At least part of the answer is to use the dereferencing operator (^) to obtain an attribute from the template reference UFID. I am still unsure why it was not necessary to use the dereferencing operator for product and libray object associated data.

<ie:webject name="Query-Objects" type="OBJ">
<ie:param name="INSTANCE" data="&lt;%=instance%">"/>
<ie:param name="ATTRIBUTE" data="name,containerTemplateReference^name" delim=","/">
<ie:param name="WHERE" data="()"/">
<ie:param name="TYPE" data="wt.projmgmt.admin.Project2"/">
<ie:param name="GROUP_OUT" data="projectContainers"/">
</ie:webject>

Top Tags