Details
-
Bug
-
Resolution: Done
-
Major
-
jBPM 3.0.0
-
None
Description
The following script was failing for me.
" <script>" +
" <expression>" +
" outParm = response.getTestOutputParm();" +
" </expression>" +
" <out variable='outParm' />" +
" </script>" +
The problem was traced back to Script.hbm.xml which was mapping the in variables to the same table as the out variables. This caused Script.createInterpreter() to load all of the out variables as in variables which caused my "response" variable to NOT be loaded into the Interpreter which then caused the script to fail. I've attached the fix below, I've tested it in the core project as well as in the db project that generates the SQL.
**********
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping default-access="field" >
<subclass name="org.jbpm.jpdl.def.Script"
discriminator-value="S"
extends="org.jbpm.graph.def.Action">
<property name="expression" column="EXPRESSION_" />
<property name="resultVariableName" column="RESULTVARIABLENAME_" />
<set name="inVariables" table="JBPM_SCRIPTVARIABLES_IN">
<key column="SCRIPT_" foreign-key="FK_VARIABLE_SCRIPT_IN" />
<element type="string" />
</set>
<set name="outVariables" table="JBPM_SCRIPTVARIABLES_OUT">
<key column="SCRIPT_" foreign-key="FK_VARIABLE_SCRIPT_OUT"/>
<element type="string" />
</set>
</subclass>
</hibernate-mapping>