<?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 Why does it risk to update a variable during a process ? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/why-does-it-risk-to-update-a-variable-during-a-process/m-p/179124#M132254</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;BR /&gt;&lt;SPAN&gt;I'm looking to update a variable and I found this topic&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.activiti.org/content/how-update-process-variable" rel="nofollow noopener noreferrer"&gt;http://forums.activiti.org/content/how-update-process-variable&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mr Barrey told this &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"Why would you want that? [update a process variable] It would screw the transaction going on at that time"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Why do we do to avoid that ? Is there a workaround ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my case I have a subprocess because several people have to accomplish a task . &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I created a List of string to include people Id and to inject in a process&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Actually, when process is started and&amp;nbsp; before subprocess, I have to check if any other people have to accomplish a task in subprocess or not (because between the beginning of the whole process and the subproccess call , it exist a while of 14 days.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So before starting process I do this&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;List&amp;lt;String&amp;gt; people=&amp;nbsp; new ArrayList&amp;lt;String&amp;gt;();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;String person1= "id1";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;String person2= "id2";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;String person3= "id3";&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;superiors.add(person1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;superiors.add(person2);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;superiors.add(person3);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Map&amp;lt;String, Object&amp;gt; variableMap = new HashMap&amp;lt;String, Object&amp;gt;();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;variableMap.put("peopleForSubprocess", people);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Processstart…. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BUT when process is started , if a person is detected to accomplish the subprocess, we have to update the variable :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;List&amp;lt;String&amp;gt; people = (List&amp;lt;String&amp;gt;) runtimeService.getVariable(processId, "peopleForSubprocess");&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;String sup4 = "id4";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;people .add(sup4 );&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;runtimeService.setVariable(task.getExecutionId(), "peopleForSubprocess", people );&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can we do that ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Or is it better to create a new variable ? (but it seems impossible because , a subprocess can get only one collection)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Jun 2014 09:44:32 GMT</pubDate>
    <dc:creator>fabrice1</dc:creator>
    <dc:date>2014-06-02T09:44:32Z</dc:date>
    <item>
      <title>Why does it risk to update a variable during a process ?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/why-does-it-risk-to-update-a-variable-during-a-process/m-p/179124#M132254</link>
      <description>Hello,I'm looking to update a variable and I found this topichttp://forums.activiti.org/content/how-update-process-variableMr Barrey told this "Why would you want that? [update a process variable] It would screw the transaction going on at that time"Why do we do to avoid that ? Is there a workaround</description>
      <pubDate>Mon, 02 Jun 2014 09:44:32 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/why-does-it-risk-to-update-a-variable-during-a-process/m-p/179124#M132254</guid>
      <dc:creator>fabrice1</dc:creator>
      <dc:date>2014-06-02T09:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: Why does it risk to update a variable during a process ?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/why-does-it-risk-to-update-a-variable-during-a-process/m-p/179125#M132255</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;SPAN&gt;I would say, that you can update variable in the subprocess without any concerns.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;org.activiti.engine.test.bpmn.subprocess.SubProcessTest#testDataObjectScope&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;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 07:12:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/why-does-it-risk-to-update-a-variable-during-a-process/m-p/179125#M132255</guid>
      <dc:creator>martin_grofcik</dc:creator>
      <dc:date>2014-06-03T07:12:26Z</dc:date>
    </item>
  </channel>
</rss>

