Start a topic
With the exception of Windchill, The PTC Community is on read-only status until April 6 in preparation for moving our community to a new platform. Learn more here
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

The PTC Community is on temporary read only status in preparation for moving our community to a new platform. Learn more here

Translate the entire conversation 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