title: Terminate process instance in jBPM 6
body: <p>There's similar issue at
  <a href="https://stackoverflow.com/questions/27910474/terminate-process-at-any-step-jbpm">Terminate process at any step (jbpm)</a></p>
  
  <p>Similarly, I'd like to implement the ability to terminate the process instance at any task (script task, user task, service task). I can try to add a gateway with an intermediate catch event for each single task in my workflow. But it seems inefficient and makes the bpm diagram cluttered. </p>
  
  <p>In Oracle BPM, it's easy to have a <code>Message Wait</code> event and an automatic task where I can do <code>this.action=ABORT</code>. </p>
  
  <p><img src="https://i.stack.imgur.com/dDEPw.png" alt="Oracle BPM Terminate"></p>
  
  <p>Similarly in my jBPM process, an user would send a "terminate" command through an UI which would terminate the process. Before termination, however, the process will do some post processing (i.e.,: update db table or send an email to notify users of termination) which I'd like to perform inside a custom work item handler. An example of the workflow would like look this. I know that this doesn't conform to the bpm specification that an user task should have one incoming and one outgoing connection.</p>
  
  <p><img src="https://i.stack.imgur.com/hvNUG.png" alt="Example workflow with termination signal"></p>