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

How to get BaselinedPlan object

adev-2
4-Participant

How to get BaselinedPlan object

Hi,

I am trying to retrieve BaselinedPlan object using the OOTB api but when I try to get object it throws me class case exception. can any one tell me which API i can use to retrieve BaselinedPlan

code using:

PlanActivity pa = getPlanActivity(activityName, proj);  // get PlanActivity

  ObjectReference objRef = wt.fc.ObjectReference.newObjectReference(pa);

  com.ptc.projectmanagement.plan.baseline.BaselineHelper.service.getActiveBaseline(objRef);

Error Message : Caused by: java.lang.ClassCastException: com.ptc.projectmanagement.plan.baseline.BaselinedPlanActivity cannot be cast to com.ptc.projectmanagement.plan.baseline.BaselinedPlan

2 REPLIES 2
BhushanNehe
14-Alexandrite
(To:adev-2)

You are querying BaselinedPlanActivity, you can get the BaselinedPlan object from BaselinedPlanActivity using the below API

<<BaselinedPlanActivity-Object>>.getRootReference().getObject();

Regards,

Bhushan

adev-2
4-Participant
(To:BhushanNehe)

Hi Bhushan,

thank you for your replay I have also found an api to retrieve Baseline object

BaselinedPlan bp =  com.ptc.projectmanagement.plan.baseline.BaselineHelper.service.getActiveBaseline((ObjectReference.newObjectReference(plan)));

Announcements