I am using Windchill PDMLink Release 11.2 and Datecode with CPS 126.96.36.199
I am trying to change the domain to some folders that were created automatically with a script was created using java code.
I found a method from the class AdministrativeDomainManager called changeAdministrativeDomain(DomainAdministered obj, AdminDomainRef domain_ref) that it says :Changes the domain to which the object belongs and sets domain inheritence to false.
So when I try to get the AdminDomainRef using AdminDomainRef (see code below) I get an exception that says I am out of context(see error messages or warning) String newDomain="Default//Test//XDomain//"; AdminDomainRef admDom = AdministrativeDomainHelper.getAdminDomainRef(newDomain);
Please I need help on that I could not get any clear documentation or example about it , if you have some java code example to move a folder to another domain ( knowing that that domain already exists in windchill ) will be great if you share it.
Here are the errors that I faced
Status Code: 500
Exception: (wt.inf.container.containerResource/26) wt.inf.container.ClassicContainerNotFoundException: Context not found: "Windchill PDM"
I'm Charles from PTC Technical Support in Europe, I will provide you assistance on this question.
Is it possible to activate below logger:
windchill wt.util.jmx.SetLogLevel wt.admin ALL
Reproduce the use-case with the error message, then send me the MethodServer log and pinpoint the timestamp and the login used.
You can send log file to firstname.lastname@example.org.
I remain at your disposal for any questions or concerns.
I thank you for your email and the provided logs.
I'm able to reproduce the error message and I'd guess this is due to the format being passed for the path.
Could you try something e.g.
Does it work?
Hi Charles, thank you for your help.
I just tested the solution you suggested but for this admDom=AdministrativeDomainHelper.getAdminDomainRef("/Default/TEST/XDomain"); is not working I received the same exception : Exception: (wt.inf.container.containerResource/26) wt.inf.container.ClassicContainerNotFoundException: Context not found: "Windchill PDM".
I just guess but first object shouldn't be AdminDomainRef there is DomainAdministered which is parent class of Subfolder or RootFolder.
I would put there a object type SubFolder