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
Good day to all,
Does anyone knows a way to retreived the name of the approver once the promotion request is completed then sent this name to an attribute then show this name on the Proe drawing???
Basically I need to show on the drawing who has approved to have this name on the PDF generated by the publisher!
OK I found a portion of solution,
First create a new attribute attach to EPMdoc (In my case APPROVE_BY. )
Save as the promotion approval request out of the box.
Then in the workflow add new variables with type java.lang.string.
Then in the activity add this variable and in the transition tab select the approve transition and add the following java code
"try {
wt.org.WTPrincipal currentUser = wt.session.SessionHelper.manager.getPrincipal();
APPROVE_BY = currentUser.getName();
}"
Now I need to update the attribute. any ideas!
Have you found a solution for your problem? I´ve actually followed your advice with the getPrincipal() function. But this returns Administrator all the time. May be because the Workflow is processed through the administrator. The requestor and approver are normal users and non administration users.
And what about passing the attributes back to Pro/E?
Any suggestion?