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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Code to create a baseline

klozier
10-Marble

Code to create a baseline

New to creating code. I would like to create a managed baseline for a given EPMDoc using code. Reading the javadoc it would appear that I should use newManagedBaseline. I would like to see an example of code that creates a new baseline.


Thanks,


-Kelly

2 REPLIES 2

You could try this..

WTHashSet wtHashSet = new WTHashSet();
wtHashSet.addElement(epmDocument);
ManagedBaseline managedBaseline = ManagedBaseline.newManagedBaseline();
managedBaseline.setName("BASELINE_NAME");
managedBaseline.setNumber("BASELINE_NUMBER");
managedBaseline.setDescription("BASELINE_DESCRIPTION");
managedBaseline.setContainer(epmDocument.getContainer());
managedBaseline.setFolderingInfo(epmDocument.getFolderingInfo());
managedBaseline.setTopObject(epmDocument);
managedBaseline =
(ManagedBaseline)PersistenceHelper.manager.save(managedBaseline);
BaselineHelper.service.addToBaseline(wtHashSet, managedBaseline);


Sudeep Bhattarai
sudeep.bhattarai@najanaja.com
847-220-7008
Solutions Architect
NajaNaja Ltd
klozier
10-Marble
(To:klozier)

Thanks for the suggestions. I can now create a baseline and add the pbo. Since the pbo is an EPMDoc it has required dependants. Any suggestions on how to collect the required dependants and add them to the baseline?


Thanks again,


Kelly Lozier


BMPC-KAPL

Announcements


Top Tags