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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Get names of promotion request workflow participants as variable

skahl
1-Newbie

Get names of promotion request workflow participants as variable

Hello,

does anybody know how to get the names of the people participating in a workflow process (e.g. promotion request) as a variable or attribute? For example, I would like to get the name of the approver so that it can be mapped to the cad-software parameters to have it automatically filled in the table on drawings and so on.

Regards

4 REPLIES 4

Hi,

I am also facing this issue. Approver is out of the box modeled attribute which needs to be mapped to Proe Drawing format.

Can someone help?

I would also like to be able to do this. Have you guys figured out how? What versions of Windchill/CAD program are you running?

Thanks!

GregoryPERASSO
14-Alexandrite
(To:skahl)

Hello

create a workflow global variable:

"approver" type of object: wt.org.WTPrincipalReference

set this code in the complete transition of the task where you want to get the approver (assume it is a task assigned to a single user)

WfAssignedActivity activity= (wt.workflow.work.WfAssignedActivity)self.getObject();

java.util.Enumeration allassig2 = activity.getAssignments();

while (allassig2.hasMoreElements())
{
Object a2= allassig2.nextElement();
java.util.Enumeration balots = ((wt.workflow.work.WfAssignment)a2).getBallots();
while (balots .hasMoreElements())
{
Object bal= balots .nextElement();

approver = ((WfBallot)bal).getVoter();

}
}


the approver can be then cast as a WTUser

(wt.org.WTUser)approver.getPrincipal();

where you will have methods to get the full name, name of the user , etc ....

regards

Gregory

Hi Gregory,

Even after creating the variable "approver" type of object: wt.org.WTPrincipalReference, the check syntax shows error - cannot find variable "approver".

Any suggestions?

Regards

Ishaan Nayyar

Top Tags