I want to know how we should assosiate variable to task.
In jbpm_variableinstace table we have a column taskinstance which probably map that variable to task.
How to populate that field???????
You use the taskcontroller mechanism. For more info see the docs : http://docs.jboss.com/jbpm/v3/userguide/taskmanagement.html#taskcontrollers. But attention, the info here is somewhat stale. Use the docs that came with your distribution for the correct version.