AnsweredAssumed Answered

Start process synchronously and return results Back

Question asked by smirzai on Jul 17, 2013
Latest reply on Jan 27, 2016 by jubedus
Actually this is a continuation of this topic:
   http://forums.activiti.org/content/starting-process-instance-synchronously


Especially in OLTP or embeded use cases, one wants to run the workflow and get the results synchronously. In some cases there is no real database behind or the performance requirements are too strict to enable historization.

What I would like to suggest, is something like this:

First the output variables should be introduced exactly like subprocess, only for the main process. Here is an example:


<process id="vacationRequest" name="Vacation request">
     <extensionElements>
          <activiti:out source="someVariableInSubProcss" target="nameOfVariableInMainProcess" />
  </extensionElements>

    <startEvent id="request" activiti:initiator="employeeName">  …


then it could be something like :
    Map<String,Object> outcome = myRuntimeService.startInstance("myProcess", vars);

will start the process, wait until it ends, then preserves and returns the result from context and not history tables.
I can try to see how I can implement it. 

Outcomes