<?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 Re: How to catch an error from a ServiceTask? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/how-to-catch-an-error-from-a-servicetask/m-p/195592#M148722</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you throw a new BpmnError, and have a boundary event for that error, it will be caught.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Not a generic exception, but a BpmnError.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Jul 2014 09:33:14 GMT</pubDate>
    <dc:creator>jbarrez</dc:creator>
    <dc:date>2014-07-22T09:33:14Z</dc:date>
    <item>
      <title>How to catch an error from a ServiceTask?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-catch-an-error-from-a-servicetask/m-p/195589#M148719</link>
      <description>Hello,I have a Call Activity which contains a Service Task. The service task throws an Exception within the execute method as below://Checking if report returns NULLif(valueString.contains("Nothing")) {&amp;nbsp;&amp;nbsp;&amp;nbsp;System.out.println("Null coming through: " + valueString);&amp;nbsp;&amp;nbsp;&amp;nbsp;execution.setVariable("valueVar",</description>
      <pubDate>Fri, 18 Jul 2014 17:03:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-catch-an-error-from-a-servicetask/m-p/195589#M148719</guid>
      <dc:creator>zlatan316</dc:creator>
      <dc:date>2014-07-18T17:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to catch an error from a ServiceTask?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-catch-an-error-from-a-servicetask/m-p/195590#M148720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes you can throw a BpmnError in your Java delegate and catch it with an error boundary event.&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 08:51:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-catch-an-error-from-a-servicetask/m-p/195590#M148720</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2014-07-21T08:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to catch an error from a ServiceTask?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-catch-an-error-from-a-servicetask/m-p/195591#M148721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The above model however does not work. I throw the error in my execute method, but the flow out of the ErrorBoundaryEvent does not occur. All that happens is my Java code catches the error.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 09:51:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-catch-an-error-from-a-servicetask/m-p/195591#M148721</guid>
      <dc:creator>zlatan316</dc:creator>
      <dc:date>2014-07-21T09:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to catch an error from a ServiceTask?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-catch-an-error-from-a-servicetask/m-p/195592#M148722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you throw a new BpmnError, and have a boundary event for that error, it will be caught.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Not a generic exception, but a BpmnError.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jul 2014 09:33:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-catch-an-error-from-a-servicetask/m-p/195592#M148722</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2014-07-22T09:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to catch an error from a ServiceTask?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-catch-an-error-from-a-servicetask/m-p/195593#M148723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;My Eclipse IDE does not recognize 'BPMNException' as a valid type of Exception. However I see I can throw an ActivitiException which is recognize by Eclipse, but unfortunately this also does not let my flow exit from the ErrorBoundaryEvent.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jul 2014 15:31:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-catch-an-error-from-a-servicetask/m-p/195593#M148723</guid>
      <dc:creator>zlatan316</dc:creator>
      <dc:date>2014-07-22T15:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to catch an error from a ServiceTask?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-catch-an-error-from-a-servicetask/m-p/195594#M148724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You will need to throw BPMNError (org.activiti.engine.delegate.BpmnError) from your delegate class. Once boundary event will capture this error, it will trigger the next task or step which you have associated with boundary event.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jul 2014 18:19:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-catch-an-error-from-a-servicetask/m-p/195594#M148724</guid>
      <dc:creator>sahusunil</dc:creator>
      <dc:date>2014-07-22T18:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to catch an error from a ServiceTask?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-catch-an-error-from-a-servicetask/m-p/195595#M148725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ah yes, so I can throw a BPMNError after referencing the class correctly. However, it will still not move onto the next step of the flow once the error is thrown.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the relevant XML I am using.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;serviceTask id="servicetask6" name="Retrieve Non Submission Report" activiti:class="ssrsrunner.RetrieveNonSubmissionReport"&amp;gt;&amp;lt;/serviceTask&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;boundaryEvent id="boundaryerror1" name="Error" attachedToRef="servicetask6"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;lt;errorEventDefinition&amp;gt;&amp;lt;/errorEventDefinition&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/boundaryEvent&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;sequenceFlow id="flow36" sourceRef="boundaryerror1" targetRef="servicetask7"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;lt;conditionExpression xsi:type="tFormalExpression"&amp;gt;&amp;lt;![CDATA[${submissionPercentageVar == -1}]]&amp;gt;&amp;lt;/conditionExpression&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/sequenceFlow&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and an excerpt of the updated actual code which throws the BPMNError:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if(myRunner.submissionStatsMap.get("totalSubmission").get(0).contains("NaN")) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; System.out.println("Null coming through from Submission %: " + myRunner.submissionStatsMap.get("totalSubmission").get(0));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; execution.setVariable("submissionPercentageVar", -1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; throw new BpmnError("BPMNNull%Error");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 19:07:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-catch-an-error-from-a-servicetask/m-p/195595#M148725</guid>
      <dc:creator>zlatan316</dc:creator>
      <dc:date>2014-07-23T19:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to catch an error from a ServiceTask?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-catch-an-error-from-a-servicetask/m-p/195596#M148726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have discovered what was stopping this issue. I had a condition in my flow leading out of the ErrorBoundaryEvent and the Service task it was attached to. If I removed these the error was caught and the correct path was taken. I wonder why having a flow condition, even though they would evaluate correctly, would stop an error from being caught and allow the flow to continue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also removed a try catch statement from my code which allowed Activiti full control over the handling of the error thrown.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the suggestions all.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 13:04:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-catch-an-error-from-a-servicetask/m-p/195596#M148726</guid>
      <dc:creator>zlatan316</dc:creator>
      <dc:date>2014-07-24T13:04:20Z</dc:date>
    </item>
  </channel>
</rss>

