Hi Arun,
I am still not getting what purpose the addtion of code will serve.
Can you please give the process details also. I mean have you defined any owner for that task. If you have not assigned it then there may the need to create a user.
I am facing the similar problem. Even if I say complete on the task, the workflow is not going forward.