title: Mule ESB How to exit a transaction gracefully
body: <p>I'm using Mule Studio and my flow has a transaction in it. If a file is not found, i'd like to exit the transaction without throwing an error. Mule Exception stack-traces are huge and ugly in logs. </p>
  
  <p>Is there a way to just die &lt;transaction-end&gt; or something? </p>
  
  <p>At this point I'd consider some form of  tag to stop processing the message all  together. </p>
  
  <p>code to messy to give example but here's an excerpt:</p>
  
  <pre><code>&lt;transactional action="ALWAYS_BEGIN" doc:name="Transactional"&gt;
      &lt;flow-ref name="ingest_provider" doc:name="Ingest Provider"/&gt;
      &lt;flow-ref name="create_asset" doc:name="Create Asset"/&gt;
      &lt;foreach collection="#[payload['Asset Resource']]" doc:name="Foreach Asset Resource"&gt;
          &lt;or-filter doc:name="Only movie or preview"&gt; 
              &lt;expression-filter expression="#[payload['resource_class']=='movie']"/&gt;  
              &lt;expression-filter expression="#[payload['resource_class']=='preview']"/&gt;  
          &lt;/or-filter&gt;
          &lt;expression-transformer expression="payload.put('resource_guid', payload.guid); payload" doc:name="Expression"/&gt;
  
          &lt;choice doc:name="Choice"&gt;
              &lt;when expression="#[!fileExists(new File('${ipvod.ingest.in.av}', payload.Content[0].filename).toString())]"&gt;                           
                  &lt;logger message="Could not locate resource_file=#[new File('${ipvod.ingest.in.av}', payload.Content[0].filename).toString()] for asset_guid=#[flowVars.asset_guid]" level="ERROR" doc:name="Logger"/&gt;
                  &lt;set-payload value="#[asset_guid]" doc:name="Set Payload"/&gt;
  
  &lt;!-- I'd like the code to die here --&gt;
                  &lt;scripting:component doc:name="Script"&gt;
                      &lt;scripting:script engine="Groovy"&gt;&lt;![CDATA[
                                  throw new Exception('File Not Found!')
                      ]]&gt;&lt;/scripting:script&gt;
                  &lt;/scripting:component&gt;
              &lt;/when&gt;
          &lt;/choice&gt;
  </code></pre>