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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

How to create PlanActivity using code?

VasiliyRepecki
1-Newbie

How to create PlanActivity using code?

Hi.

I need create com.ptc.projectmanagement.plan.PlanActivity and add into existing Project using java code. How i can do it?

Thanks.

2 REPLIES 2

first, need get the project,then coding like this:

Plan plan = (Plan)PlanHelper.service.getPlan(ObjectReference.newObjectReference(project));

PlanActivity activity = PlanActivity.newPlanActivity(WTContainerRef.newWTContainerRef(project));

activity.setName("name");

activity.setLineNumber(4);   //this is important to display the PlanActivity

activity = (PlanActivity)PlanHelper.service.addToPlan(activity, plan);

KD
4-Participant
4-Participant
(To:yliu-2)

Hi All,

Apart from the methods mentioned above there are many useful methods in " PlannableHelper.service "  also.

PlannableHelper.service.getPlannableByLineNumber

PlannableHelper.service.addPlannable

PlannableHelper.service.getImmediateChildren

etc.

Thanks And Regads,

Kaushik

Top Tags