cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

We are happy to announce the new Windchill Customization board! Learn more.

Remove attachments when copying.

ash
6-Contributor
6-Contributor

Remove attachments when copying.

I have created subtype of Part : ASPart . Object of ASPart of Part is created. Some document is attached to the object in describeBy link. When I copy the object,the DescribedBy Link should not be copied. By Default it copies all the attachments of the object. I need to Validate Copy/Paste, to copy/paste object without any attachments. How should I do that?

5 REPLIES 5
olivierfresse
13-Aquamarine
(To:ash)

Check https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS119051&art_lang=en&posno=3&q=Part%20Document%20described%20by%20copy&ProductFamily=Windchill%7CWPA&source=search

You need to remove the wt.enterprise.copyRule6 property.

aka :

xconfmanager --undefine wt.enterprise.copyRules6

ash
6-Contributor
6-Contributor
(To:olivierfresse)

Thanks Olivier. It does work.

But that might affect other OOTB requirements like when it would be required to actually copy the DescribedBy Link object.

Other Solution could be, to find out which listener event gets triggered when the copy action is used. I have tried out a few

  • getManagerService().addEventListener(new PostModifyAdapter(this.getConceptualClassname()),

  PersistenceManagerEvent.generateEventKey(PersistenceManagerEvent.PRE_INSERT));

  • getManagerService().addEventListener(new PostModifyAdapter(this.getConceptualClassname()),

WorkPackageEvent.generateEventKey(WorkPackageEvent.PRE_COPY));

  • getManagerService().addEventListener(new PostModifyAdapter(this.getConceptualClassname()),

WorkPackageEvent.generateEventKey(WorkPackageEvent.POST_COPY));

None of them are triggered for Copy/Paste.

olivierfresse
13-Aquamarine
(To:ash)

Well,

there is COPY_LINK PersistenceManagerEvent, as described in

https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS214710&art_lang=en&posno=1&q=POST_STORE&ProductFamily=Windchi…

But if you want to keep these links in some cases and not in others, it may not be easy to find the origin of the event.

MatthewKnight
4-Participant
(To:ash)

This looks like a good opportunity for product Idea something like: Paste Special -> Paste Without Attachments.

ash
6-Contributor
6-Contributor
(To:ash)

COPY_LINK PersistenceManagerEvent is for BOM structures I guess. It didn't work.


I found the listener.

Its EnterpriseServiceEvent.POST_COPY. This listener only gets triggered for COPY & then we can use our logic to search the link & de-link it.


Hoping this works. Thanks.

Top Tags