Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
Is it possible to display name/number of drawing on a Change Notice?
If so, is it possible to provide a link to drawing in the email, in the instructions?
You can create a variable in Workflow, populate it with the list of drawings, and then insert this variable into your notifications:
wt.maturity.StandardMaturityService p = new wt.maturity.StandardMaturityService();
wt.maturity.PromotionNotice pn =(wt.maturity.PromotionNotice)primaryBusinessObject;
wt.fc.QueryResult pn_targets = (wt.fc.QueryResult) p.getPromotionTargets(pn);
wt.epm.EPMDocument doc;
// Clearing workflow variable for Rework cycle
dwgUrlList = "";
while (pn_targets.hasMoreElements()) {
Object obj = pn_targets.nextElement();
String objType = obj.getClass().getName();
try {
if (objType.equals("wt.epm.EPMDocument")) {
doc = (wt.epm.EPMDocument) obj;
com.ptc.core.lwc.server.PersistableAdapter pa = new com.ptc.core.lwc.server.PersistableAdapter(doc,null,wt.session.SessionHelper.getLocale(),null);
pa.load("docType","authoringApplication");
java.lang.String docType = (java.lang.String) pa.get("docType");
java.lang.String authoringApp = (java.lang.String) pa.get("authoringApplication");
if(docType.equals("CADDRAWING") && authoringApp.equals("SOLIDWORKS")) {
com.ptc.netmarkets.model.NmOid objectID = new com.ptc.netmarkets.model.NmOid("EPMDocument", doc.getPersistInfo().getObjectIdentifier());
com.ptc.netmarkets.util.beans.NmURLFactoryBean URLbean = new com.ptc.netmarkets.util.beans.NmURLFactoryBean();
java.lang.String url = com.ptc.netmarkets.util.misc.NetmarketURL.buildURL(URLbean, "object", "view", objectID);
dwgUrlList = dwgUrlList + System.lineSeparator() + "<a href=\"" + url + "\">" + doc.getDisplayIdentity().getLocalizedMessage(wt.session.SessionHelper.getLocale()) + "</a>";
}
}
}
catch(wt.util.WTException e) {
e.printStackTrace();
}
}
if (dwgUrlList.equals("")) {
dwgUrlList = "<b>None</b>";
}
In my case I'm creating a list of SolidWorks drawings only with URLs.