From do-not-reply at jboss.org Wed Aug 11 23:08:13 2010
Content-Type: multipart/mixed; boundary="===============2955969366587255383=="
MIME-Version: 1.0
From: do-not-reply at jboss.org
To: jbpm-commits at lists.jboss.org
Subject: [jbpm-commits] JBoss JBPM SVN: r6579 - in
jbpm3/branches/jbpm-3.2-soa/modules: core/src/test/java/org/jbpm/jbpm2818 and
3 other directories.
Date: Wed, 11 Aug 2010 23:08:13 -0400
Message-ID: <201008120308.o7C38DaO030331@svn01.web.mwc.hst.phx2.redhat.com>
--===============2955969366587255383==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: alex.guizar(a)jboss.com
Date: 2010-08-11 23:08:13 -0400 (Wed, 11 Aug 2010)
New Revision: 6579
Added:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2818/
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2818=
/JBPM2818Test.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbp=
m2818/
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbp=
m2818/gpd.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbp=
m2818/processdefinition.xml
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en-US/mod=
elling.xml
Log:
JBPM-2818 test super-state leaving transition
review and improve super-state documentation
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm=
2818/JBPM2818Test.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm281=
8/JBPM2818Test.java (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm281=
8/JBPM2818Test.java 2010-08-12 03:08:13 UTC (rev 6579)
@@ -0,0 +1,52 @@
+/*
+ * 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.jbpm2818;
+
+import org.jbpm.db.AbstractDbTestCase;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ProcessInstance;
+
+/**
+ * Leaving node in super-state throws JbpmException: cannot leave Node wit=
hout leaving
+ * transition.
+ * =
+ * @see JBPM-2818
+ * @author Alejandro Guizar
+ */
+public class JBPM2818Test extends AbstractDbTestCase {
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ ProcessDefinition processDefinition =3D ProcessDefinition.parseXmlReso=
urce("org/jbpm/jbpm2818/processdefinition.xml");
+ deployProcessDefinition(processDefinition);
+ }
+
+ public void testSuperStateLeavingTransition() {
+ ProcessInstance processInstance =3D jbpmContext.newProcessInstance("jb=
pm2818");
+ processInstance.signal();
+ assertEquals("state1", processInstance.getRootToken().getNode().getNam=
e());
+
+ processInstance =3D saveAndReload(processInstance);
+ processInstance.signal();
+ assertTrue("expected " + processInstance + " to have ended", processIn=
stance.hasEnded());
+ }
+}
Property changes on: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java=
/org/jbpm/jbpm2818/JBPM2818Test.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm=
/jbpm2818/gpd.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jb=
pm2818/gpd.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jb=
pm2818/gpd.xml 2010-08-12 03:08:13 UTC (rev 6579)
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Property changes on: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/reso=
urces/org/jbpm/jbpm2818/gpd.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm=
/jbpm2818/processdefinition.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jb=
pm2818/processdefinition.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jb=
pm2818/processdefinition.xml 2010-08-12 03:08:13 UTC (rev 6579)
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Property changes on: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/reso=
urces/org/jbpm/jbpm2818/processdefinition.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en=
-US/modelling.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en-US/mo=
delling.xml 2010-08-11 23:44:35 UTC (rev 6578)
+++ jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en-US/mo=
delling.xml 2010-08-12 03:08:13 UTC (rev 6579)
@@ -583,15 +583,16 @@
A super-state is a group of nodes. They can be nested
recursively and are used to add a hierarchy to the process
- definition. (For example, use this functionality
- to group all of the nodes belonging to a process in phases.)
+ definition. For example, this functionality is useful
+ to group the nodes belonging to a process in phases.
=
=
- Actions can be associated with super-state events. A consequen=
ce
- of this is that a token can be in multiple nested nodes at any
- given time. This can be convenient when checking if a process
- execution is in, for example, the start-up phase. One is free =
to
- group any set of nodes into a super-state.
+ Actions can be associated with super-state events. Events
+ fired by tokens in nested nodes bubble up the super-state
+ hierarchy up to the process definition. The token therefore
+ acts as being in every node in the hierarchy at the same
+ time. This can be convenient when checking if a process
+ execution is in, for example, the start-up phase.
=
@@ -600,14 +601,18 @@
=
- Any of the transitions leaving a super-state can be taken by
- tokens in the nodes found within that same super state.
+ Any transition leaving a super-state can be taken by a
+ token positioned in any node within that super-state.
+ One use case for this feature is to model a
+ cancel transition which can be taken at any time.
+
+
Transitions can also arrive in super-states, in which case the
- token will be redirected to the first node in it. =
+ token will be redirected to the first node in document order. =
Furthermore, nodes which are outside the super-state can have
transitions directly to nodes that are inside it =
- and vice versa. Finally, super-states can also be =
- self-referential.
+ and viceversa. Finally, as any other node, super-states can
+ also self-transition.
=
@@ -621,8 +626,8 @@
superstate-enter and
superstate-leave. They will be
fired irrespective of which transitions the node has entered or
- left. (As long as a token takes transitions within the
- super-state, these events will not be fired.)
+ left. As long as a token takes transitions within the
+ super-state, these events will not be fired.
=
@@ -641,13 +646,13 @@
=
- Node names have to be unique (within their
- scope.) The scope of the node is its
- node-collection. (Both the process
- definition and the super-state are node collections.) To refer
+ Node names have to be unique within their
+ scope. The scope of the node is its
+ node-collection. Both the process
+ definition and the super-state are node collections. To refer
to nodes in super-states, specify the relative, slash
- (/) separated name. (The slash separates the node
- names. Use . to refer to an upper level.) The next
+ (/) separated name. The slash separates the node
+ names. Use .. to refer to an upper level. The next
example shows how to refer to a node in a super-state:
=
--===============2955969366587255383==--