[jbpm-commits] JBoss JBPM SVN: r4927 - in jbpm4/trunk/modules: examples/src/test/java/org/jbpm/examples/subprocess/variables and 8 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu May 28 06:10:52 EDT 2009


Author: tom.baeyens at jboss.com
Date: 2009-05-28 06:10:52 -0400 (Thu, 28 May 2009)
New Revision: 4927

Added:
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessInParameterImpl.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessOutParameterImpl.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessParameterImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ScopeInstanceContext.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ScopeInstanceEnvironment.java
Removed:
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ExecutionContext.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ExecutionEnvironment.java
Modified:
   jbpm4/trunk/modules/api/src/main/resources/jpdl-4.0.xsd
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/variables/SubProcessVariablesTest.java
   jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/variables/SubProcessDocument.jpdl.xml
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionExpressionActivity.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JavaActivity.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ScriptActivity.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessBinding.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/MailProducerImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionEvaluator.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptManager.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/GroovyExpressionTest.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/JuelExpressionTest.java
   jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Jpdl.xml
Log:
JBPM-2214 changed sub-process variables into parameters

Modified: jbpm4/trunk/modules/api/src/main/resources/jpdl-4.0.xsd
===================================================================
--- jbpm4/trunk/modules/api/src/main/resources/jpdl-4.0.xsd	2009-05-28 09:22:34 UTC (rev 4926)
+++ jbpm4/trunk/modules/api/src/main/resources/jpdl-4.0.xsd	2009-05-28 10:10:52 UTC (rev 4927)
@@ -385,8 +385,8 @@
         </documentation></annotation>
         <complexType>
           <sequence minOccurs="0" maxOccurs="unbounded">
-            <element ref="tns:variable" minOccurs="0" maxOccurs="unbounded" />
-            <element ref="tns:out-variable" minOccurs="0" maxOccurs="unbounded" />
+            <element name="parameter-in" type="tns:parameterType" minOccurs="0" maxOccurs="unbounded" />
+            <element name="parameter-out" type="tns:parameterType" minOccurs="0" maxOccurs="unbounded" />
             <element ref="tns:timer" minOccurs="0" maxOccurs="unbounded"/>
             <element ref="tns:on" minOccurs="0" maxOccurs="unbounded">
               <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
@@ -708,34 +708,27 @@
     </complexType>
   </element>
 
-  <element name="variable">
-    <complexType>
-      <attribute name="name" type="string">
-        <annotation><documentation>The name of the variable.
-        </documentation></annotation>
-      </attribute>
-      <attribute name="init" type="string">
-        <annotation><documentation>An expression for which the resulting 
-        value will be used as initial value for the variable.
-        </documentation></annotation>
-      </attribute>
-    </complexType>
-  </element>
+  <complexType name="parameterType">
+    <attribute name="subvar" type="string">
+      <annotation><documentation>The name of the sub process variable.
+      </documentation></annotation>
+    </attribute>
+    <attribute name="expr" type="string">
+      <annotation><documentation>An expression for which the resulting 
+      value will be used as value.
+      </documentation></annotation>
+    </attribute>
+    <attribute name="lang" type="string">
+      <annotation><documentation>Language of the expression.
+      </documentation></annotation>
+    </attribute>
+    <attribute name="var" type="string">
+      <annotation><documentation>Name of the process variable
+      in the super process execution..
+      </documentation></annotation>
+    </attribute>
+  </complexType>
 
-  <element name="out-variable">
-    <complexType>
-      <attribute name="name" type="string">
-        <annotation><documentation>The name of the variable.
-        </documentation></annotation>
-      </attribute>
-      <attribute name="init" type="string">
-        <annotation><documentation>An expression that will be resolved in the 
-        inner scope and for which the resulting value will be set as a variable 
-        in the outer scope.
-        </documentation></annotation>
-      </attribute>
-    </complexType>
-  </element>
 
   <element name="timer">
     <complexType>

Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/variables/SubProcessVariablesTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/variables/SubProcessVariablesTest.java	2009-05-28 09:22:34 UTC (rev 4926)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/variables/SubProcessVariablesTest.java	2009-05-28 10:10:52 UTC (rev 4927)
@@ -57,7 +57,7 @@
     super.tearDown();
   }
 
