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

How to create Parent & Child WTPart using Code ?

Highlighted
Newbie

How to create Parent & Child WTPart using Code ?

Hi all

I want to create WTPart Parent and Child to it in stuctured way using java code with Oracle sequence as Number.

1 REPLY 1

Re: How to create Parent & Child WTPart using Code ?

Hi Guru,

I dont know the exact way.But you may try this

WTPart workingCopy;

WTPart part = WTPart.newWTPart("myPartNumber", "MyPartName");

part.setContainer(c.getContainer());

PersistenceHelper.

manager.save(part);

WTPart childPart = WTPart.newWTPart("myChildPartNumber", "MyChildPartName");

childPart.setContainer(c.getContainer());

PersistenceHelper.

manager.save(childPart);

workingCopy = (WTPart)WorkInProgressHelper.

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

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

Persistable per2 = PersistenceHelper.

manager.save(link);

WorkInProgressHelper.

service.checkin(workingCopy,null);

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum! ______________________________ Check out the Windchill Tips Board! We're talking about Whirlpool's use of digital twin, augmented reality, and data-driven design!

The NAVIGATE WORKING GROUP is here! Come innovate with PTC!

Sign up for a Working Group