<?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: Issues about persistence of variables in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/issues-about-persistence-of-variables/m-p/147424#M102899</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;Well the idea is that you can/should be able to set variables whenever you want at runtime, right ? After the Activiti Engine has been built and started, you should be allowed to add process variables when you want. For example, in a ScriptTask you can set execution.setVariable("Name", value). I am wondering why my first approach does not work. Setting a variable from a ScriptTask WORKS, this is why I have a dilemma. Why from ScriptTask works, and right after starting the process instance does not ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Because for example UserTask/Form variables are properly saved/persisted. I can retrieve them at any time after they are created. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;return this.processEngine.getRuntimeService().getVariables(executionId);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Why do you say that variables have to be stored before starting the process since UserTasks are able to create new variables at runtime ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 16 Jun 2013 23:27:01 GMT</pubDate>
    <dc:creator>sorinello</dc:creator>
    <dc:date>2013-06-16T23:27:01Z</dc:date>
    <item>
      <title>Issues about persistence of variables</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/issues-about-persistence-of-variables/m-p/147422#M102897</link>
      <description>Hello.I have an Activiti consistency behavior issue.The code below (I have 2 versions) starts an Activiti Process Instance (None Start Event node). NEXT node is a UserTask node, which has a TaslkListener attached. I am NOT able to get the process variables inside the TaskListener with the FIRST vers</description>
      <pubDate>Sun, 16 Jun 2013 10:54:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/issues-about-persistence-of-variables/m-p/147422#M102897</guid>
      <dc:creator>sorinello</dc:creator>
      <dc:date>2013-06-16T10:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: Issues about persistence of variables</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/issues-about-persistence-of-variables/m-p/147423#M102898</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 just started using Activiti myself and where playing with the same code you were.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your first version won't work, because you'll have to set the variables before you start your process instance. The 2nd version IS the way to go about achieving that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me guess why you were trying 1st version and why you ask this question: Are you trying to set the variables for the process that starts at much later time? If this is the case, variables are not currently supported for deferred/timed process. My workaround was to store the variables as a HistoricTaskInstance ( as I need to keep some audit trails anyway for the fact that I'm creating a timed process that generates user tasks ), and then look it up when my TaskListener executes.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Jun 2013 21:36:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/issues-about-persistence-of-variables/m-p/147423#M102898</guid>
      <dc:creator>hyapit</dc:creator>
      <dc:date>2013-06-16T21:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: Issues about persistence of variables</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/issues-about-persistence-of-variables/m-p/147424#M102899</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;Well the idea is that you can/should be able to set variables whenever you want at runtime, right ? After the Activiti Engine has been built and started, you should be allowed to add process variables when you want. For example, in a ScriptTask you can set execution.setVariable("Name", value). I am wondering why my first approach does not work. Setting a variable from a ScriptTask WORKS, this is why I have a dilemma. Why from ScriptTask works, and right after starting the process instance does not ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Because for example UserTask/Form variables are properly saved/persisted. I can retrieve them at any time after they are created. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;return this.processEngine.getRuntimeService().getVariables(executionId);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Why do you say that variables have to be stored before starting the process since UserTasks are able to create new variables at runtime ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Jun 2013 23:27:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/issues-about-persistence-of-variables/m-p/147424#M102899</guid>
      <dc:creator>sorinello</dc:creator>
      <dc:date>2013-06-16T23:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Issues about persistence of variables</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/issues-about-persistence-of-variables/m-p/147425#M102900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to understand the problem too. I ran into the exact same problem as you did and immediately use your approach #2. From your response, our setup/use-case context seems different ( It was not ScriptTask and it revolved around timer definition in my case )&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Would love to hear from Activiti devs for a better understanding of Sorinello's problem. &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Jun 2013 23:42:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/issues-about-persistence-of-variables/m-p/147425#M102900</guid>
      <dc:creator>hyapit</dc:creator>
      <dc:date>2013-06-16T23:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: Issues about persistence of variables</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/issues-about-persistence-of-variables/m-p/147426#M102901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In your first version the user task is already created when you set the variables.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So it depends on which event for the task listener you are using if the variables will be available. I expect you used a create or assignment event, right? When using these events, the task listener is already executed when you invoke the setVariable methods. Therefore the second approach does work.&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, 17 Jun 2013 08:49:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/issues-about-persistence-of-variables/m-p/147426#M102901</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2013-06-17T08:49:43Z</dc:date>
    </item>
  </channel>
</rss>

