[jbpm-commits] JBoss JBPM SVN: r5390 - in jbpm4/trunk/modules/bpmn/src: test/java/org/jbpm/bpmn/flownodes and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Jul 30 08:32:04 EDT 2009


Author: camunda
Date: 2009-07-30 08:32:04 -0400 (Thu, 30 Jul 2009)
New Revision: 5390

Added:
   jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/test/shipment.java.bpmn.xml
   jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/test/shipment.ws.bpmn.xml
Removed:
   jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/test/shipment.bpmn.xml
Modified:
   jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/BpmnActivity.java
   jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/ParallelGatewayTest.java
   jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/UserTaskTest.java
Log:


Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/BpmnActivity.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/BpmnActivity.java	2009-07-30 11:51:09 UTC (rev 5389)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/BpmnActivity.java	2009-07-30 12:32:04 UTC (rev 5390)
@@ -21,13 +21,86 @@
  */
 package org.jbpm.bpmn.flownodes;
 
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jbpm.api.Execution;
 import org.jbpm.api.activity.ActivityBehaviour;
+import org.jbpm.pvm.internal.model.Activity;
+import org.jbpm.pvm.internal.model.Condition;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.Transition;
 
 /**
- * @author Tom Baeyens
+ * Basic activity for BPMN activities (tasks, gateways and event)
+ * 
+ * @author bernd.ruecker at camunda.com
  */
 public abstract class BpmnActivity implements ActivityBehaviour {
-  
-  private static final long serialVersionUID = 1L;
 
+    private static final long serialVersionUID = 1L;
+
+    public void leaveBpmnActivity(ExecutionImpl execution) {
+	// TODO: Move to AbstractTask? Different in Gateway...
+	// TODO: must be used!
+	proceedForked(execution);
+    }
+
+    /**
+     * In BPMN multiple outgoing sequence flows behave like a fork.
+     * 
+     * Code copied basically from jPDL fork.
+     */
+    public void proceedForked(ExecutionImpl execution) {
+	Activity activity = execution.getActivity();
+
+	// evaluate the conditions and find the transitions that should be
+	// forked
+	List<Transition> forkingTransitions = new ArrayList<Transition>();
+	List<Transition> outgoingTransitions = activity.getOutgoingTransitions();
+	for (Transition transition : outgoingTransitions) {
+	    Condition condition = transition.getCondition();
+	    if ((condition == null) || (condition.evaluate(execution))) {
+		forkingTransitions.add(transition);
+	    }
+	}
+
+	// if no outgoing transitions should be forked,
+	if (forkingTransitions.size() == 0) {
+	    // end this execution
+	    execution.end();
+
+	    // if there is exactly 1 transition to be taken, just use the
+	    // incoming execution
+	}
+	else if (forkingTransitions.size() == 1) {
+	    execution.take(forkingTransitions.get(0));
+
+	    // if there are more transitions
+	}
+	else {
+	    ExecutionImpl concurrentRoot = null;
+	    if (Execution.STATE_ACTIVE_ROOT.equals(execution.getState())) {
+		concurrentRoot = execution;
+		execution.setState(Execution.STATE_INACTIVE_CONCURRENT_ROOT);
+		execution.setActivity(null);
+	    }
+	    else if (Execution.STATE_ACTIVE_CONCURRENT.equals(execution.getState())) {
+		concurrentRoot = execution.getParent();
+	    }
+
+	    for (Transition transition : forkingTransitions) {
+		// launch a concurrent path of execution
+		String childExecutionName = transition.getName();
+		ExecutionImpl concurrentExecution = concurrentRoot.createExecution(childExecutionName);
+		concurrentExecution.setActivity(activity);
+		concurrentExecution.setState(Execution.STATE_ACTIVE_CONCURRENT);
+		concurrentExecution.take(transition);
+
+		if (concurrentRoot.isEnded()) {
+		    break;
+		}
+	    }
+	}
+    }
 }

Modified: jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/ParallelGatewayTest.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/ParallelGatewayTest.java	2009-07-30 11:51:09 UTC (rev 5389)
+++ jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/ParallelGatewayTest.java	2009-07-30 12:32:04 UTC (rev 5390)
@@ -111,40 +111,4 @@
     }
   }
   
