[jbpm-commits] JBoss JBPM SVN: r6011 - in jbpm4/trunk/modules: devguide/src/main/docbook/en/modules and 5 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Dec 21 12:29:04 EST 2009


Author: jbarrez
Date: 2009-12-21 12:29:04 -0500 (Mon, 21 Dec 2009)
New Revision: 6011

Added:
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.receive.task.java.png
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/task/receive/
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/task/receive/ReceiveTaskJavaTest.java
   jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/receive/
   jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/receive/receive_task_java.bpmn.xml
Modified:
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/task/script/ScriptTaskTest.java
Log:
JBPM-2665: document Java receive task

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.receive.task.java.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.receive.task.java.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml	2009-12-21 16:48:15 UTC (rev 6010)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml	2009-12-21 17:29:04 UTC (rev 6011)
@@ -857,6 +857,42 @@
       </para>
     
     </section>
+    
+    <section id="receiveTaskJava">
+    
+      <title>Task: Java Receive task</title>
+      
+      <para>
+        A <emphasis role="bold">receive task</emphasis> is a task that waits for the arrival of 
+        an external message. Besides the obvious use case involving webservices, the specification
+        is liberal in what to do in other environment. The web service use case is not yet 
+        implemented, but the receive task can already be used in a Java environment.
+      </para>
+      
+      <para>
+        The receive task is depicted as a rounded rectangle (= task shape) with a little enveloppe
+        in the left top corner.
+        <mediaobject><imageobject><imagedata align="center" fileref="images/bpmn2.receive.task.java.png"/></imageobject></mediaobject>
+      </para>
+      
+      <para>
+        In a Java environment, the receive task without any other attribute filled in besides
+        an id and (optionally) a name, behaves as a wait state. To introduce a wait state in your
+        business process, just add the following line:
+        <programlisting>
+&lt;receiveTask id=&quot;receiveTask&quot; name=&quot;wait&quot; /&gt;        
+        </programlisting>
+        Process execution will wait in such a receive task. The process can then be continued
+        using the familiar jBPM <emphasis role="bold">signal methods</emphasis>. Note that
+        this will probably change in the future, since a 'signal' has a completely different
+        meaning in BPMN 2.0.
+        <programlisting>
+Execution execution = processInstance.findActiveExecutionIn(&quot;receiveTask&quot;);
+executionService.signalExecutionById(execution.getId());        
+        </programlisting>
+      </para>
+    
+    </section>
   
   </section> <!-- End of basic constructs section -->
   

Added: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/task/receive/ReceiveTaskJavaTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/task/receive/ReceiveTaskJavaTest.java	                        (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/task/receive/ReceiveTaskJavaTest.java	2009-12-21 17:29:04 UTC (rev 6011)
@@ -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.examples.bpmn.task.receive;
+
+import org.jbpm.api.NewDeployment;
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.test.JbpmTestCase;
+
+/**
+ * 
+ * @author Joram Barrez
+ */
+public class ReceiveTaskJavaTest extends JbpmTestCase {
+  
+  @Override
+  protected void setUp() throws Exception {
+      super.setUp();
+      NewDeployment deployment = repositoryService.createDeployment();
+      deployment.addResourceFromClasspath("org/jbpm/examples/bpmn/task/receive/receive_task_java.bpmn.xml");
+      registerDeployment(deployment.deploy());
+  }
+  
+  public void testWaitStatebehaviour() {
+    ProcessInstance processInstance = executionService.startProcessInstanceByKey("receiveTaskJava");
+    assertActivityActive(processInstance.getId(), "receiveTask");
+    executionService.signalExecutionById(processInstance.findActiveExecutionIn("receiveTask").getId());
+    //assertProcessInstanceEnded(processInstance);
+  }
+
+}

Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/task/script/ScriptTaskTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/task/script/ScriptTaskTest.java	2009-12-21 16:48:15 UTC (rev 6010)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/bpmn/task/script/ScriptTaskTest.java	2009-12-21 17:29:04 UTC (rev 6011)
@@ -39,8 +39,7 @@
 	protected void setUp() throws Exception {
 		super.setUp();
 		NewDeployment deployment = repositoryService.createDeployment();
-		deployment
-				.addResourceFromClasspath("org/jbpm/examples/bpmn/task/script/script_task.bpmn.xml");
+		deployment.addResourceFromClasspath("org/jbpm/examples/bpmn/task/script/script_task.bpmn.xml");
 		registerDeployment(deployment.deploy());
 	}
 

Added: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/receive/receive_task_java.bpmn.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/receive/receive_task_java.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/bpmn/task/receive/receive_task_java.bpmn.xml	2009-12-21 17:29:04 UTC (rev 6011)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 ../../../../../../../../../../bpmn/src/main/resources/BPMN20.xsd"
+	xmlns="http://schema.omg.org/spec/BPMN/2.0" typeLanguage="http://www.w3.org/2001/XMLSchema"
+	expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://jbpm.org/example/bpmn2/receiveTaskJava">
+
+	<process id="receiveTaskJava" name="Bpmn 2.0 example receive task Java">
+
+		<startEvent id="Start" />
+
+		<sequenceFlow id="flow1" sourceRef="Start"
+			targetRef="receiveTask" />
+
+		<receiveTask id="receiveTask" name="wait" />
+		
+		<sequenceFlow id="flow2" sourceRef="receiveTask"
+			targetRef="End" />
+
+		<endEvent id="End" name="End" />
+		
+	</process>
+</definitions>



More information about the jbpm-commits mailing list