Community

Problems with usage python language in jpdl.xml

reply from Andrey Chuyko in jBPM - View the full discussion

Thahks, Huisheng Xu for your replay!! But I`ve included python factory into jbpm.default.scriptmanager.xml.

I`ve done it as this one - <script-language name="python" factory="org.python.jsr223.PyScriptEngineFactory" />.

 

And i checked it debuging code. So, in the class org.jbpm.pvm.internal.script.ScriptManager in the method evaluate(String script, String language)

I`ve got object ScriptEngine = org.python.jsr223.PyScriptEngine@6ca716

which have object interp = org.python.util.PythonInterpreter@17cd18d

and object factory = org.python.jsr223.PyScriptEngineFactory@f92541.

 

<script name="invoke script" var="text" lang="python" g="113,18,104,52">
<text>import sys;print "start test!";testvar1 = 2 * 2 + 90;print "testvar1=", testvar1</text>
<transition to="wait" />
</script>

By this means that python is visible in jpdl.xml. But when evaluate(ScriptEngine scriptEngine, String script) is run then throw Exception

javax.script.ScriptException: NameError: name 'testvar1' is not defined in <script> at line number 1. For some reason variables can`t be remembered.

 

May be I try to use wrong factory org.python.jsr223.PyScriptEngineFactory???

If somebody hade met with this strangeness.

 

Thanks alot for replies!!! Andrew

Reply to this message by going to Community

Start a new discussion in jBPM at Community