-  public void testUncontrolledSequenceFlowAsFork() {
-	String deploymentId = repositoryService.createDeployment().addResourceFromClasspath("org/jbpm/bpmn/flownodes/forkWithUncontrolledSequenceFlow.bpmn.xml").deploy();
-
-	try {
-	    ProcessInstance pi = executionService.startProcessInstanceByKey("ForkWithUncontrolledSequenceFlowProcess");
-	    
-	    String pid = pi.getId();
-	    
-	    TaskQuery taskQuery = taskService.createTaskQuery();
-	    List<Task> allTasks = taskQuery.list();
-
-	    // since the uncontrolled sequence flow OUT of the activity behaves as a fork
-	    // we now have two tasks
-	    assertEquals(2, allTasks.size());
-	    assertEquals("UserTaskLeg1", allTasks.get(0).getActivityName());
-	    assertEquals("UserTaskLeg2", allTasks.get(1).getActivityName());
-	    
-	    // specifying a transition is unnecessary, BPMN has outgoing AND semantic!
-	    // TODO: fix
-	    // Currently not passing any 'outcome'
-	    taskService.completeTask( allTasks.get(0).getId());
-	    taskService.completeTask( allTasks.get(1).getId());
-
-	    assertEquals(0, taskQuery.list().size());
-	    	    
-	    pi = executionService.findProcessInstanceById(pid);
-	    // process instance is ended
-	    assertNull(pi);
-	    
-	  
-	}
-	finally {
-	    repositoryService.deleteDeploymentCascade(deploymentId);
-	}
-
-  }
 }

Modified: jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/UserTaskTest.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/UserTaskTest.java	2009-07-30 11:51:09 UTC (rev 5389)
+++ jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/UserTaskTest.java	2009-07-30 12:32:04 UTC (rev 5390)
@@ -31,7 +31,6 @@
 import org.jbpm.pvm.internal.client.ClientProcessInstance;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.pvm.internal.xml.Parse;
-import org.jbpm.pvm.internal.xml.Problem;
 import org.jbpm.test.JbpmTestCase;
 
 /**
@@ -79,14 +78,57 @@
 	    // TODO: fix
 	    taskService.completeTask( allTasks.get(0).getId(), "flow2" );
 
+	    assertEquals(0, taskQuery.list().size());
+	    
+	    // process instance is ended
 	    pi = executionService.findProcessInstanceById(pi.getId());
+	    assertEquals(true, pi.isEnded());
+	}
+	finally {
+	    repositoryService.deleteDeploymentCascade(deploymentId);
+	}
+    }
+    
+    /**
+     * check that multiple outgoing sequence flows will be handled as fork, like specified in BPMN
+     * 
+     * Check with user tasks, sicne the engine stops there for sure.
+     */
+    public void testUncontrolledSequenceFlowAsFork() {
+	String deploymentId = repositoryService.createDeployment().addResourceFromClasspath("org/jbpm/bpmn/flownodes/forkWithUncontrolledSequenceFlow.bpmn.xml").deploy();
+
+	try {
+	    ProcessInstance pi = executionService.startProcessInstanceByKey("ForkWithUncontrolledSequenceFlowProcess");
 	    
+	    String pid = pi.getId();
+	    
+	    TaskQuery taskQuery = taskService.createTaskQuery();
+	    List<Task> allTasks = taskQuery.list();
+
+	    // since the uncontrolled sequence flow OUT of the activity behaves as a fork
+	    // we now have two tasks
+	    assertEquals(2, allTasks.size());
+	    assertEquals("UserTaskLeg1", allTasks.get(0).getActivityName());
+	    assertEquals("UserTaskLeg2", allTasks.get(1).getActivityName());
+	    
+	    // specifying a transition is unnecessary, BPMN has outgoing AND semantic!
+	    // TODO: fix
+	    // Currently not passing any 'outcome'
+	    taskService.completeTask( allTasks.get(0).getId()); // define output / flow?
+	    taskService.completeTask( allTasks.get(1).getId());
+
+	    assertEquals(0, taskQuery.list().size());
+	    	    
+	    pi = executionService.findProcessInstanceById(pid);
 	    // process instance is ended
 	    assertNull(pi);
+	    
+	  
 	}
 	finally {
 	    repositoryService.deleteDeploymentCascade(deploymentId);
 	}
-    }
 
+  }
+
 }

