<?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 cancel a process outside of the process in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/cancel-a-process-outside-of-the-process/m-p/206419#M159549</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm running Seam 2 and Activiti 5.18&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to create and execute a long asynchonous workflow, during the process, the user should be able to cancel the execution of the workflow (from a JSF page, outside scope of the process)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Whenn the process is running, I tried to call the suspendProcessInstanceById and deleteProcessInstance methods of RuntimeService but they have no incidence on the current runing worflow, I mean the processinstance END_DATE is correctly flagged in the db but the process continue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the code&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-java line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;processEngine = seamConfiguredProcessEngine.getProcessEngine();&lt;BR /&gt;RuntimeService runtimeService = processEngine.getRuntimeService();&lt;BR /&gt;pack.setStatus("Cancelled");&lt;BR /&gt;packageDao.merge(pack);&lt;BR /&gt;runtimeService.setVariable(pack.getJbpmProcessId(), "pack", pack);&lt;BR /&gt;runtimeService.suspendProcessInstanceById(pack.getJbpmProcessId());&lt;BR /&gt;runtimeService.deleteProcessInstance(pack.getJbpmProcessId(), "deleteReason");&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;As the process continue, I changed the nodes of the workflow to first get the pack object, check the status and execute my code only if the status is not "Cancelled"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess the process keep the variable in cache, because the object I load from the context do not contain the status Cancelled I set previously, and even if I reload the entity using the entityManager (I can see the updated value in the db througt phpMyAdmin).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How can I stop a process or change the values of the entities of a running process when i am outside of this async process?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Nov 2015 12:08:13 GMT</pubDate>
    <dc:creator>supreme06</dc:creator>
    <dc:date>2015-11-02T12:08:13Z</dc:date>
    <item>
      <title>cancel a process outside of the process</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cancel-a-process-outside-of-the-process/m-p/206419#M159549</link>
      <description>Hello,I'm running Seam 2 and Activiti 5.18I need to create and execute a long asynchonous workflow, during the process, the user should be able to cancel the execution of the workflow (from a JSF page, outside scope of the process)Whenn the process is running, I tried to call the suspendProcessInsta</description>
      <pubDate>Mon, 02 Nov 2015 12:08:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cancel-a-process-outside-of-the-process/m-p/206419#M159549</guid>
      <dc:creator>supreme06</dc:creator>
      <dc:date>2015-11-02T12:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: cancel a process outside of the process</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cancel-a-process-outside-of-the-process/m-p/206420#M159550</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;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;How can I stop a process&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;org.activiti.engine.test.api.runtime.RuntimeServiceTest#testDeleteProcessInstance&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;change the values of the entities of a running process when i am outside of this async process?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;CODE&gt;org.activiti.engine.test.api.runtime.RuntimeServiceTest#testSetVariables&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;In activiti source.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Martin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Nov 2015 08:55:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cancel-a-process-outside-of-the-process/m-p/206420#M159550</guid>
      <dc:creator>martin_grofcik</dc:creator>
      <dc:date>2015-11-03T08:55:33Z</dc:date>
    </item>
  </channel>
</rss>

