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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

How do i get the display name of a role?

sdrzewiczewski
7-Bedrock

How do i get the display name of a role?

I have some code that will grab information from the assigned activites of a workflow. One of the items I grab is the Role. Problem is, it's returning the enumerations key, and not it's display name. Below is a snippet of the code...


...

WTArrayList voting;
try {
voting = (WTArrayList)WfEngineHelper.service.getVotingEvents(self, null, null, null);
Object anItem = null;
WfVotingEventAudit aVote = null;
if (voting != null && !voting.isEmpty())
{
Iterator voteIterator = voting.iterator();

while (voteIterator.hasNext())
{
ObjectReference anItemRef = (ObjectReference)voteIterator.next();
anItem = anItemRef.getObject();

if (anItem instanceof WfVotingEventAudit)
{
MyVote currentVote = new MyVote();
aVote = (WfVotingEventAudit)anItem;
currentVote.setRole(aVote.getRole().toString());

...


I've tried using

  • aVote.getRole().getFullDisplay()
  • aVote.getRole().getDisplay()
  • aVote.getValueSet().toString()

All of which returned the key, not the value.

1 REPLY 1

Well it appears my code was correct. I must not have cleared something correctly... That's what I get for doing work after hours... 🙂
Top Tags