OW2 Consortium
Search OW2 Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | orchestra-commits List | January 2009 Index

<--  Date Index  --> <--  Thread Index  -->

[[orchestra-commits]] [2082] trunk/OrchestraPVM/modules: Support of FlowDefinition


Title: [2082] trunk/OrchestraPVM/modules: Support of FlowDefinition
Revision
2082
Author
afuca
Date
2009-01-29 10:54:59 +0100 (Thu, 29 Jan 2009)

Log Message

Support of FlowDefinition

Modified Paths

Added Paths

Diff

Added: trunk/OrchestraPVM/modules/api/src/main/java/org/ow2/orchestra/facade/def/FlowActivityDefinition.java (0 => 2082)


--- trunk/OrchestraPVM/modules/api/src/main/java/org/ow2/orchestra/facade/def/FlowActivityDefinition.java	                        (rev 0)
+++ trunk/OrchestraPVM/modules/api/src/main/java/org/ow2/orchestra/facade/def/FlowActivityDefinition.java	2009-01-29 09:54:59 UTC (rev 2082)
@@ -0,0 +1,24 @@
+/**
+ * Copyright (C) 2009 Bull S. A. S.
+ * Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois
+ * This library 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
+ * version 2.1 of the License.
+ * This library 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
+ * program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA  02110-1301, USA.
+ **/
+
+package org.ow2.orchestra.facade.def;
+
+import java.util.List;
+
+
+public interface FlowActivityDefinition extends ActivityWithChildrenDefinition {
+
+  List<String> getLinks();
+
+}
Property changes on: trunk/OrchestraPVM/modules/api/src/main/java/org/ow2/orchestra/facade/def/FlowActivityDefinition.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Id

Added: trunk/OrchestraPVM/modules/core/src/main/java/org/ow2/orchestra/facade/def/full/FlowActivityFullDefinition.java (0 => 2082)


--- trunk/OrchestraPVM/modules/core/src/main/java/org/ow2/orchestra/facade/def/full/FlowActivityFullDefinition.java	                        (rev 0)
+++ trunk/OrchestraPVM/modules/core/src/main/java/org/ow2/orchestra/facade/def/full/FlowActivityFullDefinition.java	2009-01-29 09:54:59 UTC (rev 2082)
@@ -0,0 +1,29 @@
+/**
+ * Copyright (C) 2009 Bull S. A. S.
+ * Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois
+ * This library 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
+ * version 2.1 of the License.
+ * This library 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
+ * program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA  02110-1301, USA.
+ **/
+
+package org.ow2.orchestra.facade.def.full;
+
+import java.util.List;
+
+import org.ow2.orchestra.facade.def.FlowActivityDefinition;
+
+/**
+ *
+ * @author Alfonso Fuca
+ */
+public interface FlowActivityFullDefinition extends ActivityWithChildrenFullDefinition, FlowActivityDefinition {
+
+  void setLinks(List<String> linkList);
+
+}
Property changes on: trunk/OrchestraPVM/modules/core/src/main/java/org/ow2/orchestra/facade/def/full/FlowActivityFullDefinition.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Id

Added: trunk/OrchestraPVM/modules/core/src/main/java/org/ow2/orchestra/facade/def/full/impl/FlowActivityFullDefinitionImpl.java (0 => 2082)


