Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
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
You are querying BaselinedPlanActivity, you can get the BaselinedPlan object from BaselinedPlanActivity using the below API
<<BaselinedPlanActivity-Object>>.getRootReference().getObject();
Regards,
Bhushan
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)));