<?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 Skipping an async ServiceTask with the ManagementService in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/skipping-an-async-servicetask-with-the-managementservice/m-p/178354#M131484</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In our JavaServiceTask we are calling an external REST-Service that is unfortunately not idempotent. Due to an exception the Activiti execution was rolled back after the service call was made. In the subsequent retries the REST call fails since it already knows the transaction id. We need a way to skip the actual service task execution and move to the next step, which in our case is a complex event gateway with three messages.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using the ManagementService we have wrote this command, that almost does what we want. The problem is that it does not delete the async job for the current task, and that it somehow creates a new ProcessInstanceId, while keeping the ExecutionId the same, I would have expected the opposite behavior.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any tipps what we are missing here?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-java line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;public class PerformOutgoingBehavior implements Command&amp;lt;Boolean&amp;gt;, Serializable {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private final Execution execution;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public PerformOutgoingBehavior(@Nonnull Execution execution) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; super();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.execution = execution;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Boolean execute(CommandContext commandContext) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExecutionEntityManager executionManager = commandContext.getExecutionEntityManager();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExecutionEntity executionEntity = executionManager.findExecutionById(execution.getId());&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new BpmnActivityBehavior().performDefaultOutgoingBehavior(executionEntity)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return true;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;}&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Jul 2014 13:18:12 GMT</pubDate>
    <dc:creator>damokles</dc:creator>
    <dc:date>2014-07-07T13:18:12Z</dc:date>
    <item>
      <title>Skipping an async ServiceTask with the ManagementService</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/skipping-an-async-servicetask-with-the-managementservice/m-p/178354#M131484</link>
      <description>In our JavaServiceTask we are calling an external REST-Service that is unfortunately not idempotent. Due to an exception the Activiti execution was rolled back after the service call was made. In the subsequent retries the REST call fails since it already knows the transaction id. We need a way to s</description>
      <pubDate>Mon, 07 Jul 2014 13:18:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/skipping-an-async-servicetask-with-the-managementservice/m-p/178354#M131484</guid>
      <dc:creator>damokles</dc:creator>
      <dc:date>2014-07-07T13:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: Skipping an async ServiceTask with the ManagementService</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/skipping-an-async-servicetask-with-the-managementservice/m-p/178355#M131485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No, the job won't be deleted in this case. It simply moves the execution pointer further, but leaves the job as-is.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you need it, you really would have to delete the job in the same command.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, can't you solve it more gracefully with a try - catch in the async service task? And then in the catch to the appropiate routing?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2014 13:28:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/skipping-an-async-servicetask-with-the-managementservice/m-p/178355#M131485</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2014-07-07T13:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: Skipping an async ServiceTask with the ManagementService</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/skipping-an-async-servicetask-with-the-managementservice/m-p/178356#M131486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The problem is that the return code of the REST-Service is not descriptive enough to use a try catch for this scenario, since there might be other errors that have the same status code that should be retried. No ideal I know, but that is how it is at the moment.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Deleting the job would not be the problem. Is there anything else I should be aware of?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regarding the new ProcessInstanceId, that was an unfortunate error in our monitoring tool which switched executionId and processInstanceId.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2014 15:33:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/skipping-an-async-servicetask-with-the-managementservice/m-p/178356#M131486</guid>
      <dc:creator>damokles</dc:creator>
      <dc:date>2014-07-07T15:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: Skipping an async ServiceTask with the ManagementService</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/skipping-an-async-servicetask-with-the-managementservice/m-p/178357#M131487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No, if you do a delete of the job, and execute a default bpmn 2.0 leave with the execution - should mimic what the job would normally do.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jul 2014 15:58:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/skipping-an-async-servicetask-with-the-managementservice/m-p/178357#M131487</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2014-07-09T15:58:54Z</dc:date>
    </item>
  </channel>
</rss>

