-
1. Re: Use of process variables after a startProcess
eaa May 7, 2011 8:30 PM (in response to byungwoojun)Another case of magical casting:
ProcessInstance pi = ksession.startProcess("com.sample.Hello", params);
String result = (String) ((WorkflowProcessInstance)pi).getVariable("Object 1");
Please note that getVariable() returns an Object, so you will need to cast it to the real type.
-
2. Use of process variables after a startProcess
byungwoojun May 7, 2011 9:06 PM (in response to eaa)Hi Esteban,
Thank you very much for sharing your insight!!!
bwj
-
3. Use of process variables after a startProcess
cheney-dut May 9, 2011 9:32 PM (in response to eaa)ProcessInstance pi = ksession.startProcess("com.sample.Hello", params);
String result = (String) ((WorkflowProcessInstance)pi).getVariable("Object 1");
It can get the variables, when the process has no sub-process.
But i have another quertion!
if i set the variables in the parent process instance, how can i get them in the sub-process instance?
Thank you!
-
4. Use of process variables after a startProcess
eaa May 11, 2011 10:39 PM (in response to cheney-dut)If you are using re-usable processes, you need to configure the input/output variable mappings between the parent process and the child process.
I have a test scenario using re-usable subprocesses. You can take a look at it if you want:
https://github.com/esteban-aliverti/JBPM-Samples/tree/master/Simple-SubProcess-Sample
The test class is ReusableSubProcessTest.java.
The processes this test uses are:
Open the bpmn files in eclipse (or in a text editor if you are tough ) and see the mapping I'm talking about.
-
5. Use of process variables after a startProcess
cheney-dut May 12, 2011 2:50 AM (in response to eaa)Thank you all the same although i've learned the solution. Hhe!
Best regards!