title: Activiti - A Gateway to stop all parallel flows?
body: <p>We are using the <a href="http://www.activiti.org/" rel="noreferrer">Activiti</a> framework to construct decoupled business processes that will handle specific messages. </p>
  
  <p>BPMN has a notation <code>Parallel Gateway</code>, which allows us to create flows of tasks that go in "parallel". But is there a mechanisms (a Gateway) to start <strong>parallel flows</strong> but which will kill other ones as soon as one of the parallel flows finishes? </p>
  
  <p>For example:</p>
  
  <pre><code>StartEvent -&gt; ParallelGateway (fork) -&gt; {FlowA, FlowB, FlowC} -&gt; ParallelGateway (join) -&gt; EndEvent
  </code></pre>
  
  <p>If <code>FlowB</code> finishes first, the <strong>join Gateway</strong> must NOT wait for other ones to finish, stop them (so that they won't need to be executed to the end) and proceed to the next flow (in the example it's an EndEvent).</p>
  
  <p>Any ideas how to achieve that?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Found this <a href="http://forums.activiti.org/content/exclusive-join-forked-parallel-gateway-executions" rel="noreferrer">thread</a> but unfortunately this solution doesn't stop other flows.</p>