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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Code to create a baseline

klozier
8-Gravel

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

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

Top Tags