cancel
Showing results for 
Search instead for 
Did you mean: 

How to return an object or value from the process

purna_cherukuri
Champ in-the-making
Champ in-the-making
Hi,

I am new to Activiti. I am using Activiti5.9 and trying out with some simple use cases. 
I am trying to perform service orchestration flow with two webservices and some conditional logic. 
My aim is to collate both the webservice xml responses into one and return back from this process. 
Calling the webservices and collating the xml is working fine.  But how to return the response xml back to the client? 

I tried populating one process variable from my collation java task and trying to access it from my processController class(which starts the process). 
For this, I am using RunTimeService's getVariable method by passing executionId and variable name. 
But by the time i come to this statement, Process execution is completed and it is not able to resolve that particular processId from *_RE_* tables.  This is causing ActivitiException.   

What is the best solution or practice for these kind of scenarios.  How to return a String/Object from my process to my controller class?

Thanks in advance.
1 REPLY 1

trademak
Star Contributor
Star Contributor
Hi,

I think your approach is okay, but you'll have to use the HistoryService to retrieve process variables from completed process instances instead.

Best regards,