Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
How to create a Save-as-History link between two WTDocuments in windchill12.1?
Which api should I use to create a link between two WTDocuments?
Solved! Go to Solution.
Hi @HelesicPetr
That report issue not allowing to finish the migration. Anyway, it was replaced by ConfigurableLinks and its working fine.
Thanks
Hello @Naga_2000
You need to know the type of object you want to create.
In this case MadeFromLink
create the link set the objects and preferences then save the link
MadeFromLink saveAsRow = new MadeFromLink();
saveAsRow.setOriginal(originalDocument);
saveAsRow.setCopy(newObjectDocument);
PersistenceHelper.manager.store((Persistable) saveAsRow);
hope this can help.
PetrH
Hi @HelesicPetr
This API is unsupported in latest version. In Eclipse or any IDE, it will show that API. But when you check in the javadoc for the version 12.1.2.0, the API MadeFromLink is not available in that javadoc.
Thanks,
Naga
Hi @Naga_2000
Where is problem? do you want to create history link?
Use it.
The object MadeFromLink is also table in database, where the information is stored and I do not believe that PTC would change the table to an another one in a new release to store same history information just in new table. .
If you can't find API to create history link in the JavaDoc then you can not create history link by supported API.
PS> supported API means that the API will not be changed in the future and customers can use it without any future compatibility issue.
But PTC can use any API in the application even though it is not supported by javaDoc
PetrH.
Hi
The main problem comes here, when migrating our existing environment to Windchill+ SaaS, it shows that some of the API's like MadeFromLink as Unsupported in the "Windchill Custom Class Assessment Report".
Naga.
Hi @Naga_2000
It is PTC Problem that needs to be solved with them.
Windchill+ has to allow that classes if you want to deploy your customization to SaaS.
There is no way to create just the history link another way because the object of history link is the "MadeFromLink".
you may use different api to create a copy of object that also create the history link "MadeFromLink"
StandardEnterpriseService enterserv = StandardEnterpriseService.newStandardEnterpriseService();
enterserv.saveCopy(originalDocument,newObjectDocument);
but the StandardEnterpriseService.class also contains the method to the create history link.
So in my opinion you should work with PTC who is responsible for the control mechanism for Windchill+
PTC can use unsupported API but but you can't this is not right..
PetrH
Hi @Naga_2000
btw Is it problem if the API is reported as unsupported?
Does this report issue allows you to finish migration to SaaS ?
If so do not care it will work because PTC also use that API.
PetrH
Hi @HelesicPetr
That report issue not allowing to finish the migration. Anyway, it was replaced by ConfigurableLinks and its working fine.
Thanks
Hi @Naga_2000
It means that the PTC will not allow to use customers own customizations in the Windchill+
This is not good...
PetrH