not tested, but this should work:
- you have to replace the <task-service /> tag in your jbpm.cfg.xml with something like
<object name="taskService" class="your.TaskService">
<field name="commandService" ><ref object="txRequiredCommandService"></field>
<object /> - your.TaskService extends org.jbpm.pvm.internal.svc.TaskServiceImpl and implements your custom method