--- trunk/OrchestraPVM/modules/core/src/main/java/org/ow2/orchestra/facade/def/full/impl/FlowActivityFullDefinitionImpl.java	                        (rev 0)
+++ trunk/OrchestraPVM/modules/core/src/main/java/org/ow2/orchestra/facade/def/full/impl/FlowActivityFullDefinitionImpl.java	2009-01-29 09:54:59 UTC (rev 2082)
@@ -0,0 +1,71 @@
+/**
+ * Copyright (C) 2009 Bull S. A. S.
+ * Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois
+ * This library 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
+ * version 2.1 of the License.
+ * This library 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
+ * program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA  02110-1301, USA.
+ **/
+
+package org.ow2.orchestra.facade.def.full.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.ow2.orchestra.facade.def.FlowActivityDefinition;
+import org.ow2.orchestra.facade.def.full.FlowActivityFullDefinition;
+import org.ow2.orchestra.facade.def.impl.FlowActivityDefinitionImpl;
+import org.ow2.orchestra.facade.runtime.ActivityType;
+import org.ow2.orchestra.facade.uuid.ActivityDefinitionUUID;
+import org.ow2.orchestra.facade.uuid.ProcessDefinitionUUID;
+
+/**
+ *
+ * @author Alfonso Fuca
+ */
+public class FlowActivityFullDefinitionImpl extends ActivityWithChildrenFullDefinitionImpl implements FlowActivityFullDefinition {
+
+  private List<String> linkList;
+
+  protected FlowActivityFullDefinitionImpl(){
+  }
+
+  public FlowActivityFullDefinitionImpl(final FlowActivityFullDefinition flowActivityFullDefinition) {
+    super(flowActivityFullDefinition);
+    this.linkList = new ArrayList<String>();
+    this.linkList.addAll(flowActivityFullDefinition.getLinks());
+  }
+
+  public FlowActivityFullDefinitionImpl(final ProcessDefinitionUUID processDefinitionUUID,
+    final ActivityDefinitionUUID activityDefinitionUUID, final String name) {
+    super(activityDefinitionUUID, processDefinitionUUID, name);
+    this.linkList = new ArrayList<String>();
+  }
+
+  @Override
+  public ActivityType getType() {
+    return ActivityType.FLOW;
+  }
+
+  public void setLinks(final List<String> linkList) {
+    this.linkList.addAll(linkList);
+  }
+
+  public FlowActivityDefinition copy() {
+    return new FlowActivityDefinitionImpl(this);
+  }
+
+  public FlowActivityFullDefinition fullCopy() {
+    return new FlowActivityFullDefinitionImpl(this);
+  }
+
+  public List<String> getLinks() {
+    return linkList;
+  }
+
+}
Property changes on: trunk/OrchestraPVM/modules/core/src/main/java/org/ow2/orchestra/facade/def/full/impl/FlowActivityFullDefinitionImpl.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Id

Added: trunk/OrchestraPVM/modules/core/src/main/java/org/ow2/orchestra/facade/def/impl/FlowActivityDefinitionImpl.java (0 => 2082)


--- trunk/OrchestraPVM/modules/core/src/main/java/org/ow2/orchestra/facade/def/impl/FlowActivityDefinitionImpl.java	                        (rev 0)
+++ trunk/OrchestraPVM/modules/core/src/main/java/org/ow2/orchestra/facade/def/impl/FlowActivityDefinitionImpl.java	2009-01-29 09:54:59 UTC (rev 2082)
@@ -0,0 +1,44 @@
+/**
+ * Copyright (C) 2009 Bull S. A. S.
+ * Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois
+ * This library 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
+ * version 2.1 of the License.
+ * This library 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
+ * program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA  02110-1301, USA.
+ **/
+
+package org.ow2.orchestra.facade.def.impl;
+
+import java.util.List;
+
+import org.ow2.orchestra.facade.def.FlowActivityDefinition;
+import org.ow2.orchestra.facade.runtime.ActivityType;
+
+/**
+ *
+ * @author Alfonso Fuca
+ */
+public class FlowActivityDefinitionImpl extends ActivityWithChildrenDefinitionImpl implements FlowActivityDefinition {
+
+  private List<String> linkList;
+
+  public FlowActivityDefinitionImpl(final FlowActivityDefinition record) {
+    super(record);
+    this.linkList.addAll(record.getLinks());
+  }
+
+  @Override
+  public ActivityType getType() {
+    return ActivityType.FLOW;
+  }
+
+  public List<String> getLinks() {
+    return linkList;
+  }
+
+}
Property changes on: trunk/OrchestraPVM/modules/core/src/main/java/org/ow2/orchestra/facade/def/impl/FlowActivityDefinitionImpl.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Id

Modified: trunk/OrchestraPVM/modules/core/src/main/java/org/ow2/orchestra/parsing/binding/FlowBinding.java (2081 => 2082)


