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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Java code to create Change Notice and its Change Tasks

ybagul
12-Amethyst

Java code to create Change Notice and its Change Tasks

We need to create change notice and pre-defined change tasks (about 10) under it programmatically. Windchill version is 9.1 M40. Can anyone share code related to this?

ACCEPTED SOLUTION

Accepted Solutions
ybagul
12-Amethyst
(To:ybagul)

public void newChangeOrder() throws WTException, WTPropertyVetoException{

WTChangeOrder2 changeOrder = WTChangeOrder2.newWTChangeOrder2("Test Change Notice ");

changeOrder.setChangeNoticeComplexity(ChangeNoticeComplexity.SIMPLE);

changeOrder = (WTChangeOrder2)ChangeHelper2.service.saveChangeOrder(changeOrder);

WTChangeActivity2 changeActivity1 = WTChangeActivity2.newWTChangeActivity2("Test Change Activity 01");

changeActivity1.setDescription("Test Change Activity 01 Description!!!");

changeActivity1 = (WTChangeActivity2)ChangeHelper2.service.saveChangeActivity(changeOrder, changeActivity1);

WTChangeActivity2 changeActivity2 = WTChangeActivity2.newWTChangeActivity2("Test Change Activity 02");

changeActivity2.setDescription("Test Change Activity 02 Description!!!");

changeActivity2 = (WTChangeActivity2)ChangeHelper2.service.saveChangeActivity(changeOrder, changeActivity2);

WTChangeActivity2 changeActivity3 = WTChangeActivity2.newWTChangeActivity2("Test Change Activity 03");

changeActivity3.setDescription("Test Change Activity 03 Description!!!");

changeActivity3 = (WTChangeActivity2)ChangeHelper2.service.saveChangeActivity(changeOrder, changeActivity3);

}

View solution in original post

1 REPLY 1
ybagul
12-Amethyst
(To:ybagul)

public void newChangeOrder() throws WTException, WTPropertyVetoException{

WTChangeOrder2 changeOrder = WTChangeOrder2.newWTChangeOrder2("Test Change Notice ");

changeOrder.setChangeNoticeComplexity(ChangeNoticeComplexity.SIMPLE);

changeOrder = (WTChangeOrder2)ChangeHelper2.service.saveChangeOrder(changeOrder);

WTChangeActivity2 changeActivity1 = WTChangeActivity2.newWTChangeActivity2("Test Change Activity 01");

changeActivity1.setDescription("Test Change Activity 01 Description!!!");

changeActivity1 = (WTChangeActivity2)ChangeHelper2.service.saveChangeActivity(changeOrder, changeActivity1);

WTChangeActivity2 changeActivity2 = WTChangeActivity2.newWTChangeActivity2("Test Change Activity 02");

changeActivity2.setDescription("Test Change Activity 02 Description!!!");

changeActivity2 = (WTChangeActivity2)ChangeHelper2.service.saveChangeActivity(changeOrder, changeActivity2);

WTChangeActivity2 changeActivity3 = WTChangeActivity2.newWTChangeActivity2("Test Change Activity 03");

changeActivity3.setDescription("Test Change Activity 03 Description!!!");

changeActivity3 = (WTChangeActivity2)ChangeHelper2.service.saveChangeActivity(changeOrder, changeActivity3);

}

Announcements


Top Tags