Deleted: jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/test/shipment.bpmn.xml
===================================================================
--- jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/test/shipment.bpmn.xml	2009-07-30 11:51:09 UTC (rev 5389)
+++ jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/test/shipment.bpmn.xml	2009-07-30 12:32:04 UTC (rev 5390)
@@ -1,148 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<bpmn:definitions id="ShipmentDefinitions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 D:\Projekte\workspace\jbpm4\BPMN-2.0\src\resource\BPMN20.xsd" xmlns:bpmn="http://schema.omg.org/spec/BPMN/2.0" xmlns:sample="http://sample.bpmn.camunda.com/" xmlns:xbpmn="http://bpmn.camunda.com/" xmlns:tns="http://sample.bpmn.camunda.com/" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://sample.bpmn.camunda.com/">
-	
-	<!-- imports -->
-	<bpmn:import namespace="http://sample.bpmn.camunda.com/" location="D:\Projekte\workspace\jbpm4\BPMN-2.0\src\resource\SampleService.xsd" importType="http://www.w3.org/2001/XMLSchema"/>
-	<bpmn:import namespace="http://sample.bpmn.camunda.com/" location="D:\Projekte\workspace\jbpm4\BPMN-2.0\src\resource\SampleService.wsdl" importType="http://schemas.xmlsoap.org/wsdl/soap/"/>
-	<bpmn:import namespace="http://sample.bpmn.camunda.com/" location="D:\Projekte\workspace\jbpm4\BPMN-2.0\src\resource\ShipmentProcessService.wsdl" importType="http://schemas.xmlsoap.org/wsdl/soap/"/>
-	
-	<!-- definition structures for process variables -->
-	<bpmn:itemDefinition id="lieferungDef" itemKind="Information" structureRef="sample:shipment"/>
-	
-	<!-- definition structures for messages -->
-	<bpmn:itemDefinition id="ProzessStartenDef" itemKind="Information" structureRef="sample:startShipmentProces"/>
-	<bpmn:itemDefinition id="LieferungAnlegenDef" itemKind="Information" structureRef="sample:createShipment"/>
-	<bpmn:itemDefinition id="KommissioniertDef" itemKind="Information" structureRef="sample:notifyShipmentConsigned"/>
-	
-	<!-- messages -->
-	<bpmn:message name="ProzessStarten" id="ProzessStartenNachricht" structureRef="tns:ProzessStartenDef"/>
-	<bpmn:message name="LieferungAnlegen" id="LieferungAnlegenNachricht" structureRef="tns:LieferungAnlegenDef"/>
-	<bpmn:message name="Kommissioniert" id="KommissioniertNachricht" structureRef="tns:KommissioniertDef"/>
-	
-	<!-- Services -->
-	<!-- serivceReference ?? -->
-	<!-- conversation? Participant? -->
-	
-	<bpmn:endPoint id="ProzessEndpoint">
-		<xbpmn:url/>
-	</bpmn:endPoint>
-	<bpmn:endPoint id="LiefersystemEndpoint">
-		<xbpmn:url/>
-	</bpmn:endPoint>
-	
-	<!-- interfaces -->
-	<bpmn:interface id="ProzessInterface" name="Lieferprozess Schnittstelle">
-		<bpmn:operation name="startShipmentProcess">
-			<bpmn:inMessageRef>tns:ProzessStartenNachricht</bpmn:inMessageRef>
-		</bpmn:operation>
-		<bpmn:operation name="notifyShipmentConsigned">
-			<bpmn:inMessageRef>tns:KommissioniertNachricht</bpmn:inMessageRef>
-		</bpmn:operation>
-	</bpmn:interface>
-	<bpmn:interface id="LiefersystemInterface" name="Liefersystem Schnittstelle">
-		<bpmn:operation name="createShiptment">
-			<bpmn:inMessageRef>tns:LieferungAnlegenNachricht</bpmn:inMessageRef>
-		</bpmn:operation>
-	</bpmn:interface>
-	<!-- Resources / Performers -->
-	<bpmn:resource id="VertriebResource" name="Vertrieb"/>
-	<!-- process definition -->
-	<bpmn:process id="Shipment" name="Shipment">
-		<bpmn:documentation id="doc1">Teilprozess der Lieferung</bpmn:documentation>
-		
-		<!-- process variables -->
-		<bpmn:dataObject id="lieferungVariable" name="Lieferung" itemSubjectRef="tns:lieferungDef"/>
-		
-		<!-- Start-Event -->
-		<bpmn:startEvent id="Start">
-			<bpmn:dataOutput id="ProzessStartOutput" itemSubjectRef="tns:ProzessStartenNachricht"/>
-			<bpmn:dataOutputAssociation>
-				<bpmn:assignment>
-					<bpmn:from xsi:type="bpmn:tFormalExpression">getDataOutput('ProzessStartOutput')/shipment</bpmn:from>
-					<bpmn:to xsi:type="bpmn:tFormalExpression">getDataObject('lieferungVariable')</bpmn:to>
-				</bpmn:assignment>
-				<bpmn:sourceRef>ProzessStartOutput</bpmn:sourceRef>
-				<bpmn:targetRef>tns:lieferungVariable</bpmn:targetRef>
-			</bpmn:dataOutputAssociation>
-			<bpmn:messageEventDefinition messageRef="tns:ProzessStartenNachricht">
-				<bpmn:operationRef>tns:startShipmentProcess</bpmn:operationRef>
-			</bpmn:messageEventDefinition>
-		</bpmn:startEvent>
-		
-		<!-- Activity 1: Service Task -->
-		<bpmn:serviceTask id="LieferungBuchen" name="Lieferung buchen" implementation="WebService" operationRef="createShipment">
-			<xbpmn:url/>
-			<bpmn:ioSpecification>
-				<bpmn:dataInput id="LieferungBuchenInput" isCollection="false" itemSubjectRef="tns:LieferungAnlegenNachricht"/>
-				<bpmn:inputSet>
-					<bpmn:dataInputRefs>LieferungBuchenInput</bpmn:dataInputRefs>
-				</bpmn:inputSet>
-				<bpmn:outputSet/>
-			</bpmn:ioSpecification>
-			<bpmn:dataInputAssociation>
-				<bpmn:assignment>
-					<bpmn:from xsi:type="bpmn:tFormalExpression">bpmn:getDataObject('lieferungVariable')</bpmn:from>
-					<bpmn:to xsi:type="bpmn:tFormalExpression">bpmn:getDataInput('LieferungBuchenInput'/shipment/</bpmn:to>
-				</bpmn:assignment>
-				<bpmn:sourceRef>tns:lieferungVariable</bpmn:sourceRef>
-				<bpmn:targetRef>LieferungBuchenInput</bpmn:targetRef>
-			</bpmn:dataInputAssociation>
-		</bpmn:serviceTask>
-		
-		<!-- Activity 2: Receive Task -->
-		<bpmn:receiveTask id="WartenAufLieferung" name="Warten auf Lieferung" instantiate="false" implementation="WebService" operationRef="notifyShipmentConsigned" messageRef="tns:Kommissioniert">
-			<bpmn:ioSpecification>
-				<bpmn:dataOutput id="KommissioniertOutput" itemSubjectRef="tns:KommissioniertNachricht"/>
-				<bpmn:inputSet/>
-				<bpmn:outputSet>
-					<bpmn:dataOutputRefs>KommissioniertOutput</bpmn:dataOutputRefs>
-				</bpmn:outputSet>
-			</bpmn:ioSpecification>
-
-			<bpmn:dataOutputAssociation>
-				<bpmn:assignment>
-					<bpmn:from xsi:type="bpmn:tFormalExpression">getDataOutput('KommissioniertOutput')/shipment</bpmn:from>
-					<bpmn:to xsi:type="bpmn:tFormalExpression">getDataObject('lieferungVariable')</bpmn:to>
-				</bpmn:assignment>
-				<bpmn:sourceRef>KommissioniertOutput</bpmn:sourceRef>
-				<bpmn:targetRef>tns:lieferungVariable</bpmn:targetRef>
-			</bpmn:dataOutputAssociation>
-		</bpmn:receiveTask>
-		
-		<!-- Gateway -->
-		<bpmn:exclusiveGateway id="PruefeAvisierung" name="Avisierung benoetigt?"/>
-		
-		<!-- Activity 3: User Task -->
-		<bpmn:userTask id="LieferterminAvisieren" name="Liefertermin avisieren" implementation="other">
-			<!--		<bpmn:humanPerformer resourceRef="tns:Vertrieb"></bpmn:humanPerformer>-->
-			<bpmn:potentialOwner resourceRef="tns:VertriebResource"/>
-		</bpmn:userTask>
-		
-		<!-- End Events -->
-		<bpmn:endEvent id="End" name="End"/>
-		
-		<!-- Sequence Flow -->
-		<bpmn:sequenceFlow id="flow1" sourceRef="Start" targetRef="LieferungBuchen" name="Start->LieferungBuchen"/>
-		<bpmn:sequenceFlow id="flow2" sourceRef="LieferungBuchen" targetRef="WartenAufLieferung"/>
-		<bpmn:sequenceFlow id="flow3" sourceRef="WartenAufLieferung" targetRef="PruefeAvisierung"/>
-		<bpmn:sequenceFlow id="flow4" sourceRef="PruefeAvisierung" targetRef="LieferterminAvisieren">
-			<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">getDataObject('lieferungVariable')/confirmationRequired=true</bpmn:conditionExpression>
-		</bpmn:sequenceFlow>
-		<bpmn:sequenceFlow id="flow5" sourceRef="PruefeAvisierung" targetRef="End">
-			<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">not( getDataObject('lieferungVariable')/confirmationRequired=true )</bpmn:conditionExpression>
-		</bpmn:sequenceFlow>
-		<bpmn:sequenceFlow id="flow6" sourceRef="LieferterminAvisieren" targetRef="End"/>
-	</bpmn:process>
-
-<!--	
-	<bpmn:correlationSubscription>
-	</bpmn:correlationSubscription>
--->
-	
-	<!-- TODO: Correlation / Conversation -->
-	<bpmn:conversation>
-		<bpmn:correlationKey>
-			<bpmn:correlationPropertyRef>test</bpmn:correlationPropertyRef>
-		</bpmn:correlationKey>
-	</bpmn:conversation>
-</bpmn:definitions>

Copied: jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/test/shipment.java.bpmn.xml (from rev 5381, jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/test/shipment.bpmn.xml)
===================================================================
--- jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/test/shipment.java.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/test/shipment.java.bpmn.xml	2009-07-30 12:32:04 UTC (rev 5390)
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions id="ShipmentDefinitions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 D:\Projekte\workspace\jbpm4\BPMN-2.0\src\resource\BPMN20.xsd" xmlns:bpmn="http://schema.omg.org/spec/BPMN/2.0" xmlns:sample="http://sample.bpmn.camunda.com/" xmlns:xbpmn="http://bpmn.camunda.com/" xmlns:tns="http://sample.bpmn.camunda.com/" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://sample.bpmn.camunda.com/">
+	
+	<!-- imports -->
+	<bpmn:import namespace="http://sample.bpmn.camunda.com/" location="D:\Projekte\workspace\jbpm4\BPMN-2.0\src\resource\SampleService.xsd" importType="http://www.w3.org/2001/XMLSchema"/>
+	<bpmn:import namespace="http://sample.bpmn.camunda.com/" location="D:\Projekte\workspace\jbpm4\BPMN-2.0\src\resource\SampleService.wsdl" importType="http://schemas.xmlsoap.org/wsdl/soap/"/>
+	<bpmn:import namespace="http://sample.bpmn.camunda.com/" location="D:\Projekte\workspace\jbpm4\BPMN-2.0\src\resource\ShipmentProcessService.wsdl" importType="http://schemas.xmlsoap.org/wsdl/soap/"/>
+	
+	<!-- definition structures for process variables -->
+	<bpmn:itemDefinition id="lieferungDef" itemKind="Information" structureRef="sample:shipment"/>
+	
+	<!-- definition structures for messages -->
+	<bpmn:itemDefinition id="ProzessStartenDef" itemKind="Information" structureRef="sample:startShipmentProces"/>
+	<bpmn:itemDefinition id="LieferungAnlegenDef" itemKind="Information" structureRef="sample:createShipment"/>
+	<bpmn:itemDefinition id="KommissioniertDef" itemKind="Information" structureRef="sample:notifyShipmentConsigned"/>
+	
+	<!-- messages -->
+	<bpmn:message name="ProzessStarten" id="ProzessStartenNachricht" structureRef="tns:ProzessStartenDef"/>
+	<bpmn:message name="LieferungAnlegen" id="LieferungAnlegenNachricht" structureRef="tns:LieferungAnlegenDef"/>
+	<bpmn:message name="Kommissioniert" id="KommissioniertNachricht" structureRef="tns:KommissioniertDef"/>
+	
+	<!-- Services -->
+	<!-- serivceReference ?? -->
+	<!-- conversation? Participant? -->
+	
+	<bpmn:endPoint id="ProzessEndpoint">
+		<xbpmn:url/>
+	</bpmn:endPoint>
+	<bpmn:endPoint id="LiefersystemEndpoint">
+		<xbpmn:url/>
+	</bpmn:endPoint>
+	
+	<!-- interfaces -->
+	<bpmn:interface id="ProzessInterface" name="Lieferprozess Schnittstelle">
+		<bpmn:operation name="startShipmentProcess">
+			<bpmn:inMessageRef>tns:ProzessStartenNachricht</bpmn:inMessageRef>
+		</bpmn:operation>
+		<bpmn:operation name="notifyShipmentConsigned">
+			<bpmn:inMessageRef>tns:KommissioniertNachricht</bpmn:inMessageRef>
+		</bpmn:operation>
+	</bpmn:interface>
+	<bpmn:interface id="LiefersystemInterface" name="Liefersystem Schnittstelle">
+		<bpmn:operation name="createShiptment">
+			<bpmn:inMessageRef>tns:LieferungAnlegenNachricht</bpmn:inMessageRef>
+		</bpmn:operation>
+	</bpmn:interface>
+	<!-- Resources / Performers -->
+	<bpmn:resource id="VertriebResource" name="Vertrieb"/>
+	<!-- process definition -->
+	<bpmn:process id="Shipment" name="Shipment">
+		<bpmn:documentation id="doc1">Teilprozess der Lieferung</bpmn:documentation>
+		
+		<!-- process variables -->
+		<bpmn:dataObject id="lieferungVariable" name="Lieferung" itemSubjectRef="tns:lieferungDef"/>
+		
+		<!-- Start-Event -->
+		<bpmn:startEvent id="Start">
+			<bpmn:dataOutput id="ProzessStartOutput" itemSubjectRef="tns:ProzessStartenNachricht"/>
+			<bpmn:dataOutputAssociation>
+				<bpmn:assignment>
+					<bpmn:from xsi:type="bpmn:tFormalExpression">getDataOutput('ProzessStartOutput')/shipment</bpmn:from>
+					<bpmn:to xsi:type="bpmn:tFormalExpression">getDataObject('lieferungVariable')</bpmn:to>
+				</bpmn:assignment>
+				<bpmn:sourceRef>ProzessStartOutput</bpmn:sourceRef>
+				<bpmn:targetRef>tns:lieferungVariable</bpmn:targetRef>
+			</bpmn:dataOutputAssociation>
+			<bpmn:messageEventDefinition messageRef="tns:ProzessStartenNachricht">
+				<bpmn:operationRef>tns:startShipmentProcess</bpmn:operationRef>
+			</bpmn:messageEventDefinition>
+		</bpmn:startEvent>
+		
+		<!-- Activity 1: Service Task -->
+		<bpmn:serviceTask id="LieferungBuchen" name="Lieferung buchen" implementation="WebService" operationRef="createShipment">
+			<xbpmn:url/>
+			<bpmn:ioSpecification>
+				<bpmn:dataInput id="LieferungBuchenInput" isCollection="false" itemSubjectRef="tns:LieferungAnlegenNachricht"/>
+				<bpmn:inputSet>
+					<bpmn:dataInputRefs>LieferungBuchenInput</bpmn:dataInputRefs>
+				</bpmn:inputSet>
+				<bpmn:outputSet/>
+			</bpmn:ioSpecification>
+			<bpmn:dataInputAssociation>
+				<bpmn:assignment>
+					<bpmn:from xsi:type="bpmn:tFormalExpression">bpmn:getDataObject('lieferungVariable')</bpmn:from>
+					<bpmn:to xsi:type="bpmn:tFormalExpression">bpmn:getDataInput('LieferungBuchenInput'/shipment/</bpmn:to>
+				</bpmn:assignment>
+				<bpmn:sourceRef>tns:lieferungVariable</bpmn:sourceRef>
+				<bpmn:targetRef>LieferungBuchenInput</bpmn:targetRef>
+			</bpmn:dataInputAssociation>
+		</bpmn:serviceTask>
+		
+		<!-- Activity 2: Receive Task -->
+		<bpmn:receiveTask id="WartenAufLieferung" name="Warten auf Lieferung" instantiate="false" implementation="WebService" operationRef="notifyShipmentConsigned" messageRef="tns:Kommissioniert">
+			<bpmn:ioSpecification>
+				<bpmn:dataOutput id="KommissioniertOutput" itemSubjectRef="tns:KommissioniertNachricht"/>
+				<bpmn:inputSet/>
+				<bpmn:outputSet>
+					<bpmn:dataOutputRefs>KommissioniertOutput</bpmn:dataOutputRefs>
+				</bpmn:outputSet>
+			</bpmn:ioSpecification>
+
+			<bpmn:dataOutputAssociation>
+				<bpmn:assignment>
+					<bpmn:from xsi:type="bpmn:tFormalExpression">getDataOutput('KommissioniertOutput')/shipment</bpmn:from>
+					<bpmn:to xsi:type="bpmn:tFormalExpression">getDataObject('lieferungVariable')</bpmn:to>
+				</bpmn:assignment>
+				<bpmn:sourceRef>KommissioniertOutput</bpmn:sourceRef>
+				<bpmn:targetRef>tns:lieferungVariable</bpmn:targetRef>
+			</bpmn:dataOutputAssociation>
+		</bpmn:receiveTask>
+		
+		<!-- Gateway -->
+		<bpmn:exclusiveGateway id="PruefeAvisierung" name="Avisierung benoetigt?"/>
+		
+		<!-- Activity 3: User Task -->
+		<bpmn:userTask id="LieferterminAvisieren" name="Liefertermin avisieren" implementation="other">
+			<!--		<bpmn:humanPerformer resourceRef="tns:Vertrieb"></bpmn:humanPerformer>-->
+			<bpmn:potentialOwner resourceRef="tns:VertriebResource"/>
+		</bpmn:userTask>
+		
+		<!-- End Events -->
+		<bpmn:endEvent id="End" name="End"/>
+		
+		<!-- Sequence Flow -->
+		<bpmn:sequenceFlow id="flow1" sourceRef="Start" targetRef="LieferungBuchen" name="Start->LieferungBuchen"/>
+		<bpmn:sequenceFlow id="flow2" sourceRef="LieferungBuchen" targetRef="WartenAufLieferung"/>
+		<bpmn:sequenceFlow id="flow3" sourceRef="WartenAufLieferung" targetRef="PruefeAvisierung"/>
+		<bpmn:sequenceFlow id="flow4" sourceRef="PruefeAvisierung" targetRef="LieferterminAvisieren">
+			<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">getDataObject('lieferungVariable')/confirmationRequired=true</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+		<bpmn:sequenceFlow id="flow5" sourceRef="PruefeAvisierung" targetRef="End">
+			<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">not( getDataObject('lieferungVariable')/confirmationRequired=true )</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+		<bpmn:sequenceFlow id="flow6" sourceRef="LieferterminAvisieren" targetRef="End"/>
+	</bpmn:process>
+
+<!--	
+	<bpmn:correlationSubscription>
+	</bpmn:correlationSubscription>
+-->
+	
+	<!-- TODO: Correlation / Conversation -->
+	<bpmn:conversation>
+		<bpmn:correlationKey>
+			<bpmn:correlationPropertyRef>test</bpmn:correlationPropertyRef>
+		</bpmn:correlationKey>
+	</bpmn:conversation>
+</bpmn:definitions>

Added: jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/test/shipment.ws.bpmn.xml
===================================================================
--- jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/test/shipment.ws.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/test/shipment.ws.bpmn.xml	2009-07-30 12:32:04 UTC (rev 5390)
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions id="ShipmentDefinitions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 D:\Projekte\workspace\jbpm4\BPMN-2.0\src\resource\BPMN20.xsd" xmlns:bpmn="http://schema.omg.org/spec/BPMN/2.0" xmlns:sample="http://sample.bpmn.camunda.com/" xmlns:xbpmn="http://bpmn.camunda.com/" xmlns:tns="http://sample.bpmn.camunda.com/" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://sample.bpmn.camunda.com/">
+	
+	<!-- imports -->
+	<bpmn:import namespace="http://sample.bpmn.camunda.com/" location="D:\Projekte\workspace\jbpm4\BPMN-2.0\src\resource\SampleService.xsd" importType="http://www.w3.org/2001/XMLSchema"/>
+	<bpmn:import namespace="http://sample.bpmn.camunda.com/" location="D:\Projekte\workspace\jbpm4\BPMN-2.0\src\resource\SampleService.wsdl" importType="http://schemas.xmlsoap.org/wsdl/soap/"/>
+	<bpmn:import namespace="http://sample.bpmn.camunda.com/" location="D:\Projekte\workspace\jbpm4\BPMN-2.0\src\resource\ShipmentProcessService.wsdl" importType="http://schemas.xmlsoap.org/wsdl/soap/"/>
+	
+	<!-- definition structures for process variables -->
+	<bpmn:itemDefinition id="lieferungDef" itemKind="Information" structureRef="sample:shipment"/>
+	
+	<!-- definition structures for messages -->
+	<bpmn:itemDefinition id="ProzessStartenDef" itemKind="Information" structureRef="sample:startShipmentProces"/>
+	<bpmn:itemDefinition id="LieferungAnlegenDef" itemKind="Information" structureRef="sample:createShipment"/>
+	<bpmn:itemDefinition id="KommissioniertDef" itemKind="Information" structureRef="sample:notifyShipmentConsigned"/>
+	
+	<!-- messages -->
+	<bpmn:message name="ProzessStarten" id="ProzessStartenNachricht" structureRef="tns:ProzessStartenDef"/>
+	<bpmn:message name="LieferungAnlegen" id="LieferungAnlegenNachricht" structureRef="tns:LieferungAnlegenDef"/>
+	<bpmn:message name="Kommissioniert" id="KommissioniertNachricht" structureRef="tns:KommissioniertDef"/>
+	
+	<!-- Services -->
+	<!-- serivceReference ?? -->
+	<!-- conversation? Participant? -->
+	
+	<bpmn:endPoint id="ProzessEndpoint">
+		<xbpmn:url/>
+	</bpmn:endPoint>
+	<bpmn:endPoint id="LiefersystemEndpoint">
+		<xbpmn:url/>
+	</bpmn:endPoint>
+	
+	<!-- interfaces -->
+	<bpmn:interface id="ProzessInterface" name="Lieferprozess Schnittstelle">
+		<bpmn:operation name="startShipmentProcess">
+			<bpmn:inMessageRef>tns:ProzessStartenNachricht</bpmn:inMessageRef>
+		</bpmn:operation>
+		<bpmn:operation name="notifyShipmentConsigned">
+			<bpmn:inMessageRef>tns:KommissioniertNachricht</bpmn:inMessageRef>
+		</bpmn:operation>
+	</bpmn:interface>
+	<bpmn:interface id="LiefersystemInterface" name="Liefersystem Schnittstelle">
+		<bpmn:operation name="createShiptment">
+			<bpmn:inMessageRef>tns:LieferungAnlegenNachricht</bpmn:inMessageRef>
+		</bpmn:operation>
+	</bpmn:interface>
+	<!-- Resources / Performers -->
+	<bpmn:resource id="VertriebResource" name="Vertrieb"/>
+	<!-- process definition -->
+	<bpmn:process id="Shipment" name="Shipment">
+		<bpmn:documentation id="doc1">Teilprozess der Lieferung</bpmn:documentation>
+		
+		<!-- process variables -->
+		<bpmn:dataObject id="lieferungVariable" name="Lieferung" itemSubjectRef="tns:lieferungDef"/>
+		
+		<!-- Start-Event -->
+		<bpmn:startEvent id="Start">
+			<bpmn:dataOutput id="ProzessStartOutput" itemSubjectRef="tns:ProzessStartenNachricht"/>
+			<bpmn:dataOutputAssociation>
+				<bpmn:assignment>
+					<bpmn:from xsi:type="bpmn:tFormalExpression">getDataOutput('ProzessStartOutput')/shipment</bpmn:from>
+					<bpmn:to xsi:type="bpmn:tFormalExpression">getDataObject('lieferungVariable')</bpmn:to>
+				</bpmn:assignment>
+				<bpmn:sourceRef>ProzessStartOutput</bpmn:sourceRef>
+				<bpmn:targetRef>tns:lieferungVariable</bpmn:targetRef>
+			</bpmn:dataOutputAssociation>
+			<bpmn:messageEventDefinition messageRef="tns:ProzessStartenNachricht">
+				<bpmn:operationRef>tns:startShipmentProcess</bpmn:operationRef>
+			</bpmn:messageEventDefinition>
+		</bpmn:startEvent>
+		
+		<!-- Activity 1: Service Task -->
+		<bpmn:serviceTask id="LieferungBuchen" name="Lieferung buchen" implementation="WebService" operationRef="createShipment">
+			<xbpmn:url/>
+			<bpmn:ioSpecification>
+				<bpmn:dataInput id="LieferungBuchenInput" isCollection="false" itemSubjectRef="tns:LieferungAnlegenNachricht"/>
+				<bpmn:inputSet>
+					<bpmn:dataInputRefs>LieferungBuchenInput</bpmn:dataInputRefs>
+				</bpmn:inputSet>
+				<bpmn:outputSet/>
+			</bpmn:ioSpecification>
+			<bpmn:dataInputAssociation>
+				<bpmn:assignment>
+					<bpmn:from xsi:type="bpmn:tFormalExpression">bpmn:getDataObject('lieferungVariable')</bpmn:from>
+					<bpmn:to xsi:type="bpmn:tFormalExpression">bpmn:getDataInput('LieferungBuchenInput'/shipment/</bpmn:to>
+				</bpmn:assignment>
+				<bpmn:sourceRef>tns:lieferungVariable</bpmn:sourceRef>
+				<bpmn:targetRef>LieferungBuchenInput</bpmn:targetRef>
+			</bpmn:dataInputAssociation>
+		</bpmn:serviceTask>
+		
+		<!-- Activity 2: Receive Task -->
+		<bpmn:receiveTask id="WartenAufLieferung" name="Warten auf Lieferung" instantiate="false" implementation="WebService" operationRef="notifyShipmentConsigned" messageRef="tns:Kommissioniert">
+			<bpmn:ioSpecification>
+				<bpmn:dataOutput id="KommissioniertOutput" itemSubjectRef="tns:KommissioniertNachricht"/>
+				<bpmn:inputSet/>
+				<bpmn:outputSet>
+					<bpmn:dataOutputRefs>KommissioniertOutput</bpmn:dataOutputRefs>
+				</bpmn:outputSet>
+			</bpmn:ioSpecification>
+
+			<bpmn:dataOutputAssociation>
+				<bpmn:assignment>
+					<bpmn:from xsi:type="bpmn:tFormalExpression">getDataOutput('KommissioniertOutput')/shipment</bpmn:from>
+					<bpmn:to xsi:type="bpmn:tFormalExpression">getDataObject('lieferungVariable')</bpmn:to>
+				</bpmn:assignment>
+				<bpmn:sourceRef>KommissioniertOutput</bpmn:sourceRef>
+				<bpmn:targetRef>tns:lieferungVariable</bpmn:targetRef>
+			</bpmn:dataOutputAssociation>
+		</bpmn:receiveTask>
+		
+		<!-- Gateway -->
+		<bpmn:exclusiveGateway id="PruefeAvisierung" name="Avisierung benoetigt?"/>
+		
+		<!-- Activity 3: User Task -->
+		<bpmn:userTask id="LieferterminAvisieren" name="Liefertermin avisieren" implementation="other">
+			<!--		<bpmn:humanPerformer resourceRef="tns:Vertrieb"></bpmn:humanPerformer>-->
+			<bpmn:potentialOwner resourceRef="tns:VertriebResource"/>
+		</bpmn:userTask>
+		
+		<!-- End Events -->
+		<bpmn:endEvent id="End" name="End"/>
+		
+		<!-- Sequence Flow -->
+		<bpmn:sequenceFlow id="flow1" sourceRef="Start" targetRef="LieferungBuchen" name="Start->LieferungBuchen"/>
+		<bpmn:sequenceFlow id="flow2" sourceRef="LieferungBuchen" targetRef="WartenAufLieferung"/>
+		<bpmn:sequenceFlow id="flow3" sourceRef="WartenAufLieferung" targetRef="PruefeAvisierung"/>
+		<bpmn:sequenceFlow id="flow4" sourceRef="PruefeAvisierung" targetRef="LieferterminAvisieren">
+			<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">getDataObject('lieferungVariable')/confirmationRequired=true</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+		<bpmn:sequenceFlow id="flow5" sourceRef="PruefeAvisierung" targetRef="End">
+			<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">not( getDataObject('lieferungVariable')/confirmationRequired=true )</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+		<bpmn:sequenceFlow id="flow6" sourceRef="LieferterminAvisieren" targetRef="End"/>
+	</bpmn:process>
+
+<!--	
+	<bpmn:correlationSubscription>
+	</bpmn:correlationSubscription>
+-->
+	
+	<!-- TODO: Correlation / Conversation -->
+	<bpmn:conversation>
+		<bpmn:correlationKey>
+			<bpmn:correlationPropertyRef>test</bpmn:correlationPropertyRef>
+		</bpmn:correlationKey>
+	</bpmn:conversation>
+</bpmn:definitions>



More information about the jbpm-commits mailing list