I haven't found any direct solution yet, but I solved the problem in an unconventional way.
I write here the solution I have adopted, it may be useful for other people.
- I put the variable name and value in an XML file that it is read at process invokation (this file is already read 'cause contains the process logic for various task):
- That "node" in XML is then appended in the input XML file feeded into form;
- Now in form I'm able to get the value and use it in javascript.
Mauro