cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Updating EPMDocument attributes through a promotion request

Highlighted
Newbie

Updating EPMDocument attributes through a promotion request

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 ?

1 REPLY 1

Re: Updating EPMDocument attributes through a promotion request

As I understand it, the workflow will have to check-out the files to a workspace (one that exists for wcadmin to use, but this can be in any context), then it can make the modifiactions to the files and check them in again.

Hope this helps !