Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
I believe you will find code in the following snippet that you can use... this is from a promotion workflow that we use currently in 8 M050.
To route the workflow, I suggest assigning a value to a workflow variable in the code below then you can fire using that value. In the snippet below, I included wtPart - but we only use manufacturer parts and regular wtParts here. In the wtDocument branch, we havea soft type called "Procurement Specifications".
wt.fc.QueryResult qr = wt.maturity.MaturityHelper.service.getPromotionTargets( (wt.maturity.PromotionNotice) primaryBusinessObject);
while (qr.hasMoreElements()) {
Object obj = qr.nextElement();
if (obj instanceof wt.part.WTPart) {
if (obj instanceof com.ptc.windchill.suma.part.ManufacturerPart) {
// DO MFR PART ACTIONS //;
} else {
// DO PART ACTIONS //
}
}
} else {
if (obj instanceof wt.doc.WTDocument) {
wt.doc.WTDocument doc = (wt.doc.WTDocument)obj;
com.ptc.windchill.enterprise.copy.server.CoreMetaUtility cmu = new com.ptc.windchill.enterprise.copy.server.CoreMetaUtility();
String docType = cmu.getLocalizedTypeString((WTObject) doc, wt.session.SessionHelper.getLocale());
if ("Procurement Specifications".equals(docType)) {
// DO DOCUMENT (soft type Procurement Specification) ACTIONS //
}
}
}
}