Shannon, sorry for beeing not clear about that by "programmatically" I meant that you have to do it in Java code and I see no way to do it in the jDPL definition, variables in jPDL are execution scoped like HuiSheng said.
HuiSheng, I hacked that in my project but I have other customizations too, so not sure if this works in a plain jBPM4.4, however the variable table in the database is linked to the task with a hibernate map definition that has cascade="all-delete-orphan" so the variable should be deleted when the task is removed from the task table... but I am still trying to figure out the details