<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Process start ExecutionListener and exceptions in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/process-start-executionlistener-and-exceptions/m-p/193830#M146960</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a weird behaviour when in an ExecutionListener I have an exception raised by an Activiti Engine API.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Specifically, at start of a certain process I go looking into the deployment for the starting process if a certain file has been uploaded also, like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;blockcode&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RepositoryService repo = execution.getEngineServices().getRepositoryService();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ProcessDefinition pDef = repo.createProcessDefinitionQuery()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .processDefinitionId(execution.getProcessDefinitionId())&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .singleResult();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;InputStream is = repo.getResourceAsStream(pDef.getDeploymentId(), routingName);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// do something with is&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/blockcode&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I mis-read the documentation and overlooked the ActivitObjectNotFoundException (I expected a simple null return value as Class.getResorceAsStream() does, no big deal).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Crazy thing is that if I catch and silence the exception, like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;blockcode&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;try {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; RepositoryService repo = execution.getEngineServices().getRepositoryService();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; InputStream is = repo.getResourceAsStream(pDef.getDeploymentId(), resourceName);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; // do something with is&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;} catch(ActivitObjectNotFoundException&amp;nbsp; aonf) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; log.warn("exta resource not found, skipping")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/blockcode&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The task in the process will execute, but then I will have in the log an exception stack trace from the getResourceAsStream and all the transaction will be rolled back.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Why is that?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(Activiti 5.15.1)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Jul 2014 14:53:55 GMT</pubDate>
    <dc:creator>lmollea</dc:creator>
    <dc:date>2014-07-16T14:53:55Z</dc:date>
    <item>
      <title>Process start ExecutionListener and exceptions</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/process-start-executionlistener-and-exceptions/m-p/193830#M146960</link>
      <description>Hey again,I have a weird behaviour when in an ExecutionListener I have an exception raised by an Activiti Engine API.Specifically, at start of a certain process I go looking into the deployment for the starting process if a certain file has been uploaded also, like this:&amp;lt;blockcode&amp;gt;RepositorySe</description>
      <pubDate>Wed, 16 Jul 2014 14:53:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/process-start-executionlistener-and-exceptions/m-p/193830#M146960</guid>
      <dc:creator>lmollea</dc:creator>
      <dc:date>2014-07-16T14:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: Process start ExecutionListener and exceptions</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/process-start-executionlistener-and-exceptions/m-p/193831#M146961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is another Exception being thrown as well?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you catch the exception then Activiti will not rollback the process instance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 10:14:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/process-start-executionlistener-and-exceptions/m-p/193831#M146961</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2014-07-21T10:14:09Z</dc:date>
    </item>
  </channel>
</rss>

