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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Has anyone tried overriding Windchill workflow email notification..

PreetiGupta
14-Alexandrite

Has anyone tried overriding Windchill workflow email notification..

All the supported methods available does not meet the requirements.

6 REPLIES 6

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)?

What do you want to do and which version of WC

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

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>

If you are using custom code to send email notification in expression robot, which executes at start transition, then you can send email notification for reassign as well.

over ride the method reassign from NmWorkItemCommands and add your code snippet over there.

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

Still template processor.

Top Tags