[jbpm-commits] JBoss JBPM SVN: r3350 - in jbpm4/trunk/modules: examples/src/test/java/org/jbpm/examples/state and 6 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Dec 11 17:02:01 EST 2008


Author: tom.baeyens at jboss.com
Date: 2008-12-11 17:02:01 -0500 (Thu, 11 Dec 2008)
New Revision: 3350

Added:
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/sequence/
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/sequence/StateSequenceTest.java
   jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/state/sequence/
   jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/state/sequence/process.jpdl.xml
Removed:
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/states/StateSequenceTest.java
   jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/states/process.jpdl.xml
Modified:
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/processinstance/EndProcessInstanceTest.java
   jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml
Log:
more examples

Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/processinstance/EndProcessInstanceTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/processinstance/EndProcessInstanceTest.java	2008-12-11 21:04:38 UTC (rev 3349)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/processinstance/EndProcessInstanceTest.java	2008-12-11 22:02:01 UTC (rev 3350)
@@ -30,33 +30,10 @@
  */
 public class EndProcessInstanceTest extends DbTestCase {
 
-  public void testEndOk() {
-    deployJpdlResource("org/jbpm/examples/end/multiple/process.jpdl.xml");
+  public void testEndProcessInstance() {
+    deployJpdlResource("org/jbpm/examples/end/processinstance/process.jpdl.xml");
     
-    Execution execution = executionService.startExecutionByKey("EndMultiple");
-    String executionId = execution.getId();
-    
-    execution = executionService.signalExecutionById(executionId, "200");
-    assertEquals("ok", execution.getNodeName());
+    Execution execution = executionService.startExecutionByKey("EndProcessInstance");
+    assertTrue(execution.isEnded());
   }
-
-  public void testEndBadRequest() {
-    deployJpdlResource("org/jbpm/examples/end/multiple/process.jpdl.xml");
-    
-    Execution execution = executionService.startExecutionByKey("EndMultiple");
-    String executionId = execution.getId();
-    
-    execution = executionService.signalExecutionById(executionId, "400");
-    assertEquals("bad request", execution.getNodeName());
-  }
-
-  public void testEndInternalServerError() {
-    deployJpdlResource("org/jbpm/examples/end/multiple/process.jpdl.xml");
-    
-    Execution execution = executionService.startExecutionByKey("EndMultiple");
-    String executionId = execution.getId();
-    
-    execution = executionService.signalExecutionById(executionId, "500");
-    assertEquals("internal server error", execution.getNodeName());
-  }
 }

Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/sequence/StateSequenceTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/sequence/StateSequenceTest.java	                        (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/sequence/StateSequenceTest.java	2008-12-11 22:02:01 UTC (rev 3350)
@@ -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.examples.state.sequence;
+
+import org.jbpm.Execution;
+import org.jbpm.test.DbTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class StateSequenceTest extends DbTestCase {
+
+  public void testWaitStatesSequence() {
+    deployJpdlResource("org/jbpm/examples/state/sequence/process.jpdl.xml");
+    
+    Execution execution = executionService.startExecutionByKey("StateSequence");
+    assertEquals("a", execution.getNodeName());
+
+    String executionId = execution.getId();
+    execution = executionService.signalExecutionById(executionId);
+    assertEquals("b", execution.getNodeName());
+
+    execution = executionService.signalExecutionById(executionId);
+    assertEquals("c", execution.getNodeName());
+  }
+
+}

Deleted: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/states/StateSequenceTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/states/StateSequenceTest.java	2008-12-11 21:04:38 UTC (rev 3349)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/states/StateSequenceTest.java	2008-12-11 22:02:01 UTC (rev 3350)
@@ -1,47 +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.examples.state.sequence;
-
-import org.jbpm.Execution;
-import org.jbpm.test.DbTestCase;
-
-
-/**
- * @author Tom Baeyens
- */
-public class StateSequenceTest extends DbTestCase {
-
-  public void testWaitStatesSequence() {
-    deployJpdlResource("org/jbpm/examples/state/sequence/process.jpdl.xml");
-    
-    Execution execution = executionService.startExecutionByKey("StateSequence");
-    assertEquals("a", execution.getNodeName());
-
-    String executionId = execution.getId();
-    execution = executionService.signalExecutionById(executionId);
-    assertEquals("b", execution.getNodeName());
-
-    execution = executionService.signalExecutionById(executionId);
-    assertEquals("c", execution.getNodeName());
-  }
-
-}

Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/state/sequence/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/state/sequence/process.jpdl.xml	                        (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/state/sequence/process.jpdl.xml	2008-12-11 22:02:01 UTC (rev 3350)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="StateSequence" xmlns="http://jbpm.org/4/jpdl">
+
+  <start>
+    <flow to="a" />
+  </start>
+
+  <state name="a">
+    <flow to="b" />
+  </state>
+
+  <state name="b">
+    <flow to="c" />
+  </state>
+
+  <state name="c" />
+
+</process>

Deleted: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/states/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/states/process.jpdl.xml	2008-12-11 21:04:38 UTC (rev 3349)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/states/process.jpdl.xml	2008-12-11 22:02:01 UTC (rev 3350)
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<process name="StateSequence" xmlns="http://jbpm.org/4/jpdl">
-
-  <start>
-    <flow to="a" />
-  </start>
-
-  <state name="a">
-    <flow to="b" />
-  </state>
-
-  <state name="b">
-    <flow to="c" />
-  </state>
-
-  <state name="c" />
-
-</process>

Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml	2008-12-11 21:04:38 UTC (rev 3349)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml	2008-12-11 22:02:01 UTC (rev 3350)
@@ -462,6 +462,16 @@
         are still active within the same process instance, all of 
         them will be ended. 
         </para>
+        <programlisting>&lt;process name=&quot;EndProcessInstance&quot; xmlns=&quot;http://jbpm.org/4/jpdl&quot;&gt;
+
+  &lt;start&gt;
+    &lt;flow to=&quot;end&quot; /&gt;
+  &lt;/start&gt;
+
+  &lt;end name=&quot;end&quot; /&gt;
+
+&lt;/process&gt;</programlisting>
+        <para>When a new process instance is created, it immediately ends.</para>
       </section>
       <section id="endexecution">
         <title><literal>end</literal> execution</title>
@@ -470,16 +480,65 @@
         should be left active.  To get this behaviour, set 
         attribute <literal>ends=&quot;execution&quot;</literal>
         </para>
+        <table><title><literal>end</literal> execution 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>ends</literal></entry>
+                <entry>{processinstance|execution}</entry>
+                <entry>processinstance</entry>
+                <entry>optional</entry>
+                <entry>specifies if the whole process instance should be ended or 
+                just the path of execution that arrives in the end activity. 
+                </entry>
+              </row>
+            </tbody>
+          </tgroup>
+        </table>
       </section>
       <section id="endmultiple">
         <title><literal>end</literal> multiple</title>
-        <para>TODO
+        <para>A process can have multiple end states.  This can be handy to indicate 
+        different outcomes of a process instance.  For example
         </para>
+        <programlisting></programlisting>
       </section>
       <section id="endstate">
         <title><literal>end</literal> state</title>
         <para>TODO
         </para>
+        <table><title><literal>end</literal> execution 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>state</literal></entry>
+                <entry>String</entry>
+                <entry></entry>
+                <entry>optional</entry>
+                <entry>the state assigned to the execution. 
+                </entry>
+              </row>
+            </tbody>
+          </tgroup>
+        </table>
       </section>
     </section>
 




More information about the jbpm-commits mailing list