in the attached picture you can see a structure, how items in our changemanagement could be linked via relationship fields. All items are the same itemtype, and its also always the same relationship field. Items can have different specifications, so the item at the top is in most cases a "library" and in the middle there could be "packages" and at the bottom there are "modules".
The following relationships are possible:
library -> package
library -> module
package -> package
package -> module
So how we can build a query which returns all libraries, which have a relationship (direct or not) to modules with a certain state? All what i found is the possibilty to filter over direct relationships to the next level in this structure, but not over 3 or 4 level. And also i didnt see a way to do this with subqueries.
In a pseudo-query i would say:
Give me all libraries (which have modules in state A) or (which have packages which have modules in state A) or (which have packages which have packages (which have modules in State A))
I know that reports could give us multilevel relationship filter, but thats not what we need...
I really would appreciate any hint...
Solved! Go to Solution.
unfortunately this cannot be solved by a query.
Queries are only able to selected items that match a "filter" based on their first level of relationship (up or down)
What you describe would mean to JOIN the result of several queries. This cannot be done using sub-queries.
The only way to solve this is a report.
i suspected this already
But i got help from our PTC Technical Consultant. He gave me a hint to a Qquery-function "walk". It is documented only in the ServerAdministrationGuide, not in the Workflows&Documents-Documentation and the functionality isnt available or even configurable yet in the GUI. So you have to create at least a very basic query from the cli with this command:
im createquery --queryDefinition='(walk[<relationship>] <id>)'
The <id> is holding the ID of the element where the walking-procedure should start. For later refinements you can use the GUI.
But this function has at least two limitations:
So its a first step...
kind regards, Jens
I don't mean to drive you away from the walk function, but keep in mind it is documented for use within reports, at least within the 10.6 Server Administration Guide.
The official answer to this sort of functionality is still to use reports, as Matthias pointed out.
i know that this functionality is "officialy" only available in reports, but i think it's clear that there is a demand for such functionality for queries too. I think we will look if there is an already existing and matching RfC to add our company to it. Otherwise we will open a new one.
kind regards, Jens
Thank you for posting the RFC information, Matthias!
Jens, I have updated the KCS article (CS88090) to try to capture your statement of what is desired. If you have not already done so, please add your organization to this issue by opening a case with PTC Integrity Support to be associated with this enhancement request.