Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
Hi.
I have WCTypeInstanceIdentifier with String representation as "WCTYPE|wt.folder.SubFolder~~WCP|317820|5".
How can i get folder from this object?
Thanks.
Solved! Go to Solution.
Hi!
If 317820 is idA2A2 field in the table that describe subfolder attributes (may be SubFolder table), then you can get object like this:
SubFolder sf =(SubFolder)( new ReferenceFactory()).getReference("OR:wt.folder.SubFolder:317820").getObject();
Hi!
If 317820 is idA2A2 field in the table that describe subfolder attributes (may be SubFolder table), then you can get object like this:
SubFolder sf =(SubFolder)( new ReferenceFactory()).getReference("OR:wt.folder.SubFolder:317820").getObject();
To get the "OR:wt.folder.SubFolder:317820" String out of the WCTypeInstanceIdentifier (Assuming your WCTypeInstanceIdentifier is stored in a variable called "tii"):
String persistenceIdentifier = tii.getPersistenceIdentifier();
WTReference reference = new ReferenceFactory().getReference(persistenceIdentifier);
SubFolder sf = (SubFolder) reference.getObject();