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

I want to retrieve the attribute value of the clasification node

RaikarRaghu
12-Amethyst

I want to retrieve the attribute value of the clasification node

Version: Windchill 12.1

 

Use Case: i have the string attribute called "Cappio" it has update based on the classification attribute value. step 1: I created the Classification tree, in the Bolt node i created the attribute "M" it having the enumeration list. Step 2: i need to retrieve the attribute value, update in the "Cappio" attribute using Persistable Adapter


Description:

 

# I am getting the default value of the attribute, but i don't want the default value i need the value that is stored in the attribute

 

public static String getEnumerationItemDisValue(String Nodeview, String accoppiamento) throws WTException {

String displayValue = null;

boolean enforce = SessionServerHelper.manager.setAccessEnforced(false);

QuerySpec qs = new QuerySpec();

int enumerentry = qs.appendClassList(LWCEnumerationEntry.class, true);

int enumvalue = qs.appendClassList(LWCLocalizablePropertyValue.class, true);

int enumlink = qs.appendClassList(LWCEnumerationEntryLink.class, false);

int enumpv = qs.appendClassList(LWCPropertyValue.class, false);

int enummaster = qs.appendClassList(LWCMasterEnumerationDefinition.class, false);

int pd = qs.appendClassList(LWCPropertyDefinition.class, false);

 

qs.appendWhere(new SearchCondition(LWCMasterEnumerationDefinition.class, WTAttributeNameIfc.ID_NAME,

LWCEnumerationEntryLink.class, "enumerationReference.key.id"), new int[]{enummaster, enumlink});

qs.appendAnd();

qs.appendWhere(new SearchCondition(LWCPropertyValue.class, "holderReference.key.id",

LWCEnumerationEntryLink.class, "thePersistInfo.theObjectIdentifier.id"), new int[]{enumpv, enumlink});

qs.appendAnd();

qs.appendWhere(new SearchCondition(LWCEnumerationEntry.class, WTAttributeNameIfc.ID_NAME,

LWCEnumerationEntryLink.class, "entryReference.key.id"), new int[]{enumerentry, enumlink});

qs.appendAnd();

qs.appendWhere(new SearchCondition(LWCEnumerationEntry.class, WTAttributeNameIfc.ID_NAME,

LWCLocalizablePropertyValue.class, "holderReference.key.id"), new int[]{enumerentry, enumvalue});

qs.appendAnd();

qs.appendWhere(new SearchCondition(LWCLocalizablePropertyValue.class, "propertyReference.key.id",

LWCPropertyDefinition.class, WTAttributeNameIfc.ID_NAME), new int[]{enumvalue, pd});

qs.appendAnd();

qs.appendWhere(new SearchCondition(LWCMasterEnumerationDefinition.class,

LWCMasterEnumerationDefinition.NAME, SearchCondition.EQUAL, enumName), new int[]{enummaster});

qs.appendOrderBy(LWCPropertyValue.class, "value", false);

 

QueryResult qr = PersistenceHelper.manager.find((StatementSpec) qs);

while (qr.hasMoreElements()) {

Object[] o = (Object[]) qr.nextElement();

LWCEnumerationEntry entry = (LWCEnumerationEntry) o[enumerentry];

LWCLocalizablePropertyValue entryValue = (LWCLocalizablePropertyValue) o[enumvalue];

if (entry.getName().equals(accoppiamento)) {

displayValue = entryValue.getValue();

System.out.println("Display Name of " + accoppiamento + " is " + displayValue);

break;

}

}

SessionServerHelper.manager.setAccessEnforced(enforce);

return displayValue;

}

 

1 REPLY 1

Hi @RaikarRaghu,

Thank you for your question. 

Your post has not yet received any response. I am replying to raise awareness. Hopefully, another community member will be able to help.

Also, feel free to add any additional information you think might be relevant. It sometimes helps to have screenshots to better understand what you are trying to do.

 

Regards,

Vivek N
Community Moderation Team

Announcements
Top Tags