How to change my customized attribute of EPMDocutment by API?
- February 8, 2017
- 3 replies
- 4467 views
I want to use API to change my customized attribute of EPMDocument, the attribute setting in Utility as attachment show. Who can help me?
Always failed, the error info is:
Exception in thread "main" java.lang.reflect.InvocationTargetException
at wt.method.RemoteMethodServer.invoke(RemoteMethodServer.java:795)
at com.cisco.whichen2.SetEPMAttribute.main(SetEPMAttribute.java:47)
Caused by: com.ptc.core.meta.container.common.ConstraintException: The value for TestWhichen cannot be changed.
... 2 more
code:
public static void setEPMAttribute(EPMDocument epm, String attribute,
String value) throws Exception {
PersistableAdapter obj = new PersistableAdapter(epm, null,
java.util.Locale.US,
new com.ptc.core.meta.common.DisplayOperationIdentifier());
obj.load(attribute);
obj.set(attribute, value);
obj.apply();
PersistenceHelper.manager.modify(epm);
}

