<?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 Calling REST from activiti task in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/calling-rest-from-activiti-task/m-p/184447#M137577</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Please confirm if the below scenario is possible..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to call REST based webservice through service task and wants to pass the return result of REST to drool file, is it possible that I can do it with no java code? Means I don't have to call REST service in Java delegate class and pass returned results from java class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it also possible that I can call REST service from script task and pass the result of REST to drool file?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Jul 2015 18:32:17 GMT</pubDate>
    <dc:creator>vahaj</dc:creator>
    <dc:date>2015-07-10T18:32:17Z</dc:date>
    <item>
      <title>Calling REST from activiti task</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/calling-rest-from-activiti-task/m-p/184447#M137577</link>
      <description>Please confirm if the below scenario is possible..I want to call REST based webservice through service task and wants to pass the return result of REST to drool file, is it possible that I can do it with no java code? Means I don't have to call REST service in Java delegate class and pass returned r</description>
      <pubDate>Fri, 10 Jul 2015 18:32:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/calling-rest-from-activiti-task/m-p/184447#M137577</guid>
      <dc:creator>vahaj</dc:creator>
      <dc:date>2015-07-10T18:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: Calling REST from activiti task</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/calling-rest-from-activiti-task/m-p/184448#M137578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If I sum up my above requirements than I would say is it possible to call REST based webservices in activiti work flow with out using java code?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If Yes than please share any working example of it, or in which task element I can do it?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Jul 2015 14:15:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/calling-rest-from-activiti-task/m-p/184448#M137578</guid>
      <dc:creator>vahaj</dc:creator>
      <dc:date>2015-07-11T14:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calling REST from activiti task</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/calling-rest-from-activiti-task/m-p/184449#M137579</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;SPAN&gt;sorry I ask you directly but, what's wrong using java ? &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are a few solutions but in my point of view the ServiceTask is the best way.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, the other solutions i'm thinking of, the ScriptTask is involved:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. groovy scripting &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; import groovy.json.*&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;def url = "&lt;/SPAN&gt;&lt;A href="http://www.mocky.io/v2/55a18e8fd66d56fe140e9356%22.toURL" rel="nofollow noopener noreferrer"&gt;http://www.mocky.io/v2/55a18e8fd66d56fe140e9356'.toURL&lt;/A&gt;&lt;SPAN&gt;().text&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;def root = new JsonSlurper().parseText(url)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;root.each() { elem -&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; println "${elem.name}"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;note that you could use the groovyx.net.http.RESTClient which is maybe a better solution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. javascript (fyi: Activiti is using Rhino javascript engine so you could study it to see what exactly you are allowed to do with it.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;here is an example of Rhino script for getting the content from an url.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;javascript&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;function fetch(urlStr) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; importPackage(java.io, java.net);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; var url = new URL(urlStr);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; var urlStream = url.openStream();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; var reader = new BufferedReader(new InputStreamReader(urlStream, "latin1"));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; var html = "";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; var line;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; while (line = reader.readLine()) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; if (line == null) break;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; html += line;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; return html;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/javascript&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just let your imagination fly&amp;nbsp; &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;you could use Apache HttpClient which fits better for such a task. &lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Jul 2015 22:00:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/calling-rest-from-activiti-task/m-p/184449#M137579</guid>
      <dc:creator>vasile_dirla</dc:creator>
      <dc:date>2015-07-11T22:00:05Z</dc:date>
    </item>
  </channel>
</rss>

