<?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 Starting a process instance synchronously in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/starting-a-process-instance-synchronously/m-p/69024#M44337</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 think it's not possible to run a process instance synchronously, I mean, to get the "output" process variables after execution?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd like to do something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;Map&amp;lt;String,Object&amp;gt; outcome = myRuntimeService.startInstance("myBackgroundProcess", vars);&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Where 'myBackgroundProcess' is a composition of service tasks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What would be the best (a good) way, to achieve this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;michael&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Jul 2011 15:09:51 GMT</pubDate>
    <dc:creator>gant</dc:creator>
    <dc:date>2011-07-28T15:09:51Z</dc:date>
    <item>
      <title>Starting a process instance synchronously</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/starting-a-process-instance-synchronously/m-p/69024#M44337</link>
      <description>Hi,I think it's not possible to run a process instance synchronously, I mean, to get the "output" process variables after execution?I'd like to do something like:Map&amp;lt;String,Object&amp;gt; outcome = myRuntimeService.startInstance("myBackgroundProcess", vars);‍Where 'myBackgroundProcess' is a compositi</description>
      <pubDate>Thu, 28 Jul 2011 15:09:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/starting-a-process-instance-synchronously/m-p/69024#M44337</guid>
      <dc:creator>gant</dc:creator>
      <dc:date>2011-07-28T15:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: Starting a process instance synchronously</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/starting-a-process-instance-synchronously/m-p/69025#M44338</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 runs synchronously if you have only automatic tasks in your process.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So you can do something similar to what you want, only you need 2 lines of code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;With the process instance ID you get back from the start method, you can retrieve all the variables via the HistoricService.&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>Thu, 28 Jul 2011 15:14:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/starting-a-process-instance-synchronously/m-p/69025#M44338</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2011-07-28T15:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: Starting a process instance synchronously</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/starting-a-process-instance-synchronously/m-p/69026#M44339</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;Thank you for your quick answer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not familiar with historyService. I can get HistoricProcessInstance or HistoricDetail, but how can I get the variables from there?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;michael&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jul 2011 15:40:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/starting-a-process-instance-synchronously/m-p/69026#M44339</guid>
      <dc:creator>gant</dc:creator>
      <dc:date>2011-07-28T15:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: Starting a process instance synchronously</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/starting-a-process-instance-synchronously/m-p/69027#M44340</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;You do something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;List&amp;lt;HistoricDetail&amp;gt; historicVariableUpdateList = historyService.createHistoricDetailQuery().variableUpdates().list();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for (HistoricDetail historicDetail : historicVariableUpdateList) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; HistoricVariableUpdate historicVariableUpdate = (HistoricVariableUpdate) historicDetail;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; System.out.println("historic variable update, revision " + historicVariableUpdate.getRevision() +&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ", variable type name " + historicVariableUpdate.getVariableTypeName() +&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ", variable name " + historicVariableUpdate.getVariableName() +&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ", Variable value '" + historicVariableUpdate.getValue()+"'");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This way you get all process variable updates if you set the historyLevel of the process engine to full.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You can order it so you get the latest updates first.&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>Thu, 28 Jul 2011 15:44:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/starting-a-process-instance-synchronously/m-p/69027#M44340</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2011-07-28T15:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Starting a process instance synchronously</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/starting-a-process-instance-synchronously/m-p/69028#M44341</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 have a process with two Script Tasks and tried to got the variables using the historyService. Following is the result:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;Name: y * Value: 2 * Revision: 0 * Time: 1311931591000&lt;BR /&gt;Name: x * Value: 4 * Revision: 0 * Time: 1311931591000&lt;BR /&gt;Name: x * Value: 6.0 * Revision: 0 * Time: 1311931591000&lt;BR /&gt;Name: y * Value: 12.0 * Revision: 0 * Time: 1311931591000&lt;BR /&gt;Name: x * Value: 36.0 * Revision: 0 * Time: 1311931591000&lt;BR /&gt;Name: y * Value: -24.0 * Revision: 0 * Time: 1311931591000&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;the values are correct, 2 and 4 are the values in the input variables, line 3&amp;amp;4 are the correct values after first scripts task, lines 5&amp;amp;6 after the second script task. But why is the revision always 0? and the timestamp always the same?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2011 09:29:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/starting-a-process-instance-synchronously/m-p/69028#M44341</guid>
      <dc:creator>gant</dc:creator>
      <dc:date>2011-07-29T09:29:01Z</dc:date>
    </item>
  </channel>
</rss>

