Hi,
Yes, it will be unique for that session, or fully unique across sessions if you use persistence.
The getTaskByWorkItemId() method uses asynchronous communication, so you need to provide a response handler that will be called asynch. and return the result. Simply use the BlockingGetTaskResponseHandler if you want to get the result synchronously.
Kris