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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Translate the entire conversation x

Cascading attribute displays internal name of global enumeration from PersistableAdapter

Dobi
17-Peridot

Cascading attribute displays internal name of global enumeration from PersistableAdapter

Version: Windchill 13.0

 

Use Case: Using PersistableAdapter to get IBA values of a cascading attribute, the obj.get("attribute_internal_name") for the cascading attributes specifically returns the internal names of the underlying global enumeration item instead of the display name.


Description:

I have a WTPart subtype that has several cascading attributes. 

 

 

Is this expected behavior? Is there a way to get the display value of the enumerated value that is used to set up the cascading attribute?

PersistableAdapter, when used to get the original value ("Reason for Classification" in my case) returns the enumerated value list internal value instead of the display value. 

 

Setup:

Dobi_0-1763158264859.png

 

ACCEPTED SOLUTION

Accepted Solutions
Dobi
17-Peridot
(To:Dobi)

As it turns out, this solves the problem: Print enumeration display value 

A few notes I picked up. 

  • We're on Windchill 13. EnumerationEntryIdentifier, LWCEnumerationEntryValuesFactory, and LocalizedValues don't exist in the JavaDoc (depricated, or otherwise). Without this being written down in full detail in that post I would have struggled to find my way through it. 
  • AttributeTypeSummary REQUIRES that the Locale is added in the persistabelAdapter. Otherwise it doesn't work. Would be nice to have that noted in the AttributeTypeSummary class somewhere...
  • This continues to work with: com.ptc.core.lwc.server.PersistableAdapter obj = new com.ptc.core.lwc.server.PersistableAdapter(prt,null,locale, new com.ptc.core.meta.common.DisplayOperationIdentifier()); The last bit doesn't have to be null

View solution in original post

2 REPLIES 2
Dobi
17-Peridot
(To:Dobi)

As it turns out, this solves the problem: Print enumeration display value 

A few notes I picked up. 

  • We're on Windchill 13. EnumerationEntryIdentifier, LWCEnumerationEntryValuesFactory, and LocalizedValues don't exist in the JavaDoc (depricated, or otherwise). Without this being written down in full detail in that post I would have struggled to find my way through it. 
  • AttributeTypeSummary REQUIRES that the Locale is added in the persistabelAdapter. Otherwise it doesn't work. Would be nice to have that noted in the AttributeTypeSummary class somewhere...
  • This continues to work with: com.ptc.core.lwc.server.PersistableAdapter obj = new com.ptc.core.lwc.server.PersistableAdapter(prt,null,locale, new com.ptc.core.meta.common.DisplayOperationIdentifier()); The last bit doesn't have to be null
HelesicPetr
22-Sapphire II
(To:Dobi)

Hi @Dobi 

If something is not in the JavaDoc that does not mean you can not use it.

It is not just officially supported for customization but if it works, then it works. there is just a risk that PTC would change the API in the future. But it is your responsible to keep in mind it.  

 

Some old API functions are not in the Windchill 13+ because PTC removed most of depreciated apis that had been selected as depreciated more then 10 years ago 😄 

 

PetrH

Announcements

Top Tags