The code to get current user.
curUserId()
The code to get current user worker.
Option 1:
HcmWorkerRecId hcmWorkerRecId = HcmWorkerLookup::currentWorker();
Option 2:
HcmWorkerRecId hcmWorkerRecId = HcmWorker::userId2Worker(curUserId());
The code to get current worker name
DirPartyName workerName = HcmWorker::worker2Name(HcmWorker::userId2Worker(curUserId()));