Skip to main content
12-Amethyst
September 19, 2026
Question

API to get the template of a container (Product/Library)

  • September 19, 2026
  • 0 replies
  • 5 views

Background: I’m working on a requirement to filter all Product and Library containers in an Organization based on the template they were created from. So I need to read the template associated with each container.

Has anyone successfully retrieved template information for Product or Library containers without hitting this recursion issue or any recommended API for this job? 

What I’ve tried so far:

  1. ContainerTemplateService.getContainerTemplate(...) I attempted calling the getContainerTemplate API using both the container’s own reference and the OrgContainer reference. In all cases, the method consistently returns null, even for containers that I know were created from a template.

  2. WTContainer.getContainerTemplateReference().getName() This API does return a template name when called once, but any further processing (such as checking startsWith(...)) triggers a runtime failure:

java.lang.StackOverflowError
    at wt.method.RemoteMethodServer.invoke
    at wt.fc.CachedObjectReference.inflate
    at wt.inf.container.WTContainerTemplateRef.getName
    at wt.inf.container.WTContainerTemplateRef.initialize
    at wt.inf.container.WTContainerTemplateRef.inflate

It appears that inflating the WTContainerTemplateRef causes recursive error.