Quantcast
Channel: PTC Community: Message List - Windchill
Viewing all articles
Browse latest Browse all 8876

Re: FolderHelper.assignFolderByReference

$
0
0

Hi Kaushik,

 

I've had a little success with the below mentioned code:

 

public class CustomWTPartMover implements RemoteAccess{

 

 

 

    public static void PartMover(WTPart part)

    {

               System.out.println("try started");

              try {

 

                        ObjectIdentifier oid2 = ObjectIdentifier.newObjectIdentifier("wt.pdmlink.PDMLinkProduct:12551258277");

                        System.out.println(" My Product Found");                       

                        PDMLinkProduct product = (PDMLinkProduct) PersistenceHelper.manager.refresh(oid2);

                        System.out.println("Product Refreshed");                       

                        Folder folder = FolderHelper.service.getFolder("/Default/NewPart", (WTContainerRef)product.getContainerReference());

                        System.out.println("Folder Found"); 

                        FolderHelper.service.changeFolder((FolderEntry)part, folder); 

 

                        /*

                        WTValuedHashMap map = new WTValuedHashMap();

                        map.put((FolderEntry)part,folder);

                        System.out.println("Folder mapped");

                        ContainerMoveHelper.service.moveAllVersions(map);

                        */

 

                        System.out.println("Change Folder successfully!!!!!");

 

              }

              catch (WTException e) {

                        e.printStackTrace();

              }

    }}

 

The problem is, the program doesn't recognize the Product, instead move the object to Organization/Folders. Any help here?

 

Thanks,

 

Wasim


Viewing all articles
Browse latest Browse all 8876

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>