Skip to main content
12-Amethyst
August 13, 2015
Solved

How to get Requested Promotion State and Process Initiator in Promotion Request Workflow with Expression robot

  • August 13, 2015
  • 2 replies
  • 3533 views

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

Best answer by satre-2

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

2 replies

satre-21-VisitorAnswer
1-Visitor
August 13, 2015

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

12-Amethyst
August 14, 2015

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.