<?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 Handling Exceptions in TaskListeners in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/handling-exceptions-in-tasklisteners/m-p/129840#M91235</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello guys,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have been working on a problem for hours now and cannot find a clean way to solve it. Maybe someone here has a good advice for me?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I want to do is the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a simple process that looks like this:&amp;nbsp; start -&amp;gt; UserTask1 -&amp;gt; UserTask2 -&amp;gt; UserTask3 -&amp;gt; end&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;UserTask2 is activiti:async="true" and has a TaskListener assigned that is triggered by the "create" event. The TaskListener does some EJB logic which could generate exceptions that let the TaskListener fail in its execution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I want to do is define a stable exception handling for this TaskListener which should eg "revert" the process back to UserTask1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately I do not know how to do it. Right now the execution fails and the process instance is suspended.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to take another sequenceFlow in case of an exception in the TaskListener execution? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Why do I need a TaskListener anyway? Well, I want to do the logic at the very moment of the UserTask2 creation and I need the name of UserTask2 for the TaskListener execution.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Jul 2013 10:45:35 GMT</pubDate>
    <dc:creator>uprooter</dc:creator>
    <dc:date>2013-07-19T10:45:35Z</dc:date>
    <item>
      <title>Handling Exceptions in TaskListeners</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/handling-exceptions-in-tasklisteners/m-p/129840#M91235</link>
      <description>Hello guys,I have been working on a problem for hours now and cannot find a clean way to solve it. Maybe someone here has a good advice for me?What I want to do is the following:I have a simple process that looks like this:&amp;nbsp; start -&amp;gt; UserTask1 -&amp;gt; UserTask2 -&amp;gt; UserTask3 -&amp;gt; endUserTask2 is</description>
      <pubDate>Fri, 19 Jul 2013 10:45:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/handling-exceptions-in-tasklisteners/m-p/129840#M91235</guid>
      <dc:creator>uprooter</dc:creator>
      <dc:date>2013-07-19T10:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Exceptions in TaskListeners</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/handling-exceptions-in-tasklisteners/m-p/129841#M91236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can always replace the task-create-listener by a service-task right after the previous user-task. This has the same effect, once the previous task is completed, some code is run. If you throw an exception from the service-task (due to EJB-magic you do), the UserTask2 won't be started yet, and the process is rolled back to UserTask1. Also, it doesn't make sense marking user-tasks as being async, as the only thing a user-task does, is create a Task-entry in the DB and stop the process/execution from executing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Service-task is better suited for executing 'logic'. If you insist on having a task-listener, you can always try-catch the exception and throw a BPMNException instead. This way, you can use a message (boundary) event to go back to user-task1. The advantage of this approach is that the diagram clearly shows that there is a possibility of an functional error.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jul 2013 11:36:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/handling-exceptions-in-tasklisteners/m-p/129841#M91236</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-07-19T11:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Exceptions in TaskListeners</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/handling-exceptions-in-tasklisteners/m-p/129842#M91237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thanks for the quick reply!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The reason I have configured the user task to be async is to let the transaction commit on UserTask1 completion without triggerring the TaskListener of UserTask2 because the TaskListener expects a certain DB state that is updated in the same transaction as UserTask1 completion &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have thought about the option of using a service task as well but it has 2 disantvantages for my use case:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Since it is a generic code in the TaskListener I need the name of the task that the listener is attached to. The service task would have a different name then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. I need the candidate groups defined in the UserTask2 which I can get from the DelegateTask without problems&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jul 2013 12:41:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/handling-exceptions-in-tasklisteners/m-p/129842#M91237</guid>
      <dc:creator>uprooter</dc:creator>
      <dc:date>2013-07-19T12:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Exceptions in TaskListeners</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/handling-exceptions-in-tasklisteners/m-p/129843#M91238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Does activiti support a message boundary event on a user task? I cant figure out how to get it working. It always says &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;org.activiti.engine.ActivitiException: Execution with id '3305' does not have a subscription to a message event with name 'newInvoice'&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Jul 2013 10:30:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/handling-exceptions-in-tasklisteners/m-p/129843#M91238</guid>
      <dc:creator>uprooter</dc:creator>
      <dc:date>2013-07-20T10:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Exceptions in TaskListeners</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/handling-exceptions-in-tasklisteners/m-p/129844#M91239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sounds strange, cause a task has an execution pointing to that specific task. Is is simply a receive message on the bondary of a user task?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 07:55:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/handling-exceptions-in-tasklisteners/m-p/129844#M91239</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2013-07-24T07:55:50Z</dc:date>
    </item>
  </channel>
</rss>

