<?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: Behavior of process when has throw exceptions in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/behavior-of-process-when-has-throw-exceptions/m-p/94026#M64377</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, it is. Also, check the user guide, more specifically the service task. It has a section on exception strategy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Eg, this is another approach:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;Throwing BPMN Errors&lt;BR /&gt;As of Activiti 5.9, it is possible to throw BPMN Errors from user code inside Service Tasks or Script Tasks. In order to do this, a special ActivitiException called BpmnError can be thrown in JavaDelegates or scripts and since Activiti 5.10 also in expressions and delegate expressions. The engine will catch this exception and forward it to an appropriate error handler, e.g., a Boundary Error Event or an Error Event Sub-Process.&lt;BR /&gt;&lt;BR /&gt;public class ThrowBpmnErrorDelegate implements JavaDelegate {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; public void execute(DelegateExecution execution) throws Exception {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; try {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; executeBusinessLogic();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (BusinessExeption e) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new BpmnError("BusinessExeptionOccured");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;The constructor argument is an error code, which will be used to determine the error handler that is responsible for the error. See Boundary Error Event for information on how to catch a BPMN Error.&lt;BR /&gt;&lt;BR /&gt;This mechanism should be used only for business faults that shall be handled by a Boundary Error Event or Error Event Sub-Process modeled in the process definition. Technical errors should be represented by other exception types and are usually not handled inside a process.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Oct 2012 07:28:22 GMT</pubDate>
    <dc:creator>jbarrez</dc:creator>
    <dc:date>2012-10-03T07:28:22Z</dc:date>
    <item>
      <title>Behavior of process when has throw exceptions</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/behavior-of-process-when-has-throw-exceptions/m-p/94023#M64374</link>
      <description>Is it correct to drop all process data (historic, runtime data), on exception occurrency, it's agreed with the BPM model?If a process not have a userTask or boundaryEvent, the last commit have not exists, so when rolled back, the process would never have existed.&amp;nbsp;&amp;nbsp; Example:startEvent-&amp;gt;serviceTask</description>
      <pubDate>Fri, 28 Sep 2012 18:30:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/behavior-of-process-when-has-throw-exceptions/m-p/94023#M64374</guid>
      <dc:creator>nandoztx</dc:creator>
      <dc:date>2012-09-28T18:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior of process when has throw exceptions</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/behavior-of-process-when-has-throw-exceptions/m-p/94024#M64375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What you are describing is correct. When an exception occurs when executing a process, it's rolled back to the initial state it was in, prior to the API-call (or timer firing) that caused the process to "flow". In case of starting a process-instance, there is indeed NO process created when an exception occurs between process-start and the first wait-state or end-event.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So when you're using external non-transactional resources, you'll have to roll your own solution to overcome this. This is a generic (not activiti-specific) problem, communication with external services…&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 07:12:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/behavior-of-process-when-has-throw-exceptions/m-p/94024#M64375</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2012-10-01T07:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior of process when has throw exceptions</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/behavior-of-process-when-has-throw-exceptions/m-p/94025#M64376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank's &lt;/SPAN&gt;&lt;EM&gt;frederikheremans&lt;/EM&gt;&lt;SPAN&gt;! &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I had this doubt cause this behavior is a little bit weird, but if it is an official bahavior… no problem &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://connect.hyland.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Actually, in my workflows, I use a &lt;/SPAN&gt;&lt;EM&gt;scriptTask&lt;/EM&gt;&lt;SPAN&gt; to call &lt;/SPAN&gt;&lt;EM&gt;serviceTasks&lt;/EM&gt;&lt;SPAN&gt; or logical procedures to execute something. Protecting the code with &lt;/SPAN&gt;&lt;EM&gt;try{}catch&lt;/EM&gt;&lt;SPAN&gt; blocks I can handle the sequence flow, in exceptions or not, according with my business rule. It's a good way to avoid java code modifications and decouple the business rule from the server code. Example: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;scriptTask id="changeCurrentUserPassword" name="Alterar atual senha de usuário" scriptFormat="groovy"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;script&amp;gt; &amp;lt;![CDATA[&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; def userToChangePassword = userService.getUserByLogin(userNameChangePassword);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; userToChangePassword.setPassword(newPassword);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; userEmailChangePassword = userToChangePassword.getPersonEmail();&lt;BR /&gt;&amp;nbsp; try{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; userService.updateUser(userToChangePassword);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; successOnSendRequest = true;&lt;BR /&gt;&amp;nbsp; }catch(Exception e){&lt;BR /&gt;&amp;nbsp;&amp;nbsp; successOnSendRequest = false;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; exceptionOnChangePassword = e.getMessage();&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ]]&amp;gt; &amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/scriptTask&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sequenceFlow sourceRef="changeCurrentUserPassword" targetRef="successOnRequestOrNot"/&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;SPAN&gt;and in my sequenceFlow:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;exclusiveGateway id="successOnRequestOrNot" name="Verificar sucesso ao solicitar nova senha" /&amp;gt;&lt;BR /&gt; &amp;lt;sequenceFlow sourceRef="successOnRequestOrNot" targetRef="successGateway"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;conditionExpression xsi:type="tFormalExpression"&amp;gt;${successOnSendRequest == true}&amp;lt;/conditionExpression&amp;gt;&lt;BR /&gt; &amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt; &amp;lt;sequenceFlow sourceRef="successOnRequestOrNot" targetRef="errorGateway"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;conditionExpression xsi:type="tFormalExpression"&amp;gt;${successOnSendRequest == false}&amp;lt;/conditionExpression&amp;gt;&lt;BR /&gt; &amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;It's a good way to treat exceptions and model the business sequence flow.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It's a pretty good solution?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 13:24:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/behavior-of-process-when-has-throw-exceptions/m-p/94025#M64376</guid>
      <dc:creator>nandoztx</dc:creator>
      <dc:date>2012-10-01T13:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior of process when has throw exceptions</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/behavior-of-process-when-has-throw-exceptions/m-p/94026#M64377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, it is. Also, check the user guide, more specifically the service task. It has a section on exception strategy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Eg, this is another approach:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;Throwing BPMN Errors&lt;BR /&gt;As of Activiti 5.9, it is possible to throw BPMN Errors from user code inside Service Tasks or Script Tasks. In order to do this, a special ActivitiException called BpmnError can be thrown in JavaDelegates or scripts and since Activiti 5.10 also in expressions and delegate expressions. The engine will catch this exception and forward it to an appropriate error handler, e.g., a Boundary Error Event or an Error Event Sub-Process.&lt;BR /&gt;&lt;BR /&gt;public class ThrowBpmnErrorDelegate implements JavaDelegate {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; public void execute(DelegateExecution execution) throws Exception {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; try {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; executeBusinessLogic();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (BusinessExeption e) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new BpmnError("BusinessExeptionOccured");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;The constructor argument is an error code, which will be used to determine the error handler that is responsible for the error. See Boundary Error Event for information on how to catch a BPMN Error.&lt;BR /&gt;&lt;BR /&gt;This mechanism should be used only for business faults that shall be handled by a Boundary Error Event or Error Event Sub-Process modeled in the process definition. Technical errors should be represented by other exception types and are usually not handled inside a process.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2012 07:28:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/behavior-of-process-when-has-throw-exceptions/m-p/94026#M64377</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2012-10-03T07:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior of process when has throw exceptions</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/behavior-of-process-when-has-throw-exceptions/m-p/94027#M64378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can any one tell me like how to get the error message from inside the boundary Error Event or Error Event Sub-Process modeled&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Sep 2015 08:56:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/behavior-of-process-when-has-throw-exceptions/m-p/94027#M64378</guid>
      <dc:creator>yogesh1454</dc:creator>
      <dc:date>2015-09-02T08:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior of process when has throw exceptions</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/behavior-of-process-when-has-throw-exceptions/m-p/94028#M64379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You mean the java exception message? If so, then that's not possible : a typed java exception is mapped to an error. Maybe the BpmnError can accept a custom message, but haven't tried it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2015 09:52:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/behavior-of-process-when-has-throw-exceptions/m-p/94028#M64379</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2015-09-08T09:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior of process when has throw exceptions</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/behavior-of-process-when-has-throw-exceptions/m-p/94029#M64380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is it possible to extract a ActivitiObjectNotFound exception programmatically from within a subprocess, without the use of an error boundary event?&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Apr 2016 10:26:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/behavior-of-process-when-has-throw-exceptions/m-p/94029#M64380</guid>
      <dc:creator>ciarancorson1</dc:creator>
      <dc:date>2016-04-15T10:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior of process when has throw exceptions</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/behavior-of-process-when-has-throw-exceptions/m-p/94030#M64381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No. When would that exception happen?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I can only think of that happening in a custom service task? if so, why not try-catch it?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2016 13:55:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/behavior-of-process-when-has-throw-exceptions/m-p/94030#M64381</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2016-04-20T13:55:02Z</dc:date>
    </item>
  </channel>
</rss>

