You need to take it out from process instance:
ProcessInstance pi = ksession.getProcessInstance(id);
That will give you access to process variables.
thanks for the quickly response, but I have a string as "id", not a long
I resolved with getid();
XD thanks Maciej
Instead of the variables can I take a instance of class that I created in a script Task??