<?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 Lightweight async via Groovy &amp; REST? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/lightweight-async-via-groovy-rest/m-p/65394#M41406</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;First, kudos to the entire team, Activiti's been a treat to learn (even for a Java newbie).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Issue: I've had surprising success with fairly complex Activiti workflows, but have failed to integrate Activiti into our async python/php infrastructure.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Use case - Amazon Mechanical Turk process: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; - intiate process via human task/form&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; - enqueue task/process vars via script task &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; —&amp;nbsp; (groovy: add process Vars to Redis queue via jedis)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; —&amp;nbsp; problem: ProcessInstanceID or BusinessKey not available within &amp;lt;script&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; - do external work (Amazon Turk via our existing systems)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; —&amp;nbsp; may be a multi-day process depending on scope&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; - integrate back into workflow via REST&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; —&amp;nbsp; problem: assuming I have ProcessInstanceID/BusinessKey&amp;nbsp; REST api returns png diagram, but not json of current task(s)&amp;nbsp; (service/process/&amp;lt;123&amp;gt;/diagram)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; - wait for human approval&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; - complete process&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Pulling hair out a bit trying to work around these two issues:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; o How to enqueue correlation keys &amp;amp; process variables via groovy/jython script?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; o Determine current task(s) for given correlation key via REST?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I assume I'm missing something obvious… or more likely I'm an edge case, relying on experimental interfaces and just need to bust out the Java Beans/Spring for dummies? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Appreciate any pointers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Rob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 May 2011 18:54:30 GMT</pubDate>
    <dc:creator>roblong</dc:creator>
    <dc:date>2011-05-13T18:54:30Z</dc:date>
    <item>
      <title>Lightweight async via Groovy &amp; REST?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/lightweight-async-via-groovy-rest/m-p/65394#M41406</link>
      <description>First, kudos to the entire team, Activiti's been a treat to learn (even for a Java newbie).Issue: I've had surprising success with fairly complex Activiti workflows, but have failed to integrate Activiti into our async python/php infrastructure.Use case - Amazon Mechanical Turk process:  - intiate p</description>
      <pubDate>Fri, 13 May 2011 18:54:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/lightweight-async-via-groovy-rest/m-p/65394#M41406</guid>
      <dc:creator>roblong</dc:creator>
      <dc:date>2011-05-13T18:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Lightweight async via Groovy &amp; REST?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/lightweight-async-via-groovy-rest/m-p/65395#M41407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can just use varaibles in you script. So if you have a process-variable with name "myProcessvar", it will be available in the script-context as myProcessVar. The business-key is curently not exposed in scripts. A workaround (delegateExecution.getBusinessKey() will be available in activiti 5.6) could be storing the businessKey as variable:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; - Use a execution/task listener right before the script-task, using an expression, eg:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;extensionElements&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activiti:executionListener expression="${execution.setVariable('theKey', execution.getBusinessKey()}" event="take" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/extensionElements&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;SPAN&gt; - In scriptTask, business-key is available under variable theKey&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;About the REST-API. Not all java-api calls are available through rest. So getting al tasks for a processInstanceID is not possible… You'll have to extend the activiti-rest or write your own servlet/rest-endpoint in the java-app that calls the Activiti java-API I'm affraid…&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2011 13:37:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/lightweight-async-via-groovy-rest/m-p/65395#M41407</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-05-20T13:37:01Z</dc:date>
    </item>
  </channel>
</rss>

