Hello!
I am trying to get the process variables content before the process finishes, while it is executing async tasks.
Let’s say I have a process with 2 tasks in this order: Task01 and Task02.
Task01 is synchronous, and Task02 is marked as “Asynchronous before”.
Task01 creates a process variable named Var01 and set a value “Hello!”.
Then I start this process using Java API using the following Java statement:
runtimeService.createProcessInstanceByKey(“processIdentification”).executeWithVariablesInReturn();
I noticed that after Task01 completes, the statement createProcessInstanceByKey returns the thread execution to my Java program, but var01 is not returned in the instance that the method returns.
I also noticed that after Task02 completes and the process finishes, I am able to get the variable var01 using the History Service from the Process Engine, but I need to get the var01 content as soon as the thread execution returns to my Java program, is it possible to do without making both Task01 and Task02 synchronous?
Thanks!
Fernando