I wonder if there is an approach to get the defined output mapping parameters for a task. I don't want to hardcode the output parameter name when completing a task. I can define the mapping parameter following certain name convertion. so that I can get the list, iterate over it and find the value for each item via reflection.
you can read that up from the process definition. version 6.1 comes with draft implementation of a service that can do that for you and in 6.2 there is ready services api for doing that as well. So assuming you use jbpm embedded in you application you might want to use that approach.