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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

How to get the WTPrincipal wo did the checkout of an object?

pnierkamp
1-Newbie

How to get the WTPrincipal wo did the checkout of an object?

Hello,


I'm looking for a way to determine who has checked out an object in Windchill.


I tried it a little bit with this piece of code:

w = CheckInOutTaskLogic.getWorkingCopy(w);
if (CheckInOutTaskLogic.isCheckedOut(w)) {
if (CheckInOutTaskLogic.isCheckedOutByOther(w))
checkedOutBy = CheckInOutTaskLogic.getCheckedOutBy(w);
else
checkedOutBy = SessionHelper.getPrincipal();
}
}

"w" is a Workable and WorkInProgressHelper.isCheckedOut(w) returns true.


But CheckInOutTaskLogic.getCheckedOutBy(w) returns always null.


Is something wrong with this approach?



Thanks in advance

Regards
Philipp Nierkamp

1 REPLY 1

Hi Philipp,

Try the getCheckedOutBy api on checkedout object rather than working
copy.

Workable originalCopy = WorkInProgressHelper.service.originalCopyOf(w);
CheckInOutTaskLogic.getCheckedOutBy(originalCopy) ;


Regards,
Prathap <">http://goo.gl/LuT5>



Top Tags