As far as I can remember, taskInstance.getVariablesLocally() returns a Map of variables used for that specific task instance, and taskInstance.getVariables() will also return a Map of variables, but this time all variables belonging to the entire process, and not just the task instance. Someone correct me if I'm wrong.
Oh and by the way, the API's do show all available methods etc, check your docs directory. eg. \jbpm-jpdl-3.2.2\doc\javadoc-jpdl\index.html and look at TaskInstance class.
To see what the source code actually does, look at stuff like: \jbpm-jpdl-3.2.2\src\jpdl\org\jbpm\taskmgmt\exe\TaskInstance.java
Hope this helps...