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

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Dec 23 07:43:50 EST 2008


Author: tom.baeyens at jboss.com
Date: 2008-12-23 07:43:49 -0500 (Tue, 23 Dec 2008)
New Revision: 3534

Added:
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EndCancelBinding.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EndErrorBinding.java
Modified:
   jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/state/EndStateTest.java
   jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/end/state/process.jpdl.xml
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EndActivity.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EndBinding.java
   jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.activities.xml
Log:
added end-error and end-cancel

Modified: jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
===================================================================
--- jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd	2008-12-23 12:40:10 UTC (rev 3533)
+++ jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd	2008-12-23 12:43:49 UTC (rev 3534)
@@ -111,6 +111,42 @@
           </attribute>
         </complexType>
       </element>
+
+      <element name="end-cancel">
+        <annotation><documentation>End cancel event.
+        </documentation></annotation>
+        <complexType>
+          <sequence>
+          </sequence>
+          <attributeGroup ref="tns:nodeAttributes" />
+          <attribute name="ends" default="process-instance">
+            <simpleType>
+              <restriction base="string">
+                <enumeration value="execution"/>
+                <enumeration value="process-instance"/>
+              </restriction>
+            </simpleType>
+          </attribute>
+        </complexType>
+      </element>
+
+      <element name="end-error">
+        <annotation><documentation>End cancel event.
+        </documentation></annotation>
+        <complexType>
+          <sequence>
+          </sequence>
+          <attributeGroup ref="tns:nodeAttributes" />
+          <attribute name="ends" default="process-instance">
+            <simpleType>
+              <restriction base="string">
+                <enumeration value="execution"/>
+                <enumeration value="process-instance"/>
+              </restriction>
+            </simpleType>
+          </attribute>
+        </complexType>
+      </element>
       
       <!-- ~~~ STATE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
       <element name="state">

Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/state/EndStateTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/state/EndStateTest.java	2008-12-23 12:40:10 UTC (rev 3533)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/state/EndStateTest.java	2008-12-23 12:43:49 UTC (rev 3534)
@@ -46,7 +46,7 @@
     Execution execution = executionService.startExecutionByKey("EndState");
     String executionId = execution.getId();
     execution = executionService.signalExecutionById(executionId, "400");
-    assertEquals("error", execution.getState());
+    assertEquals("cancel", execution.getState());
     assertEquals("bad request", execution.getNodeName());
   }
 

Modified: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/end/state/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/end/state/process.jpdl.xml	2008-12-23 12:40:10 UTC (rev 3533)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/end/state/process.jpdl.xml	2008-12-23 12:43:49 UTC (rev 3534)
@@ -13,7 +13,7 @@
   </state>
 
   <end name="ok" state="completed" g="239,40,48,48"/>
-  <end name="bad request" state="error" g="239,97,48,48"/>
-  <end name="internal server error" state="error" g="240,154,48,48"/>
+  <end-cancel name="bad request" g="239,97,48,48"/>
+  <end-error name="internal server error" g="240,154,48,48"/>
 
 </process>

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EndActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EndActivity.java	2008-12-23 12:40:10 UTC (rev 3533)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EndActivity.java	2008-12-23 12:43:49 UTC (rev 3534)
@@ -35,14 +35,6 @@
   protected boolean endProcessInstance = true;
   protected String state = null;
 
-  public EndActivity() {
-  }
-
-  public EndActivity(boolean endProcessInstance, String state) {
-    this.endProcessInstance = endProcessInstance;
-    this.state = state;
-  }
-
   public void execute(ActivityExecution execution) {
     OpenExecution executionToEnd = null;
     if (endProcessInstance) {
@@ -57,4 +49,11 @@
       execution.end(executionToEnd, state);
     }
   }
+  
+  public void setEndProcessInstance(boolean endProcessInstance) {
+    this.endProcessInstance = endProcessInstance;
+  }
+  public void setState(String state) {
+    this.state = state;
+  }
 }

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EndBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EndBinding.java	2008-12-23 12:40:10 UTC (rev 3533)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EndBinding.java	2008-12-23 12:43:49 UTC (rev 3534)
@@ -36,6 +36,10 @@
     super("end");
   }
 
+  protected EndBinding(String tag) {
+    super(tag);
+  }
+
   public Object parse(Element element, Parse parse, Parser parser) {
     
     boolean endProcessInstance = true;
@@ -46,6 +50,10 @@
     
     String state = XmlUtil.attribute(element, "state", false, parse);
     
-    return new EndActivity(endProcessInstance, state);
+    EndActivity endActivity = new EndActivity();
+    endActivity.setEndProcessInstance(endProcessInstance);
+    endActivity.setState(state);
+    
+    return endActivity;
   }
 }

Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EndCancelBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EndCancelBinding.java	                        (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EndCancelBinding.java	2008-12-23 12:43:49 UTC (rev 3534)
@@ -0,0 +1,43 @@
+/*
+ * 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.activity;
+
+import org.jbpm.pvm.internal.xml.Parse;
+import org.jbpm.pvm.internal.xml.Parser;
+import org.w3c.dom.Element;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class EndCancelBinding extends EndBinding {
+
+  public EndCancelBinding() {
+    super("end-cancel");
+  }
+
+  public Object parse(Element element, Parse parse, Parser parser) {
+    EndActivity endActivity = (EndActivity) super.parse(element, parse, parser);
+    endActivity.setState("cancel");
+    return endActivity;
+  }
+}


Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EndCancelBinding.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EndErrorBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EndErrorBinding.java	                        (rev 0)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EndErrorBinding.java	2008-12-23 12:43:49 UTC (rev 3534)
@@ -0,0 +1,43 @@
+/*
+ * 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.activity;
+
+import org.jbpm.pvm.internal.xml.Parse;
+import org.jbpm.pvm.internal.xml.Parser;
+import org.w3c.dom.Element;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class EndErrorBinding extends EndBinding {
+
+  public EndErrorBinding() {
+    super("end-error");
+  }
+
+  public Object parse(Element element, Parse parse, Parser parser) {
+    EndActivity endActivity = (EndActivity) super.parse(element, parse, parser);
+    endActivity.setState("error");
+    return endActivity;
+  }
+}


Property changes on: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/EndErrorBinding.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Modified: jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.activities.xml
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.activities.xml	2008-12-23 12:40:10 UTC (rev 3533)
+++ jbpm4/trunk/modules/jpdl/src/main/resources/jbpm.jpdl.activities.xml	2008-12-23 12:43:49 UTC (rev 3534)
@@ -4,6 +4,8 @@
   <activity binding="org.jbpm.jpdl.activity.StateBinding" />
   <activity binding="org.jbpm.jpdl.activity.ExclusiveBinding" />
   <activity binding="org.jbpm.jpdl.activity.EndBinding" />
+  <activity binding="org.jbpm.jpdl.activity.EndCancelBinding" />
+  <activity binding="org.jbpm.jpdl.activity.EndErrorBinding" />
   <activity binding="org.jbpm.jpdl.activity.ForkBinding" />
   <activity binding="org.jbpm.jpdl.activity.JoinBinding" />
   <activity binding="org.jbpm.jpdl.activity.HqlBinding" />




More information about the jbpm-commits mailing list