Hi Roxy,
Do you want to set "process variable" or "task output variable"?
Your code seems to try to set "process variable"
How about setting the variable via the Task Output Variable and then map those task output to the process variable that you want to set. That works with JBPM5.4..
Regards,
Thomas Setiabudi