<?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: Python Scrits in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207635#M160765</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;you could use Jython in order to call python scripts.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;As of Jython 2.5.1 an implementation of JSR 223 is bundled in jython.jar. Simply add jython to your CLASSPATH and ask for the python script engine as you already mentioned above: "set the scriptFormat value to "python""&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://www.jython.org/" rel="nofollow noopener noreferrer"&gt;http://www.jython.org/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Aug 2015 21:37:07 GMT</pubDate>
    <dc:creator>vasile_dirla</dc:creator>
    <dc:date>2015-08-26T21:37:07Z</dc:date>
    <item>
      <title>Python Scrits</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207632#M160762</link>
      <description>What's the trick for getting Python scripts enabled in script tasks. I set the scriptFormat value to "python" and it tells me "Can't find scripting engine for 'python'"</description>
      <pubDate>Tue, 25 Aug 2015 20:44:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207632#M160762</guid>
      <dc:creator>johnambrosiano</dc:creator>
      <dc:date>2015-08-25T20:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Python Scrits</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207633#M160763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the problem could be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://activiti.org/userguide/index.html#bpmnScriptTask" rel="nofollow noopener noreferrer"&gt;http://activiti.org/userguide/index.html#bpmnScriptTask&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The value of the scriptFormat attribute must be a name that is compatible with the JSR-223 (scripting for the Java platform). By default JavaScript is included in every JDK and as such doesn’t need any additional jars. If you want to use another (JSR-223 compatible) scripting engine, it is sufficient to add the corresponding jar to the classpath and use the appropriate name. For example, the Activiti unit tests often use Groovy because the syntax is pretty similar to that of Java.&lt;BR /&gt;&lt;BR /&gt;Do note that the Groovy scripting engine is bundled with the groovy-all jar. Before version 2.0, the scripting engine was part of the regular Groovy jar. As such, one must now add following dependency:…&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Martin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Aug 2015 05:30:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207633#M160763</guid>
      <dc:creator>martin_grofcik</dc:creator>
      <dc:date>2015-08-26T05:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: Python Scrits</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207634#M160764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, Martin. I've seen this before. An example for Python would be helpful. Do you or anyone else know of such an example?&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Aug 2015 15:41:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207634#M160764</guid>
      <dc:creator>johnambrosiano</dc:creator>
      <dc:date>2015-08-26T15:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Python Scrits</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207635#M160765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;you could use Jython in order to call python scripts.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;As of Jython 2.5.1 an implementation of JSR 223 is bundled in jython.jar. Simply add jython to your CLASSPATH and ask for the python script engine as you already mentioned above: "set the scriptFormat value to "python""&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://www.jython.org/" rel="nofollow noopener noreferrer"&gt;http://www.jython.org/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Aug 2015 21:37:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207635#M160765</guid>
      <dc:creator>vasile_dirla</dc:creator>
      <dc:date>2015-08-26T21:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: Python Scrits</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207636#M160766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, Vasile. I'll try it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Aug 2015 23:19:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207636#M160766</guid>
      <dc:creator>johnambrosiano</dc:creator>
      <dc:date>2015-08-26T23:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: Python Scrits</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207637#M160767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Vasile,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Did as you suggested. (1) Using the Activiti Designer Eclipse plugin. (2) Have jython 2.7.0 in the POM for the project.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(3) Defining the following in the script task in the process:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;scriptTask id="scripttask1" name="Script Task"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; activiti:autoStoreVariables="false" scriptFormat="python"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;lt;script&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Hello"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;/scriptTask&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(4) Invoking with:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; public void startScript() {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ProcessEngine processEngine = ProcessEngineConfiguration&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; .createStandaloneInMemProcessEngineConfiguration()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .buildProcessEngine();&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; RuntimeService runtimeService = processEngine.getRuntimeService(); &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; RepositoryService repositoryService = processEngine.getRepositoryService();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; repositoryService.createDeployment()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; .addClasspathResource("diagrams/HelloScript.bpmn")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; .deploy();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "helloScript");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(5) Getting these errors:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;org.activiti.engine.ActivitiException: Can't find scripting engine for 'python'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.activiti.engine.impl.scripting.ScriptingEngines.getEngineByName(ScriptingEngines.java:124)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.activiti.engine.impl.scripting.ScriptingEngines.evaluate(ScriptingEngines.java:85)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.activiti.engine.impl.scripting.ScriptingEngines.evaluate(ScriptingEngines.java:73)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What am I missing? Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Aug 2015 23:32:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207637#M160767</guid>
      <dc:creator>johnambrosiano</dc:creator>
      <dc:date>2015-08-26T23:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Python Scrits</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207638#M160768</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;just create a unit test to demonstrate what's not working and upload it here (rename the zip extension to txt in order to upload it)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 07:20:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207638#M160768</guid>
      <dc:creator>vasile_dirla</dc:creator>
      <dc:date>2015-08-27T07:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Python Scrits</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207639#M160769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, Vasile,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's a diagram, a test, and the POM file to show the dependencies I've included.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 18:50:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207639#M160769</guid>
      <dc:creator>johnambrosiano</dc:creator>
      <dc:date>2015-08-27T18:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: Python Scrits</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207640#M160770</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;I don't have knowledge of python but during the debug I see that the engine cannot import the 'site' module so I decided to disable this (I have no idea what's the impact over the python engine so maybe if you know more about python you can add some more info here.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://docs.python.org/2/library/site.html" rel="nofollow noopener noreferrer"&gt;https://docs.python.org/2/library/site.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway.. back to Jython JSR 223 support:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; I did a few changes to your code and now it works:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; @Test&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; @Deployment(resources = {"diagrams/HelloScript.bpmn"})&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; public void startScript() {&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Properties props = new Properties();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; props.put("python.import.site","false");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Properties preprops = System.getProperties();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; PythonInterpreter.initialize(preprops, props, new String[0]);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ProcessInstance processInstance = activitiRule.getRuntimeService().startProcessInstanceByKey("helloScript");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; assert(processInstance.getDeploymentId()!=null);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and also changed the script of your ScriptTask to: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;script&amp;gt;import sys; a = 42; print a; x = 2 + 2; print "x:",x&amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and i can see this result:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;INFO: Processing resource diagrams/HelloScript.bpmn&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;42&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;x: 4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;so.. it's working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are a few issues as i can see with Jython, if the script contains new lines, it will fail when parsing. &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;Will be nice if we'll find a nice solution for python scripts in Activiti even that means we'll put some code into Jython or just change it with something else.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Aug 2015 15:18:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207640#M160770</guid>
      <dc:creator>vasile_dirla</dc:creator>
      <dc:date>2015-08-28T15:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: Python Scrits</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207641#M160771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;not really unsupported, (if you have the proper library which is able to interpret python it's supported)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;scripting it's interpreted by an external library so it has nothing to do with Activiti.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since you are interested by python support you said would like to see that written in the documentation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but as you know there could be hundreds of script engines in the world what will be if we'll write about all of them ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Imagine that you could develop your own scripting with support for JSR 233 and you'll be able to use it in java.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;see this: &lt;/SPAN&gt;&lt;A href="https://www.jcp.org/en/jsr/detail?id=223" rel="nofollow noopener noreferrer"&gt;https://www.jcp.org/en/jsr/detail?id=223&lt;/A&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Aug 2015 15:31:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207641#M160771</guid>
      <dc:creator>vasile_dirla</dc:creator>
      <dc:date>2015-08-28T15:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Python Scrits</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207642#M160772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So it looks like Python is pretty much unsupported at this time. Should probably put that in the documentation somewhere.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not dedicated to Jython, by the way. Just seemed like that was what JSR 223 led me to believe, i.e., it says the interpreter for Python is backed by Jython - if I read it right.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you know if there's a workaround, like getting Groovy to call Python or something?&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Aug 2015 15:48:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207642#M160772</guid>
      <dc:creator>johnambrosiano</dc:creator>
      <dc:date>2015-08-28T15:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: Python Scrits</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207643#M160773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your example, by the way. I don't mean to seem ungrateful.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get your point about scripting not necessarily being the responsibility of Activiti, but Groovy is transparently usable and has a clear example in the user guide. Python is the #1 scripting language in the world, as for instance suggested here &lt;/SPAN&gt;&lt;A href="http://www.drdobbs.com/jvm/the-rise-and-fall-of-languages-in-2013/240165192" rel="nofollow noopener noreferrer"&gt;http://www.drdobbs.com/jvm/the-rise-and-fall-of-languages-in-2013/240165192&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Honestly, I'm not clear on how JSR 223 is supported generally. Perhaps it would help if I learned a bit about that. On Activiti's end, a section in the user guide on the general topic of getting interpreters for the top scripting languages to work with Activiti might be really helpful. For example, my understanding is that Javascript should work out of the box in Activiti like Groovy, but I couldn't get that one to work for me either. Same "cannot find interpreter" error.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Aug 2015 15:49:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207643#M160773</guid>
      <dc:creator>johnambrosiano</dc:creator>
      <dc:date>2015-08-28T15:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Python Scrits</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207644#M160774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;this is how you could use a scripting engine form a java app.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ScriptEngine engine = new ScriptEngineManager().getEngineByName("python");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; engine.put("a", "1234");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; engine.eval("print a");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this will work if you have in the classpath the proper jar.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Aug 2015 15:54:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207644#M160774</guid>
      <dc:creator>vasile_dirla</dc:creator>
      <dc:date>2015-08-28T15:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Python Scrits</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207645#M160775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Excellent. Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Aug 2015 16:29:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207645#M160775</guid>
      <dc:creator>johnambrosiano</dc:creator>
      <dc:date>2015-08-28T16:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: Python Scrits</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207646#M160776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you for posting the code to initialize the Jython runtime!&amp;nbsp; That was quite helpful.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are a couple of additional pieces of information that might help others.&amp;nbsp; First, it seems like the issue about the "python.import.site" property is discussed in this defect in the Jython project:&amp;nbsp; &lt;/SPAN&gt;&lt;A href="http://bugs.jython.org/issue2355" rel="nofollow noopener noreferrer"&gt;http://bugs.jython.org/issue2355&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Second, I was able to work around the indenting issue like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;blockcode&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; &amp;lt;script&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;![CDATA[&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import sys&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;a = 42&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;print a&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;x = 2 + 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;print "x: ", x&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;]]&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; &amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/blockcode&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is that indenting is important to Python and what looks normal in XML will not run in Python because of the leading indentation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2016 13:47:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/python-scrits/m-p/207646#M160776</guid>
      <dc:creator>allenhadden</dc:creator>
      <dc:date>2016-04-06T13:47:34Z</dc:date>
    </item>
  </channel>
</rss>

