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

We are happy to announce the new Windchill Customization board! Learn more.

Updating EPMDocument attributes through a promotion request

dask
1-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
NickD
8-Gravel
(To:dask)

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 !

Top Tags