<?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: Deleting processing instance from API doesn't work in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/deleting-processing-instance-from-api-doesn-t-work/m-p/138568#M97123</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you're using 2 different sources (data-base connections), you should make sure you use JTA with two-phased-commit or something similar. If you're using JPA-integration, we're assuming that the same transaction is used for both activiti and JPA. If this is not the case, it's possible that rollbacks of activiti don't force a rollback of your data. This is not purely activiti-related, but related to any app that uses 2 different DB's in a single "atomic" block of work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;About the first issue, this is the actual implementation… &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt; @Delete&lt;BR /&gt;&amp;nbsp; public void deleteProcessInstance() {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(!authenticate()) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProcessInstance processInstance = getProcessInstanceFromRequest();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; String deleteReason = getQueryParameter("deleteReason", getQuery());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActivitiUtil.getRuntimeService().deleteProcessInstance(processInstance.getId(), deleteReason);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; setStatus(Status.SUCCESS_NO_CONTENT);&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&lt;/CODE&gt;&lt;SPAN&gt;Very straight-forward call to the JAVA-API. We also have test-coverage for this. I'm guessing there is something wrong with the way transaction are handled in your rest-app…&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;/**&lt;BR /&gt;&amp;nbsp;&amp;nbsp; * Test deleting a single process instance.&lt;BR /&gt;&amp;nbsp;&amp;nbsp; */&lt;BR /&gt;&amp;nbsp; @Deployment(resources = {"org/activiti/rest/api/runtime/ProcessInstanceResourceTest.process-one.bpmn20.xml"})&lt;BR /&gt;&amp;nbsp; public void testDeleteProcessInstance() {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("processOne", "myBusinessKey");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ClientResource client = getAuthenticatedClient(RestUrls.createRelativeResourceUrl(RestUrls.URL_PROCESS_INSTANCE, processInstance.getId()));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; client.delete();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; assertEquals(Status.SUCCESS_NO_CONTENT, client.getResponse().getStatus());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Check if process-instance is gone&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; assertEquals(0, runtimeService.createProcessInstanceQuery().processInstanceId(processInstance.getId()).count());&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&lt;/CODE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Jul 2013 08:11:07 GMT</pubDate>
    <dc:creator>frederikherema1</dc:creator>
    <dc:date>2013-07-09T08:11:07Z</dc:date>
    <item>
      <title>Deleting processing instance from API doesn't work</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/deleting-processing-instance-from-api-doesn-t-work/m-p/138566#M97121</link>
      <description>Using Activity 5.13.$ curl -v -X DELETE -u admin http://.../activiti-rest/service/runtime/process-instances/1401HTTP/1.1 204 No Content‍‍‍‍‍Then:$ curl -v -u admin http://.../activiti-rest/service/runtime/process-instances/1401HTTP/1.1 200 OK{&amp;nbsp;&amp;nbsp;&amp;nbsp; "id": "1401",&amp;nbsp;&amp;nbsp;&amp;nbsp; "url": "http://.../activiti-rest/ser</description>
      <pubDate>Fri, 05 Jul 2013 19:08:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/deleting-processing-instance-from-api-doesn-t-work/m-p/138566#M97121</guid>
      <dc:creator>ddossot</dc:creator>
      <dc:date>2013-07-05T19:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting processing instance from API doesn't work</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/deleting-processing-instance-from-api-doesn-t-work/m-p/138567#M97122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There was other strange behaviours like all edits to workflows in the Modeler were silently lost.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But I found out the root cause of the issue: I was using a different database for storing my JPA annotated entities. If I move these tables inside the database used by Activiti, everything works fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The surprising thing is that my entities were correctly hydrated from the other DB and most of Activiti was working, just some features were not working, but not reporting error either.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess the question is: is it possible to use two data sources, one for Activiti and one for custom entities persistence? I imagine the answer is yes and that I did something wrong with the configuration, but having an authoritative answer would be nice.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jul 2013 21:05:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/deleting-processing-instance-from-api-doesn-t-work/m-p/138567#M97122</guid>
      <dc:creator>ddossot</dc:creator>
      <dc:date>2013-07-05T21:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting processing instance from API doesn't work</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/deleting-processing-instance-from-api-doesn-t-work/m-p/138568#M97123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you're using 2 different sources (data-base connections), you should make sure you use JTA with two-phased-commit or something similar. If you're using JPA-integration, we're assuming that the same transaction is used for both activiti and JPA. If this is not the case, it's possible that rollbacks of activiti don't force a rollback of your data. This is not purely activiti-related, but related to any app that uses 2 different DB's in a single "atomic" block of work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;About the first issue, this is the actual implementation… &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt; @Delete&lt;BR /&gt;&amp;nbsp; public void deleteProcessInstance() {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(!authenticate()) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProcessInstance processInstance = getProcessInstanceFromRequest();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; String deleteReason = getQueryParameter("deleteReason", getQuery());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActivitiUtil.getRuntimeService().deleteProcessInstance(processInstance.getId(), deleteReason);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; setStatus(Status.SUCCESS_NO_CONTENT);&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&lt;/CODE&gt;&lt;SPAN&gt;Very straight-forward call to the JAVA-API. We also have test-coverage for this. I'm guessing there is something wrong with the way transaction are handled in your rest-app…&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;/**&lt;BR /&gt;&amp;nbsp;&amp;nbsp; * Test deleting a single process instance.&lt;BR /&gt;&amp;nbsp;&amp;nbsp; */&lt;BR /&gt;&amp;nbsp; @Deployment(resources = {"org/activiti/rest/api/runtime/ProcessInstanceResourceTest.process-one.bpmn20.xml"})&lt;BR /&gt;&amp;nbsp; public void testDeleteProcessInstance() {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("processOne", "myBusinessKey");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ClientResource client = getAuthenticatedClient(RestUrls.createRelativeResourceUrl(RestUrls.URL_PROCESS_INSTANCE, processInstance.getId()));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; client.delete();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; assertEquals(Status.SUCCESS_NO_CONTENT, client.getResponse().getStatus());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Check if process-instance is gone&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; assertEquals(0, runtimeService.createProcessInstanceQuery().processInstanceId(processInstance.getId()).count());&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&lt;/CODE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jul 2013 08:11:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/deleting-processing-instance-from-api-doesn-t-work/m-p/138568#M97123</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-07-09T08:11:07Z</dc:date>
    </item>
  </channel>
</rss>

