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

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Apr 20 16:43:59 EDT 2009


Author: tom.baeyens at jboss.com
Date: 2009-04-20 16:43:59 -0400 (Mon, 20 Apr 2009)
New Revision: 4590

Added:
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomeactivity/
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomeactivity/SubProcessOutcomeActivityTest.java
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomevalue/
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomevalue/SubProcessOutcomeValueTest.java
   jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomeactivity/
   jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomeactivity/SubProcessDocument.jpdl.xml
   jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomeactivity/SubProcessReview.jpdl.xml
   jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomevalue/
   jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomevalue/SubProcessDocument.jpdl.xml
   jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomevalue/SubProcessReview.jpdl.xml
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/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/userguide/src/main/docbook/en/modules/ch05-Jpdl.xml
Log:
JBPM-2025 sub process activity : outcome mapping examples

Modified: jbpm4/trunk/modules/api/src/main/resources/jpdl-4.0.xsd
===================================================================
--- jbpm4/trunk/modules/api/src/main/resources/jpdl-4.0.xsd	2009-04-20 17:32:22 UTC (rev 4589)
+++ jbpm4/trunk/modules/api/src/main/resources/jpdl-4.0.xsd	2009-04-20 20:43:59 UTC (rev 4590)
@@ -395,11 +395,6 @@
                           <group ref="tns:wireObjectGroup" />
                         </complexType>
                       </element>