-  public void testWaitStatesSequence() {
+  public void testSubProcessVariables() {
     Map<String, Object> variables = new HashMap<String, Object>();
     variables.put("document", "This document describes how we can make more money...");
     

Modified: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/variables/SubProcessDocument.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/variables/SubProcessDocument.jpdl.xml	2009-05-28 09:22:34 UTC (rev 4926)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/variables/SubProcessDocument.jpdl.xml	2009-05-28 10:10:52 UTC (rev 4927)
@@ -10,8 +10,8 @@
                sub-process-key="SubProcessReview" 
                g="96,16,127,52">
                
-    <variable name="document" init="#{document}" />
-    <out-variable name="reviewResult" init="#{result}" />
+    <parameter-in var="document" subvar="document" />
+    <parameter-out var="reviewResult" subvar="result" />
     
     <transition to="wait" />
   </sub-process>

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionExpressionActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionExpressionActivity.java	2009-05-28 09:22:34 UTC (rev 4926)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionExpressionActivity.java	2009-05-28 10:10:52 UTC (rev 4927)
@@ -26,6 +26,7 @@
 import org.jbpm.api.model.Activity;
 import org.jbpm.api.model.Transition;
 import org.jbpm.pvm.internal.env.EnvironmentDefaults;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.pvm.internal.script.ScriptManager;
 
 /**
@@ -43,7 +44,7 @@
     String transitionName = null;
 
     ScriptManager scriptManager = EnvironmentDefaults.getScriptManager();
-    Object result = scriptManager.evaluateExpression(expr, execution, lang);
+    Object result = scriptManager.evaluateExpression(expr, (ExecutionImpl)execution, lang);
     if ( (result!=null)
          && (! (result instanceof String))
        ) {

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JavaActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JavaActivity.java	2009-05-28 09:22:34 UTC (rev 4926)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JavaActivity.java	2009-05-28 10:10:52 UTC (rev 4927)
@@ -28,6 +28,7 @@
 import org.jbpm.api.env.Environment;
 import org.jbpm.api.model.OpenExecution;
 import org.jbpm.pvm.internal.env.EnvironmentDefaults;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.pvm.internal.script.ScriptManager;
 import org.jbpm.pvm.internal.util.ReflectUtil;
 import org.jbpm.pvm.internal.wire.Descriptor;
@@ -63,7 +64,7 @@
 
     } else if (expression!=null) {
       ScriptManager scriptManager = EnvironmentDefaults.getScriptManager();
-      target = scriptManager.evaluateExpression(expression, execution, language);
+      target = scriptManager.evaluateExpression(expression, (ExecutionImpl)execution, language);
     
     } else {
       throw new JbpmException("no target specified");

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ScriptActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ScriptActivity.java	2009-05-28 09:22:34 UTC (rev 4926)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ScriptActivity.java	2009-05-28 10:10:52 UTC (rev 4927)
@@ -23,6 +23,7 @@
 
 import org.jbpm.api.env.Environment;
 import org.jbpm.api.model.OpenExecution;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.pvm.internal.script.ScriptManager;
 
 
@@ -39,7 +40,7 @@
 
   public void perform(OpenExecution execution) {
     ScriptManager scriptManager = Environment.getFromCurrent(ScriptManager.class);
-    Object returnValue = scriptManager.evaluateScript(script, execution, language);
+    Object returnValue = scriptManager.evaluateScript(script, (ExecutionImpl)execution, language);
     
     if (variableName!=null) {
       execution.setVariable(variableName, returnValue);

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java	2009-05-28 09:22:34 UTC (rev 4926)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java	2009-05-28 10:10:52 UTC (rev 4927)
@@ -31,8 +31,6 @@
 import org.jbpm.api.session.RepositorySession;
 import org.jbpm.jpdl.internal.model.JpdlExecution;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.VariableDefinitionImpl;
-import org.jbpm.pvm.internal.model.VariableOutDefinitionSet;
 import org.jbpm.pvm.internal.script.ScriptManager;
 import org.jbpm.pvm.internal.task.SwimlaneImpl;
 
@@ -47,9 +45,10 @@
   protected String subProcessKey;
   protected String subProcessId;
   protected Map<String, String> swimlaneMappings;
-  protected List<VariableDefinitionImpl> variableDefinitions;
 
-  protected VariableOutDefinitionSet variableOutDefinitionSet;
+  protected List<SubProcessInParameterImpl> inParameters;
+  protected List<SubProcessOutParameterImpl> outParameters;
+  
   protected String outcomeExpression;
   protected Map<Object, String> outcomeVariableMappings;
 
@@ -77,12 +76,10 @@
       }
     }
     
-    for (VariableDefinitionImpl variableDefinition: variableDefinitions) {
-      String variableName = variableDefinition.getName();
-      Object value = variableDefinition.getInitValue(jpdlExecution);
-      subProcessInstance.setVariable(variableName, value);
+    for (SubProcessInParameterImpl inParameter: inParameters) {
+      inParameter.produce(jpdlExecution, subProcessInstance);
     }
-    
+
     subProcessInstance.start();
     execution.waitForSignal();
   }
@@ -93,9 +90,10 @@
     ExecutionImpl subProcessInstance = jpdlExecution.getSubProcessInstance();
     jpdlExecution.setSubProcessInstance(null);
 
-    variableOutDefinitionSet.processOutVariables(jpdlExecution, subProcessInstance);
+    for (SubProcessOutParameterImpl outParameter: outParameters) {
+      outParameter.consume(jpdlExecution, subProcessInstance);
+    }
     
-    
     String transitionName = null;
     Activity activity = execution.getActivity();
     String subProcessActivityName = subProcessInstance.getActivityName();
@@ -137,13 +135,19 @@
   public void setSubProcessId(String subProcessId) {
     this.subProcessId = subProcessId;
   }
-  public void setVariableDefinitions(List<VariableDefinitionImpl> variableDefinitions) {
-    this.variableDefinitions = variableDefinitions;
-  }
-  public void setVariableOutDefinitionSet(VariableOutDefinitionSet variableOutDefinitionSet) {
-    this.variableOutDefinitionSet = variableOutDefinitionSet;
-  }
   public void setOutcomeExpression(String outcomeExpression) {
     this.outcomeExpression = outcomeExpression;
   }
+  public List<SubProcessInParameterImpl> getInParameters() {
+    return inParameters;
+  }
+  public void setInParameters(List<SubProcessInParameterImpl> inParameters) {
+    this.inParameters = inParameters;
+  }
+  public List<SubProcessOutParameterImpl> getOutParameters() {
+    return outParameters;
+  }
+  public void setOutParameters(List<SubProcessOutParameterImpl> outParameters) {
+    this.outParameters = outParameters;
+  }
 }

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessBinding.java	2009-05-28 09:22:34 UTC (rev 4926)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessBinding.java	2009-05-28 10:10:52 UTC (rev 4927)
@@ -21,13 +21,11 @@
  */
 package org.jbpm.jpdl.internal.activity;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.jbpm.jpdl.internal.xml.JpdlParser;
-import org.jbpm.pvm.internal.model.VariableDefinitionImpl;
-import org.jbpm.pvm.internal.model.VariableOutDefinitionSet;
 import org.jbpm.pvm.internal.util.XmlUtil;
 import org.jbpm.pvm.internal.wire.Descriptor;
 import org.jbpm.pvm.internal.wire.WireContext;
@@ -55,12 +53,50 @@
     String subProcessId = XmlUtil.attribute(element, "sub-process-id");
     subProcessActivity.setSubProcessId(subProcessId);
     
-    List<VariableDefinitionImpl> variableDefinitions = JpdlParser.parseVariableDefinitions(element, parse, true);
-    subProcessActivity.setVariableDefinitions(variableDefinitions);
-    
-    VariableOutDefinitionSet variableOutDefinitionSet = JpdlParser.parseVariableOutDefinitionSet(element, parse);
-    subProcessActivity.setVariableOutDefinitionSet(variableOutDefinitionSet);
-     
+    List<SubProcessInParameterImpl> inParameters = new ArrayList<SubProcessInParameterImpl>();
+    for (Element inElement: XmlUtil.elements(element, "parameter-in")) {
+      SubProcessInParameterImpl inParameter = new SubProcessInParameterImpl();
+      parseParameter(inElement, inParameter);
+      inParameters.add(inParameter);
+
+      if (inParameter.getSubVariableName()==null) {
+        parse.addProblem("no 'subvar' specified for parameter-in", element);
+      }
+      if ( (inParameter.getExpression()==null)
+           && (inParameter.getVariableName()==null)
+         ) {
+        parse.addProblem("no 'expr' or 'variable' specified for parameter-in '"+inParameter.getSubVariableName()+"'", element);
+      }
+      if ( (inParameter.getExpression()!=null)
+           && (inParameter.getVariableName()!=null)
+         ) {
+        parse.addProblem("attributes 'expr' and 'variable' are mutually exclusive on parameter-in", element);
+      }
+    }
+    subProcessActivity.setInParameters(inParameters);
+
+    List<SubProcessOutParameterImpl> outParameters = new ArrayList<SubProcessOutParameterImpl>();
+    for (Element outElement: XmlUtil.elements(element, "parameter-out")) {
+      SubProcessOutParameterImpl outParameter = new SubProcessOutParameterImpl();
+      parseParameter(outElement, outParameter);
+      outParameters.add(outParameter);
+      
+      if (outParameter.getVariableName()==null) {
+        parse.addProblem("no 'variable' specified for parameter-in", element);
+      }
+      if ( (outParameter.getExpression()==null)
+           && (outParameter.getSubVariableName()==null)
+         ) {
+        parse.addProblem("no 'expr' or 'subvar' specified for parameter-out '"+outParameter.getVariableName()+"'", element);
+      }
+      if ( (outParameter.getExpression()!=null)
+           && (outParameter.getSubVariableName()!=null)
+         ) {
+        parse.addProblem("attributes 'expr' and 'subvar' are mutually exclusive on parameter-out '"+outParameter.getVariableName()+"'", element);
+      }
+    }
+    subProcessActivity.setOutParameters(outParameters);
+
     Map<String, String> swimlaneMappings = parseSwimlaneMappings(element, parse);
     subProcessActivity.setSwimlaneMappings(swimlaneMappings);
 
@@ -93,6 +129,26 @@
     return subProcessActivity;
   }
 
+  void parseParameter(Element element, SubProcessParameterImpl parameter) {
+    String name = XmlUtil.attribute(element, "subvar");
+    parameter.setSubVariableName(name);
+    
+    String expr = XmlUtil.attribute(element, "expr");
+    if (expr!=null) {
+      parameter.setExpression(expr);
+    }
+ 
+    String language = XmlUtil.attribute(element, "lang");
+    if (language!=null) {
+      parameter.setLanguage(language);
+    }
+
+    String variable = XmlUtil.attribute(element, "var");
+    if (variable!=null) {
+      parameter.setVariableName(variable);
+    }
+  }
+
   public static Map<String, String> parseSwimlaneMappings(Element element, Parse parse) {
     Map<String, String> swimlaneMappings = new HashMap<String, String>();
     

Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessInParameterImpl.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessInParameterImpl.java	                        (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessInParameterImpl.java	2009-05-28 10:10:52 UTC (rev 4927)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.activity;
+
+import org.jbpm.pvm.internal.env.EnvironmentDefaults;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.script.ScriptManager;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class SubProcessInParameterImpl extends SubProcessParameterImpl {
+
+  private static final long serialVersionUID = 1L;
+  
+  public void produce(ExecutionImpl superExecution, ExecutionImpl subProcessInstance) {
+    Object value = null;
+    if (variableName!=null) {
+      value = superExecution.getVariable(variableName);
+    } else {
+      ScriptManager scriptManager = EnvironmentDefaults.getScriptManager();
+      value = scriptManager.evaluateExpression(expression, superExecution, language);
+    }
+    
+    subProcessInstance.setVariable(subVariableName, value);
+  }
+}


Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessInParameterImpl.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessOutParameterImpl.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessOutParameterImpl.java	                        (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessOutParameterImpl.java	2009-05-28 10:10:52 UTC (rev 4927)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.activity;
+
+import org.jbpm.pvm.internal.env.EnvironmentDefaults;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
+import org.jbpm.pvm.internal.script.ScriptManager;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class SubProcessOutParameterImpl extends SubProcessParameterImpl {
+
+  private static final long serialVersionUID = 1L;
+  
+  public void consume(ExecutionImpl superExecution, ScopeInstanceImpl subProcessInstance) {
+    Object value = null;
+    
+    if (variableName!=null) {
+      value = subProcessInstance.getVariable(subVariableName);
+    } else {
+      ScriptManager scriptManager = EnvironmentDefaults.getScriptManager();
+      value = scriptManager.evaluateExpression(expression, subProcessInstance, language);
+    }
+
+    superExecution.setVariable(variableName, value);
+  }
+}


Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessOutParameterImpl.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessParameterImpl.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessParameterImpl.java	                        (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessParameterImpl.java	2009-05-28 10:10:52 UTC (rev 4927)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jpdl.internal.activity;
+
+import java.io.Serializable;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class SubProcessParameterImpl implements Serializable {
+
+  private static final long serialVersionUID = 1L;
+
+  protected String subVariableName;
+  protected String variableName;
+  protected String expression;
+  protected String language;
+
+  public String getVariableName() {
+    return variableName;
+  }
+  public void setVariableName(String variable) {
+    this.variableName = variable;
+  }
+  public String getExpression() {
+    return expression;
+  }
+  public void setExpression(String expression) {
+    this.expression = expression;
+  }
+  public String getLanguage() {
+    return language;
+  }
+  public void setLanguage(String language) {
+    this.language = language;
+  }
+  public String getSubVariableName() {
+    return subVariableName;
+  }
+  public void setSubVariableName(String name) {
+    this.subVariableName = name;
+  }
+}


Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessParameterImpl.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/MailProducerImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/MailProducerImpl.java	2009-05-28 09:22:34 UTC (rev 4926)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/MailProducerImpl.java	2009-05-28 10:10:52 UTC (rev 4927)
@@ -51,6 +51,7 @@
 import org.jbpm.pvm.internal.email.spi.AddressResolver;
 import org.jbpm.pvm.internal.email.spi.MailProducer;
 import org.jbpm.pvm.internal.identity.spi.IdentitySession;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.pvm.internal.script.ScriptManager;
 
 /**
@@ -131,7 +132,7 @@
 
   private String evaluateExpression(String expression, Execution execution) {
     ScriptManager scriptManager = Environment.getFromCurrent(ScriptManager.class);
-    Object value = scriptManager.evaluateExpression(expression, execution, template.getLanguage());
+    Object value = scriptManager.evaluateExpression(expression, (ExecutionImpl)execution, template.getLanguage());
     if (!(value instanceof String)) {
       throw new JbpmException("expected expression '"
           + expression

Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ExecutionContext.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ExecutionContext.java	2009-05-28 09:22:34 UTC (rev 4926)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ExecutionContext.java	2009-05-28 10:10:52 UTC (rev 4927)
@@ -1,62 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.env;
-
-import java.util.Set;
-
-import org.jbpm.api.Execution;
-import org.jbpm.api.env.Context;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
-
-public class ExecutionContext implements Context {
-  
-  ExecutionImpl execution;
-
-  public String getName() {
-    return "execution";
-  }
-
-  public ExecutionContext(Execution execution) {
-    this.execution = (ExecutionImpl) execution;
-  }
-
-  public Object get(String key) {
-    return execution.getVariable(key);
-  }
-
-  public boolean has(String key) {
-    return execution.hasVariable(key);
-  }
-
-  public Set<String> keys() {
-    return execution.getVariableKeys();
-  }
-
-  public Object set(String key, Object value) {
-    execution.setVariable(key, value);
-    return null;
-  }
-
-  public <T> T get(Class<T> type) {
-    return null;
-  }
-}

Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ExecutionEnvironment.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ExecutionEnvironment.java	2009-05-28 09:22:34 UTC (rev 4926)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ExecutionEnvironment.java	2009-05-28 10:10:52 UTC (rev 4927)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.env;
-
-import org.jbpm.api.Execution;
-
-/**
- * @author Tom Baeyens
- */
-public class ExecutionEnvironment extends BasicEnvironment {
-
-  private static final long serialVersionUID = 1L;
-  
-  public ExecutionEnvironment(Execution execution) {
-    addContext(new ExecutionContext(execution));
-    pushEnvironment(this);
-  }
-}

Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ScopeInstanceContext.java (from rev 4923, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ExecutionContext.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ScopeInstanceContext.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ScopeInstanceContext.java	2009-05-28 10:10:52 UTC (rev 4927)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.env;
+
+import java.util.Set;
+
+import org.jbpm.api.JbpmException;
+import org.jbpm.api.env.Context;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
+import org.jbpm.pvm.internal.task.TaskImpl;
+
+public class ScopeInstanceContext implements Context {
+  
+  String name;
+  ScopeInstanceImpl scopeInstance;
+
+  public String getName() {
+    return name;
+  }
+
+  public ScopeInstanceContext(ScopeInstanceImpl scopeInstance) {
+    this.scopeInstance = scopeInstance;
+    if (scopeInstance instanceof ExecutionImpl) {
+      name = "execution";
+    } else if (scopeInstance instanceof TaskImpl) {
+      name = "task";
+    } else {
+      throw new JbpmException("invalid scope instance "+scopeInstance);
+    }
+  }
+
+  public Object get(String key) {
+    return scopeInstance.getVariable(key);
+  }
+
+  public boolean has(String key) {
+    return scopeInstance.hasVariable(key);
+  }
+
+  public Set<String> keys() {
+    return scopeInstance.getVariableKeys();
+  }
+
+  public Object set(String key, Object value) {
+    scopeInstance.setVariable(key, value);
+    return null;
+  }
+
+  public <T> T get(Class<T> type) {
+    return null;
+  }
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ScopeInstanceContext.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ScopeInstanceEnvironment.java (from rev 4923, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ExecutionEnvironment.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ScopeInstanceEnvironment.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ScopeInstanceEnvironment.java	2009-05-28 10:10:52 UTC (rev 4927)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.env;
+
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
+
+/**
+ * @author Tom Baeyens
+ */
+public class ScopeInstanceEnvironment extends BasicEnvironment {
+
+  private static final long serialVersionUID = 1L;
+  
+  public ScopeInstanceEnvironment(ScopeInstanceImpl scopeInstance) {
+    addContext(new ScopeInstanceContext(scopeInstance));
+    pushEnvironment(this);
+  }
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/ScopeInstanceEnvironment.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:mergeinfo
   + 
Name: svn:eol-style
   + LF

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionEvaluator.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionEvaluator.java	2009-05-28 09:22:34 UTC (rev 4926)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionEvaluator.java	2009-05-28 10:10:52 UTC (rev 4927)
@@ -49,7 +49,7 @@
 
   public Object evaluateExpression(OpenExecution execution) {
     ScriptManager scriptManager = EnvironmentDefaults.getScriptManager();
-    return scriptManager.evaluateExpression(expr, execution, lang);
+    return scriptManager.evaluateExpression(expr, (ExecutionImpl)execution, lang);
   }
 
   public String getName() {

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptManager.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptManager.java	2009-05-28 09:22:34 UTC (rev 4926)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptManager.java	2009-05-28 10:10:52 UTC (rev 4927)
@@ -31,8 +31,9 @@
 import org.jbpm.api.JbpmException;
 import org.jbpm.api.env.Environment;
 import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.ExecutionContext;
-import org.jbpm.pvm.internal.env.ExecutionEnvironment;
+import org.jbpm.pvm.internal.env.ScopeInstanceContext;
+import org.jbpm.pvm.internal.env.ScopeInstanceEnvironment;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
 import org.jbpm.pvm.internal.wire.WireContext;
 import org.jbpm.pvm.internal.wire.WireDefinition;
 import org.jbpm.pvm.internal.wire.xml.WireParser;
@@ -78,22 +79,22 @@
   /** {@link #evaluate(String, Execution, String) evaluates} the expression 
    * with the given language or with the defaultExpressionLanguage if the 
    * given language is null. */
-  public Object evaluateExpression(String expression, Execution execution, String language) {
-    return evaluate(expression, execution, (language!=null ? language : defaultExpressionLanguage));
+  public Object evaluateExpression(String expression, ScopeInstanceImpl scopeInstance, String language) {
+    return evaluate(expression, scopeInstance, (language!=null ? language : defaultExpressionLanguage));
   }
 
   /** {@link #evaluate(String, Execution, String) evaluates} the script 
    * with the given language or with the defaultScriptLanguage if the 
    * given language is null. */
-  public Object evaluateScript(String script, Execution execution, String language) {
-    return evaluate(script, execution, (language!=null ? language : defaultScriptLanguage));
+  public Object evaluateScript(String script, ScopeInstanceImpl scopeInstance, String language) {
+    return evaluate(script, scopeInstance, (language!=null ? language : defaultScriptLanguage));
   }
 
   /** evaluates the script with the given language.
    * If script is null, then this method will return null.
    * @throws JbpmException if language is null.
    */
-  public Object evaluate(String script, Execution execution, String language) {
+  public Object evaluate(String script, ScopeInstanceImpl scopeInstance, String language) {
     if (script==null) {
       return null;
     }
@@ -107,13 +108,13 @@
     
     if (log.isTraceEnabled()) log.trace("evaluating "+language+" script "+script);
     
-    if (execution==null) {
+    if (scopeInstance==null) {
       return evaluate(scriptEngine, script);
     }
 
     Environment environment = Environment.getCurrent();
     if (environment==null) {
-      environment = new ExecutionEnvironment(execution);
+      environment = new ScopeInstanceEnvironment(scopeInstance);
       try {
         return evaluate(scriptEngine, script);
       } finally {
@@ -121,7 +122,7 @@
       }
     }
 
-    ExecutionContext executionContext = new ExecutionContext(execution);
+    ScopeInstanceContext executionContext = new ScopeInstanceContext(scopeInstance);
     environment.addContext(executionContext);
     try {
       return evaluate(scriptEngine, script);

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/GroovyExpressionTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/GroovyExpressionTest.java	2009-05-28 09:22:34 UTC (rev 4926)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/GroovyExpressionTest.java	2009-05-28 10:10:52 UTC (rev 4927)
@@ -27,6 +27,7 @@
 import org.jbpm.pvm.activities.WaitState;
 import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
 import org.jbpm.pvm.internal.cfg.JbpmConfiguration;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.pvm.internal.script.ScriptManager;
 import org.jbpm.test.BaseJbpmTestCase;
 
@@ -68,7 +69,7 @@
     
     Environment environment = environmentFactory.openEnvironment();
     try {
-      assertEquals("hello", scriptManager.evaluateExpression("pv", execution, "groovy"));
+      assertEquals("hello", scriptManager.evaluateExpression("pv", (ExecutionImpl)execution, "groovy"));
     } finally {
       environment.close();
     }

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/JuelExpressionTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/JuelExpressionTest.java	2009-05-28 09:22:34 UTC (rev 4926)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/JuelExpressionTest.java	2009-05-28 10:10:52 UTC (rev 4927)
@@ -27,6 +27,7 @@
 import org.jbpm.pvm.activities.WaitState;
 import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
 import org.jbpm.pvm.internal.cfg.JbpmConfiguration;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.pvm.internal.script.ScriptManager;
 import org.jbpm.test.BaseJbpmTestCase;
 
@@ -64,7 +65,7 @@
     
     Environment environment = environmentFactory.openEnvironment();
     try {
-      assertEquals("hello", scriptManager.evaluateExpression("#{pv}", execution, null));
+      assertEquals("hello", scriptManager.evaluateExpression("#{pv}", (ExecutionImpl)execution, null));
     } finally {
       environment.close();
     }

Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Jpdl.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Jpdl.xml	2009-05-28 09:22:34 UTC (rev 4926)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Jpdl.xml	2009-05-28 10:10:52 UTC (rev 4927)
@@ -1274,7 +1274,7 @@
 	        </thead>
 	        <tbody>
 	          <row>
-	            <entry><literal>variable</literal></entry>
+	            <entry><literal>parameter-in</literal></entry>
 	            <entry>0..*</entry>
 	            <entry>Declares a variable that is passed to the sub process instance
 	            when it is created.
@@ -1290,9 +1290,9 @@
             </row>
              -->
 	          <row>
-	            <entry><literal>out-variable</literal></entry>
+	            <entry><literal>parameter-out</literal></entry>
 	            <entry>0..*</entry>
-	            <entry>Declares a variable that will be set in the parent execution
+	            <entry>Declares a variable that will be set in the super process execution
 	            when the sub process ends.
 	            </entry>
 	          </row>
@@ -1300,6 +1300,100 @@
 	      </tgroup>
 	    </table>
 
+      <table><title><literal>parameter-in</literal> attributes:</title>
+        <tgroup cols="5" rowsep="1" colsep="1">
+          <thead>
+            <row>
+              <entry>Attribute</entry>
+              <entry>Type</entry>
+              <entry>Default</entry>
+              <entry>Required?</entry>
+              <entry>Description</entry>
+            </row>
+          </thead>
+          <tbody>
+            <row>
+              <entry><literal>subvar</literal></entry>
+              <entry>string</entry>
+              <entry></entry>
+              <entry><emphasis role="bold">required</emphasis> </entry>
+              <entry>The name of the sub process variable in which the value is set.</entry>
+            </row>
+            <row>
+              <entry><literal>var</literal></entry>
+              <entry>string</entry>
+              <entry></entry>
+              <entry>exactly one of {'var', 'expr'} is required to specify the value</entry>
+              <entry>The name of the variable in the super process execution context.</entry>
+            </row>
+            <row>
+              <entry><literal>expr</literal></entry>
+              <entry>string</entry>
+              <entry></entry>
+              <entry>exactly one of {'var', 'expr'} is required to specify the value</entry>
+              <entry>An expression that will be resolved in the <emphasis role="bold">super</emphasis> process execution 
+              context.  The resulting value will be set in the sub process variable.
+              </entry>
+            </row>
+            <row>
+              <entry><literal>lang</literal></entry>
+              <entry>string</entry>
+              <entry>juel</entry>
+              <entry>optional</entry>
+              <entry>The scripting language in which the expression should be resolved.</entry>
+            </row>
+          </tbody>
+        </tgroup>
+      </table>
+
+      <table><title><literal>parameter-out</literal> attributes:</title>
+        <tgroup cols="5" rowsep="1" colsep="1">
+          <thead>
+            <row>
+              <entry>Attribute</entry>
+              <entry>Type</entry>
+              <entry>Default</entry>
+              <entry>Required?</entry>
+              <entry>Description</entry>
+            </row>
+          </thead>
+          <tbody>
+            <row>
+              <entry><literal>var</literal></entry>
+              <entry>string</entry>
+              <entry></entry>
+              <entry><emphasis role="bold">required</emphasis></entry>
+              <entry>The name of the variable in the super process execution context
+              in which the value will be set.</entry>
+            </row>
+            <row>
+              <entry><literal>subvar</literal></entry>
+              <entry>string</entry>
+              <entry></entry>
+              <entry>exactly one of {'subvar', 'expr'} is required to specify the value</entry>
+              <entry>The name of the sub process variable from which the value 
+              will be taken.</entry>
+            </row>
+            <row>
+              <entry><literal>expr</literal></entry>
+              <entry>string</entry>
+              <entry></entry>
+              <entry>exactly one of {'subvar', 'expr'} is required to specify the value</entry>
+              <entry>An expression that will be resolved in the <emphasis role="bold">sub</emphasis> process execution 
+              context.  The resulting value will be set in the super process variable.
+              </entry>
+            </row>
+            <row>
+              <entry><literal>lang</literal></entry>
+              <entry>string</entry>
+              <entry>juel</entry>
+              <entry>optional</entry>
+              <entry>The scripting language in which the expression should be resolved.</entry>
+            </row>
+          </tbody>
+        </tgroup>
+      </table>
+
       <table><title>Extra <literal>transition</literal> elements in case of outcome variable mappings:</title>
         <tgroup cols="3" rowsep="1" colsep="1">
           <thead>
@@ -1343,8 +1437,8 @@
   <emphasis role="bold">&lt;sub-process name=&quot;review&quot;
                sub-process-key=&quot;SubProcessReview&quot;&gt;
                
-    &lt;variable name=&quot;document&quot; init=&quot;#{document}&quot; /&gt;
-    &lt;out-variable name=&quot;reviewResult&quot; init=&quot;#{result}&quot; /&gt;
+    &lt;parameter-in var=&quot;document&quot; subvar=&quot;document&quot; /&gt;
+    &lt;parameter-out var=&quot;reviewResult&quot; subvar=&quot;result&quot; /&gt;
     
     &lt;transition to=&quot;wait&quot; /&gt;
   &lt;/sub-process&gt;</emphasis>




More information about the jbpm-commits mailing list