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.

Move objects from one context's folder to another context's folder while creation

ptc-4819768
1-Newbie

Move objects from one context's folder to another context's folder while creation

Hi All,

I've a requirement which asks to move objects of a certain type from one product to another product while creation. For example, if I created a WTPart in Product A, it should get stored automatically in a given location within Product B.

I'm not sure how to enable such move action within inter context movements. How can we achieve such scenario?

Thanks in advance.

Wasim

4 REPLIES 4
VINO
4-Participant
(To:ptc-4819768)

I think this can be acheived by adding a custom workflow to the WTPart object and from there you can check where that is getting created,according with that you can assign a Folder location for that part

Hi Vigneshwaran,

I appreciate your reply. Could you please provide a logic or example to achieve this? I think there should be a listener required to listen to creation of WTParts?

Thanks,

Wasim

VINO
4-Participant
(To:ptc-4819768)

I don't think you need any listener or service to capture the creation of WTParts.Since you are adding that inside the custom workflow for wtpart,add a expression robot and specify your folder path there.

This API will work to assign the location.

FolderHelper.assignFolderByReference(part, oRef);

Here oRef is ObjectReference

Hi Vigneshwara,

Sorry for a late posting. I am able to figure out the type of object. When a WTPart is getting created, we'll move it. However, the code is not working for me.

Could you please help me with a snippet or exact code required to move an object from one context to another?

I tried to use getFolderPath but it doesn't work with 10.1.

Thanks in advance.

Wasim

Top Tags