Objective: Change Request/Change Notice Number and description attributes in the Workflow Notification Email.
In the workflow template, Is there a way to add Change Request Description/Number as variables ?
Currently, the email looks like this
But, I'm looking for something like this with Change Request/Notice attributes in the bottom.
Solved! Go to Solution.
Documentation is above. You need to customize the codebase/templates/General*.html files like below. This is mine to show the PBO name and number. The pboNumber is a workflow variable so you can call those out too. This modifies the email subject as it appears.
<html>
<!-- bcwti
--
-- Copyright (c) 1997, 1998 Windchill Technology, Inc. All Rights Reserved.
--
-- This software is the confidential and proprietary information of
-- Windchill Technology. You shall not disclose such confidential information
-- and shall use it only in accordance with the terms of the license
-- agreement you entered into with Windchill Technology.
--
-- ecwti
-->
<SCRIPT LANGUAGE=Windchill> <!-- beginSubject --> </SCRIPT>
<SCRIPT LANGUAGE=Windchill> <!-- getActivityName --> </SCRIPT>
<SCRIPT LANGUAGE=Windchill> <!-- addText text=" - " --> </SCRIPT>
<SCRIPT LANGUAGE=Windchill> <!-- getProcessVariable varName="pboNumber" --> </SCRIPT>
<SCRIPT LANGUAGE=Windchill> <!-- addText text=" - " --> </SCRIPT>
<SCRIPT LANGUAGE=Windchill> <!-- getPrimaryBusinessObjectName --> </SCRIPT>
<SCRIPT LANGUAGE=Windchill> <!-- endSubject --> </SCRIPT>
<head>
<SCRIPT LANGUAGE=Windchill>
<!--
getStyleSheetProps
-->
</SCRIPT>
</head>
<body>
<font face="Arial, Helvetica, sans-serif">
<SCRIPT LANGUAGE=Windchill> activityNotificationUrl </SCRIPT>
</font>
<SCRIPT LANGUAGE=Windchill>
<!--
activityAttributes notification=true
-->
</SCRIPT>
</body>
</html>
Next I modified the task Instructions to include data which would appear in the subject of the email:
The final result is like this:
Documentation is above. You need to customize the codebase/templates/General*.html files like below. This is mine to show the PBO name and number. The pboNumber is a workflow variable so you can call those out too. This modifies the email subject as it appears.
<html>
<!-- bcwti
--
-- Copyright (c) 1997, 1998 Windchill Technology, Inc. All Rights Reserved.
--
-- This software is the confidential and proprietary information of
-- Windchill Technology. You shall not disclose such confidential information
-- and shall use it only in accordance with the terms of the license
-- agreement you entered into with Windchill Technology.
--
-- ecwti
-->
<SCRIPT LANGUAGE=Windchill> <!-- beginSubject --> </SCRIPT>
<SCRIPT LANGUAGE=Windchill> <!-- getActivityName --> </SCRIPT>
<SCRIPT LANGUAGE=Windchill> <!-- addText text=" - " --> </SCRIPT>
<SCRIPT LANGUAGE=Windchill> <!-- getProcessVariable varName="pboNumber" --> </SCRIPT>
<SCRIPT LANGUAGE=Windchill> <!-- addText text=" - " --> </SCRIPT>
<SCRIPT LANGUAGE=Windchill> <!-- getPrimaryBusinessObjectName --> </SCRIPT>
<SCRIPT LANGUAGE=Windchill> <!-- endSubject --> </SCRIPT>
<head>
<SCRIPT LANGUAGE=Windchill>
<!--
getStyleSheetProps
-->
</SCRIPT>
</head>
<body>
<font face="Arial, Helvetica, sans-serif">
<SCRIPT LANGUAGE=Windchill> activityNotificationUrl </SCRIPT>
</font>
<SCRIPT LANGUAGE=Windchill>
<!--
activityAttributes notification=true
-->
</SCRIPT>
</body>
</html>
Next I modified the task Instructions to include data which would appear in the subject of the email:
The final result is like this:
I've updated General, General_en_GN, General_en_US html files.
But since the template in my workflow is NotificationRobot template, I am wondering if I should change the NotificationRobot html files instead of General.* html files.
Next, Does the variable need to show up in the dropdown for it to work?
This is the output so far. My email notification has {pboNumber} and {pboDescription} variable names instead of their values. Please let me know if I'm missing something.
Hi @RG_10753677
Sure you need to update the correct html template. So if you use notification robot you need to update that one.
If the variables do not exist then it will not be shown in the email.
You need to create the variables in the workflow and fill up with correct values by code.
PetrH
pboNumber and pboDescription are already existing variables. Can you guide me how/where do I create them? TIA
Hi @RG_10753677
If the variables exist why do you ask how to create it?
I guess that you just want to fill them with values as you need.
It depends what is the primaryObject in the workflow. is it change request? notice? task? or something else?
for change notice here is example
wt.change2.WTChangeOrder2 changeOrder = (wt.change2.WTChangeOrder2)primaryBusinessObject;
pboNumber = changeOrder.getNumber();
pboNumber has to exist as a variable and type string.
You need to just add the code to a expression robot of the workflow
the example can be used for any type of object. You just need to change the object type.
an another example from changeTask
wt.change2.WTChangeActivity2 thisActivity= (wt.change2.WTChangeActivity2)primaryBusinessObject;
com.ptc.core.lwc.server.PersistableAdapter obj = new com.ptc.core.lwc.server.PersistableAdapter(thisActivity,null,null,null);
obj.load("name","number");
pboNumber = obj.get("number").toString();
pboName = obj.get("name").toString();
PetrH