<?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: Cannot get process execution variables in latest state in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/cannot-get-process-execution-variables-in-latest-state/m-p/73591#M48043</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;More info on this issue, it would seem the "commit" is not a global one for the entire process.&amp;nbsp; All changes made to the execution variable prior to inserting the:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;errorMsgs = errorMsgs&lt;/CODE&gt;&lt;BR /&gt;&lt;STRONG&gt;will &lt;/STRONG&gt;&lt;SPAN&gt;be saved and can be retrieved, but any additional changes AFTER that call will still be lost.&amp;nbsp; Thus the solution seems to be to put in an additional scriptTask prior to the end of the script that re-sets each variable that got updated throughout the execution (not those that got set).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, as a little corollary to this, scriptTasks aren't the only items with this problem.&amp;nbsp; If you use a serviceTask with Spring integration, and invoke a bean method like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;helloBean.doSomethingWithError(errorMsgs)&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;And if the doSomethingWithError method adds a new error message to the list of errorMsgs as part of the execution, that change will not get picked up on by Activiti in the same manner as it does not in the script task.&amp;nbsp; If you put a scriptTask after the serviceTask that has the:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;errorMsgs = errorMsgs&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;inside of it, then the change will be recognized.&amp;nbsp; Very odd behavior.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 May 2011 22:17:14 GMT</pubDate>
    <dc:creator>tidetom</dc:creator>
    <dc:date>2011-05-20T22:17:14Z</dc:date>
    <item>
      <title>Cannot get process execution variables in latest state</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cannot-get-process-execution-variables-in-latest-state/m-p/73585#M48037</link>
      <description>Hello.I'm trying to write an integration test for my Activiti process, which contains a lot of Script tasks. I basically need a way to retrieve process execution variables. First I've tried placing a dummy Java Receive task at the process' end and then retrieve the variables usingruntimeService.getV</description>
      <pubDate>Fri, 20 May 2011 12:58:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cannot-get-process-execution-variables-in-latest-state/m-p/73585#M48037</guid>
      <dc:creator>dmitry_serdiuk</dc:creator>
      <dc:date>2011-05-20T12:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot get process execution variables in latest state</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cannot-get-process-execution-variables-in-latest-state/m-p/73586#M48038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;From where do you exactly call runtimeService.getVariables(processInstance.getId());? is the process running than, or in a wait-state?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2011 13:42:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cannot-get-process-execution-variables-in-latest-state/m-p/73586#M48038</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-05-20T13:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot get process execution variables in latest state</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cannot-get-process-execution-variables-in-latest-state/m-p/73587#M48039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've called this when process reached Java Receive task (later I've replaced it with User Task with same effect), the execution returned. E.g.:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;//…putting together initialVariables map&lt;BR /&gt;&lt;BR /&gt;ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("p_verify", initialVariables);&lt;BR /&gt;//the process has been started&lt;BR /&gt;&lt;BR /&gt;//this line gets executed when process reached User Task and, therefore, in wait state.&lt;BR /&gt;Map&amp;lt;String, Object&amp;gt; afterVariables = runtimeService.getVariables(processInstance.getId());&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Inside script tasks I add elements to the array:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt; errorMsgs.add(stdMsgs.get(13011L));&lt;/CODE&gt;&lt;SPAN&gt;And I want to check that errorMsgs afterwards in JUnit.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2011 14:03:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cannot-get-process-execution-variables-in-latest-state/m-p/73587#M48039</guid>
      <dc:creator>dmitry_serdiuk</dc:creator>
      <dc:date>2011-05-20T14:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot get process execution variables in latest state</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cannot-get-process-execution-variables-in-latest-state/m-p/73588#M48040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thats really strange. Could you make simple testcase (junit test + process) that shows this behaviour, because that should just work &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://connect.hyland.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2011 14:07:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cannot-get-process-execution-variables-in-latest-state/m-p/73588#M48040</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-05-20T14:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot get process execution variables in latest state</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cannot-get-process-execution-variables-in-latest-state/m-p/73589#M48041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've created a very simple test case. Plz see in attachments.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2011 18:08:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cannot-get-process-execution-variables-in-latest-state/m-p/73589#M48041</guid>
      <dc:creator>dmitry_serdiuk</dc:creator>
      <dc:date>2011-05-20T18:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot get process execution variables in latest state</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cannot-get-process-execution-variables-in-latest-state/m-p/73590#M48042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Dmitry,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I found a hack workaround for your issue, if you simply put:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;errorMsgs = errorMsgs&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Then the errorMsgs changes will be made.&amp;nbsp; Note that oddly enough you only have to do this one time somewhere in your process flow. This would indicate to me that Activiti must register changes to an execution variable only when it's set, and not when it's updated … therefore if it's set at least once, then all changes before and after will be logged.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm no Activiti expert (just starting myself) - maybe some of the Activiti folks can weigh in on this as to whether my assumption above is correct?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Tom&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2011 20:19:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cannot-get-process-execution-variables-in-latest-state/m-p/73590#M48042</guid>
      <dc:creator>tidetom</dc:creator>
      <dc:date>2011-05-20T20:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot get process execution variables in latest state</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cannot-get-process-execution-variables-in-latest-state/m-p/73591#M48043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;More info on this issue, it would seem the "commit" is not a global one for the entire process.&amp;nbsp; All changes made to the execution variable prior to inserting the:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;errorMsgs = errorMsgs&lt;/CODE&gt;&lt;BR /&gt;&lt;STRONG&gt;will &lt;/STRONG&gt;&lt;SPAN&gt;be saved and can be retrieved, but any additional changes AFTER that call will still be lost.&amp;nbsp; Thus the solution seems to be to put in an additional scriptTask prior to the end of the script that re-sets each variable that got updated throughout the execution (not those that got set).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, as a little corollary to this, scriptTasks aren't the only items with this problem.&amp;nbsp; If you use a serviceTask with Spring integration, and invoke a bean method like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;helloBean.doSomethingWithError(errorMsgs)&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;And if the doSomethingWithError method adds a new error message to the list of errorMsgs as part of the execution, that change will not get picked up on by Activiti in the same manner as it does not in the script task.&amp;nbsp; If you put a scriptTask after the serviceTask that has the:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;errorMsgs = errorMsgs&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;inside of it, then the change will be recognized.&amp;nbsp; Very odd behavior.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2011 22:17:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cannot-get-process-execution-variables-in-latest-state/m-p/73591#M48043</guid>
      <dc:creator>tidetom</dc:creator>
      <dc:date>2011-05-20T22:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot get process execution variables in latest state</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cannot-get-process-execution-variables-in-latest-state/m-p/73592#M48044</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;Activiti has a built-in mechanism for saving serializable variables again, when they have changed once the command-context is being closed. Looks like the variables loaded from within a service/script-task aren't picked up by this, so the serializable value in't persisted to the DB. The workaround suggested by tidetom will explicitly do a "execution.setVariable" behind the screens, which stores the new value to the DB.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;@see &lt;/SPAN&gt;&lt;A href="http://jira.codehaus.org/browse/ACT-820" rel="nofollow noopener noreferrer"&gt;http://jira.codehaus.org/browse/ACT-820&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2011 10:10:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cannot-get-process-execution-variables-in-latest-state/m-p/73592#M48044</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-05-23T10:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot get process execution variables in latest state</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cannot-get-process-execution-variables-in-latest-state/m-p/73593#M48045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, thanks for the clarifications.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Will use suggested workaround while waiting for the fix…&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2011 11:42:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cannot-get-process-execution-variables-in-latest-state/m-p/73593#M48045</guid>
      <dc:creator>dmitry_serdiuk</dc:creator>
      <dc:date>2011-05-23T11:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot get process execution variables in latest state</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cannot-get-process-execution-variables-in-latest-state/m-p/73594#M48046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I m facing a similar issue. The scenario is a little different from one mentioned above.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Acitivi verision : 5.12.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my code snippet.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Map&amp;lt;String, Object&amp;gt; var = new HashMap&amp;lt;String, Object&amp;gt;();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var.put("workorderrequest", payload);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var.put("workOrderResponse", response);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ProcessInstance pi = runtime.startProcessInstanceByKey("getWorkOrder", var);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;response = (GetWorkOrderDetailsResponseType) runtime.getVariable(pi.getProcessInstanceId(),"workOrderResponse");&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At the time of runtime.getVariable, my process is already complete and successfull. I'm not able to access the process level parameters from it. I m running activiti on weblogic 10.3.4 with oracle 11g database with spring configuration.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It give me the following exception.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;DFLTLOG&amp;gt; DEBUG 19:32:31 org.springframework.jdbc.datasource.SimpleDriverDataSource&amp;gt; Creating new JDBC Driver Connection to [jdbc&lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://connect.hyland.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;racle:thin:@10.100.10.207:1521:sidev11g]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;07:32:31,503 [[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] ERROR org.activiti.engine.impl.interceptor.CommandContext&amp;nbsp; - Error while closing command context&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;org.activiti.engine.ActivitiObjectNotFoundException: execution 301 doesn't exist&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.activiti.engine.impl.cmd.GetExecutionVariableCmd.execute(GetExecutionVariableCmd.java:54)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:61)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.activiti.engine.impl.RuntimeServiceImpl.getVariable(RuntimeServiceImpl.java:118)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at com.sigma.omp.extinterfaces.oms.WorkOrderOMSAmdocsV1PortTypeImpl.getWorkOrderDetails(WorkOrderOMSAmdocsV1PortTypeImpl.java:91)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at java.lang.reflect.Method.invoke(Method.java:597)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker.invoke(WLSInstanceResolver.java:92)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker.invoke(WLSInstanceResolver.java:74)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:151)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at com.sun.xml.ws.server.sei.EndpointMethodHandlerImpl.invoke(EndpointMethodHandlerImpl.java:268)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:100)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:866)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:815)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:778)&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 May 2013 14:20:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cannot-get-process-execution-variables-in-latest-state/m-p/73594#M48046</guid>
      <dc:creator>rahult</dc:creator>
      <dc:date>2013-05-16T14:20:49Z</dc:date>
    </item>
  </channel>
</rss>

