Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hi,
I need to include Requested Promotion State and Process Initiator in Promotion Request Task notification email, send to Approver. I will change Task notification email template to include Process variables via getProcessVariable command.
Both Requested Promotion State and Process Initiator are already included in activityAttributes command in email template, but this command also includes bunch of other stuff, which is not needed. I did not find a way to customize activitaAttributes command and also there is no way to translate, what it returns.
So, I need a sample Java code to get Requested Promotion State and Process Initiator in workflow Expression robot extracted from PBO, in my case wt.maturity.PromotionNotice.
Thanks in advance.
Tomaz
Solved! Go to Solution.
Tomaz,
You can use below API's to get requestor/creator of promotion request and target state.
PromotionNotice pn=POB;
String matuarityState=pn.getMaturityState().toString();
String creatorName=pn.getCreatorFullName();
Instead of changing, notification template you can add requester and state in Activity instruction, sot that it will be included in task assignment email
Hope it help!!!
Thanks
Shreyas
Tomaz,
You can use below API's to get requestor/creator of promotion request and target state.
PromotionNotice pn=POB;
String matuarityState=pn.getMaturityState().toString();
String creatorName=pn.getCreatorFullName();
Instead of changing, notification template you can add requester and state in Activity instruction, sot that it will be included in task assignment email
Hope it help!!!
Thanks
Shreyas
Hello Shreyas,
those are exactly the methods I was looking for. Thanks a lot. Sometimes, finding correct function in Windchill API is real PIA.
It is true, that I can include both variables in Activity instructions, but then I have to include activityAttributes command in mail template, which also includes other information, which are not needed and just confuse the users. I want my mail notification plain and with exact info they need.
Anyway, thanks again for help.
BTW, do you know maybe, how to get back Display Name of LC state instead of Key value? getMaturityState returns Key value and then I need Case statement to display proper name.