The community will undergo maintenance on October 16th at 10:00 PM PDT and will be unavailable for up to one hour.
I am using Windchill PDMLink Release 11.2 and Datecode with CPS 11.2.1.14
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"
Hi Selene,
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 cgautier@ptc.com.
I remain at your disposal for any questions or concerns.
Kind Regards,
Charles Gautier.
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.
admDom=AdministrativeDomainHelper.getAdminDomainRef("/Default");
and
admDom=AdministrativeDomainHelper.getAdminDomainRef("/Default/TEST/XDomain");
Does it work?
KR,
Charles.
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".
Thanks,
-Selene
thanks.
Does it mean for "/Default" it works?
KR,
Charles.
Yes for "/Default" it works but for the path I need does not work.
Hi @Selene
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
PetrH
Hi Selene,
Can you try:
changeAdministrativeDomain( DomainAdministered obj, AdminDomainRef domain_ref, boolean inheritedDomain )
KR,
Charles.
Hi Selene,
Did you get a chance to review my message?
KR,
Charles.