Response from process to rest service

Hi,

Can you please tell me how to get the response from process engine like some variables should be send back to rest response.

I found this, RestService Response from Process - #14 by Sunil_R
but this pretty old. Is there any imrproved thing here ?