<?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: Script evaluation in a separated thread in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/script-evaluation-in-a-separated-thread/m-p/75913#M49987</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;In the current trunk of Activiti you can make use of async continuations.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This means that you can execute a specific task asynchronous. Is that what you're looking for?&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>Fri, 23 Sep 2011 13:23:13 GMT</pubDate>
    <dc:creator>trademak</dc:creator>
    <dc:date>2011-09-23T13:23:13Z</dc:date>
    <item>
      <title>Script evaluation in a separated thread</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/script-evaluation-in-a-separated-thread/m-p/75912#M49986</link>
      <description>Hi,Is it possible to run script evaluations in a separated thread ? I made my own script engine which uses the javascript engine.I have something like that &lt;IMG id="smileytongue" class="emoticon emoticon-smileytongue" src="https://migration33.stage.lithium.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;ublic Object eval(String script, Bindings n) throws ScriptException {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ScriptThread thread = new ScriptThread(javascriptEngine,script,n)</description>
      <pubDate>Fri, 23 Sep 2011 13:12:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/script-evaluation-in-a-separated-thread/m-p/75912#M49986</guid>
      <dc:creator>mathiasd</dc:creator>
      <dc:date>2011-09-23T13:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Script evaluation in a separated thread</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/script-evaluation-in-a-separated-thread/m-p/75913#M49987</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;In the current trunk of Activiti you can make use of async continuations.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This means that you can execute a specific task asynchronous. Is that what you're looking for?&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>Fri, 23 Sep 2011 13:23:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/script-evaluation-in-a-separated-thread/m-p/75913#M49987</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2011-09-23T13:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Script evaluation in a separated thread</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/script-evaluation-in-a-separated-thread/m-p/75914#M49988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Not sure. Actually I'm trying to add some protections in my workflows. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For example I want to protect my workflow engine against infinite loops in script tasks. That's why I want to start the eval method in a separated Thread and interrupt this Thread if the evaluation is too long. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Actually I found the problem, I just add :&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt; Context.setProcessEngineConfiguration(config);&lt;BR /&gt; Context.setCommandContext(commandContext);&lt;BR /&gt;&lt;/CODE&gt;&lt;SPAN&gt;before evaluation. Now I throw a ScriptException if the script is too long. My new problem (&lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://connect.hyland.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;) is that after the exception is thrown, the script seems to be still running (JavaVM still take 100% of the CPU).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe you know a better solution to implement this "watchdog" ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2011 13:32:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/script-evaluation-in-a-separated-thread/m-p/75914#M49988</guid>
      <dc:creator>mathiasd</dc:creator>
      <dc:date>2011-09-23T13:32:35Z</dc:date>
    </item>
  </channel>
</rss>

