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:

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">
          <activiti:out source="someVariableInSubProcss" target="nameOfVariableInMainProcess" />

    <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.