Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Translate the entire conversation x

How to create PlanActivity using code?

VasiliyRepecki
12-Amethyst

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
12-Amethyst
12-Amethyst
(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

Announcements

Top Tags