Question
How to find the baseline for a PromotionNotice?
Windchill 9.1 M070
I am attempting to remove objects from a PromotionNotice's baseline that are not set for promotion.My initial problem is figuring out how to find the baseline for the PromotionNotice. I am attempting to do this in an expression robot in the promotion request workflow as follows:
wt.maturity.PromotionNotice pbo = (wt.maturity.PromotionNotice)primaryBusinessObject;
//get the promotion request baseline
wt.fc.collections.WTCollection collection= new wt.fc.collections.WTArrayList();
collection.add(pbo);
wt.vc.baseline.Baseline pnBaseLine = null;
wt.fc.collections.WTKeyedMap pnBaseLineWTKM = wt.vc.baseline.BaselineHelper.service.getBaselines(collection, wt.vc.baseline.ManagedBaseline.class);
//******The following is returning null
pnBaseLine = (wt.vc.baseline.Baseline)pnBaseLineWTKM.get(pbo);
***at this point pnBaseLine == null
***I was expecting to have a Baseline
***What obvious java/Windchill thingy am I missing here?
//get the objects actually getting promoted
//this works
wt.fc.QueryResult pnTargets = wt.maturity.MaturityHelper.service.getPromotionTargets(pbo);
//get the all the objects in the promotion notices baseline
//this works
wt.fc.QueryResult pnBaseLineItems = wt.maturity.MaturityHelper.service.getBaselineItems(pbo);
//some logic that figures out what objects exist in pnBaseLineItems that do not exist in pnTargets
//this logic is working
.
.
.
//And finally to remove an object from the baseline I think this is what I need
//however at this point I don't have a Baseline to remove from
EPMDocument someEPMDocFromAboveLogic;
wt.vc.baseline.BaselineHelper.service.removeFromBaseline(someEPMDocFromAboveLogic, pnBaseLine);
So my problem is that I can't figure out how to find the baseline for the promotion request. I am probably missing something obvious here.
Thanks
--
I am attempting to remove objects from a PromotionNotice's baseline that are not set for promotion.My initial problem is figuring out how to find the baseline for the PromotionNotice. I am attempting to do this in an expression robot in the promotion request workflow as follows:
wt.maturity.PromotionNotice pbo = (wt.maturity.PromotionNotice)primaryBusinessObject;
//get the promotion request baseline
wt.fc.collections.WTCollection collection= new wt.fc.collections.WTArrayList();
collection.add(pbo);
wt.vc.baseline.Baseline pnBaseLine = null;
wt.fc.collections.WTKeyedMap pnBaseLineWTKM = wt.vc.baseline.BaselineHelper.service.getBaselines(collection, wt.vc.baseline.ManagedBaseline.class);
//******The following is returning null
pnBaseLine = (wt.vc.baseline.Baseline)pnBaseLineWTKM.get(pbo);
***at this point pnBaseLine == null
***I was expecting to have a Baseline
***What obvious java/Windchill thingy am I missing here?
//get the objects actually getting promoted
//this works
wt.fc.QueryResult pnTargets = wt.maturity.MaturityHelper.service.getPromotionTargets(pbo);
//get the all the objects in the promotion notices baseline
//this works
wt.fc.QueryResult pnBaseLineItems = wt.maturity.MaturityHelper.service.getBaselineItems(pbo);
//some logic that figures out what objects exist in pnBaseLineItems that do not exist in pnTargets
//this logic is working
.
.
.
//And finally to remove an object from the baseline I think this is what I need
//however at this point I don't have a Baseline to remove from
EPMDocument someEPMDocFromAboveLogic;
wt.vc.baseline.BaselineHelper.service.removeFromBaseline(someEPMDocFromAboveLogic, pnBaseLine);
So my problem is that I can't figure out how to find the baseline for the promotion request. I am probably missing something obvious here.
Thanks
--

