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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Can the 'link' to drawing be displayed on workflow instructions email?

RG_10753677
10-Marble

Can the 'link' to drawing be displayed on workflow instructions email?

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?

 

1 REPLY 1
DmitryC
14-Alexandrite
(To:RG_10753677)

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.

Announcements

Top Tags