Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
I do have IBA attribute field on the wizard table. I want to update that attribute without check out and checkin object.
I have tried using following code for that. But getting error message that "Design is not checked out and cannot be modified".
object.load("XXXXX","YYYY","ZZZ");
/* Set value of IBAName soft attribute to IBAValue */
object.set("XXXX", strCNo);
object.set("YYY", strCS);
object.set("ZZZ", strAS);
perObj = object.apply();
perObj = (Persistable) PersistenceHelper.manager.modify(perObj);
There are some methods in wt.iba.value.service which you can use, but PTC does not recommend that.
Please refer to this thread.Re: Update IBA without Checking-Out the Object
Hi Binesh,
Appreciate your prompt response. I will try to evaluate the mentioned package. It would be great if you help with some pseudo code if any.
I got workaround for this: below is the code
PersistableAdapter perAdap = new PersistableAdapter(perObj, null, Locale.US, new UpdateOperationIdentifier());
perAdap.load("XXXX");
perAdap.set("XXXX", str);
perObj= perAdap.apply();
Hi,
You need to persist your modifications :
The following code does what you want and uses the PersistableAdapter.
A direct use of IBAValueDBService may be prohibited by the thought police...
import com.ptc.core.lwc.server.PersistableAdapter
import com.ptc.core.meta.common.UpdateOperationIdentifier
import wt.fc.Persistable
import wt.fc.PersistenceServerHelper
import wt.iba.value.DefaultAttributeContainer
import wt.iba.value.service.IBAValueDBService
import wt.part.WTPart
WTPart p;
PersistableAdapter obj = new PersistableAdapter(p, null, Locale.US, new UpdateOperationIdentifier());
obj.load("SOUS_CHAPITRE");
obj.set("SOUS_CHAPITRE", "Ploum, ploum, tra-la-la");
p = (WTPart)obj.apply();
// Here is the trick
IBAValueDBService ibaserv = new IBAValueDBService();
ibaserv.updateAttributeContainer(p, ((DefaultAttributeContainer)p.getAttributeContainer()).getConstraintParameter(),null,null);
PersistenceServerHelper.manager.update((Persistable)p);
thanks olivier for your prompt help and support.
Please suggest a way to update values on the EPM Document too. As current code is showing some issue like: "Attribute values cannot be added, removed, or changed"
Yes, EPMDocuments cannot be managed with this API.
You need to use EPMWorkspaceHelper.manager.setAttributes, as described in the link below.
Some limitations :