Hi .
I'd like to update a couple of attribute belonging to a EPMDocument associated with a PromotionNotice object in a promotion request workflow.
I've chosen the following method to accomplish this:
LWCNormalizedObject obj = new LWCNormalizedObject(my_persistable,null,Locale.US,new UpdateOperationIdentifier());
obj.load("attributeA","attribtueB");
obj.set("attributeA",Boolean.TRUE);
obj.set("attribtueB","Hello World");
obj.apply();
PersistenceHelper.manager.modify(my_persistable);
When i make a new promotion request from the windchill UI the attributes are'nt updated at all. Looking through the logfile led me to this error.
(wt.vc.wip.wipResource/47) wt.vc.wip.WorkInProgressException: The object is not checked out and cannot be modified.
I've concluded that it's (PersistenceHelper.manager.modify(my_persistable);) that trows the error.
my_persistable is set by iterating through the query result returned from a call to MaturityHelper.service.getPromotionTarget(PromotionNotice).
What am i doing wrong here ?