I do not fully understand the last sentence in your question, but I guess you are asking how to look up the work manager in java:comp/env/..?
You need to configure your work manager in your deployment descriptor such as web.xml, ejb-jar.xml first as below
<resource-ref>
<res-ref-name>wm/MyWorkManager</res-ref-name>
<res-type>commonj.work.WorkManager</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
Then you do JNDI lookup as java:comp/env/wm/MyWorkManager