The task name (and I'm guessing a bit at this point) might be null there because you've already passed out of the task node at the point where your handler is getting called.
One workaround solution that comes to mind is to have an action on the nodeEnter event of your task node that stores the name of the task in a Process Variable. Then, in your transition action, you can retrieve the name of the last task by reading the value of the process variable, which should persist throughout the execution of the entire process.
There's an example in section 3.3 of the user guide "http://docs.jboss.org/jbpm/v3/userguide/tutorial.html#d0e622".
Hope that helps![/url]
Thanks a lot for the help Octomac.
I'll try it.