Quantcast
Channel: PTC Community : Unanswered Discussions - Windchill
Viewing all articles
Browse latest Browse all 3592

Creating a link between Parent Part and Child Part using windchill API's

$
0
0

Hi,

 

I am getting the following error while creating a link between a checked out working copy of a part and a child part.

 

(wt.vc.wip.wipResource/0) wt.vc.wip.WorkInProgressException: The object was improperly initialized (i.e., it was null).

        at wt.method.RemoteMethodServer.invoke(RemoteMethodServer.java:795)

        at wt.services.ServiceFactory$ClientInvocationHandler.invoke(ServiceFact

ory.java:349)

        at $Proxy8.checkout(Unknown Source)

        at com.injector.Injector_Test.main(Injector_Test.java:201)

 

Any suggestions on how to solve this error ?

 

Code for reference :

 

WTPart part = WTPart.newWTPart(

 

"Part1", "MyPart");

PersistenceHelper.

 

manager.save(part);

WTPart childPart = WTPart.newWTPart(

 

"CPart1", "MyChildPart");

 

PersistenceHelper.

 

manager.save(childPart);

 

 

WTPart Workingcopy = (WTPart)WorkInProgressHelper.

 

service.checkout(part, null, null).getWorkingCopy();

 

PersistenceHelper.

 

manager.save(link);

WorkInProgressHelper.

 

service.checkin(Workingcopy,null);

 

 

WTPartUsageLink link = WTPartUsageLink.newWTPartUsageLink(Workingcopy, (WTPartMaster) childPart.getMaster());

 

 

 


Viewing all articles
Browse latest Browse all 3592

Trending Articles



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