Skip to main content
1-Visitor
March 7, 2014
Question

How to update the Softtype attribute and OOTB attribute of WTDocument

  • March 7, 2014
  • 9 replies
  • 5995 views

Hi can any one help me how I can update the WTDocument attributes I have some softtype also. currently I am using Update-Objects to update the objects I am looking for Windchill API

9 replies

1-Visitor
March 7, 2014

public static void updateAttributesValues(Persistable object, String[] attributeNames, Object[] attributeValues) throws WTException

{

if(attributeNames.length != attributeValues.length)

{

throw new WTException("The length of attribute names array is not the same as the length of attribute values array");

}

LWCNormalizedObject lwcNormalizedObject = new LWCNormalizedObject(object, null, null, new UpdateOperationIdentifier());

lwcNormalizedObject.load(attributeNames);

for(int i=0; i<attributeNames.length; i++)

{

lwcNormalizedObject.set(attributeNames[i], attributeValues[i]);

}

lwcNormalizedObject.apply();

}

17-Peridot
March 7, 2014

By the way, LWCNormalizedObject is depricated in PDMLink 10.2.

WindchillJavadoc 10.2:

LWCNormalizedObject is deprecated and is planned to be removed in the next release. Use PersistableAdapter instead.

1-Visitor
March 7, 2014

Hello Bjoern,

I am not able to search the PersistableAdapter class I am using Windchill 10.0 M010 can you tell me the package and if possible can you share code with me ?