Skip to main content
15-Moonstone
January 4, 2017
Question

Has anyone tried overriding Windchill workflow email notification..

  • January 4, 2017
  • 3 replies
  • 3064 views

All the supported methods available does not meet the requirements.

3 replies

1-Visitor
January 4, 2017

What kind of requirements?

Do you need to send an e-mail to an address that comes from a global variable? Do you need to send an e-mail with attachment(s)?

1-Visitor
January 4, 2017

What do you want to do and which version of WC

15-Moonstone
January 4, 2017

thanks for Responding. I have WC 11.0.

I need to generate link which has the workitem id in the email. The URL link takes them to the PTC Navigate Change App. I went about it this way..

-  Start transition in wfAssigned activity does not have it just yet. So I used SendEmail in the expression robot which gets fired when the activity is fired. Only issue with this approach is that when the people are added or reassigned they will not get the email. So it is half way there.

So I am wondering if there is a way to override methods in template processor. Or is there a way to add our own method in General_en_US template.

I am sure all of us have come across this ...

thanks,

Preeti

1-Visitor
January 4, 2017

I don't know if 11 still uses the template processor stuff.  I'm not sure if workNotification/General is loaded from a property or not, but if so, extending that java file and updating the service property would be ideal.  Otherwise, something like the below *may* work or come close to working.  Adding a new processor and sub html template seems like overkill when all you want to do is add a method, but maybe it will work.

wt.services/svc/default/wt.enterprise.TemplateProcessor/GetCustomLink/java.lang.Object/0=com.custom.GetCustomLinkProcessor/duplicate

//custom class extends DefaultTemplateProcessor/etc

//custom class has method: getCustomLink(Properties,Locale,OutputStream)

public void getCustomLink(Properties properties, Locale locale, OutputStream os) throws WTException {

  //navigation context to workItem

  //get link/whatever

  PrintWriter writer = TemplateOutputStream.getPrintWriter(thelink, locale);

  writer.print(link);

  writer.flush();

}

wt.services/rsc/default/wt.templateutil.DefaultHTMLTemplate/GetCustomLink/java.lang.Object/0=templates.workNotification.custom.GetCustomLinkHTMLFile

//Inside General_localization.html

<script language=windchill>

<!--

     processSubTemplate action=GetCustomLink

  -->

</script>

//Inside codebase/templates/workNotification/custom/GetCustomLinkHTMLFile_localization.html

<script language=Windchill><!-- getCustomLink --></script>

15-Moonstone
January 6, 2017

Take a look at http://support.ptc.com/cs/help/windchill_hc/wc110_hc/

Still template processor.