<?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 NPE While deleting a processInstance in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/npe-while-deleting-a-processinstance/m-p/164689#M118417</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a scenario were i invoke my application's service API from within activiti's ServiceTask. Now in case if the Service API throws an exception, i would like to terminate the processInstance, and also retain the history details as i require it to fetch the status of the workflow at a later point of time using the processInstanceId.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;To achieve this I wrapped all the ServiceTask logic inside a try catch block and then whenever an exception occurs i catch the exception and would like to terminate the processInstance using the runtimeService.deleteProcessInstance(pid). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Theoretically i expected&amp;nbsp; things to work, but Activiti(5.11) throws an NPE @ AbstractBpmnActivityBehaviour.hasCompensationHandler(), Is it an expected behavior? or a bug with activiti? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The issue seems to be similar to the below:- &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.activiti.org/content/npe-511-when-deleting-process-service-task#comment-19035" rel="nofollow noopener noreferrer"&gt;http://forums.activiti.org/content/npe-511-when-deleting-process-service-task#comment-19035&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could anyone please help me out in achieving the said behavior?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One way which i could think of is to wrap the tasks inside a sub-process and to have an error Boundary event on the sub-process boundary which ends the execution. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any way of triggering an End-Event from within the ServiceTask programmatically ??&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could anyone please guide me in the right direction.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Aug 2013 13:45:07 GMT</pubDate>
    <dc:creator>vivverma</dc:creator>
    <dc:date>2013-08-29T13:45:07Z</dc:date>
    <item>
      <title>NPE While deleting a processInstance</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/npe-while-deleting-a-processinstance/m-p/164689#M118417</link>
      <description>Hi,I have a scenario were i invoke my application's service API from within activiti's ServiceTask. Now in case if the Service API throws an exception, i would like to terminate the processInstance, and also retain the history details as i require it to fetch the status of the workflow at a later po</description>
      <pubDate>Thu, 29 Aug 2013 13:45:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/npe-while-deleting-a-processinstance/m-p/164689#M118417</guid>
      <dc:creator>vivverma</dc:creator>
      <dc:date>2013-08-29T13:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: NPE While deleting a processInstance</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/npe-while-deleting-a-processinstance/m-p/164690#M118418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;any solutions/recommendations?? &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 Aug 2013 06:33:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/npe-while-deleting-a-processinstance/m-p/164690#M118418</guid>
      <dc:creator>vivverma</dc:creator>
      <dc:date>2013-08-31T06:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: NPE While deleting a processInstance</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/npe-while-deleting-a-processinstance/m-p/164691#M118419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The best way to do this is add an error boundary event to the service task or an exclusive gateway after the service task that checks if the exception has occurred. If an exception occurred it goes to an end event otherwise it just continues the normal flow.&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, 02 Sep 2013 17:11:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/npe-while-deleting-a-processinstance/m-p/164691#M118419</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2013-09-02T17:11:51Z</dc:date>
    </item>
  </channel>
</rss>