-                      <element name="outcome">
-                        <complexType>
-                          <attribute name="activity" type="string" use="required" />
-                        </complexType>
-                      </element>
                     </sequence>
                   </extension>
                 </complexContent>

Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomeactivity/SubProcessOutcomeActivityTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomeactivity/SubProcessOutcomeActivityTest.java	                        (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomeactivity/SubProcessOutcomeActivityTest.java	2009-04-20 20:43:59 UTC (rev 4590)
@@ -0,0 +1,108 @@
+/*
+ * 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.examples.subprocess.outcomeactivity;
+
+import java.util.List;
+
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.task.Task;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class SubProcessOutcomeActivityTest extends JbpmTestCase {
+
+  long subProcessReviewDeploymentDbid;
+  long subProcessDocumentDeploymentDbid;
+  
+  protected void setUp() throws Exception {
+    super.setUp();
+    
+    subProcessReviewDeploymentDbid = repositoryService.createDeployment()
+        .addResourceFromClasspath("org/jbpm/examples/subprocess/outcomeactivity/SubProcessReview.jpdl.xml")
+        .deploy();
+
+    subProcessDocumentDeploymentDbid = repositoryService.createDeployment()
+        .addResourceFromClasspath("org/jbpm/examples/subprocess/outcomeactivity/SubProcessDocument.jpdl.xml")
+        .deploy();
+  }
+
+  protected void tearDown() throws Exception {
+    repositoryService.deleteDeploymentCascade(subProcessReviewDeploymentDbid);
+    repositoryService.deleteDeploymentCascade(subProcessDocumentDeploymentDbid);
+    
+    super.tearDown();
+  }
+
+  public void testSubProcessResultOk() {
+    ProcessInstance processInstance = executionService
+        .startProcessInstanceByKey("SubProcessDocument");
+    
+    assertNotNull(processInstance.findActiveExecutionIn("review"));
+
+    List<Task> taskList = taskService.findAssignedTasks("johndoe");
+    Task task = taskList.get(0);
+    
+    // the task in the sub process instance is completed 
+    taskService.completeTask(task.getDbid(), "ok");
+
+    // we check that the process instance has moved to the next step 
+    processInstance = executionService.findProcessInstanceById(processInstance.getId());
+    assertNotNull(processInstance.findActiveExecutionIn("next step"));
+  }
+
+  public void testSubProcessResultNok() {
+    ProcessInstance processInstance = executionService
+        .startProcessInstanceByKey("SubProcessDocument");
+    
+    assertNotNull(processInstance.findActiveExecutionIn("review"));
+
+    List<Task> taskList = taskService.findAssignedTasks("johndoe");
+    Task task = taskList.get(0);
+    
+    // the task in the sub process instance is completed 
+    taskService.completeTask(task.getDbid(), "nok");
+
+    // we check that the process instance has moved to update
+    processInstance = executionService.findProcessInstanceById(processInstance.getId());
+    assertNotNull(processInstance.findActiveExecutionIn("update"));
+  }
+
+  public void testSubProcessResultReject() {
+    ProcessInstance processInstance = executionService
+        .startProcessInstanceByKey("SubProcessDocument");
+    
+    assertNotNull(processInstance.findActiveExecutionIn("review"));
+
+    List<Task> taskList = taskService.findAssignedTasks("johndoe");
+    Task task = taskList.get(0);
+    
+    // the task in the sub process instance is completed 
+    taskService.completeTask(task.getDbid(), "reject");
+
+    // we check that the process instance has moved to close
+    processInstance = executionService.findProcessInstanceById(processInstance.getId());
+    assertNotNull(processInstance.findActiveExecutionIn("close"));
+  }
+}


Property changes on: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomeactivity/SubProcessOutcomeActivityTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomevalue/SubProcessOutcomeValueTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomevalue/SubProcessOutcomeValueTest.java	                        (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomevalue/SubProcessOutcomeValueTest.java	2009-04-20 20:43:59 UTC (rev 4590)
@@ -0,0 +1,117 @@
+/*
+ * 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.examples.subprocess.outcomevalue;
+
+import java.util.List;
+
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.task.Task;
+import org.jbpm.test.JbpmTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class SubProcessOutcomeValueTest extends JbpmTestCase {
+
+  long subProcessReviewDeploymentDbid;
+  long subProcessDocumentDeploymentDbid;
+  
+  protected void setUp() throws Exception {
+    super.setUp();
+    
+    subProcessReviewDeploymentDbid = repositoryService.createDeployment()
+        .addResourceFromClasspath("org/jbpm/examples/subprocess/outcomevalue/SubProcessReview.jpdl.xml")
+        .deploy();
+
+    subProcessDocumentDeploymentDbid = repositoryService.createDeployment()
+        .addResourceFromClasspath("org/jbpm/examples/subprocess/outcomevalue/SubProcessDocument.jpdl.xml")
+        .deploy();
+  }
+
+  protected void tearDown() throws Exception {
+    repositoryService.deleteDeploymentCascade(subProcessReviewDeploymentDbid);
+    repositoryService.deleteDeploymentCascade(subProcessDocumentDeploymentDbid);
+    
+    super.tearDown();
+  }
+
+  public void testSubProcessResultOk() {
+    ProcessInstance processInstance = executionService
+        .startProcessInstanceByKey("SubProcessDocument");
+    
+    assertNotNull(processInstance.findActiveExecutionIn("review"));
+
+    List<Task> taskList = taskService.findAssignedTasks("johndoe");
+    Task task = taskList.get(0);
+    
+    // the result variable is set in the task
+    taskService.setVariable(task.getDbid(), "result", "ok");
+    
+    // the task in the sub process instance is completed 
+    taskService.completeTask(task.getDbid());
+
+    // we check that the process instance has moved to the next step 
+    processInstance = executionService.findProcessInstanceById(processInstance.getId());
+    assertNotNull(processInstance.findActiveExecutionIn("next step"));
+  }
+
+  public void testSubProcessResultNok() {
+    ProcessInstance processInstance = executionService
+        .startProcessInstanceByKey("SubProcessDocument");
+    
+    assertNotNull(processInstance.findActiveExecutionIn("review"));
+
+    List<Task> taskList = taskService.findAssignedTasks("johndoe");
+    Task task = taskList.get(0);
+    
+    // the result variable is set in the task
+    taskService.setVariable(task.getDbid(), "result", "nok");
+    
+    // the task in the sub process instance is completed 
+    taskService.completeTask(task.getDbid());
+
+    // we check that the process instance has moved to update
+    processInstance = executionService.findProcessInstanceById(processInstance.getId());
+    assertNotNull(processInstance.findActiveExecutionIn("update"));
+  }
+
+  public void testSubProcessResultReject() {
+    ProcessInstance processInstance = executionService
+        .startProcessInstanceByKey("SubProcessDocument");
+    
+    assertNotNull(processInstance.findActiveExecutionIn("review"));
+
+    List<Task> taskList = taskService.findAssignedTasks("johndoe");
+    Task task = taskList.get(0);
+    
+    // the result variable is set in the task
+    taskService.setVariable(task.getDbid(), "result", "reject");
+    
+    // the task in the sub process instance is completed 
+    taskService.completeTask(task.getDbid());
+
+    // we check that the process instance has moved to close
+    processInstance = executionService.findProcessInstanceById(processInstance.getId());
+    assertNotNull(processInstance.findActiveExecutionIn("close"));
+  }
+}


Property changes on: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/outcomevalue/SubProcessOutcomeValueTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

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-04-20 17:32:22 UTC (rev 4589)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/subprocess/variables/SubProcessVariablesTest.java	2009-04-20 20:43:59 UTC (rev 4590)
@@ -35,24 +35,24 @@
  */
 public class SubProcessVariablesTest extends JbpmTestCase {
 
-  long reviewDeploymentDbid;
-  long subProcessDeploymentDbid;
+  long subProcessReviewDeploymentDbid;
+  long subProcessDocumentDeploymentDbid;
   
   protected void setUp() throws Exception {
     super.setUp();
     
-    reviewDeploymentDbid = repositoryService.createDeployment()
+    subProcessReviewDeploymentDbid = repositoryService.createDeployment()
         .addResourceFromClasspath("org/jbpm/examples/subprocess/variables/SubProcessReview.jpdl.xml")
         .deploy();
 
-    subProcessDeploymentDbid = repositoryService.createDeployment()
+    subProcessDocumentDeploymentDbid = repositoryService.createDeployment()
         .addResourceFromClasspath("org/jbpm/examples/subprocess/variables/SubProcessDocument.jpdl.xml")
         .deploy();
   }
 
   protected void tearDown() throws Exception {
-    repositoryService.deleteDeploymentCascade(reviewDeploymentDbid);
-    repositoryService.deleteDeploymentCascade(subProcessDeploymentDbid);
+    repositoryService.deleteDeploymentCascade(subProcessReviewDeploymentDbid);
+    repositoryService.deleteDeploymentCascade(subProcessDocumentDeploymentDbid);
     
     super.tearDown();
   }

Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomeactivity/SubProcessDocument.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomeactivity/SubProcessDocument.jpdl.xml	                        (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomeactivity/SubProcessDocument.jpdl.xml	2009-04-20 20:43:59 UTC (rev 4590)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="SubProcessDocument" xmlns="http://jbpm.org/4/jpdl">
+
+  <start g="20,20,48,48">
+    <transition to="review" />
+  </start>
+
+  <sub-process name="review"
+               sub-process-key="SubProcessReview"
+               g="96,16,127,52">
+               
+    <transition name="ok" to="next step" />
+    <transition name="nok" to="update" />
+    <transition name="reject" to="close" />
+  </sub-process>
+  
+  <state name="next step" g="255,16,88,52"/>
+  <state name="update" g="255,36,88,52"/>
+  <state name="close" g="255,56,88,52"/>
+
+</process>


Property changes on: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomeactivity/SubProcessDocument.jpdl.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomeactivity/SubProcessReview.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomeactivity/SubProcessReview.jpdl.xml	                        (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomeactivity/SubProcessReview.jpdl.xml	2009-04-20 20:43:59 UTC (rev 4590)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="SubProcessReview" xmlns="http://jbpm.org/4/jpdl">
+
+  <start g="20,20,48,48">
+    <transition to="get approval"/>
+  </start>
+
+  <task name="get approval"
+        assignee="johndoe" 
+        g="96,16,127,52">
+
+    <transition name="ok" to="ok"/>
+    <transition name="nok" to="nok"/>
+    <transition name="reject" to="reject"/>
+  </task>
+  
+  <end name="ok" g="254,19,88,52" />
+  <end name="nok" g="254,19,88,52" />
+  <end name="reject" g="254,19,88,52" />
+
+</process>
\ No newline at end of file


Property changes on: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomeactivity/SubProcessReview.jpdl.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomevalue/SubProcessDocument.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomevalue/SubProcessDocument.jpdl.xml	                        (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomevalue/SubProcessDocument.jpdl.xml	2009-04-20 20:43:59 UTC (rev 4590)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="SubProcessDocument" xmlns="http://jbpm.org/4/jpdl">
+
+  <start g="20,20,48,48">
+    <transition to="review" />
+  </start>
+
+  <sub-process name="review"
+               sub-process-key="SubProcessReview"
+               outcome="#{result}" 
+               g="96,16,127,52">
+               
+    <transition name="ok" to="next step" />
+    <transition name="nok" to="update" />
+    <transition name="reject" to="close" />
+  </sub-process>
+  
+  <state name="next step" g="255,16,88,52"/>
+  <state name="update" g="255,36,88,52"/>
+  <state name="close" g="255,56,88,52"/>
+
+</process>


Property changes on: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomevalue/SubProcessDocument.jpdl.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomevalue/SubProcessReview.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomevalue/SubProcessReview.jpdl.xml	                        (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomevalue/SubProcessReview.jpdl.xml	2009-04-20 20:43:59 UTC (rev 4590)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="SubProcessReview" xmlns="http://jbpm.org/4/jpdl">
+
+  <start g="20,20,48,48">
+    <transition to="get approval"/>
+  </start>
+
+  <task name="get approval"
+        assignee="johndoe" 
+        g="96,16,127,52">
+
+    <transition to="end"/>
+  </task>
+  
+  <end name="end" g="254,19,88,52" />
+
+</process>
\ No newline at end of file


Property changes on: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/subprocess/outcomevalue/SubProcessReview.jpdl.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

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-04-20 17:32:22 UTC (rev 4589)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java	2009-04-20 20:43:59 UTC (rev 4590)
@@ -27,6 +27,7 @@
 import org.jbpm.api.activity.ActivityExecution;
 import org.jbpm.api.client.ClientProcessDefinition;
 import org.jbpm.api.env.Environment;
+import org.jbpm.api.model.Activity;
 import org.jbpm.api.session.RepositorySession;
 import org.jbpm.jpdl.internal.model.JpdlExecution;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
@@ -49,7 +50,6 @@
   protected List<VariableDefinitionImpl> variableDefinitions;
 
   protected VariableOutDefinitionSet variableOutDefinitionSet;
-  protected Map<String, String> outcomeActivityMappings;
   protected String outcomeExpression;
   protected Map<Object, String> outcomeVariableMappings;
 
@@ -97,17 +97,25 @@
     
     
     String transitionName = null;
+    Activity activity = execution.getActivity();
+    String subProcessActivityName = subProcessInstance.getActivityName();
     
     if (outcomeExpression!=null) {
       ScriptManager scriptManager = Environment.getFromCurrent(ScriptManager.class);
       Object value = scriptManager.evaluateExpression(outcomeExpression, subProcessInstance, null);
-      transitionName = outcomeActivityMappings.get(value);
+      // if the value is a String and matches the name of an outgoing transition
+      if ( (value instanceof String)
+           && (activity.hasOutgoingTransition(((String) value)))
+         ) {
+        // then take that one
+        transitionName = (String) value; 
+      } else {
+        // else see if there is a value mapping
+        transitionName = outcomeVariableMappings.get(value);
+      }
 
-    } else if ( (outcomeActivityMappings!=null)
-                && (!outcomeActivityMappings.isEmpty())
-              ) {
-      String subProcessActivityName = subProcessInstance.getActivityName();
-      transitionName = outcomeActivityMappings.get(subProcessActivityName);
+    } else if (activity.hasOutgoingTransition(subProcessActivityName)) {
+      transitionName = subProcessActivityName;
     }
     
     if (transitionName!=null) {
@@ -120,9 +128,6 @@
   public void setSwimlaneMappings(Map<String, String> swimlaneMappings) {
     this.swimlaneMappings = swimlaneMappings;
   }
-  public void setOutcomeActivityMappings(Map<String, String> outcomeActivityMappings) {
-    this.outcomeActivityMappings = outcomeActivityMappings;
-  }
   public void setOutcomeVariableMappings(Map<Object, String> outcomeVariableMappings) {
     this.outcomeVariableMappings = outcomeVariableMappings;
   }

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-04-20 17:32:22 UTC (rev 4589)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessBinding.java	2009-04-20 20:43:59 UTC (rev 4590)
@@ -64,11 +64,12 @@
     Map<String, String> swimlaneMappings = parseSwimlaneMappings(element, parse);
     subProcessActivity.setSwimlaneMappings(swimlaneMappings);
 
-    Map<String, String> outcomeActivityMappings = new HashMap<String, String>();
     Map<Object, String> outcomeVariableMappings = new HashMap<Object, String>();
 
     String outcomeExpression = XmlUtil.attribute(element, "outcome");
     if (outcomeExpression!=null) {
+      subProcessActivity.setOutcomeExpression(outcomeExpression);
+      
       for (Element transitionElement: XmlUtil.elements(element, "transition")) {
         Element outcomeValueElement = XmlUtil.element(transitionElement, "outcome-value");
         if (outcomeValueElement!=null) {
@@ -87,22 +88,6 @@
         }
       }
 
-    } else {  // no outcome expression
-
-      // search for end activity mappings
-      for (Element transitionElement: XmlUtil.elements(element, "transition")) {
-        Element outcomeElement = XmlUtil.element(transitionElement, "outcome");
-        if (outcomeElement!=null) {
-          String transitionName = XmlUtil.attribute(transitionElement, "name");
-          if (transitionName==null) {
-            parse.addProblem("transitions with an outcome must have a name", transitionElement);
-          }
-          String activity = XmlUtil.attribute(outcomeElement, "activity");
-          if (activity!=null) {
-            outcomeActivityMappings.put(activity, transitionName);
-          }
-        }
-      }
     }
 
     return subProcessActivity;

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-04-20 17:32:22 UTC (rev 4589)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Jpdl.xml	2009-04-20 20:43:59 UTC (rev 4590)
@@ -1238,51 +1238,6 @@
         </tgroup>
       </table>
       
-      <table><title>Extra <literal>transition</literal> elements in case of activity mappings:</title>
-        <tgroup cols="3" rowsep="1" colsep="1">
-          <thead>
-            <row>
-              <entry>Element</entry>
-              <entry>Multiplicity</entry>
-              <entry>Description</entry>
-            </row>
-          </thead>
-          <tbody>
-            <row>
-              <entry><literal>outcome</literal></entry>
-              <entry>0..1</entry>
-              <entry>Specifies 
-              </entry>
-            </row>
-          </tbody>
-        </tgroup>
-      </table>
-      
-      <table><title><literal>outcome</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>activity</literal></entry>
-              <entry>string</entry>
-              <entry></entry>
-              <entry><emphasis role="bold">required</emphasis></entry>
-              <entry>Refers to an <literal>end</literal> activity name of the 
-              sub-process.  This transition is taken when the sub process ends in
-              that specific <literal>end</literal> activity.</entry>
-            </row>
-          </tbody>
-        </tgroup>
-      </table>
-      
       <!-- ~~~ SUB PROCESS VARIABLES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
 
       <section id="subprocessvariables">




More information about the jbpm-commits mailing list