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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Retrieve the API of all objects affected by change notifications in WTpart through programming

ZK_11667139
10-Marble

Retrieve the API of all objects affected by change notifications in WTpart through programming

I need to retrieve the API of all objects affected by change notifications in WTpart through programming, because I need to control whether the WTPart objects of the affected objects already have other changes when creating a new ECN. If so, the current change will be canceled and the customer will be prompted that there are already other changes in the objects. Please complete them first before initiating the change

ACCEPTED SOLUTION

Accepted Solutions

QueryResult activities = ChangeHelper2.service.getAffectingChangeActivities(part);
while (activities.hasMoreElements()) {
WTChangeActivity2 activity = (WTChangeActivity2) activities.nextElement();
QueryResult orders = ChangeHelper2.service.getChangeOrder(activity);
while (orders.hasMoreElements()) {
WTChangeOrder2 order = (WTChangeOrder2) orders.nextElement();
QueryResult qrProcs = WfEngineHelper.service.getAssociatedProcesses(order,
WfState.OPEN_RUNNING, null);
if (qrProcs.size() > 0) {
showFlag = false;
message = "Part:" + part.getNumber() + "-" + part.getName() + "has a running change process and is not allowed to initiate it again";
}
}
}

View solution in original post

2 REPLIES 2

QueryResult activities = ChangeHelper2.service.getAffectingChangeActivities(part);
while (activities.hasMoreElements()) {
WTChangeActivity2 activity = (WTChangeActivity2) activities.nextElement();
QueryResult orders = ChangeHelper2.service.getChangeOrder(activity);
while (orders.hasMoreElements()) {
WTChangeOrder2 order = (WTChangeOrder2) orders.nextElement();
QueryResult qrProcs = WfEngineHelper.service.getAssociatedProcesses(order,
WfState.OPEN_RUNNING, null);
if (qrProcs.size() > 0) {
showFlag = false;
message = "Part:" + part.getNumber() + "-" + part.getName() + "has a running change process and is not allowed to initiate it again";
}
}
}

Thank you very much for your reply. My issue has been resolved. thank you

Announcements

Top Tags