--- trunk/OrchestraPVM/modules/core/src/main/java/org/ow2/orchestra/parsing/binding/FlowBinding.java	2009-01-29 09:03:25 UTC (rev 2081)
+++ trunk/OrchestraPVM/modules/core/src/main/java/org/ow2/orchestra/parsing/binding/FlowBinding.java	2009-01-29 09:54:59 UTC (rev 2082)
@@ -13,6 +13,7 @@
  **/
 package org.ow2.orchestra.parsing.binding;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -26,7 +27,12 @@
 import org.ow2.orchestra.definition.activity.Flow;
 import org.ow2.orchestra.definition.element.Link;
 import org.ow2.orchestra.exception.StaticAnalysisException;
+import org.ow2.orchestra.facade.def.full.ActivityFullDefinition;
+import org.ow2.orchestra.facade.def.full.FlowActivityFullDefinition;
+import org.ow2.orchestra.facade.def.full.impl.FlowActivityFullDefinitionImpl;
 import org.ow2.orchestra.facade.runtime.ActivityType;
+import org.ow2.orchestra.facade.uuid.ActivityDefinitionUUID;
+import org.ow2.orchestra.facade.uuid.ProcessDefinitionUUID;
 import org.ow2.orchestra.util.StaticAnalysisFault;
 import org.w3c.dom.Element;
 
@@ -39,19 +45,15 @@
   /** log. */
   private static Logger log = Logger.getLogger(FlowBinding.class.getName());
 
-
   public FlowBinding() {
     super("flow", ActivityType.FLOW);
   }
   /**
    * Parses the given dom element to build a Node and a behaviour.
    *
-   * @param element
-   *            dom element to parse
-   * @param parse
-   *            parse
-   * @param parser
-   *            parser
+   * @param element dom element to parse
+   * @param parse parse
+   * @param parser parser
    * @return the build behaviour!
    */
   public Object parse(final Element element, final Parse parse, final Parser parser) {
@@ -69,8 +71,7 @@
       parseLinks(linkElements, flow, parse);
     }
 
-    NodeImpl activityNode = createActivityNodeWithChildren(element, parse,
-        parser, flow);
+    NodeImpl activityNode = createActivityNodeWithChildren(element, parse, parser, flow);
 
     checkLinks(flow, parse);
 
