you can get the new value by : ret = instance.getVariable(variableName);
you just need to be sure that your java code is executed after your ret variable was updated (after the exeution of your script).
I am sorry that it can't work.
the varible instance of Class ProcessInstance hava no such functions as getVarible(). So this is not a good approach.
I am sure that ret was updated after the execution of my script. I print out the result in my script and it is 2.
Thank you anyway.
you have to cast the processInstance to WorkflowProcessInstanceImpl:
WorkflowProcessInstanceImpl processInstance = (WorkflowProcessInstanceImpl) ksession.getProcessInstance(processInstanceId)
WorkflowProcessInstanceImpl instance=(WorkflowProcessInstanceImpl) ksession.startProcess("org.jbpm.sample.hello",paras);
this is working from me
That's a good idea!
Thank you very much!!