Skip to main content
17-Peridot
March 11, 2022
Solved

Parent Subfolder

  • March 11, 2022
  • 1 reply
  • 3363 views

Hi team

In QueryBuilder you can join the document table to the Subfolder table, which gives you the 'leaf' folder where the document resides. You can have Subfolder Name in the 'Select or Constrain' tab. Good.

You can join from the Subfolder to its parent Subfolder, and so on for deep folder trees (performance seems to suffer due to this).

I don't always have the same depth of folders, so is there a way to recurse all the way up to the top folder? I hesitate to say 'iterate' because Windchill uses that term w.r.t. versioning, and I am not talking of that.

 

Maybe this is relevant: you can join the Document table to the Folder table via the 'Iterated Folder Member Link' but there are no Folder fields which can be used as criteria. How/What/Where can this be useful?

thanks

Rick

Best answer by d_graham

Rick, hi

 

If you want to enter the folder path as the criteria that is doable.

 

In my example I entered the object and returned its folder path.

I wrote my own method which looped from the bottom up until it got to the top level folder.

 

That said, there are two OOTB getLocation methods.  The one that you'd pass the WTDoc. EPMDoc. WTPart (or any other object that is in the folder) is depreciated (WC 12.1) but it still works.

 

As for inputting the folder path itself, you can certainly pass the input to a Java Method and return the desired results.  You just need to enter it as a String "Parameter" and pass the String to your Java Method.

 

If you need help with this feel free contact me at windchill.developer@yahoo.com 

 

 

David

 

 

 

 

 

 

1 reply

Marco Tosin
21-Topaz I
21-Topaz I
March 11, 2022

Rick,

I believe we have same limits as for extracting all BOM levels because, at the moment, query builder tool cannot be recursive.

Marco
rleir17-PeridotAuthor
17-Peridot
March 19, 2022

Marco, Kudos to you for your reply. You say 'BOM' but no: I am asking more generally about nested folders.

 

/default/folderLevel2/folderLevel3/folderLevel4/folderLevel5/folderLevel6/  .. containing documents, parts, whatever.

 

QB gives me good access to the lowest level of subfolder, it can be used for report criteria. I cannot access the complete folderpath for use as report criteria (though I can display it). If I want access to the individual folders in the folderpath, I need to join to the subfolder's parent, and its parent, and so on.

That is fine when I know in advance how deep the folders go. As it happens, I want the parent's parent to be a report criterion (don't ask). That would be folderLevel4 above, and I have a working QB report for that.

 

It would be nice to know a more general way to access folders in the folderpath. Suppose you want the folder which is second level from the top to be a report criterion, but the folderpath depth varies from library to library? 

 

I think that your answer is simply 'no, that is not supported in QB'?

Thanks

Rick

18-Opal
March 19, 2022

Query Builder can be recursive.

What you want to do IS supported by Query Builder.

You can get the job done using “Java Method”.

 

Using Java Method you can go from the document to its folder and then recursively go up the folders until you get to the top folder.

The full path can then be returned and displayed in the report.

d_graham_1-1647780323650.png

 

 

d_graham_0-1647780228406.png

Seems to work.