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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

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

pnierkamp
1-Visitor

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>



Announcements


Top Tags