@@ -80,34 +81,44 @@
   /**
    * Parses links elements of the given flow.
    *
-   * @param linkElements
-   *            the list of all links elements of the given flow
-   * @param flow
-   *            flow
+   * @param linkElements the list of all links elements of the given flow
+   * @param flow flow
    */
   private void parseLinks(final List<Element> linkElements, final Flow flow, final Parse parse) {
+    // Definition
+    DefinitionKeeper definitionKeeper = parse.findObject(DefinitionKeeper.class);
+    FlowActivityFullDefinition flowActivityFullDefinition = (FlowActivityFullDefinition) definitionKeeper
+      .getActivityFullDefinition();
+    List<String> linkList = new ArrayList<String>();
+
     Map<String, Link> links = new HashMap<String, Link>();
     if (linkElements != null) {
       for (Element linkElement : linkElements) {
         String linkName = XmlUtil.attribute(linkElement, "name");
         if (links.containsKey(linkName)) {
           // Static Analysis SA00064
-          String message = StaticAnalysisFault.getMessage("SA00064",
-              "  link " + linkName + " defined twice in flow " + flow.getName());
+          String message = StaticAnalysisFault.getMessage("SA00064", "  link " + linkName + " defined twice in flow "
+            + flow.getName());
           parse.addProblem(message, new StaticAnalysisException("SA00064"));
         } else {
           Link link = new Link();
           link.setName(linkName);
           links.put(linkName, link);
+
+          // Definition
+          linkList.add(linkName);
         }
       }
     }
     flow.setLinks(links);
+
+    // Definition
+    flowActivityFullDefinition.setLinks(linkList);
   }
 
   /**
-   * Check that every link defined in a flow have a corresponding source and target
-   * activities defined.
+   * Check that every link defined in a flow have a corresponding source and
+   * target activities defined.
    *
    * @param flow : The flow on which links should be checked
    * @param parse : parse
@@ -118,11 +129,17 @@
       for (Link link : links.values()) {
         if ((link.getSourceActivity() == null) || (link.getTargetActivity() == null)) {
           // Static Analysis SA00066
-          String message = StaticAnalysisFault.getMessage("SA00066",
-              "  Link " + link.getName() + " missing either source or target");
+          String message = StaticAnalysisFault.getMessage("SA00066", "  Link " + link.getName()
+            + " missing either source or target");
           parse.addProblem(message, new StaticAnalysisException("SA00066"));
         }
       }
     }
   }
+
+  @Override
+  public ActivityFullDefinition createActivityFullDefinition(final ProcessDefinitionUUID processDefinitionUUID,
+    final ActivityDefinitionUUID activityDefinitionUUID, final String name, final Parse parse) {
+    return new FlowActivityFullDefinitionImpl(processDefinitionUUID, activityDefinitionUUID, name);
+  }
 }

Modified: trunk/OrchestraPVM/modules/core/src/main/resources/bpel.activitydefinitiontypes.hbm.xml (2081 => 2082)


--- trunk/OrchestraPVM/modules/core/src/main/resources/bpel.activitydefinitiontypes.hbm.xml	2009-01-29 09:03:25 UTC (rev 2081)
+++ trunk/OrchestraPVM/modules/core/src/main/resources/bpel.activitydefinitiontypes.hbm.xml	2009-01-29 09:54:59 UTC (rev 2082)
@@ -347,6 +347,17 @@
     </component>
   </subclass>
 
+  <subclass name="FlowActivityFullDefinitionImpl" extends="ActivityWithChildrenFullDefinitionImpl"
+    abstract="false">
+    <list name="linkList" cascade="all-delete-orphan">
+      <key foreign-key="FLOW_LINKS_FK">
+        <column name="FLOW_LINKS_ID_" index="FLOW_LINKS_IDX" />
+      </key>
+      <list-index column="INDEX_" />
+      <element column="FLOW_LINKS_" type="string" />
+    </list>
+  </subclass>
+
   <subclass name="UnknownActivityFullDefinitionImpl" extends="ActivityWithChildrenFullDefinitionImpl"
     abstract="false">
   </subclass>

Modified: trunk/OrchestraPVM/modules/core/src/test/java/org/ow2/orchestra/test/runtime/TestFullDBModel.java (2081 => 2082)


--- trunk/OrchestraPVM/modules/core/src/test/java/org/ow2/orchestra/test/runtime/TestFullDBModel.java	2009-01-29 09:03:25 UTC (rev 2081)
+++ trunk/OrchestraPVM/modules/core/src/test/java/org/ow2/orchestra/test/runtime/TestFullDBModel.java	2009-01-29 09:54:59 UTC (rev 2082)
@@ -36,6 +36,7 @@
 import org.ow2.orchestra.facade.def.full.impl.ActivityWithChildrenFullDefinitionImpl;
 import org.ow2.orchestra.facade.def.full.impl.AssignActivityFullDefinitionImpl;
 import org.ow2.orchestra.facade.def.full.impl.EmptyActivityFullDefinitionImpl;
+import org.ow2.orchestra.facade.def.full.impl.FlowActivityFullDefinitionImpl;
 import org.ow2.orchestra.facade.def.full.impl.ForeachActivityFullDefinitionImpl;
 import org.ow2.orchestra.facade.def.full.impl.IfActivityFullDefinitionImpl;
 import org.ow2.orchestra.facade.def.full.impl.InvokeActivityFullDefinitionImpl;
@@ -203,6 +204,9 @@
   public void testForeachActivityFullDefinition() throws Exception {
     verifyPersistence(ForeachActivityFullDefinitionImpl.class);
   }
+  public void testFlowActivityFullDefinition() throws Exception {
+    verifyPersistence(FlowActivityFullDefinitionImpl.class);
+  }
 
   public void testUnknownActivityFullDefinition() throws Exception {
     verifyPersistence(UnknownActivityFullDefinitionImpl.class);
@@ -306,6 +310,10 @@
       } else if (fieldName.equals("correlationList")) {
         return new ArrayList<CorrelationDefinition>();
       }
+    } else if (className.equals(FlowActivityFullDefinitionImpl.class.getName())) {
+      if (fieldName.equals("linkList")) {
+        return new ArrayList<String>();
+      }
     }
     return null;
   }

Modified: trunk/OrchestraPVM/modules/core/src/test/java/org/ow2/orchestra/test/services/def/AbstractSubTypesDefinitionTest.java (2081 => 2082)


--- trunk/OrchestraPVM/modules/core/src/test/java/org/ow2/orchestra/test/services/def/AbstractSubTypesDefinitionTest.java	2009-01-29 09:03:25 UTC (rev 2081)
+++ trunk/OrchestraPVM/modules/core/src/test/java/org/ow2/orchestra/test/services/def/AbstractSubTypesDefinitionTest.java	2009-01-29 09:54:59 UTC (rev 2082)
@@ -40,6 +40,7 @@
 import org.ow2.orchestra.facade.def.full.ActivityFullDefinition;
 import org.ow2.orchestra.facade.def.full.AssignActivityFullDefinition;
 import org.ow2.orchestra.facade.def.full.ElseIfFullDefinition;
+import org.ow2.orchestra.facade.def.full.FlowActivityFullDefinition;
 import org.ow2.orchestra.facade.def.full.ForeachActivityFullDefinition;
 import org.ow2.orchestra.facade.def.full.IfActivityFullDefinition;
 import org.ow2.orchestra.facade.def.full.InvokeActivityFullDefinition;
@@ -52,6 +53,7 @@
 import org.ow2.orchestra.facade.def.full.ReplyActivityFullDefinition;
 import org.ow2.orchestra.facade.def.full.ScopeActivityFullDefinition;
 import org.ow2.orchestra.facade.def.full.SequenceActivityFullDefinition;
+import org.ow2.orchestra.facade.def.full.TargetFull;
 import org.ow2.orchestra.facade.def.full.WaitActivityFullDefinition;
 import org.ow2.orchestra.facade.def.full.WhileActivityFullDefinition;
 import org.ow2.orchestra.facade.runtime.ActivityType;
@@ -127,8 +129,6 @@
         while (activityFullDefinitionIterator.hasNext()) {
           ActivityFullDefinition activityFullDefinition = activityFullDefinitionIterator.next();
 
-          System.out.println("Activity Type:" + activityFullDefinition);
-
           // Test all activity definitions
           switch (activityFullDefinition.getType()) {
 
@@ -162,6 +162,9 @@
             case FOR_EACH:
               checkForeachActivity(activityFullDefinition);
               break;
+            case FLOW:
+              checkFlowActivity(activityFullDefinition);
+              break;
 
             default:
               fail("Unknown activity: " + activityFullDefinition.getType() + " - " + activityFullDefinition.getName());
@@ -423,7 +426,7 @@
       .fullCopy());
 
     assertEquals("sequence01", sequenceActivityFullDefinition.getName());
-    assertEquals(24, sequenceActivityFullDefinition.getEnclosedActivities().size());
+    assertEquals(25, sequenceActivityFullDefinition.getEnclosedActivities().size());
   }
 
   public void checkReceiveActivity(final ActivityFullDefinition activityFullDefinition) {
@@ -765,6 +768,7 @@
       assertEquals("if01ExpressionLanguage0" + id, elseIfDefinition.getExpressionLanguage());
       id++;
     }
+    assertEquals(id - 2, elseIfDefinitionList.size());
   }
 
   private void checkPickActivity(final ActivityFullDefinition activityFullDefinition) {
@@ -798,6 +802,8 @@
         assertEquals("[]", onMessageFullDefinition.getCorrelationDefinitionList().toString());
         id++;
       }
+      assertEquals(id -1, onMessageFullDefinitionList.size());
+
     } else if ("pick02".equals(pickActivityFullDefinition.getName())) {
       List<OnMessageFullDefinition> 
       Iterator<OnMessageFullDefinition> 
@@ -823,6 +829,8 @@
         assertEquals("[]", onMessageFullDefinition.getFromPartDefinitionList().toString());
         id++;
       }
+      assertEquals(id -1, onMessageFullDefinitionList.size());
+
     } else if ("pick03".equals(pickActivityFullDefinition.getName())) {
       List<OnMessageFullDefinition> 
       List<OnAlarmFullDefinition> 
@@ -851,7 +859,10 @@
         assertEquals(null, onMessageFullDefinition.getMessageExchange());
         assertEquals(null, onMessageFullDefinition.getVariable());
         assertEquals("[]", onMessageFullDefinition.getCorrelationDefinitionList().toString());
+        id++;
       }
+      assertEquals(id -1, onMessageFullDefinitionList.size());
+
       Iterator<OnAlarmFullDefinition> 
 
       while (onAlarmFullDefinitionIterator.hasNext()) {
@@ -899,7 +910,48 @@
       assertEquals("foreach02ExpressionLanguageStart", foreachActivityFullDefinition.getStartCounterExpressionLanguage());
       assertEquals(false, foreachActivityFullDefinition.isParallel());
     } else {
-      fail("Unknown foreach activity: " + foreachActivityFullDefinition.getName() + " - " + foreachActivityFullDefinition.getUUID());
+      fail("Unknown foreach activity: " + foreachActivityFullDefinition.getName() + " - "
+        + foreachActivityFullDefinition.getUUID());
     }
   }
+
+  private void checkFlowActivity(final ActivityFullDefinition activityFullDefinition) {
+    FlowActivityFullDefinition flowActivityFullDefinition = ((FlowActivityFullDefinition) activityFullDefinition
+      .fullCopy());
+
+    if("flow01".equals(flowActivityFullDefinition.getName())){
+      List<ActivityFullDefinition> activityFullDefinitionList = flowActivityFullDefinition.getEnclosedActivities();
+      List<String> linkList = flowActivityFullDefinition.getLinks();
+
+      Iterator<ActivityFullDefinition> activityFullDefinitionIterator = activityFullDefinitionList.iterator();
+      Iterator<String> linkIterator = linkList.iterator();
+
+      int id = 1;
+      while(linkIterator.hasNext()){
+        String link = linkIterator.next();
+        ActivityFullDefinition enclosedActivityFullDefinition = activityFullDefinitionIterator.next();
+
+        assertEquals("flow01Link0" + id, link);
+        assertEquals("flow01Empty0" + id, enclosedActivityFullDefinition.getName());
+        assertEquals("flow01Link0" + id, enclosedActivityFullDefinition.getSourceList().iterator().next().getLinkName());
+
+        id++;
+      }
+      assertEquals(id -1, linkList.size());
+
+      ActivityFullDefinition enclosedActivityFullDefinition = activityFullDefinitionIterator.next();
+      List<TargetFull> targetFullList = enclosedActivityFullDefinition.getTargetList();
+      Iterator<TargetFull> targetFullIterator = targetFullList.iterator();
+
+      id = 1;
+      while(targetFullIterator.hasNext()) {
+        TargetFull targetFull = targetFullIterator.next();
+        assertEquals("flow01Link0" + id, targetFull.getLinkName());
+        id++;
+      }
+      assertEquals(id -1, targetFullList.size());
+    } else {
+      fail("Unknown activity: " + flowActivityFullDefinition.getName() + " - " + flowActivityFullDefinition.getUUID());
+    }
+  }
 }
\ No newline at end of file

Modified: trunk/OrchestraPVM/modules/core/src/test/resources/org/ow2/orchestra/test/services/def/definitiontest.bpel (2081 => 2082)


--- trunk/OrchestraPVM/modules/core/src/test/resources/org/ow2/orchestra/test/services/def/definitiontest.bpel	2009-01-29 09:03:25 UTC (rev 2081)
+++ trunk/OrchestraPVM/modules/core/src/test/resources/org/ow2/orchestra/test/services/def/definitiontest.bpel	2009-01-29 09:54:59 UTC (rev 2082)
@@ -315,5 +315,35 @@
     </scope>
   </forEach>
 
+  <flow name="flow01">
+    <links>
+      <link name="flow01Link01"></link>
+      <link name="flow01Link02"></link>
+      <link name="flow01Link03"></link>
+    </links>
+    <empty name="flow01Empty01">
+      <sources>
+        <source linkName="flow01Link01" />
+      </sources>
+    </empty>
+    <empty name="flow01Empty02">
+      <sources>
+        <source linkName="flow01Link02" />
+      </sources>
+    </empty>
+    <empty name="flow01Empty03">
+      <sources>
+        <source linkName="flow01Link03" />
+      </sources>
+    </empty>
+    <empty>
+      <targets>
+        <target linkName="flow01Link01" />
+        <target linkName="flow01Link02" />
+        <target linkName="flow01Link03" />
+      </targets>
+    </empty>
+  </flow>
+
   </sequence>
 </process>


<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 2006-2007, OW2 Consortium | contact | webmaster.