You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@taverna.apache.org by st...@apache.org on 2015/02/23 11:09:36 UTC

[01/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Repository: incubator-taverna-engine
Updated Branches:
  refs/heads/master 3ecb12916 -> 1eca6315f


http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/resources/META-INF/spring/reference-core-extensions-context.xml
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/resources/META-INF/spring/reference-core-extensions-context.xml b/taverna-reference-types/src/main/resources/META-INF/spring/reference-core-extensions-context.xml
new file mode 100644
index 0000000..6b7a4cb
--- /dev/null
+++ b/taverna-reference-types/src/main/resources/META-INF/spring/reference-core-extensions-context.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans 
+                           http://www.springframework.org/schema/beans/spring-beans.xsd">
+                           
+	<bean id="inlineStringReferenceBuilder" class="net.sf.taverna.t2.reference.impl.external.object.InlineStringReferenceBuilder" />
+	<bean id="inlineByteArrayReferenceBuilder" class="net.sf.taverna.t2.reference.impl.external.object.InlineByteArrayReferenceBuilder" />
+
+	<bean id="fileReference" class="net.sf.taverna.t2.reference.impl.external.file.FileReference" />
+	<bean id="httpReference" class="net.sf.taverna.t2.reference.impl.external.http.HttpReference" />
+	<bean id="inlineStringReference" class="net.sf.taverna.t2.reference.impl.external.object.InlineStringReference" />
+	<bean id="inlineByteArrayReference" class="net.sf.taverna.t2.reference.impl.external.object.InlineByteArrayReference" />
+	<bean id="vmObjectReference" class="net.sf.taverna.t2.reference.impl.external.object.VMObjectReference" />
+
+	<bean id="streamToStringConverter" class="net.sf.taverna.t2.reference.impl.external.object.StreamToStringConverter" />
+	<bean id="streamToByteArrayConverter" class="net.sf.taverna.t2.reference.impl.external.object.StreamToByteArrayConverter" />
+	<bean id="streamToVMObjectReferenceConverter" class="net.sf.taverna.t2.reference.impl.external.object.StreamToVMObjectReferenceConverter" />
+	<bean id="streamToDoubleConverter" class="net.sf.taverna.t2.reference.impl.external.object.StreamToDoubleConverter" />
+	<bean id="streamToBooleanConverter" class="net.sf.taverna.t2.reference.impl.external.object.StreamToBooleanConverter" />
+	<bean id="streamToIntegerConverter" class="net.sf.taverna.t2.reference.impl.external.object.StreamToIntegerConverter" />
+	
+	<bean id="fileToFileReference" class="net.sf.taverna.t2.reference.impl.external.file.FileToFileReference" />
+	<bean id="urlToHttpReference" class="net.sf.taverna.t2.reference.impl.external.http.UrlToHttpReference" />
+	<bean id="stringToStringReference" class="net.sf.taverna.t2.reference.impl.external.object.StringToStringReference" />
+	<bean id="byteArrayToByteArrayReference" class="net.sf.taverna.t2.reference.impl.external.object.ByteArrayToByteArrayReference" />
+	<bean id="numberToStringReference" class="net.sf.taverna.t2.reference.impl.external.object.NumberToStringReference" />
+	<bean id="characterToStringReference" class="net.sf.taverna.t2.reference.impl.external.object.CharacterToStringReference" />
+	<bean id="booleanToStringReference" class="net.sf.taverna.t2.reference.impl.external.object.BooleanToStringReference" />
+
+</beans>


[22/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/prov-o.rdf
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/prov-o.rdf b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/prov-o.rdf
new file mode 100644
index 0000000..1e9896a
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/prov-o.rdf
@@ -0,0 +1,1788 @@
+<?xml version="1.0"?>
+
+
+<!DOCTYPE rdf:RDF [
+    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
+    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
+    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
+    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
+]>
+
+
+<rdf:RDF xmlns="http://www.w3.org/ns/prov#"
+     xml:base="http://www.w3.org/ns/prov"
+     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+     xmlns:owl="http://www.w3.org/2002/07/owl#"
+     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
+     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+    <owl:Ontology rdf:about="http://www.w3.org/ns/prov-o#">
+        <rdfs:label xml:lang="en">W3C PROVenance Interchange Ontology (PROV-O)</rdfs:label>
+        <owl:versionInfo xml:lang="en">Recommendation version 2013-04-30</owl:versionInfo>
+        <rdfs:comment xml:lang="en">This document is published by the Provenance Working Group (http://www.w3.org/2011/prov/wiki/Main_Page). 
+
+If you wish to make comments regarding this document, please send them to public-prov-comments@w3.org (subscribe public-prov-comments-request@w3.org, archives http://lists.w3.org/Archives/Public/public-prov-comments/). All feedback is welcome.</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="http://www.w3.org/TR/prov-o/"/>
+        <rdfs:seeAlso rdf:resource="http://www.w3.org/ns/prov"/>
+        <specializationOf rdf:resource="http://www.w3.org/ns/prov-o"/>
+        <wasRevisionOf rdf:resource="http://www.w3.org/ns/prov-o-20120312"/>
+        <owl:versionIRI rdf:resource="http://www.w3.org/ns/prov-o-20130430"/>
+    </owl:Ontology>
+    
+    <owl:Ontology rdf:about="http://www.w3.org/ns/prov#"/>
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Annotation properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#unqualifiedForm">
+        <rdfs:comment xml:lang="en">Classes and properties used to qualify relationships are annotated with prov:unqualifiedForm to indicate the property used to assert an unqualified provenance relation.</rdfs:comment>
+        <rdfs:subPropertyOf rdf:resource="&rdfs;seeAlso"/>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#wasRevisionOf">
+        <rdfs:label>wasRevisionOf</rdfs:label>
+        <component>derivations</component>
+        <rdfs:comment xml:lang="en">A revision is a derivation that revises an entity into a revised version.</rdfs:comment>
+        <inverse>hadRevision</inverse>
+        <category>expanded</category>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#Revision"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#qualifiedRevision"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#aq">
+        <rdfs:subPropertyOf rdf:resource="&rdfs;seeAlso"/>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#sharesDefinitionWith">
+        <rdfs:subPropertyOf rdf:resource="&rdfs;seeAlso"/>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#definition">
+        <rdfs:comment xml:lang="en">A definition quoted from PROV-DM or PROV-CONSTRAINTS that describes the concept expressed with this OWL term.</rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#editorialNote">
+        <rdfs:comment xml:lang="en">A note by the OWL development team about how this term expresses the PROV-DM concept, or how it should be used in context of semantic web or linked data.</rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="&rdfs;label">
+        <rdfs:comment xml:lang="en"></rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#inverse">
+        <rdfs:comment xml:lang="en">PROV-O does not define all property inverses. The directionalities defined in PROV-O should be given preference over those not defined. However, if users wish to name the inverse of a PROV-O property, the local name given by prov:inverse should be used.</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="http://www.w3.org/TR/prov-o/#names-of-inverse-properties"/>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="&rdfs;comment">
+        <rdfs:comment xml:lang="en"></rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#constraints">
+        <rdfs:comment xml:lang="en">A reference to the principal section of the PROV-CONSTRAINTS document that describes this concept.</rdfs:comment>
+        <rdfs:subPropertyOf rdf:resource="&rdfs;seeAlso"/>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="&rdfs;seeAlso">
+        <rdfs:comment xml:lang="en"></rdfs:comment>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="&owl;versionInfo"/>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#specializationOf">
+        <rdfs:label>specializationOf</rdfs:label>
+        <constraints rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-constraints-20130430/#prov-dm-constraints-fig</constraints>
+        <dm rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-dm-20130430/#term-specialization</dm>
+        <n rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-n-20130430/#expression-specialization</n>
+        <component>alternate</component>
+        <inverse>generalizationOf</inverse>
+        <category>expanded</category>
+        <definition xml:lang="en">An entity that is a specialization of another shares all aspects of the latter, and additionally presents more specific aspects of the same thing as the latter. In particular, the lifetime of the entity being specialized contains that of any specialization. Examples of aspects include a time period, an abstraction, and a context associated with the entity.</definition>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:seeAlso rdf:resource="http://www.w3.org/ns/prov#alternateOf"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#dm">
+        <rdfs:comment xml:lang="en">A reference to the principal section of the PROV-DM document that describes this concept.</rdfs:comment>
+        <rdfs:subPropertyOf rdf:resource="&rdfs;seeAlso"/>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#category">
+        <rdfs:comment xml:lang="en">Classify prov-o terms into three categories, including &#39;starting-point&#39;, &#39;qualifed&#39;, and &#39;extended&#39;. This classification is used by the prov-o html document to gently introduce prov-o terms to its users. </rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#order">
+        <rdfs:comment xml:lang="en">The position that this OWL term should be listed within documentation. The scope of the documentation (e.g., among all terms, among terms within a prov:category, among properties applying to a particular class, etc.) is unspecified.</rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="&rdfs;isDefinedBy"/>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#editorsDefinition">
+        <rdfs:comment xml:lang="en">When the prov-o term does not have a definition drawn from prov-dm, and the prov-o editor provides one.</rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#definition"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#component">
+        <rdfs:comment xml:lang="en">Classify prov-o terms into six components according to prov-dm, including &#39;agents-responsibility&#39;, &#39;alternate&#39;, &#39;annotations&#39;, &#39;collections&#39;, &#39;derivations&#39;, and &#39;entities-activities&#39;. This classification is used so that readers of prov-o specification can find its correspondence with the prov-dm specification.</rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#qualifiedForm">
+        <rdfs:comment xml:lang="en">This annotation property links a subproperty of prov:wasInfluencedBy with the subclass of prov:Influence and the qualifying property that are used to qualify it. 
+
+Example annotation:
+
+    prov:wasGeneratedBy prov:qualifiedForm prov:qualifiedGeneration, prov:Generation .
+
+Then this unqualified assertion:
+
+    :entity1 prov:wasGeneratedBy :activity1 .
+
+can be qualified by adding:
+
+   :entity1 prov:qualifiedGeneration :entity1Gen .
+   :entity1Gen 
+       a prov:Generation, prov:Influence;
+       prov:activity :activity1;
+       :customValue 1337 .
+
+Note how the value of the unqualified influence (prov:wasGeneratedBy :activity1) is mirrored as the value of the prov:activity (or prov:entity, or prov:agent) property on the influence class.</rdfs:comment>
+        <rdfs:subPropertyOf rdf:resource="&rdfs;seeAlso"/>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#todo"/>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#n">
+        <rdfs:comment xml:lang="en">A reference to the principal section of the PROV-DM document that describes this concept.</rdfs:comment>
+        <rdfs:subPropertyOf rdf:resource="&rdfs;seeAlso"/>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+    </owl:AnnotationProperty>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Object Properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://www.w3.org/ns/prov#actedOnBehalfOf -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#actedOnBehalfOf">
+        <rdfs:label>actedOnBehalfOf</rdfs:label>
+        <component>agents-responsibility</component>
+        <inverse>hadDelegate</inverse>
+        <rdfs:comment xml:lang="en">An object property to express the accountability of an agent towards another agent. The subordinate agent acted on behalf of the responsible agent in an actual activity. </rdfs:comment>
+        <category>starting-point</category>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Agent"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Agent"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#Delegation"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#qualifiedDelegation"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#wasInfluencedBy"/>
+        <owl:propertyChainAxiom rdf:parseType="Collection">
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#qualifiedDelegation"/>
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#agent"/>
+        </owl:propertyChainAxiom>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#activity -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#activity">
+        <rdfs:label>activity</rdfs:label>
+        <editorsDefinition>The prov:activity property references an prov:Activity which influenced a resource. This property applies to an prov:ActivityInfluence, which is given by a subproperty of prov:qualifiedInfluence from the influenced prov:Entity, prov:Activity or prov:Agent.</editorsDefinition>
+        <inverse>activityOfInfluence</inverse>
+        <editorialNote xml:lang="en">This property behaves in spirit like rdf:object; it references the object of a prov:wasInfluencedBy triple.</editorialNote>
+        <category>qualified</category>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Activity"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#ActivityInfluence"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#influencer"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#agent -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#agent">
+        <rdfs:label>agent</rdfs:label>
+        <editorsDefinition xml:lang="en">The prov:agent property references an prov:Agent which influenced a resource. This property applies to an prov:AgentInfluence, which is given by a subproperty of prov:qualifiedInfluence from the influenced prov:Entity, prov:Activity or prov:Agent.</editorsDefinition>
+        <inverse>agentOfInfluence</inverse>
+        <editorialNote xml:lang="en">This property behaves in spirit like rdf:object; it references the object of a prov:wasInfluencedBy triple.</editorialNote>
+        <category>qualified</category>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Agent"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#AgentInfluence"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#influencer"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#alternateOf -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#alternateOf">
+        <rdfs:label>alternateOf</rdfs:label>
+        <constraints rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-constraints-20130430/#prov-dm-constraints-fig</constraints>
+        <dm rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-dm-20130430/#term-alternate</dm>
+        <n rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-n-20130430/#expression-alternate</n>
+        <definition xml:lang="en">Two alternate entities present aspects of the same thing. These aspects may be the same or different, and the alternate entities may or may not overlap in time.</definition>
+        <category>expanded</category>
+        <component>alternate</component>
+        <inverse>alternateOf</inverse>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <rdfs:seeAlso rdf:resource="http://www.w3.org/ns/prov#specializationOf"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#atLocation -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#atLocation">
+        <rdfs:label>atLocation</rdfs:label>
+        <rdfs:comment xml:lang="en">The Location of any resource.</rdfs:comment>
+        <inverse>locationOf</inverse>
+        <editorialNote xml:lang="en">The naming of prov:atLocation parallels prov:atTime, and is not named prov:hadLocation to avoid conflicting with the convention that prov:had* properties are used on prov:Influence classes.</editorialNote>
+        <rdfs:comment>This property has multiple RDFS domains to suit multiple OWL Profiles. See &lt;a href=&quot;#owl-profile&quot;&gt;PROV-O OWL Profile&lt;/a&gt;.</rdfs:comment>
+        <editorialNote xml:lang="en">This property is not functional because the many values could be at a variety of granularies (In this building, in this room, in that chair).</editorialNote>
+        <category>expanded</category>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Location"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#Location"/>
+        <rdfs:domain>
+            <owl:Class>
+                <owl:unionOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="http://www.w3.org/ns/prov#Activity"/>
+                    <rdf:Description rdf:about="http://www.w3.org/ns/prov#Agent"/>
+                    <rdf:Description rdf:about="http://www.w3.org/ns/prov#Entity"/>
+                    <rdf:Description rdf:about="http://www.w3.org/ns/prov#InstantaneousEvent"/>
+                </owl:unionOf>
+            </owl:Class>
+        </rdfs:domain>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#entity -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#entity">
+        <rdfs:label>entity</rdfs:label>
+        <editorsDefinition>The prov:entity property references an prov:Entity which influenced a resource. This property applies to an prov:EntityInfluence, which is given by a subproperty of prov:qualifiedInfluence from the influenced prov:Entity, prov:Activity or prov:Agent.</editorsDefinition>
+        <inverse>entityOfInfluence</inverse>
+        <editorialNote xml:lang="en">This property behaves in spirit like rdf:object; it references the object of a prov:wasInfluencedBy triple.</editorialNote>
+        <category>qualified</category>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#EntityInfluence"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#influencer"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#generated -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#generated">
+        <rdfs:label>generated</rdfs:label>
+        <component>entities-activities</component>
+        <inverse>wasGeneratedBy</inverse>
+        <category>expanded</category>
+        <editorialNote xml:lang="en">prov:generated is one of few inverse property defined, to allow Activity-oriented assertions in addition to Entity-oriented assertions.</editorialNote>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Activity"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#Generation"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#influenced"/>
+        <owl:inverseOf rdf:resource="http://www.w3.org/ns/prov#wasGeneratedBy"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#hadActivity -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#hadActivity">
+        <rdfs:label>hadActivity</rdfs:label>
+        <rdfs:comment>This property has multiple RDFS domains to suit multiple OWL Profiles. See &lt;a href=&quot;#owl-profile&quot;&gt;PROV-O OWL Profile&lt;/a&gt;.</rdfs:comment>
+        <rdfs:comment xml:lang="en">The _optional_ Activity of an Influence, which used, generated, invalidated, or was the responsibility of some Entity. This property is _not_ used by ActivityInfluence (use prov:activity instead).</rdfs:comment>
+        <editorialNote xml:lang="en">The multiple rdfs:domain assertions are intended. One is simpler and works for OWL-RL, the union is more specific but is not recognized by OWL-RL.</editorialNote>
+        <component>derivations</component>
+        <category>qualified</category>
+        <inverse>wasActivityOfInfluence</inverse>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Activity"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#Activity"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Influence"/>
+        <rdfs:domain>
+            <owl:Class>
+                <owl:unionOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="http://www.w3.org/ns/prov#Delegation"/>
+                    <rdf:Description rdf:about="http://www.w3.org/ns/prov#Derivation"/>
+                    <rdf:Description rdf:about="http://www.w3.org/ns/prov#End"/>
+                    <rdf:Description rdf:about="http://www.w3.org/ns/prov#Start"/>
+                </owl:unionOf>
+            </owl:Class>
+        </rdfs:domain>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#hadGeneration -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#hadGeneration">
+        <rdfs:label>hadGeneration</rdfs:label>
+        <inverse>generatedAsDerivation</inverse>
+        <category>qualified</category>
+        <rdfs:comment xml:lang="en">The _optional_ Generation involved in an Entity&#39;s Derivation.</rdfs:comment>
+        <component>derivations</component>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Derivation"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#Generation"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Generation"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#hadMember -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#hadMember">
+        <rdfs:label>hadMember</rdfs:label>
+        <category>expanded</category>
+        <component>expanded</component>
+        <inverse>wasMemberOf</inverse>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#Collection"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Collection"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#wasInfluencedBy"/>
+    </owl:ObjectProperty>
+    <owl:Axiom>
+        <rdfs:comment xml:lang="en">A collection is an entity that provides a structure to some constituents, which are themselves entities. These constituents are said to be member of the collections.</rdfs:comment>
+        <dm>http://www.w3.org/TR/2013/REC-prov-dm-20130430/#term-collection</dm>
+        <owl:annotatedProperty rdf:resource="&rdfs;range"/>
+        <owl:annotatedTarget rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <owl:annotatedSource rdf:resource="http://www.w3.org/ns/prov#hadMember"/>
+    </owl:Axiom>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#hadPlan -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#hadPlan">
+        <rdfs:label>hadPlan</rdfs:label>
+        <category>qualified</category>
+        <component>agents-responsibility</component>
+        <inverse>wasPlanOf</inverse>
+        <rdfs:comment xml:lang="en">The _optional_ Plan adopted by an Agent in Association with some Activity. Plan specifications are out of the scope of this specification.</rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Association"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#Plan"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Plan"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#hadPrimarySource -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#hadPrimarySource">
+        <rdfs:label>hadPrimarySource</rdfs:label>
+        <component>derivations</component>
+        <category>expanded</category>
+        <inverse>wasPrimarySourceOf</inverse>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#PrimarySource"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#qualifiedPrimarySource"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#wasDerivedFrom"/>
+        <owl:propertyChainAxiom rdf:parseType="Collection">
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#qualifiedPrimarySource"/>
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#entity"/>
+        </owl:propertyChainAxiom>
+    </owl:ObjectProperty>
+    <owl:Axiom>
+        <rdfs:comment>hadPrimarySource property is a particular case of wasDerivedFrom (see http://www.w3.org/TR/prov-dm/#term-original-source) that aims to give credit to the source that originated some information.</rdfs:comment>
+        <owl:annotatedProperty rdf:resource="&rdfs;subPropertyOf"/>
+        <owl:annotatedSource rdf:resource="http://www.w3.org/ns/prov#hadPrimarySource"/>
+        <owl:annotatedTarget rdf:resource="http://www.w3.org/ns/prov#wasDerivedFrom"/>
+    </owl:Axiom>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#hadRole -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#hadRole">
+        <rdfs:label>hadRole</rdfs:label>
+        <component>agents-responsibility</component>
+        <inverse>wasRoleIn</inverse>
+        <rdfs:comment>This property has multiple RDFS domains to suit multiple OWL Profiles. See &lt;a href=&quot;#owl-profile&quot;&gt;PROV-O OWL Profile&lt;/a&gt;.</rdfs:comment>
+        <category>qualified</category>
+        <rdfs:comment xml:lang="en">The _optional_ Role that an Entity assumed in the context of an Activity. For example, :baking prov:used :spoon; prov:qualified [ a prov:Usage; prov:entity :spoon; prov:hadRole roles:mixing_implement ].</rdfs:comment>
+        <editorsDefinition xml:lang="en">prov:hadRole references the Role (i.e. the function of an entity with respect to an activity), in the context of an instantaneous usage, generation, association, start, and end.</editorsDefinition>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Influence"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#Role"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Role"/>
+        <rdfs:domain>
+            <owl:Class>
+                <owl:unionOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="http://www.w3.org/ns/prov#Association"/>
+                    <rdf:Description rdf:about="http://www.w3.org/ns/prov#InstantaneousEvent"/>
+                </owl:unionOf>
+            </owl:Class>
+        </rdfs:domain>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#hadUsage -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#hadUsage">
+        <rdfs:label>hadUsage</rdfs:label>
+        <category>qualified</category>
+        <rdfs:comment xml:lang="en">The _optional_ Usage involved in an Entity&#39;s Derivation.</rdfs:comment>
+        <inverse>wasUsedInDerivation</inverse>
+        <component>derivations</component>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Derivation"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Usage"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#Usage"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#influenced -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#influenced">
+        <rdfs:label>influenced</rdfs:label>
+        <inverse>wasInfluencedBy</inverse>
+        <component>agents-responsibility</component>
+        <category>expanded</category>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#Influence"/>
+        <owl:inverseOf rdf:resource="http://www.w3.org/ns/prov#wasInfluencedBy"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#influencer -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#influencer">
+        <rdfs:label>influencer</rdfs:label>
+        <dm rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-dm-20130430/#term-influence</dm>
+        <category>qualified</category>
+        <inverse>hadInfluence</inverse>
+        <rdfs:comment xml:lang="en">Subproperties of prov:influencer are used to cite the object of an unqualified PROV-O triple whose predicate is a subproperty of prov:wasInfluencedBy (e.g. prov:used, prov:wasGeneratedBy). prov:influencer is used much like rdf:object is used.</rdfs:comment>
+        <editorialNote xml:lang="en">This property and its subproperties are used in the same way as the rdf:object property, i.e. to reference the object of an unqualified prov:wasInfluencedBy or prov:influenced triple.</editorialNote>
+        <editorsDefinition xml:lang="en">This property is used as part of the qualified influence pattern. Subclasses of prov:Influence use these subproperties to reference the resource (Entity, Agent, or Activity) whose influence is being qualified.</editorsDefinition>
+        <rdfs:range rdf:resource="&owl;Thing"/>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Influence"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#invalidated -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#invalidated">
+        <rdfs:label>invalidated</rdfs:label>
+        <category>expanded</category>
+        <inverse>wasInvalidatedBy</inverse>
+        <component>entities-activities</component>
+        <editorialNote xml:lang="en">prov:invalidated is one of few inverse property defined, to allow Activity-oriented assertions in addition to Entity-oriented assertions.</editorialNote>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Activity"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#Invalidation"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#influenced"/>
+        <owl:inverseOf rdf:resource="http://www.w3.org/ns/prov#wasInvalidatedBy"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#qualifiedAssociation -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#qualifiedAssociation">
+        <rdfs:label>qualifiedAssociation</rdfs:label>
+        <inverse>qualifiedAssociationOf</inverse>
+        <rdfs:comment xml:lang="en">If this Activity prov:wasAssociatedWith Agent :ag, then it can qualify the Association using prov:qualifiedAssociation [ a prov:Association;  prov:agent :ag; :foo :bar ].</rdfs:comment>
+        <component>agents-responsibility</component>
+        <category>qualified</category>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Activity"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Association"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#Association"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#qualifiedInfluence"/>
+        <unqualifiedForm rdf:resource="http://www.w3.org/ns/prov#wasAssociatedWith"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#qualifiedAttribution -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#qualifiedAttribution">
+        <rdfs:label>qualifiedAttribution</rdfs:label>
+        <inverse>qualifiedAttributionOf</inverse>
+        <category>qualified</category>
+        <component>agents-responsibility</component>
+        <rdfs:comment xml:lang="en">If this Entity prov:wasAttributedTo Agent :ag, then it can qualify how it was influenced using prov:qualifiedAttribution [ a prov:Attribution;  prov:agent :ag; :foo :bar ].</rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#Attribution"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Attribution"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#qualifiedInfluence"/>
+        <unqualifiedForm rdf:resource="http://www.w3.org/ns/prov#wasAttributedTo"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#qualifiedCommunication -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#qualifiedCommunication">
+        <rdfs:label>qualifiedCommunication</rdfs:label>
+        <inverse>qualifiedCommunicationOf</inverse>
+        <component>entities-activities</component>
+        <rdfs:comment xml:lang="en">If this Activity prov:wasInformedBy Activity :a, then it can qualify how it was influenced using prov:qualifiedCommunication [ a prov:Communication;  prov:activity :a; :foo :bar ].</rdfs:comment>
+        <category>qualified</category>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Activity"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#Communication"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Communication"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#Communication"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#qualifiedInfluence"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#qualifiedDelegation -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#qualifiedDelegation">
+        <rdfs:label>qualifiedDelegation</rdfs:label>
+        <category>qualified</category>
+        <rdfs:comment xml:lang="en">If this Agent prov:actedOnBehalfOf Agent :ag, then it can qualify how with prov:qualifiedResponsibility [ a prov:Responsibility;  prov:agent :ag; :foo :bar ].</rdfs:comment>
+        <inverse>qualifiedDelegationOf</inverse>
+        <component>agents-responsibility</component>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Agent"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#Delegation"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Delegation"/>
+        <unqualifiedForm rdf:resource="http://www.w3.org/ns/prov#actedOnBehalfOf"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#qualifiedInfluence"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#qualifiedDerivation -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#qualifiedDerivation">
+        <rdfs:label>qualifiedDerivation</rdfs:label>
+        <component>derivations</component>
+        <category>qualified</category>
+        <rdfs:comment xml:lang="en">If this Entity prov:wasDerivedFrom Entity :e, then it can qualify how it was derived using prov:qualifiedDerivation [ a prov:Derivation;  prov:entity :e; :foo :bar ].</rdfs:comment>
+        <inverse>qualifiedDerivationOf</inverse>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#Derivation"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Derivation"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#qualifiedInfluence"/>
+        <unqualifiedForm rdf:resource="http://www.w3.org/ns/prov#wasDerivedFrom"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#qualifiedEnd -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#qualifiedEnd">
+        <rdfs:label>qualifiedEnd</rdfs:label>
+        <category>qualified</category>
+        <inverse>qualifiedEndOf</inverse>
+        <component>entities-activities</component>
+        <rdfs:comment xml:lang="en">If this Activity prov:wasEndedBy Entity :e1, then it can qualify how it was ended using prov:qualifiedEnd [ a prov:End;  prov:entity :e1; :foo :bar ].</rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Activity"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#End"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#End"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#qualifiedInfluence"/>
+        <unqualifiedForm rdf:resource="http://www.w3.org/ns/prov#wasEndedBy"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#qualifiedGeneration -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#qualifiedGeneration">
+        <rdfs:label>qualifiedGeneration</rdfs:label>
+        <inverse>qualifiedGenerationOf</inverse>
+        <component>entities-activities</component>
+        <category>qualified</category>
+        <rdfs:comment xml:lang="en">If this Activity prov:generated Entity :e, then it can qualify how it performed the Generation using prov:qualifiedGeneration [ a prov:Generation;  prov:entity :e; :foo :bar ].</rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Generation"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#Generation"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#qualifiedInfluence"/>
+        <unqualifiedForm rdf:resource="http://www.w3.org/ns/prov#wasGeneratedBy"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#qualifiedInfluence -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#qualifiedInfluence">
+        <rdfs:label>qualifiedInfluence</rdfs:label>
+        <rdfs:comment xml:lang="en">Because prov:qualifiedInfluence is a broad relation, the more specific relations (qualifiedCommunication, qualifiedDelegation, qualifiedEnd, etc.) should be used when applicable.</rdfs:comment>
+        <category>qualified</category>
+        <inverse>qualifiedInfluenceOf</inverse>
+        <component>derivations</component>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Influence"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#Influence"/>
+        <unqualifiedForm rdf:resource="http://www.w3.org/ns/prov#wasInfluencedBy"/>
+        <rdfs:domain>
+            <owl:Class>
+                <owl:unionOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="http://www.w3.org/ns/prov#Activity"/>
+                    <rdf:Description rdf:about="http://www.w3.org/ns/prov#Agent"/>
+                    <rdf:Description rdf:about="http://www.w3.org/ns/prov#Entity"/>
+                </owl:unionOf>
+            </owl:Class>
+        </rdfs:domain>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#qualifiedInvalidation -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#qualifiedInvalidation">
+        <rdfs:label>qualifiedInvalidation</rdfs:label>
+        <rdfs:comment xml:lang="en">If this Entity prov:wasInvalidatedBy Activity :a, then it can qualify how it was invalidated using prov:qualifiedInvalidation [ a prov:Invalidation;  prov:activity :a; :foo :bar ].</rdfs:comment>
+        <component>entities-activities</component>
+        <category>qualified</category>
+        <inverse>qualifiedInvalidationOf</inverse>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#Invalidation"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Invalidation"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#qualifiedInfluence"/>
+        <unqualifiedForm rdf:resource="http://www.w3.org/ns/prov#wasInvalidatedBy"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#qualifiedPrimarySource -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#qualifiedPrimarySource">
+        <rdfs:label>qualifiedPrimarySource</rdfs:label>
+        <rdfs:comment xml:lang="en">If this Entity prov:hadPrimarySource Entity :e, then it can qualify how using prov:qualifiedPrimarySource [ a prov:PrimarySource; prov:entity :e; :foo :bar ].</rdfs:comment>
+        <component>derivations</component>
+        <category>qualified</category>
+        <inverse>qualifiedSourceOf</inverse>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#PrimarySource"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#PrimarySource"/>
+        <unqualifiedForm rdf:resource="http://www.w3.org/ns/prov#hadPrimarySource"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#qualifiedInfluence"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#qualifiedQuotation -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#qualifiedQuotation">
+        <rdfs:label>qualifiedQuotation</rdfs:label>
+        <category>qualified</category>
+        <inverse>qualifiedQuotationOf</inverse>
+        <rdfs:comment xml:lang="en">If this Entity prov:wasQuotedFrom Entity :e, then it can qualify how using prov:qualifiedQuotation [ a prov:Quotation;  prov:entity :e; :foo :bar ].</rdfs:comment>
+        <component>derivations</component>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#Quotation"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Quotation"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#qualifiedInfluence"/>
+        <unqualifiedForm rdf:resource="http://www.w3.org/ns/prov#wasQuotedFrom"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#qualifiedRevision -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#qualifiedRevision">
+        <rdfs:label>qualifiedRevision</rdfs:label>
+        <rdfs:comment xml:lang="en">If this Entity prov:wasRevisionOf Entity :e, then it can qualify how it was revised using prov:qualifiedRevision [ a prov:Revision;  prov:entity :e; :foo :bar ].</rdfs:comment>
+        <category>qualified</category>
+        <inverse>revisedEntity</inverse>
+        <component>derivations</component>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Revision"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#Revision"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#qualifiedInfluence"/>
+        <unqualifiedForm rdf:resource="http://www.w3.org/ns/prov#wasRevisionOf"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#qualifiedStart -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#qualifiedStart">
+        <rdfs:label>qualifiedStart</rdfs:label>
+        <inverse>qualifiedStartOf</inverse>
+        <category>qualified</category>
+        <component>entities-activities</component>
+        <rdfs:comment xml:lang="en">If this Activity prov:wasStartedBy Entity :e1, then it can qualify how it was started using prov:qualifiedStart [ a prov:Start;  prov:entity :e1; :foo :bar ].</rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Activity"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Start"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#Start"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#qualifiedInfluence"/>
+        <unqualifiedForm rdf:resource="http://www.w3.org/ns/prov#wasStartedBy"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#qualifiedUsage -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#qualifiedUsage">
+        <rdfs:label>qualifiedUsage</rdfs:label>
+        <category>qualified</category>
+        <inverse>qualifiedUsingActivity</inverse>
+        <component>entities-activities</component>
+        <rdfs:comment xml:lang="en">If this Activity prov:used Entity :e, then it can qualify how it used it using prov:qualifiedUsage [ a prov:Usage; prov:entity :e; :foo :bar ].</rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Activity"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#Usage"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Usage"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#qualifiedInfluence"/>
+        <unqualifiedForm rdf:resource="http://www.w3.org/ns/prov#used"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#specializationOf -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#specializationOf">
+        <rdfs:label>specializationOf</rdfs:label>
+        <constraints rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-constraints-20130430/#prov-dm-constraints-fig</constraints>
+        <dm rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-dm-20130430/#term-specialization</dm>
+        <n rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-n-20130430/#expression-specialization</n>
+        <component>alternate</component>
+        <category>expanded</category>
+        <inverse>generalizationOf</inverse>
+        <definition xml:lang="en">An entity that is a specialization of another shares all aspects of the latter, and additionally presents more specific aspects of the same thing as the latter. In particular, the lifetime of the entity being specialized contains that of any specialization. Examples of aspects include a time period, an abstraction, and a context associated with the entity.</definition>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <rdfs:seeAlso rdf:resource="http://www.w3.org/ns/prov#alternateOf"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#alternateOf"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#used -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#used">
+        <rdfs:label>used</rdfs:label>
+        <inverse>wasUsedBy</inverse>
+        <rdfs:comment xml:lang="en">A prov:Entity that was used by this prov:Activity. For example, :baking prov:used :spoon, :egg, :oven .</rdfs:comment>
+        <category>starting-point</category>
+        <component>entities-activities</component>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Activity"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#Usage"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#qualifiedUsage"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#wasInfluencedBy"/>
+        <owl:propertyChainAxiom rdf:parseType="Collection">
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#qualifiedUsage"/>
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#entity"/>
+        </owl:propertyChainAxiom>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#wasAssociatedWith -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#wasAssociatedWith">
+        <rdfs:label>wasAssociatedWith</rdfs:label>
+        <component>agents-responsibility</component>
+        <inverse>wasAssociateFor</inverse>
+        <rdfs:comment xml:lang="en">An prov:Agent that had some (unspecified) responsibility for the occurrence of this prov:Activity.</rdfs:comment>
+        <category>starting-point</category>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Activity"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Agent"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#Association"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#qualifiedAssociation"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#wasInfluencedBy"/>
+        <owl:propertyChainAxiom rdf:parseType="Collection">
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#qualifiedAssociation"/>
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#agent"/>
+        </owl:propertyChainAxiom>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#wasAttributedTo -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#wasAttributedTo">
+        <rdfs:label>wasAttributedTo</rdfs:label>
+        <component>agents-responsibility</component>
+        <category>starting-point</category>
+        <inverse>contributed</inverse>
+        <definition xml:lang="en">Attribution is the ascribing of an entity to an agent.</definition>
+        <rdfs:comment xml:lang="en">Attribution is the ascribing of an entity to an agent.</rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Agent"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#Attribution"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#qualifiedAttribution"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#wasInfluencedBy"/>
+        <owl:propertyChainAxiom rdf:parseType="Collection">
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#qualifiedAttribution"/>
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#agent"/>
+        </owl:propertyChainAxiom>
+    </owl:ObjectProperty>
+    <owl:Axiom>
+        <rdfs:comment>Attribution is a particular case of trace (see http://www.w3.org/TR/prov-dm/#concept-trace), in the sense that it links an entity to the agent that ascribed it.</rdfs:comment>
+        <definition>IF wasAttributedTo(e2,ag1,aAttr) holds, THEN wasInfluencedBy(e2,ag1) also holds. </definition>
+        <owl:annotatedProperty rdf:resource="&rdfs;subPropertyOf"/>
+        <owl:annotatedSource rdf:resource="http://www.w3.org/ns/prov#wasAttributedTo"/>
+        <owl:annotatedTarget rdf:resource="http://www.w3.org/ns/prov#wasInfluencedBy"/>
+    </owl:Axiom>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#wasDerivedFrom -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#wasDerivedFrom">
+        <rdfs:label>wasDerivedFrom</rdfs:label>
+        <inverse>hadDerivation</inverse>
+        <definition xml:lang="en">A derivation is a transformation of an entity into another, an update of an entity resulting in a new one, or the construction of a new entity based on a pre-existing entity.</definition>
+        <category>starting-point</category>
+        <rdfs:comment xml:lang="en">The more specific subproperties of prov:wasDerivedFrom (i.e., prov:wasQuotedFrom, prov:wasRevisionOf, prov:hadPrimarySource) should be used when applicable.</rdfs:comment>
+        <component>derivations</component>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#Derivation"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#qualifiedDerivation"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#wasInfluencedBy"/>
+        <owl:propertyChainAxiom rdf:parseType="Collection">
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#qualifiedDerivation"/>
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#entity"/>
+        </owl:propertyChainAxiom>
+    </owl:ObjectProperty>
+    <owl:Axiom>
+        <rdfs:comment>Derivation is a particular case of trace (see http://www.w3.org/TR/prov-dm/#term-trace), since it links an entity to another entity that contributed to its existence.</rdfs:comment>
+        <owl:annotatedProperty rdf:resource="&rdfs;subPropertyOf"/>
+        <owl:annotatedSource rdf:resource="http://www.w3.org/ns/prov#wasDerivedFrom"/>
+        <owl:annotatedTarget rdf:resource="http://www.w3.org/ns/prov#wasInfluencedBy"/>
+    </owl:Axiom>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#wasEndedBy -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#wasEndedBy">
+        <rdfs:label>wasEndedBy</rdfs:label>
+        <category>expanded</category>
+        <component>entities-activities</component>
+        <rdfs:comment xml:lang="en">End is when an activity is deemed to have ended. An end may refer to an entity, known as trigger, that terminated the activity.</rdfs:comment>
+        <inverse>ended</inverse>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Activity"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#End"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#qualifiedEnd"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#wasInfluencedBy"/>
+        <owl:propertyChainAxiom rdf:parseType="Collection">
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#qualifiedEnd"/>
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#entity"/>
+        </owl:propertyChainAxiom>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#wasGeneratedBy -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#wasGeneratedBy">
+        <rdfs:label>wasGeneratedBy</rdfs:label>
+        <inverse>generated</inverse>
+        <category>starting-point</category>
+        <component>entities-activities</component>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Activity"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#Generation"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#qualifiedGeneration"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#wasInfluencedBy"/>
+        <owl:propertyChainAxiom rdf:parseType="Collection">
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#qualifiedGeneration"/>
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#activity"/>
+        </owl:propertyChainAxiom>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#wasInfluencedBy -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#wasInfluencedBy">
+        <rdfs:label>wasInfluencedBy</rdfs:label>
+        <rdfs:comment xml:lang="en">Because prov:wasInfluencedBy is a broad relation, its more specific subproperties (e.g. prov:wasInformedBy, prov:actedOnBehalfOf, prov:wasEndedBy, etc.) should be used when applicable.</rdfs:comment>
+        <editorialNote xml:lang="en">The sub-properties of prov:wasInfluencedBy can be elaborated in more detail using the Qualification Pattern. For example, the binary relation :baking prov:used :spoon can be qualified by asserting :baking prov:qualifiedUsage [ a prov:Usage; prov:entity :spoon; prov:atLocation :kitchen ] .
+
+Subproperties of prov:wasInfluencedBy may also be asserted directly without being qualified.
+
+prov:wasInfluencedBy should not be used without also using one of its subproperties. 
+</editorialNote>
+        <rdfs:comment>This property has multiple RDFS domains to suit multiple OWL Profiles. See &lt;a href=&quot;#owl-profile&quot;&gt;PROV-O OWL Profile&lt;/a&gt;.</rdfs:comment>
+        <category>qualified</category>
+        <inverse>influenced</inverse>
+        <component>agents-responsibility</component>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#Influence"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#Influence"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#qualifiedInfluence"/>
+        <rdfs:domain>
+            <owl:Class>
+                <owl:unionOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="http://www.w3.org/ns/prov#Activity"/>
+                    <rdf:Description rdf:about="http://www.w3.org/ns/prov#Agent"/>
+                    <rdf:Description rdf:about="http://www.w3.org/ns/prov#Entity"/>
+                </owl:unionOf>
+            </owl:Class>
+        </rdfs:domain>
+        <rdfs:range>
+            <owl:Class>
+                <owl:unionOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="http://www.w3.org/ns/prov#Activity"/>
+                    <rdf:Description rdf:about="http://www.w3.org/ns/prov#Agent"/>
+                    <rdf:Description rdf:about="http://www.w3.org/ns/prov#Entity"/>
+                </owl:unionOf>
+            </owl:Class>
+        </rdfs:range>
+    </owl:ObjectProperty>
+    <owl:Axiom>
+        <definition>influencer: an identifier (o1) for an ancestor entity, activity, or agent that the former depends on;</definition>
+        <dm>http://www.w3.org/TR/2013/REC-prov-dm-20130430/#term-influence</dm>
+        <owl:annotatedProperty rdf:resource="&rdfs;range"/>
+        <owl:annotatedSource rdf:resource="http://www.w3.org/ns/prov#wasInfluencedBy"/>
+        <owl:annotatedTarget>
+            <owl:Class>
+                <owl:unionOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="http://www.w3.org/ns/prov#Activity"/>
+                    <rdf:Description rdf:about="http://www.w3.org/ns/prov#Agent"/>
+                    <rdf:Description rdf:about="http://www.w3.org/ns/prov#Entity"/>
+                </owl:unionOf>
+            </owl:Class>
+        </owl:annotatedTarget>
+    </owl:Axiom>
+    <owl:Axiom>
+        <definition>influencee: an identifier (o2) for an entity, activity, or agent; </definition>
+        <dm>http://www.w3.org/TR/2013/REC-prov-dm-20130430/#term-influence</dm>
+        <owl:annotatedProperty rdf:resource="&rdfs;domain"/>
+        <owl:annotatedSource rdf:resource="http://www.w3.org/ns/prov#wasInfluencedBy"/>
+        <owl:annotatedTarget>
+            <owl:Class>
+                <owl:unionOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="http://www.w3.org/ns/prov#Activity"/>
+                    <rdf:Description rdf:about="http://www.w3.org/ns/prov#Agent"/>
+                    <rdf:Description rdf:about="http://www.w3.org/ns/prov#Entity"/>
+                </owl:unionOf>
+            </owl:Class>
+        </owl:annotatedTarget>
+    </owl:Axiom>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#wasInformedBy -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#wasInformedBy">
+        <rdfs:label>wasInformedBy</rdfs:label>
+        <inverse>informed</inverse>
+        <rdfs:comment xml:lang="en">An activity a2 is dependent on or informed by another activity a1, by way of some unspecified entity that is generated by a1 and used by a2.</rdfs:comment>
+        <category>starting-point</category>
+        <component>entities-activities</component>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Activity"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Activity"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#Communication"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#qualifiedCommunication"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#wasInfluencedBy"/>
+        <owl:propertyChainAxiom rdf:parseType="Collection">
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#qualifiedCommunication"/>
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#activity"/>
+        </owl:propertyChainAxiom>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#wasInvalidatedBy -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#wasInvalidatedBy">
+        <rdfs:label>wasInvalidatedBy</rdfs:label>
+        <component>entities-activities</component>
+        <inverse>invalidated</inverse>
+        <category>expanded</category>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Activity"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#Invalidation"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#qualifiedInvalidation"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#wasInfluencedBy"/>
+        <owl:propertyChainAxiom rdf:parseType="Collection">
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#qualifiedInvalidation"/>
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#activity"/>
+        </owl:propertyChainAxiom>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#wasQuotedFrom -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#wasQuotedFrom">
+        <rdfs:label>wasQuotedFrom</rdfs:label>
+        <category>expanded</category>
+        <component>derivations</component>
+        <inverse>quotedAs</inverse>
+        <rdfs:comment xml:lang="en">An entity is derived from an original entity by copying, or &#39;quoting&#39;, some or all of it.</rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#Quotation"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#qualifiedQuotation"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#wasDerivedFrom"/>
+        <owl:propertyChainAxiom rdf:parseType="Collection">
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#qualifiedQuotation"/>
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#entity"/>
+        </owl:propertyChainAxiom>
+    </owl:ObjectProperty>
+    <owl:Axiom>
+        <rdfs:comment>Quotation is a particular case of derivation (see http://www.w3.org/TR/prov-dm/#term-quotation) in which an entity is derived from an original entity by copying, or &quot;quoting&quot;, some or all of it. </rdfs:comment>
+        <owl:annotatedProperty rdf:resource="&rdfs;subPropertyOf"/>
+        <owl:annotatedTarget rdf:resource="http://www.w3.org/ns/prov#wasDerivedFrom"/>
+        <owl:annotatedSource rdf:resource="http://www.w3.org/ns/prov#wasQuotedFrom"/>
+    </owl:Axiom>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#wasRevisionOf -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#wasRevisionOf">
+        <rdfs:label>wasRevisionOf</rdfs:label>
+        <rdfs:comment xml:lang="en">A revision is a derivation that revises an entity into a revised version.</rdfs:comment>
+        <component>derivations</component>
+        <inverse>hadRevision</inverse>
+        <category>expanded</category>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#Revision"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#qualifiedRevision"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#wasDerivedFrom"/>
+        <owl:propertyChainAxiom rdf:parseType="Collection">
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#qualifiedRevision"/>
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#entity"/>
+        </owl:propertyChainAxiom>
+    </owl:ObjectProperty>
+    <owl:Axiom>
+        <rdfs:comment>Revision is a derivation (see http://www.w3.org/TR/prov-dm/#term-Revision). Moreover, according to 
+http://www.w3.org/TR/2013/REC-prov-constraints-20130430/#term-Revision 23 April 2012 &#39;wasRevisionOf is a strict sub-relation of wasDerivedFrom since two entities e2 and e1 may satisfy wasDerivedFrom(e2,e1) without being a variant of each other.&#39;</rdfs:comment>
+        <owl:annotatedProperty rdf:resource="&rdfs;subPropertyOf"/>
+        <owl:annotatedTarget rdf:resource="http://www.w3.org/ns/prov#wasDerivedFrom"/>
+        <owl:annotatedSource rdf:resource="http://www.w3.org/ns/prov#wasRevisionOf"/>
+    </owl:Axiom>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#wasStartedBy -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#wasStartedBy">
+        <rdfs:label>wasStartedBy</rdfs:label>
+        <inverse>started</inverse>
+        <category>expanded</category>
+        <component>entities-activities</component>
+        <rdfs:comment xml:lang="en">Start is when an activity is deemed to have started. A start may refer to an entity, known as trigger, that initiated the activity.</rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Activity"/>
+        <rdfs:range rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#Start"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#qualifiedStart"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#wasInfluencedBy"/>
+        <owl:propertyChainAxiom rdf:parseType="Collection">
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#qualifiedStart"/>
+            <rdf:Description rdf:about="http://www.w3.org/ns/prov#entity"/>
+        </owl:propertyChainAxiom>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Data properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://www.w3.org/ns/prov#atTime -->
+
+    <owl:DatatypeProperty rdf:about="http://www.w3.org/ns/prov#atTime">
+        <rdfs:label>atTime</rdfs:label>
+        <component>entities-activities</component>
+        <category>qualified</category>
+        <rdfs:comment xml:lang="en">The time at which an InstantaneousEvent occurred, in the form of xsd:dateTime.</rdfs:comment>
+        <rdfs:range rdf:resource="&xsd;dateTime"/>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#InstantaneousEvent"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#InstantaneousEvent"/>
+        <unqualifiedForm rdf:resource="http://www.w3.org/ns/prov#endedAtTime"/>
+        <unqualifiedForm rdf:resource="http://www.w3.org/ns/prov#generatedAtTime"/>
+        <unqualifiedForm rdf:resource="http://www.w3.org/ns/prov#invalidatedAtTime"/>
+        <unqualifiedForm rdf:resource="http://www.w3.org/ns/prov#startedAtTime"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#endedAtTime -->
+
+    <owl:DatatypeProperty rdf:about="http://www.w3.org/ns/prov#endedAtTime">
+        <rdfs:label>endedAtTime</rdfs:label>
+        <component>entities-activities</component>
+        <editorialNote xml:lang="en">It is the intent that the property chain holds: (prov:qualifiedEnd o prov:atTime) rdfs:subPropertyOf prov:endedAtTime.</editorialNote>
+        <rdfs:comment xml:lang="en">The time at which an activity ended. See also prov:startedAtTime.</rdfs:comment>
+        <category>starting-point</category>
+        <rdfs:range rdf:resource="&xsd;dateTime"/>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Activity"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#End"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#atTime"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#generatedAtTime -->
+
+    <owl:DatatypeProperty rdf:about="http://www.w3.org/ns/prov#generatedAtTime">
+        <rdfs:label>generatedAtTime</rdfs:label>
+        <category>expanded</category>
+        <component>entities-activities</component>
+        <editorialNote xml:lang="en">It is the intent that the property chain holds: (prov:qualifiedGeneration o prov:atTime) rdfs:subPropertyOf prov:generatedAtTime.</editorialNote>
+        <rdfs:comment xml:lang="en">The time at which an entity was completely created and is available for use.</rdfs:comment>
+        <rdfs:range rdf:resource="&xsd;dateTime"/>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#Generation"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#atTime"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#invalidatedAtTime -->
+
+    <owl:DatatypeProperty rdf:about="http://www.w3.org/ns/prov#invalidatedAtTime">
+        <rdfs:label>invalidatedAtTime</rdfs:label>
+        <editorialNote xml:lang="en">It is the intent that the property chain holds: (prov:qualifiedInvalidation o prov:atTime) rdfs:subPropertyOf prov:invalidatedAtTime.</editorialNote>
+        <category>expanded</category>
+        <rdfs:comment xml:lang="en">The time at which an entity was invalidated (i.e., no longer usable).</rdfs:comment>
+        <component>entities-activities</component>
+        <rdfs:range rdf:resource="&xsd;dateTime"/>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#Invalidation"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#atTime"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#startedAtTime -->
+
+    <owl:DatatypeProperty rdf:about="http://www.w3.org/ns/prov#startedAtTime">
+        <rdfs:label>startedAtTime</rdfs:label>
+        <category>starting-point</category>
+        <editorialNote xml:lang="en">It is the intent that the property chain holds: (prov:qualifiedStart o prov:atTime) rdfs:subPropertyOf prov:startedAtTime.</editorialNote>
+        <component>entities-activities</component>
+        <rdfs:comment xml:lang="en">The time at which an activity started. See also prov:endedAtTime.</rdfs:comment>
+        <rdfs:range rdf:resource="&xsd;dateTime"/>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Activity"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#Start"/>
+        <qualifiedForm rdf:resource="http://www.w3.org/ns/prov#atTime"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#value -->
+
+    <owl:DatatypeProperty rdf:about="http://www.w3.org/ns/prov#value">
+        <rdfs:label>value</rdfs:label>
+        <dm rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-dm-20130430/#term-attribute-value</dm>
+        <category>expanded</category>
+        <editorialNote>The editor&#39;s definition comes from http://www.w3.org/TR/rdf-primer/#rdfvalue</editorialNote>
+        <definition xml:lang="en">Provides a value that is a direct representation of an entity.</definition>
+        <component>entities-activities</component>
+        <editorialNote xml:lang="en">This property serves the same purpose as rdf:value, but has been reintroduced to avoid some of the definitional ambiguity in the RDF specification (specifically, &#39;may be used in describing structured values&#39;).</editorialNote>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:domain rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Classes
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://www.w3.org/2002/07/owl#Thing -->
+
+    <owl:Class rdf:about="&owl;Thing"/>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#Activity -->
+
+    <owl:Class rdf:about="http://www.w3.org/ns/prov#Activity">
+        <rdfs:label>Activity</rdfs:label>
+        <owl:disjointWith rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <constraints rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-constraints-20130430/#prov-dm-constraints-fig</constraints>
+        <dm rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-dm-20130430/#term-Activity</dm>
+        <n rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-n-20130430/#expression-Activity</n>
+        <component>entities-activities</component>
+        <category>starting-point</category>
+        <definition>An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities.</definition>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+    </owl:Class>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#ActivityInfluence -->
+
+    <owl:Class rdf:about="http://www.w3.org/ns/prov#ActivityInfluence">
+        <rdfs:label>ActivityInfluence</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://www.w3.org/ns/prov#Influence"/>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://www.w3.org/ns/prov#hadActivity"/>
+                <owl:maxCardinality rdf:datatype="&xsd;nonNegativeInteger">0</owl:maxCardinality>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <owl:disjointWith rdf:resource="http://www.w3.org/ns/prov#EntityInfluence"/>
+        <editorsDefinition xml:lang="en">ActivitiyInfluence is the capacity of an activity to have an effect on the character, development, or behavior of another by means of generation, invalidation, communication, or other.</editorsDefinition>
+        <rdfs:comment xml:lang="en">ActivityInfluence provides additional descriptions of an Activity&#39;s binary influence upon any other kind of resource. Instances of ActivityInfluence use the prov:activity property to cite the influencing Activity.</rdfs:comment>
+        <rdfs:comment xml:lang="en">It is not recommended that the type ActivityInfluence be asserted without also asserting one of its more specific subclasses.</rdfs:comment>
+        <category>qualified</category>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:seeAlso rdf:resource="http://www.w3.org/ns/prov#activity"/>
+    </owl:Class>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#Agent -->
+
+    <owl:Class rdf:about="http://www.w3.org/ns/prov#Agent">
+        <rdfs:label>Agent</rdfs:label>
+        <owl:disjointWith rdf:resource="http://www.w3.org/ns/prov#InstantaneousEvent"/>
+        <dm rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-dm-20130430/#term-agent</dm>
+        <n rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-n-20130430/#expression-Agent</n>
+        <definition xml:lang="en">An agent is something that bears some form of responsibility for an activity taking place, for the existence of an entity, or for another agent&#39;s activity. </definition>
+        <category>starting-point</category>
+        <component>agents-responsibility</component>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+    </owl:Class>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#AgentInfluence -->
+
+    <owl:Class rdf:about="http://www.w3.org/ns/prov#AgentInfluence">
+        <rdfs:label>AgentInfluence</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://www.w3.org/ns/prov#Influence"/>
+        <editorsDefinition xml:lang="en">AgentInfluence is the capacity of an agent to have an effect on the character, development, or behavior of another by means of attribution, association, delegation, or other.</editorsDefinition>
+        <rdfs:comment xml:lang="en">AgentInfluence provides additional descriptions of an Agent&#39;s binary influence upon any other kind of resource. Instances of AgentInfluence use the prov:agent property to cite the influencing Agent.</rdfs:comment>
+        <category>qualified</category>
+        <rdfs:comment xml:lang="en">It is not recommended that the type AgentInfluence be asserted without also asserting one of its more specific subclasses.</rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <rdfs:seeAlso rdf:resource="http://www.w3.org/ns/prov#agent"/>
+    </owl:Class>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#Association -->
+
+    <owl:Class rdf:about="http://www.w3.org/ns/prov#Association">
+        <rdfs:label>Association</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://www.w3.org/ns/prov#AgentInfluence"/>
+        <dm rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-dm-20130430/#term-Association</dm>
+        <n rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-n-20130430/#expression-Association</n>
+        <component>agents-responsibility</component>
+        <rdfs:comment xml:lang="en">An instance of prov:Association provides additional descriptions about the binary prov:wasAssociatedWith relation from an prov:Activity to some prov:Agent that had some responsiblity for it. For example, :baking prov:wasAssociatedWith :baker; prov:qualifiedAssociation [ a prov:Association; prov:agent :baker; :foo :bar ].</rdfs:comment>
+        <category>qualified</category>
+        <definition xml:lang="en">An activity association is an assignment of responsibility to an agent for an activity, indicating that the agent had a role in the activity. It further allows for a plan to be specified, which is the plan intended by the agent to achieve some goals in the context of this activity.</definition>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <unqualifiedForm rdf:resource="http://www.w3.org/ns/prov#wasAssociatedWith"/>
+    </owl:Class>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#Attribution -->
+
+    <owl:Class rdf:about="http://www.w3.org/ns/prov#Attribution">
+        <rdfs:label>Attribution</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://www.w3.org/ns/prov#AgentInfluence"/>
+        <constraints rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-constraints-20130430/#prov-dm-constraints-fig</constraints>
+        <dm rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-dm-20130430/#term-attribution</dm>
+        <n rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-n-20130430/#expression-attribution</n>
+        <rdfs:comment xml:lang="en">An instance of prov:Attribution provides additional descriptions about the binary prov:wasAttributedTo relation from an prov:Entity to some prov:Agent that had some responsible for it. For example, :cake prov:wasAttributedTo :baker; prov:qualifiedAttribution [ a prov:Attribution; prov:entity :baker; :foo :bar ].</rdfs:comment>
+        <definition xml:lang="en">Attribution is the ascribing of an entity to an agent.
+
+When an entity e is attributed to agent ag, entity e was generated by some unspecified activity that in turn was associated to agent ag. Thus, this relation is useful when the activity is not known, or irrelevant.</definition>
+        <category>qualified</category>
+        <component>agents-responsibility</component>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <unqualifiedForm rdf:resource="http://www.w3.org/ns/prov#wasAttributedTo"/>
+    </owl:Class>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#Bundle -->
+
+    <owl:Class rdf:about="http://www.w3.org/ns/prov#Bundle">
+        <rdfs:label>Bundle</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <dm rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-dm-20130430/#term-bundle-entity</dm>
+        <n rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-n-20130430/#expression-bundle-declaration</n>
+        <category>expanded</category>
+        <definition xml:lang="en">A bundle is a named set of provenance descriptions, and is itself an Entity, so allowing provenance of provenance to be expressed.</definition>
+        <rdfs:comment xml:lang="en">Note that there are kinds of bundles (e.g. handwritten letters, audio recordings, etc.) that are not expressed in PROV-O, but can be still be described by PROV-O.</rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+    </owl:Class>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#Collection -->
+
+    <owl:Class rdf:about="http://www.w3.org/ns/prov#Collection">
+        <rdfs:label>Collection</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://www.w3.org/ns/prov#Entity"/>
+        <dm rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-dm-20130430/#term-collection</dm>
+        <component>collections</component>
+        <category>expanded</category>
+        <definition xml:lang="en">A collection is an entity that provides a structure to some constituents, which are themselves entities. These constituents are said to be member of the collections.</definition>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+    </owl:Class>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#Communication -->
+
+    <owl:Class rdf:about="http://www.w3.org/ns/prov#Communication">
+        <rdfs:label>Communication</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://www.w3.org/ns/prov#ActivityInfluence"/>
+        <constraints rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-constraints-20130430/#prov-dm-constraints-fig</constraints>
+        <dm rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-dm-20130430/#term-Communication</dm>
+        <n rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-n-20130430/#expression-wasInformedBy</n>
+        <component>entities-activities</component>
+        <category>qualified</category>
+        <rdfs:comment xml:lang="en">An instance of prov:Communication provides additional descriptions about the binary prov:wasInformedBy relation from an informed prov:Activity to the prov:Activity that informed it. For example, :you_jumping_off_bridge prov:wasInformedBy :everyone_else_jumping_off_bridge; prov:qualifiedCommunication [ a prov:Communication; prov:activity :everyone_else_jumping_off_bridge; :foo :bar ].</rdfs:comment>
+        <definition>Communication is the exchange of an entity by two activities, one activity using the entity generated by the other.</definition>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <unqualifiedForm rdf:resource="http://www.w3.org/ns/prov#wasInformedBy"/>
+    </owl:Class>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#Delegation -->
+
+    <owl:Class rdf:about="http://www.w3.org/ns/prov#Delegation">
+        <rdfs:label>Delegation</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://www.w3.org/ns/prov#AgentInfluence"/>
+        <dm rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-dm-20130430/#term-delegation</dm>
+        <n rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-n-20130430/#expression-delegation</n>
+        <category>qualified</category>
+        <rdfs:comment xml:lang="en">An instance of prov:Delegation provides additional descriptions about the binary prov:actedOnBehalfOf relation from a performing prov:Agent to some prov:Agent for whom it was performed. For example, :mixing prov:wasAssociatedWith :toddler . :toddler prov:actedOnBehalfOf :mother; prov:qualifiedDelegation [ a prov:Delegation; prov:entity :mother; :foo :bar ].</rdfs:comment>
+        <definition xml:lang="en">Delegation is the assignment of authority and responsibility to an agent (by itself or by another agent) to carry out a specific activity as a delegate or representative, while the agent it acts on behalf of retains some responsibility for the outcome of the delegated work.
+
+For example, a student acted on behalf of his supervisor, who acted on behalf of the department chair, who acted on behalf of the university; all those agents are responsible in some way for the activity that took place but we do not say explicitly who bears responsibility and to what degree.</definition>
+        <component>agents-responsibility</component>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov-o#"/>
+        <unqualifiedForm rdf:resource="http://www.w3.org/ns/prov#actedOnBehalfOf"/>
+    </owl:Class>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#Derivation -->
+
+    <owl:Class rdf:about="http://www.w3.org/ns/prov#Derivation">
+        <rdfs:label>Derivation</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://www.w3.org/ns/prov#EntityInfluence"/>
+        <constraints rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-constraints-20130430/#prov-dm-constraints-fig</constraints>
+        <dm rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-dm-20130430/#term-Derivation</dm>
+        <n rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/REC-prov-n-20130430/#Derivation-Relation</n>
+        <definition xml:lang="en">A derivation is a transformation of an entity into another, an update of an entity resulting in a new one, or the construction of a new entity based on a pre-existing entity.</definition>
+        <component>derivations</component>
+        <rdfs:comment xml:lang="en">An instance of prov:Derivation provides additional descriptions about the binary prov:wasDerivedFrom relation from some derived prov:Entity to another prov:Entity from which it was derived. For example, :chewed_bubble_gum prov:wasDerivedFrom :unwrapped_bubble_gum; prov:qualifiedDerivation [ a prov:Derivation; prov:entity :un

<TRUNCATED>

[21/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/ro.owl
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/ro.owl b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/ro.owl
new file mode 100644
index 0000000..a13db7e
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/ro.owl
@@ -0,0 +1,203 @@
+<?xml version="1.0"?>
+<!-- Processed by Id: cwm.py,v 1.197 2007/12/13 15:38:39 syosi Exp -->
+<!--     using base file:///home/stain/stuff/src/wf4ever/ro/ro.owl-->
+
+
+<rdf:RDF xmlns="http://www.w3.org/2002/07/owl#"
+    xmlns:owl="http://www.w3.org/2002/07/owl#"
+    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
+
+    <Ontology rdf:about="http://purl.org/wf4ever/ro">
+        <rdfs:comment xml:lang="en">This ontology shows how AO and ORE ontologies can be used together to define a ResearchObject. This ontology is further customized by the wf4ever ontology.</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="http://www.wf4ever-project.org/wiki/display/docs/Research+Object+Vocabulary+Specification"/>
+        <imports rdf:resource="http://purl.org/NET/dc_owl2dl/terms_od"/>
+        <imports rdf:resource="http://purl.org/ao/core/"/>
+        <imports rdf:resource="http://purl.org/wf4ever/ore-owl"/>
+        <imports rdf:resource="http://xmlns.com/foaf/0.1/"/>
+        <versionInfo rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0.1.1</versionInfo>
+        <versionIRI rdf:resource="https://raw.github.com/wf4ever/ro/0.1.1/ro.owl"/>
+    </Ontology>
+
+    <Class rdf:about="http://purl.org/wf4ever/ro#AggregatedAnnotation">
+        <rdfs:comment xml:lang="en">An annotation aggregated within an ro:ResearchObject.  
+
+Instances of this class are used to annotated resources aggregated within the aggregating research object, proxies of these resources, or the research object itself. In other words, if :ro is the ro:ResearchObject this annotation has been ore:isAggregatedBy, then the annotation should have at least one ao:annotatesResource which is an ore:AggregatedResource which is ore:isAggregatedBy :ro, or the annotated resource is an ore:Proxy which ore:proxyIn :ro, or the annotated resource is :ro.
+
+It is possible for the annotation to also annotate non-aggregated resources, but as above, at least one of them needs to be part of the RO or the RO itself.
+
+As a subclass of ro:SemanticAnnotation the ao:body must point to an rdfg:Graph which contains the actual annotation. </rdfs:comment>
+        <rdfs:subClassOf rdf:resource="http://purl.org/wf4ever/ro#SemanticAnnotation"/>
+        <rdfs:subClassOf rdf:resource="http://www.openarchives.org/ore/terms/AggregatedResource"/>
+        <rdfs:subClassOf rdf:parseType="Resource">
+            <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Restriction"/>
+            <onProperty rdf:resource="http://www.openarchives.org/ore/terms/isAggregatedBy"/>
+            <someValuesFrom rdf:resource="http://purl.org/wf4ever/ro#ResearchObject"/>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf rdf:parseType="Resource">
+            <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Restriction"/>
+            <onProperty rdf:resource="http://purl.org/ao/annotatesResource"/>
+            <someValuesFrom rdf:parseType="Resource">
+                <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+                <unionOf rdf:parseType="Resource">
+                    <rdf:first rdf:resource="http://purl.org/wf4ever/ro#ResearchObject"/>
+                    <rdf:rest rdf:parseType="Resource">
+                        <rdf:first rdf:resource="http://www.openarchives.org/ore/terms/AggregatedResource"/>
+                        <rdf:rest rdf:parseType="Resource">
+                            <rdf:first rdf:resource="http://www.openarchives.org/ore/terms/Proxy"/>
+                            <rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>
+                        </rdf:rest>
+                    </rdf:rest>
+                </unionOf>
+            </someValuesFrom>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf rdf:parseType="Resource">
+            <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Restriction"/>
+            <onProperty rdf:resource="http://purl.org/dc/terms/created"/>
+            <someValuesFrom rdf:resource="http://www.w3.org/2001/XMLSchema#dateTime"/>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf rdf:parseType="Resource">
+            <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Restriction"/>
+            <onProperty rdf:resource="http://purl.org/dc/terms/creator"/>
+            <someValuesFrom rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+        </rdfs:subClassOf>
+    </Class>
+
+    <Class rdf:about="http://purl.org/wf4ever/ro#Folder">
+        <rdfs:comment xml:lang="en">An ro:Folder is a special kind of ore:Aggregation where every ro:AggregatedResource must have a ro:FolderEntry proxy with a unique ro:entryName within that folder.
+
+Note that all resources which are aggregated within an (potentially nested) ro:Folder SHOULD also be aggregated by the same ro:ResearchObject this ro:Folder is aggregated within.
+
+Such folders can be nested and (optionally) used to organize the resources of the research object into a file-like structure. All such resources should also be aggregated by the ro:ResearchObject
+          </rdfs:comment>
+        <rdfs:subClassOf rdf:resource="http://purl.org/wf4ever/ro#Resource"/>
+        <rdfs:subClassOf rdf:resource="http://www.openarchives.org/ore/terms/Aggregation"/>
+    </Class>
+
+    <Class rdf:about="http://purl.org/wf4ever/ro#FolderEntry">
+        <rdfs:comment xml:lang="en">An ro:FolderEntry is any ore:Proxy instance that associates a resources aggregated within an ro:Folder with a ro:entryName. This name is (case-sensitive) unique within a given folder.</rdfs:comment>
+        <rdfs:subClassOf rdf:resource="http://www.openarchives.org/ore/terms/Proxy"/>
+        <equivalentClass rdf:parseType="Resource">
+            <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Restriction"/>
+            <onProperty rdf:resource="http://purl.org/wf4ever/ro#entryName"/>
+            <someValuesFrom rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
+        </equivalentClass>
+        <equivalentClass rdf:parseType="Resource">
+            <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Restriction"/>
+            <onProperty rdf:resource="http://www.openarchives.org/ore/terms/proxyIn"/>
+            <someValuesFrom rdf:resource="http://purl.org/wf4ever/ro#Folder"/>
+        </equivalentClass>
+        <hasKey rdf:parseType="Resource">
+            <rdf:first rdf:resource="http://www.openarchives.org/ore/terms/proxyIn"/>
+            <rdf:rest rdf:parseType="Resource">
+                <rdf:first rdf:resource="http://purl.org/wf4ever/ro#entryName"/>
+                <rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>
+            </rdf:rest>
+        </hasKey>
+    </Class>
+
+    <Class rdf:about="http://purl.org/wf4ever/ro#Manifest">
+        <rdfs:comment xml:lang="en">The ro:Manifest is used to describe an ro:ResearchObject. This identifies the resource for the manifest which lists all the aggregations of the research object, typically called ".ro/manifest.rdf" relative to the research object this manifest ore:describes.</rdfs:comment>
+        <rdfs:subClassOf rdf:resource="http://www.openarchives.org/ore/terms/ResourceMap"/>
+        <equivalentClass rdf:parseType="Resource">
+            <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Restriction"/>
+            <onProperty rdf:resource="http://www.openarchives.org/ore/terms/describes"/>
+            <someValuesFrom rdf:resource="http://purl.org/wf4ever/ro#ResearchObject"/>
+        </equivalentClass>
+    </Class>
+
+    <Class rdf:about="http://purl.org/wf4ever/ro#ResearchObject">
+        <rdfs:comment xml:lang="en">A research object aggregates a number of resources. A resource can be a workflow, web service, document, data item, data set, workflow run, software or a research object.</rdfs:comment>
+        <rdfs:subClassOf rdf:resource="http://www.openarchives.org/ore/terms/Aggregation"/>
+        <rdfs:subClassOf rdf:parseType="Resource">
+            <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Restriction"/>
+            <onProperty rdf:resource="http://purl.org/dc/terms/created"/>
+            <someValuesFrom rdf:resource="http://www.w3.org/2001/XMLSchema#dateTime"/>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf rdf:parseType="Resource">
+            <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Restriction"/>
+            <onProperty rdf:resource="http://purl.org/dc/terms/creator"/>
+            <someValuesFrom rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+        </rdfs:subClassOf>
+        <equivalentClass rdf:parseType="Resource">
+            <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Restriction"/>
+            <onProperty rdf:resource="http://www.openarchives.org/ore/terms/isDescribedBy"/>
+            <someValuesFrom rdf:resource="http://purl.org/wf4ever/ro#Manifest"/>
+        </equivalentClass>
+    </Class>
+
+    <Class rdf:about="http://purl.org/wf4ever/ro#Resource">
+        <rdfs:comment xml:lang="en">An ro:Resource is an ore:AggregatedResource which ore:isAggregatedBy an ro:ResearchObject. 
+
+This specialisation requires that there exists an ore:Proxy which is ore:proxyFor this resource, and which is ore:proxyIn the same ro:ResearchObject the resource ore:isAggregatedBy. Any annotations on such a proxy will descrive the ro:Resource within that particular ro:ResearchObject, in particular dct:creator and dct:created on the proxy will specify who added the resource to the aggregation at what time.
+
+Note that annotations (ro:AggregatedAnnotation) can be added to both the ro:Resource and the ore:Proxy - depending on if the annotation is seen to be globally true (such as the provenance of how the resource was created) or locally true within the Research Object (such as the the resource playing the role of a wf4ever:Dataset).
+
+Not all resources aggregated by an ro:ResearchObject are ro:Resource instances, in particular ro:AggregatedAnnotations will also be aggregated, but will not be "true" RO resources (and thus don't need their own ore:Proxy).  
+
+Aggregated resources MAY also be organised in (potentially nested) ro:Folders to reflect a file-system like structure. Note that any such resources SHOULD also be aggregated in the "mother" ro:ResearchObject.
+</rdfs:comment>
+        <rdfs:subClassOf rdf:resource="http://www.openarchives.org/ore/terms/AggregatedResource"/>
+        <rdfs:subClassOf rdf:parseType="Resource">
+            <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Restriction"/>
+            <onProperty rdf:resource="http://www.openarchives.org/ore/terms/isAggregatedBy"/>
+            <someValuesFrom rdf:resource="http://purl.org/wf4ever/ro#ResearchObject"/>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf rdf:parseType="Resource">
+            <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Restriction"/>
+            <onProperty rdf:parseType="Resource">
+                <inverseOf rdf:resource="http://www.openarchives.org/ore/terms/proxyFor"/>
+            </onProperty>
+            <someValuesFrom rdf:parseType="Resource">
+                <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Restriction"/>
+                <onProperty rdf:resource="http://www.openarchives.org/ore/terms/proxyIn"/>
+                <someValuesFrom rdf:resource="http://purl.org/wf4ever/ro#ResearchObject"/>
+            </someValuesFrom>
+        </rdfs:subClassOf>
+    </Class>
+
+    <Class rdf:about="http://purl.org/wf4ever/ro#SemanticAnnotation">
+        <rdfs:comment xml:lang="en">An ro:SemanticAnnotation is a specialisation of ao:Annotation which requires that ao:body points to an RDF Graph.
+
+This might be a Named Graph or a resource which can be resolved separately from the URI given by ao:body.
+
+This graph SHOULD mention the resources identified by ao:annotatesResource from this annotation, preferably by using their URIs as subject or object of statements.
+
+Note that this use of ao:body is distinct from ao:hasTopic, which also allows the association of a an RDF Graph with an ao:Annotation, but which also implies that this graph is the "topic" (subproperty of bookmark:hasTopic) of the annotated resource. This class does not require this interpretation, it is merely enough that the annotation body mentions the annotated resource, for instance to give it a dc:title or to relate two annotated resources.  Also note that the next version of the AO ontology (v2) might change this definition of ao:hasTopic, removing the need for this class.</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="http://code.google.com/p/annotation-ontology/wiki/GraphsAnnotations"/>
+        <rdfs:seeAlso rdf:resource="http://purl.org/ao/body"/>
+        <rdfs:seeAlso rdf:resource="http://purl.org/ao/hasTopic"/>
+        <rdfs:seeAlso rdf:resource="http://www.w3.org/2001/Annotea/User/BookmarkSchema"/>
+        <rdfs:seeAlso rdf:resource="http://www.w3.org/2002/01/bookmark#hasTopic"/>
+        <rdfs:subClassOf rdf:resource="http://purl.org/ao/Annotation"/>
+        <rdfs:subClassOf rdf:parseType="Resource">
+            <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Restriction"/>
+            <allValuesFrom rdf:resource="http://www.w3.org/2004/03/trix/rdfg-1/Graph"/>
+            <onProperty rdf:resource="http://purl.org/ao/body"/>
+        </rdfs:subClassOf>
+    </Class>
+
+    <ObjectProperty rdf:about="http://purl.org/wf4ever/ro#annotatesAggregatedResource">
+        <rdfs:comment xml:lang="en">ro:annotatesAggregatedResource specifies that an ao:Annotation annotates an aggregated ro:Resource. 
+                               
+When used on an ro:AggregatedAnnotation, both the domain and range of this property must ore:isAggregatedBy the same ro:ResearchObject.  
+
+TODO: Should also ro:ResearchObject and ore:Proxy be in the range of this property, or is this subproperty even needed?
+</rdfs:comment>
+        <rdfs:domain rdf:resource="http://purl.org/ao/Annotation"/>
+        <rdfs:range rdf:resource="http://purl.org/wf4ever/ro#Resource"/>
+        <rdfs:subPropertyOf rdf:resource="http://purl.org/ao/annotatesResource"/>
+    </ObjectProperty>
+
+    <DatatypeProperty rdf:about="http://purl.org/wf4ever/ro#entryName">
+        <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#FunctionalProperty"/>
+        <rdfs:comment xml:lang="en">This functional property specifies the name of a ro:FolderEntry within an ro:Folder. 
+
+This name must be case-sensitively unique within the ro:Folder, similar to a filename in a directory.
+
+TODO: Need a functional property to specify the top level folder structure of an {{ro:ResearchObject}}?
+</rdfs:comment>
+        <rdfs:domain rdf:resource="http://purl.org/wf4ever/ro#FolderEntry"/>
+        <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
+    </DatatypeProperty>
+</rdf:RDF>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/roevo.owl
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/roevo.owl b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/roevo.owl
new file mode 100644
index 0000000..bbbeb31
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/roevo.owl
@@ -0,0 +1,481 @@
+<?xml version="1.0"?>
+
+
+<!DOCTYPE rdf:RDF [
+    <!ENTITY ao "http://purl.org/ao/" >
+    <!ENTITY dcterms "http://purl.org/dc/terms/" >
+    <!ENTITY prov "http://www.w3.org/ns/prov#" >
+    <!ENTITY foaf "http://xmlns.com/foaf/0.1/" >
+    <!ENTITY ro "http://purl.org/wf4ever/ro#" >
+    <!ENTITY roevo "http://purl.org/wf4ever/roevo#" >
+    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
+    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
+    <!ENTITY xml "http://www.w3.org/XML/1998/namespace" >
+    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
+    <!ENTITY terms "http://www.openarchives.org/ore/terms/" >
+    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
+]>
+
+
+<rdf:RDF xmlns="http://www.semanticweb.org/owl/owlapi/turtle#"
+     xml:base="http://www.semanticweb.org/owl/owlapi/turtle"
+     xmlns:ro="http://purl.org/wf4ever/ro#"
+     xmlns:prov="http://www.w3.org/ns/prov#"
+     xmlns:foaf="http://xmlns.com/foaf/0.1/"
+     xmlns:terms="http://www.openarchives.org/ore/terms/"
+     xmlns:xml="http://www.w3.org/XML/1998/namespace"
+     xmlns:dcterms="http://purl.org/dc/terms/"
+     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+     xmlns:ao="http://purl.org/ao/"
+     xmlns:roevo="http://purl.org/wf4ever/roevo#"
+     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
+     xmlns:owl="http://www.w3.org/2002/07/owl#"
+     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+    <owl:Ontology rdf:about="http://purl.org/wf4ever/roevo">
+        <rdfs:comment xml:lang="en">The Research Object evolution ontology (roevo) extends the ro ontology to capture the lifecycle and versioning of research objects. roevo follows a modular approach, enabling the creation of extensions for modeling detailed taxonomies of changes for particular resources, e.g., workflows. roevo v0.4 has been aligned with PROV Ontology.</rdfs:comment>
+        <owl:versionIRI rdf:resource="http://purl.org/wf4ever/roevo/0.4"/>
+    </owl:Ontology>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Annotation properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Datatypes
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Object Properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://purl.org/ao/annotatesResource -->
+
+    <owl:ObjectProperty rdf:about="&ao;annotatesResource"/>
+    
+
+
+    <!-- http://purl.org/wf4ever/roevo#fromVersion -->
+
+    <owl:ObjectProperty rdf:about="&roevo;fromVersion">
+        <rdfs:domain rdf:resource="&roevo;ChangeSpecification"/>
+        <rdfs:range rdf:resource="&roevo;VersionableResource"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/wf4ever/roevo#hasArchive -->
+
+    <owl:ObjectProperty rdf:about="&roevo;hasArchive">
+        <rdfs:range rdf:resource="&roevo;ArchivedRO"/>
+        <rdfs:domain rdf:resource="&roevo;LiveRO"/>
+        <owl:inverseOf rdf:resource="&roevo;isArchiveOf"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/wf4ever/roevo#hasChange -->
+
+    <owl:ObjectProperty rdf:about="&roevo;hasChange">
+        <rdfs:range rdf:resource="&roevo;Change"/>
+        <rdfs:domain rdf:resource="&roevo;ChangeSpecification"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/wf4ever/roevo#hasPreviousChange -->
+
+    <owl:ObjectProperty rdf:about="&roevo;hasPreviousChange">
+        <rdfs:range rdf:resource="&roevo;Change"/>
+        <rdfs:domain rdf:resource="&roevo;Change"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/wf4ever/roevo#hasRevision -->
+
+    <owl:ObjectProperty rdf:about="&roevo;hasRevision"/>
+    
+
+
+    <!-- http://purl.org/wf4ever/roevo#hasSnapshot -->
+
+    <owl:ObjectProperty rdf:about="&roevo;hasSnapshot">
+        <rdfs:domain rdf:resource="&roevo;LiveRO"/>
+        <rdfs:range rdf:resource="&roevo;SnapshotRO"/>
+        <owl:inverseOf rdf:resource="&roevo;isSnapshotOf"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/wf4ever/roevo#isArchiveOf -->
+
+    <owl:ObjectProperty rdf:about="&roevo;isArchiveOf"/>
+    
+
+
+    <!-- http://purl.org/wf4ever/roevo#isSnapshotOf -->
+
+    <owl:ObjectProperty rdf:about="&roevo;isSnapshotOf"/>
+    
+
+
+    <!-- http://purl.org/wf4ever/roevo#relatedResource -->
+
+    <owl:ObjectProperty rdf:about="&roevo;relatedResource">
+        <rdfs:domain rdf:resource="&roevo;Change"/>
+        <rdfs:range rdf:resource="&roevo;VersionableResource"/>
+        <rdfs:subPropertyOf rdf:resource="&prov;used"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/wf4ever/roevo#toVersion -->
+
+    <owl:ObjectProperty rdf:about="&roevo;toVersion">
+        <rdfs:domain rdf:resource="&roevo;ChangeSpecification"/>
+        <rdfs:range rdf:resource="&roevo;VersionableResource"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/wf4ever/roevo#wasArchivedBy -->
+
+    <owl:ObjectProperty rdf:about="&roevo;wasArchivedBy">
+        <rdfs:domain rdf:resource="&roevo;ArchivedRO"/>
+        <rdfs:range rdf:resource="&prov;Agent"/>
+        <rdfs:subPropertyOf rdf:resource="&prov;wasAttributedTo"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/wf4ever/roevo#wasChangedBy -->
+
+    <owl:ObjectProperty rdf:about="&roevo;wasChangedBy">
+        <rdfs:range rdf:resource="&roevo;ChangeSpecification"/>
+        <rdfs:domain rdf:resource="&roevo;VersionableResource"/>
+        <rdfs:subPropertyOf rdf:resource="&prov;wasGeneratedBy"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/wf4ever/roevo#wasSnapshotedBy -->
+
+    <owl:ObjectProperty rdf:about="&roevo;wasSnapshotedBy">
+        <rdfs:domain rdf:resource="&roevo;SnapshotRO"/>
+        <rdfs:range rdf:resource="&prov;Agent"/>
+        <rdfs:subPropertyOf rdf:resource="&prov;wasAttributedTo"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#hadOriginalSource -->
+
+    <owl:ObjectProperty rdf:about="&prov;hadOriginalSource">
+        <rdfs:range rdf:resource="&prov;Entity"/>
+        <rdfs:domain rdf:resource="&prov;Entity"/>
+        <rdfs:subPropertyOf rdf:resource="&prov;wasDerivedFrom"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#used -->
+
+    <owl:ObjectProperty rdf:about="&prov;used"/>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#wasAssociatedWith -->
+
+    <owl:ObjectProperty rdf:about="&prov;wasAssociatedWith">
+        <rdfs:domain rdf:resource="&prov;Activity"/>
+        <rdfs:range rdf:resource="&prov;Agent"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#wasAttributedTo -->
+
+    <owl:ObjectProperty rdf:about="&prov;wasAttributedTo"/>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#wasDerivedFrom -->
+
+    <owl:ObjectProperty rdf:about="&prov;wasDerivedFrom">
+        <rdf:type rdf:resource="&owl;AsymmetricProperty"/>
+        <rdf:type rdf:resource="&owl;IrreflexiveProperty"/>
+        <rdfs:range rdf:resource="&prov;Entity"/>
+        <rdfs:domain rdf:resource="&prov;Entity"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#wasGeneratedBy -->
+
+    <owl:ObjectProperty rdf:about="&prov;wasGeneratedBy"/>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#wasQuotedFrom -->
+
+    <owl:ObjectProperty rdf:about="&prov;wasQuotedFrom">
+        <rdfs:domain rdf:resource="&prov;Entity"/>
+        <rdfs:range rdf:resource="&prov;Entity"/>
+        <rdfs:subPropertyOf rdf:resource="&prov;wasDerivedFrom"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#wasRevisionOf -->
+
+    <owl:ObjectProperty rdf:about="&prov;wasRevisionOf">
+        <owl:inverseOf rdf:resource="&roevo;hasRevision"/>
+        <rdfs:range rdf:resource="&prov;Entity"/>
+        <rdfs:domain rdf:resource="&prov;Entity"/>
+        <rdfs:subPropertyOf rdf:resource="&prov;wasDerivedFrom"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Data properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://purl.org/dc/terms/identifier -->
+
+    <owl:DatatypeProperty rdf:about="&dcterms;identifier"/>
+    
+
+
+    <!-- http://purl.org/wf4ever/roevo#archivedAtTime -->
+
+    <owl:DatatypeProperty rdf:about="&roevo;archivedAtTime">
+        <rdfs:domain rdf:resource="&roevo;ArchivedRO"/>
+        <rdfs:range rdf:resource="&xsd;dateTime"/>
+        <rdfs:subPropertyOf rdf:resource="&prov;generatedAtTime"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://purl.org/wf4ever/roevo#snapshotedAtTime -->
+
+    <owl:DatatypeProperty rdf:about="&roevo;snapshotedAtTime">
+        <rdfs:domain rdf:resource="&roevo;SnapshotRO"/>
+        <rdfs:range rdf:resource="&xsd;dateTime"/>
+        <rdfs:subPropertyOf rdf:resource="&prov;generatedAtTime"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#endedAtTime -->
+
+    <owl:DatatypeProperty rdf:about="&prov;endedAtTime">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:range rdf:resource="&xsd;dateTime"/>
+        <rdfs:domain rdf:resource="&prov;Activity"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#generatedAtTime -->
+
+    <owl:DatatypeProperty rdf:about="&prov;generatedAtTime"/>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#startedAtTime -->
+
+    <owl:DatatypeProperty rdf:about="&prov;startedAtTime">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:range rdf:resource="&xsd;dateTime"/>
+        <rdfs:domain rdf:resource="&prov;Activity"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Classes
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://purl.org/wf4ever/ro#AggregatedAnnotation -->
+
+    <owl:Class rdf:about="&ro;AggregatedAnnotation">
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="&ao;annotatesResource"/>
+                <owl:someValuesFrom>
+                    <owl:Class>
+                        <owl:unionOf rdf:parseType="Collection">
+                            <rdf:Description rdf:about="&roevo;Change"/>
+                            <rdf:Description rdf:about="&roevo;ChangeSpecification"/>
+                            <rdf:Description rdf:about="&roevo;VersionableResource"/>
+                        </owl:unionOf>
+                    </owl:Class>
+                </owl:someValuesFrom>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+    </owl:Class>
+    
+
+
+    <!-- http://purl.org/wf4ever/ro#ResearchObject -->
+
+    <owl:Class rdf:about="&ro;ResearchObject"/>
+    
+
+
+    <!-- http://purl.org/wf4ever/ro#Resource -->
+
+    <owl:Class rdf:about="&ro;Resource"/>
+    
+
+
+    <!-- http://purl.org/wf4ever/roevo#Addition -->
+
+    <owl:Class rdf:about="&roevo;Addition">
+        <rdfs:subClassOf rdf:resource="&roevo;Change"/>
+    </owl:Class>
+    
+
+
+    <!-- http://purl.org/wf4ever/roevo#ArchivedRO -->
+
+    <owl:Class rdf:about="&roevo;ArchivedRO">
+        <rdfs:subClassOf rdf:resource="&ro;ResearchObject"/>
+        <rdfs:subClassOf rdf:resource="&prov;Entity"/>
+    </owl:Class>
+    
+
+
+    <!-- http://purl.org/wf4ever/roevo#Change -->
+
+    <owl:Class rdf:about="&roevo;Change">
+        <rdfs:subClassOf rdf:resource="&prov;Activity"/>
+    </owl:Class>
+    
+
+
+    <!-- http://purl.org/wf4ever/roevo#ChangeSpecification -->
+
+    <owl:Class rdf:about="&roevo;ChangeSpecification">
+        <rdfs:subClassOf rdf:resource="&prov;Activity"/>
+    </owl:Class>
+    
+
+
+    <!-- http://purl.org/wf4ever/roevo#LiveRO -->
+
+    <owl:Class rdf:about="&roevo;LiveRO">
+        <rdfs:subClassOf rdf:resource="&ro;ResearchObject"/>
+        <rdfs:subClassOf rdf:resource="&prov;Entity"/>
+    </owl:Class>
+    
+
+
+    <!-- http://purl.org/wf4ever/roevo#Modification -->
+
+    <owl:Class rdf:about="&roevo;Modification">
+        <rdfs:subClassOf rdf:resource="&roevo;Change"/>
+    </owl:Class>
+    
+
+
+    <!-- http://purl.org/wf4ever/roevo#Removal -->
+
+    <owl:Class rdf:about="&roevo;Removal">
+        <rdfs:subClassOf rdf:resource="&roevo;Change"/>
+    </owl:Class>
+    
+
+
+    <!-- http://purl.org/wf4ever/roevo#SnapshotRO -->
+
+    <owl:Class rdf:about="&roevo;SnapshotRO">
+        <rdfs:subClassOf rdf:resource="&ro;ResearchObject"/>
+        <rdfs:subClassOf rdf:resource="&prov;Entity"/>
+    </owl:Class>
+    
+
+
+    <!-- http://purl.org/wf4ever/roevo#VersionableResource -->
+
+    <owl:Class rdf:about="&roevo;VersionableResource">
+        <owl:equivalentClass>
+            <owl:Class>
+                <owl:unionOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="&ro;AggregatedAnnotation"/>
+                    <rdf:Description rdf:about="&ro;Resource"/>
+                    <rdf:Description rdf:about="&roevo;ArchivedRO"/>
+                    <rdf:Description rdf:about="&roevo;SnapshotRO"/>
+                </owl:unionOf>
+            </owl:Class>
+        </owl:equivalentClass>
+        <rdfs:subClassOf rdf:resource="&prov;Entity"/>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="&dcterms;identifier"/>
+                <owl:someValuesFrom rdf:resource="&rdfs;Literal"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+    </owl:Class>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#Activity -->
+
+    <owl:Class rdf:about="&prov;Activity"/>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#Agent -->
+
+    <owl:Class rdf:about="&prov;Agent"/>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#Entity -->
+
+    <owl:Class rdf:about="&prov;Entity"/>
+</rdf:RDF>
+
+
+
+<!-- Generated by the OWL API (version 3.2.5.1928) http://owlapi.sourceforge.net -->
+


[24/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/foaf.rdf
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/foaf.rdf b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/foaf.rdf
new file mode 100644
index 0000000..83b5912
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/foaf.rdf
@@ -0,0 +1,606 @@
+<!-- This is the FOAF formal vocabulary description, expressed using W3C RDFS and OWL markup. foaf/spec version -->
+<!-- For more information about FOAF:                                            -->
+<!--   see the FOAF project homepage, http://www.foaf-project.org/               -->
+<!--   FOAF specification, http://xmlns.com/foaf/spec/                             -->
+<!--                                                                             -->
+<!-- first we introduce a number of RDF namespaces we will be using... -->
+<rdf:RDF 
+	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
+	xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" 
+	xmlns:owl="http://www.w3.org/2002/07/owl#" 
+	xmlns:vs="http://www.w3.org/2003/06/sw-vocab-status/ns#" 
+	xmlns:foaf="http://xmlns.com/foaf/0.1/" 
+	xmlns:wot="http://xmlns.com/wot/0.1/" 
+	xmlns:dc="http://purl.org/dc/elements/1.1/">
+<!-- Here we describe general characteristics of the FOAF vocabulary ('ontology'). -->
+  <owl:Ontology rdf:about="http://xmlns.com/foaf/0.1/" dc:title="Friend of a Friend (FOAF) vocabulary" dc:description="The Friend of a Friend (FOAF) RDF vocabulary, described using W3C RDF Schema and the Web Ontology Language." >
+  </owl:Ontology>
+
+
+  <!-- OWL/RDF interop section - geeks only -->
+  <!--  most folk can ignore this lot. the game here is to make FOAF
+  	work with vanilla RDF/RDFS tools, and with the stricter OWL DL 
+	profile of OWL. At the moment we're in the OWL Full flavour of OWL. 
+	The following are tricks to try have the spec live in both worlds
+	at once. See
+		http://phoebus.cs.man.ac.uk:9999/OWL/Validator
+		http://www.mindswap.org/2003/pellet/demo.shtml
+	...for some tools that help. 					-->
+  <owl:AnnotationProperty rdf:about="http://xmlns.com/wot/0.1/assurance"/>
+  <owl:AnnotationProperty rdf:about="http://xmlns.com/wot/0.1/src_assurance"/>
+  <owl:AnnotationProperty rdf:about="http://www.w3.org/2003/06/sw-vocab-status/ns#term_status"/>
+  <!--  DC terms are NOT annotation properties in general, so we consider the following 
+	claims scoped to this document. They may be removed in future revisions if
+	OWL tools become more flexible. -->
+  <owl:AnnotationProperty rdf:about="http://purl.org/dc/elements/1.1/description"/>
+  <owl:AnnotationProperty rdf:about="http://purl.org/dc/elements/1.1/title"/>
+  <owl:AnnotationProperty rdf:about="http://purl.org/dc/elements/1.1/date"/>
+  <owl:Class rdf:about="http://www.w3.org/2000/01/rdf-schema#Class"/>
+
+<!--  <owl:Class rdf:about="http://www.w3.org/2000/01/rdf-schema#Resource"/>
+  <owl:Class rdf:about="http://www.w3.org/2000/01/rdf-schema#Literal"/> -->
+  <!-- end of OWL/RDF interop voodoo. mostly. -->
+
+  <!-- utility class, a candidate for replacing the pattern of subproperty-ing rdfs:label -->
+  <rdfs:Class rdf:about="http://xmlns.com/foaf/0.1/LabelProperty" vs:term_status="unstable">
+    <rdfs:label>Label Property</rdfs:label>
+    <rdfs:comment>A foaf:LabelProperty is any RDF property with texual values that serve as labels.</rdfs:comment>
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdfs:Class>
+
+<!-- FOAF classes (types) are listed first. -->
+
+  <rdfs:Class rdf:about="http://xmlns.com/foaf/0.1/Person" rdfs:label="Person" rdfs:comment="A person." vs:term_status="stable">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+<!--    <rdfs:subClassOf><owl:Class rdf:about="http://xmlns.com/wordnet/1.6/Person"/></rdfs:subClassOf> -->
+    <rdfs:subClassOf><owl:Class rdf:about="http://xmlns.com/foaf/0.1/Agent"/></rdfs:subClassOf>
+<!--    <rdfs:subClassOf><owl:Class rdf:about="http://xmlns.com/wordnet/1.6/Agent"/></rdfs:subClassOf> -->
+    <rdfs:subClassOf><owl:Class rdf:about="http://www.w3.org/2000/10/swap/pim/contact#Person" rdfs:label="Person"/></rdfs:subClassOf>
+    <rdfs:subClassOf><owl:Class rdf:about="http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing" rdfs:label="Spatial Thing"/></rdfs:subClassOf>
+    <!-- aside: 
+	are spatial things always spatially located? 
+	Person includes imaginary people... discuss... -->
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+
+<!--    <owl:disjointWith rdf:resource="http://xmlns.com/foaf/0.1/Document"/> this was a mistake; tattoo'd people, for example. -->
+
+    <owl:disjointWith rdf:resource="http://xmlns.com/foaf/0.1/Organization"/>
+    <owl:disjointWith rdf:resource="http://xmlns.com/foaf/0.1/Project"/>
+  </rdfs:Class>
+  <rdfs:Class rdf:about="http://xmlns.com/foaf/0.1/Document" rdfs:label="Document" rdfs:comment="A document." vs:term_status="testing">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+<!--    <rdfs:subClassOf rdf:resource="http://xmlns.com/wordnet/1.6/Document"/> -->
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+    <owl:disjointWith rdf:resource="http://xmlns.com/foaf/0.1/Organization"/>
+    <owl:disjointWith rdf:resource="http://xmlns.com/foaf/0.1/Project"/>
+  </rdfs:Class>
+  <rdfs:Class rdf:about="http://xmlns.com/foaf/0.1/Organization" rdfs:label="Organization" rdfs:comment="An organization." vs:term_status="stable">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+<!--    <rdfs:subClassOf><owl:Class rdf:about="http://xmlns.com/wordnet/1.6/Organization"/></rdfs:subClassOf> -->
+    <rdfs:subClassOf rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+    <owl:disjointWith rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
+    <owl:disjointWith rdf:resource="http://xmlns.com/foaf/0.1/Document"/>
+  </rdfs:Class>
+  <rdfs:Class rdf:about="http://xmlns.com/foaf/0.1/Group" vs:term_status="stable" rdfs:label="Group" rdfs:comment="A class of Agents.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+    <rdfs:subClassOf rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+  </rdfs:Class>
+  <rdfs:Class rdf:about="http://xmlns.com/foaf/0.1/Agent" vs:term_status="stable" rdfs:label="Agent" rdfs:comment="An agent (eg. person, group, software or physical artifact).">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+    <owl:equivalentClass rdf:resource="http://purl.org/dc/terms/Agent"/>
+<!--    <rdfs:subClassOf><owl:Class rdf:about="http://xmlns.com/wordnet/1.6/Agent-3"/></rdfs:subClassOf> -->
+  </rdfs:Class>
+  <rdfs:Class rdf:about="http://xmlns.com/foaf/0.1/Project" vs:term_status="testing" rdfs:label="Project" rdfs:comment="A project (a collective endeavour of some kind).">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+<!--    <rdfs:subClassOf><owl:Class rdf:about="http://xmlns.com/wordnet/1.6/Project"/></rdfs:subClassOf> -->
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+    <owl:disjointWith rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
+    <owl:disjointWith rdf:resource="http://xmlns.com/foaf/0.1/Document"/>
+<!-- arguably a subclass of Agent; to be discussed -->
+  </rdfs:Class>
+  <rdfs:Class rdf:about="http://xmlns.com/foaf/0.1/Image" vs:term_status="testing" rdfs:label="Image" rdfs:comment="An image.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+<!--    <rdfs:subClassOf><owl:Class rdf:about="http://xmlns.com/wordnet/1.6/Document"/></rdfs:subClassOf> -->
+    <rdfs:subClassOf><owl:Class rdf:about="http://xmlns.com/foaf/0.1/Document"/></rdfs:subClassOf>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdfs:Class>
+
+  <rdfs:Class rdf:about="http://xmlns.com/foaf/0.1/PersonalProfileDocument" rdfs:label="PersonalProfileDocument" rdfs:comment="A personal profile RDF document." vs:term_status="testing">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+    <rdfs:subClassOf rdf:resource="http://xmlns.com/foaf/0.1/Document"/>
+  </rdfs:Class>
+	
+  <rdfs:Class rdf:about="http://xmlns.com/foaf/0.1/OnlineAccount" vs:term_status="testing" rdfs:label="Online Account" rdfs:comment="An online account.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+    <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing" rdfs:label="Thing"/>
+  </rdfs:Class>
+  <rdfs:Class rdf:about="http://xmlns.com/foaf/0.1/OnlineGamingAccount" vs:term_status="unstable" rdfs:label="Online Gaming Account" rdfs:comment="An online gaming account.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+    <rdfs:subClassOf rdf:resource="http://xmlns.com/foaf/0.1/OnlineAccount"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdfs:Class>
+  <rdfs:Class rdf:about="http://xmlns.com/foaf/0.1/OnlineEcommerceAccount" vs:term_status="unstable" rdfs:label="Online E-commerce Account" rdfs:comment="An online e-commerce account.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+    <rdfs:subClassOf rdf:resource="http://xmlns.com/foaf/0.1/OnlineAccount"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdfs:Class>
+  <rdfs:Class rdf:about="http://xmlns.com/foaf/0.1/OnlineChatAccount" vs:term_status="unstable" rdfs:label="Online Chat Account" rdfs:comment="An online chat account.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+    <rdfs:subClassOf rdf:resource="http://xmlns.com/foaf/0.1/OnlineAccount"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdfs:Class>
+<!-- FOAF properties (ie. relationships). -->
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/mbox" vs:term_status="stable" rdfs:label="personal mailbox" rdfs:comment="A 
+personal mailbox, ie. an Internet mailbox associated with exactly one owner, the first owner of this mailbox. This is a 'static inverse functional property', in that  there is (across time and change) at most one individual that ever has any particular value for foaf:mbox.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#InverseFunctionalProperty"/>
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/mbox_sha1sum" vs:term_status="testing" rdfs:label="sha1sum of a personal mailbox URI name" rdfs:comment="The sha1sum of the URI of an Internet mailbox associated with exactly one owner, the  first owner of the mailbox.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#InverseFunctionalProperty"/>
+
+<!--
+put it back in again 2006-01-29 - see 
+http://chatlogs.planetrdf.com/swig/2006-01-29.html#T21-12-35
+I have mailed rdfweb-dev@vapours.rdfweb.org for discussion.
+Libby
+
+Commenting out as a kindness to OWL DL users. The semantics didn't quite cover
+our usage anyway, since (a) we want static-across-time, which is so beyond OWL as 
+to be from another planet (b) we want identity reasoning invariant across xml:lang 
+tagging. FOAF code will know what to do. OWL folks note, this assertion might return. 
+
+danbri
+-->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/gender" vs:term_status="testing" 
+rdfs:label="gender" 
+rdfs:comment="The gender of this Agent (typically but not necessarily 'male' or 'female').">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#FunctionalProperty"/>
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+    <!-- whatever one's gender is, and we are liberal in leaving room for more options 
+    than 'male' and 'female', we model this so that an agent has only one gender. -->
+  </rdf:Property>
+
+
+
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/geekcode" vs:term_status="archaic" rdfs:label="geekcode" rdfs:comment="A textual geekcode for this person, see http://www.geekcode.com/geek.html">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/dnaChecksum" vs:term_status="archaic" rdfs:label="DNA checksum" rdfs:comment="A checksum for the DNA of some thing. Joke.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/sha1" vs:term_status="unstable" rdfs:label="sha1sum (hex)" rdfs:comment="A sha1sum hash, in hex.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Document"/>
+<!-- rdf:type rdf:resource="http://www.w3.org/2002/07/owl#InverseFunctionalProperty" -->
+<!-- IFP under discussion -->
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/based_near" vs:term_status="testing" rdfs:label="based near" rdfs:comment="A location that something is based near, for some broadly human notion of near.">
+<!-- see http://esw.w3.org/topic/GeoOnion for extension  ideas -->
+<!-- this was ranged as Agent... hmm -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+<!-- FOAF naming properties -->
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/title" vs:term_status="testing" rdfs:label="title" rdfs:comment="Title (Mr, Mrs, Ms, Dr. etc)">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/nick" vs:term_status="testing" rdfs:label="nickname" rdfs:comment="A short informal nickname characterising an agent (includes login identifiers, IRC and other chat nicknames).">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+<!-- ......................... chat IDs ........................... -->
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/jabberID" vs:term_status="testing" rdfs:label="jabber ID" rdfs:comment="A jabber ID for something.">
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+<!--
+    <rdfs:subPropertyOf rdf:resource="http://xmlns.com/foaf/0.1/nick"/>
+...different to the other IM IDs, as Jabber has wider usage, so 
+we don't want the implied rdfs:domain here.
+
+-->
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+    <!-- there is a case for using resources/URIs here, ... -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#InverseFunctionalProperty"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/aimChatID" vs:term_status="testing" rdfs:label="AIM chat ID" rdfs:comment="An AIM chat ID">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+    <rdfs:subPropertyOf rdf:resource="http://xmlns.com/foaf/0.1/nick"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#InverseFunctionalProperty"/>
+  </rdf:Property>
+
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/skypeID" vs:term_status="testing" rdfs:label="Skype ID" rdfs:comment="A Skype ID">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+    <rdfs:subPropertyOf rdf:resource="http://xmlns.com/foaf/0.1/nick"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+    <!-- todo: OWL2 easy key definition -->
+  </rdf:Property>
+
+<!-- http://www.stud.uni-karlsruhe.de/~uck4/ICQ/Packet-112.html -->
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/icqChatID" vs:term_status="testing" rdfs:label="ICQ chat ID" rdfs:comment="An ICQ chat ID">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+    <rdfs:subPropertyOf rdf:resource="http://xmlns.com/foaf/0.1/nick"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#InverseFunctionalProperty"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/yahooChatID" vs:term_status="testing" rdfs:label="Yahoo chat ID" rdfs:comment="A Yahoo chat ID">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+    <rdfs:subPropertyOf rdf:resource="http://xmlns.com/foaf/0.1/nick"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#InverseFunctionalProperty"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/msnChatID" vs:term_status="testing" rdfs:label="MSN chat ID" rdfs:comment="An MSN chat ID">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+    <rdfs:subPropertyOf rdf:resource="http://xmlns.com/foaf/0.1/nick"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#InverseFunctionalProperty"/>
+  </rdf:Property>
+<!-- ....................................................... -->
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/name" vs:term_status="testing" rdfs:label="name" rdfs:comment="A name for some thing.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <rdfs:domain rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+    <rdfs:subPropertyOf rdf:resource="http://www.w3.org/2000/01/rdf-schema#label"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/firstName" vs:term_status="testing" rdfs:label="firstName" rdfs:comment="The first name of a person.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/lastName" vs:term_status="testing" rdfs:label="lastName" rdfs:comment="The last name of a person.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/givenName" vs:term_status="testing" rdfs:label="Given name" rdfs:comment="The given name of some person.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/givenname" vs:term_status="archaic" rdfs:label="Given name" rdfs:comment="The given name of some person.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/surname" vs:term_status="archaic" rdfs:label="Surname" rdfs:comment="The surname of some person.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/family_name" vs:term_status="archaic" rdfs:label="family_name" rdfs:comment="The family name of some person.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/familyName" vs:term_status="testing" rdfs:label="familyName" rdfs:comment="The family name of some person.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+<!-- end of naming properties. See http://rdfweb.org/issues/show_bug.cgi?id=7
+	   for open issue / re-design discussions.
+	-->
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/phone" vs:term_status="testing" rdfs:label="phone" rdfs:comment="A phone,  specified using fully qualified tel: URI scheme (refs: http://www.w3.org/Addressing/schemes.html#tel).">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/homepage" vs:term_status="stable" rdfs:label="homepage" rdfs:comment="A homepage for some thing.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:subPropertyOf rdf:resource="http://xmlns.com/foaf/0.1/page"/>
+    <rdfs:subPropertyOf rdf:resource="http://xmlns.com/foaf/0.1/isPrimaryTopicOf"/>
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#InverseFunctionalProperty"/>
+    <!--  previously: rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Agent" -->
+    <rdfs:domain rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
+    <rdfs:range rdf:resource="http://xmlns.com/foaf/0.1/Document"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/weblog" vs:term_status="testing" rdfs:label="weblog" rdfs:comment="A weblog of some thing (whether person, group, company etc.).">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:subPropertyOf rdf:resource="http://xmlns.com/foaf/0.1/page"/>
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#InverseFunctionalProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+    <rdfs:range rdf:resource="http://xmlns.com/foaf/0.1/Document"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/openid" vs:term_status="testing" rdfs:label="openid" rdfs:comment="An OpenID for an Agent.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:subPropertyOf rdf:resource="http://xmlns.com/foaf/0.1/isPrimaryTopicOf"/>
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#InverseFunctionalProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+    <rdfs:range rdf:resource="http://xmlns.com/foaf/0.1/Document"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/tipjar" vs:term_status="testing" rdfs:label="tipjar" rdfs:comment="A tipjar document for this agent, describing means for payment and reward.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:subPropertyOf rdf:resource="http://xmlns.com/foaf/0.1/page"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+    <rdfs:range rdf:resource="http://xmlns.com/foaf/0.1/Document"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/plan" vs:term_status="testing" rdfs:label="plan" rdfs:comment="A .plan comment, in the tradition of finger and '.plan' files.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/made" vs:term_status="stable" rdfs:label="made" rdfs:comment="Something that was made by this agent.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+    <owl:inverseOf rdf:resource="http://xmlns.com/foaf/0.1/maker"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/maker"  vs:term_status="stable" rdfs:label="maker" rdfs:comment="An agent that 
+made this thing.">
+    <owl:equivalentProperty rdf:resource="http://purl.org/dc/terms/creator"/>
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
+    <rdfs:range rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+    <owl:inverseOf rdf:resource="http://xmlns.com/foaf/0.1/made"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/img" vs:term_status="testing" rdfs:label="image" rdfs:comment="An image that can be used to represent some thing (ie. those depictions which are particularly representative of something, eg. one's photo on a homepage).">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
+    <rdfs:range rdf:resource="http://xmlns.com/foaf/0.1/Image"/>
+    <rdfs:subPropertyOf rdf:resource="http://xmlns.com/foaf/0.1/depiction"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/depiction" vs:term_status="testing" rdfs:label="depiction" rdfs:comment="A depiction of some thing.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
+    <rdfs:range rdf:resource="http://xmlns.com/foaf/0.1/Image"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+    <owl:inverseOf rdf:resource="http://xmlns.com/foaf/0.1/depicts"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/depicts" vs:term_status="testing" rdfs:label="depicts" rdfs:comment="A thing depicted in this representation.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Image"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+    <owl:inverseOf rdf:resource="http://xmlns.com/foaf/0.1/depiction"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/thumbnail" vs:term_status="testing" rdfs:label="thumbnail" rdfs:comment="A derived thumbnail image.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Image"/>
+    <rdfs:range rdf:resource="http://xmlns.com/foaf/0.1/Image"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/myersBriggs" vs:term_status="testing" rdfs:label="myersBriggs" rdfs:comment="A Myers Briggs (MBTI) personality classification.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/workplaceHomepage" vs:term_status="testing" rdfs:label="workplace homepage" rdfs:comment="A workplace homepage of some person; the homepage of an organization they work for.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
+    <rdfs:range rdf:resource="http://xmlns.com/foaf/0.1/Document"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/workInfoHomepage" vs:term_status="testing" rdfs:label="work info homepage" rdfs:comment="A work info homepage of some person; a page about their work for some organization.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
+    <rdfs:range rdf:resource="http://xmlns.com/foaf/0.1/Document"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/schoolHomepage" vs:term_status="testing" rdfs:label="schoolHomepage" rdfs:comment="A homepage of a school attended by the person.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
+    <rdfs:range rdf:resource="http://xmlns.com/foaf/0.1/Document"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/knows" vs:term_status="stable" rdfs:label="knows" rdfs:comment="A person known by this person (indicating some level of reciprocated interaction between the parties).">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
+    <rdfs:range rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/interest" vs:term_status="testing" rdfs:label="interest" rdfs:comment="A page about a topic of interest to this person.">
+<!-- we should distinguish the page from the topic more carefully. danbri 2002-07-08 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+    <rdfs:range rdf:resource="http://xmlns.com/foaf/0.1/Document"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/topic_interest" vs:term_status="testing" rdfs:label="topic_interest" rdfs:comment="A thing of interest to this person.">
+<!-- we should distinguish the page from the topic more carefully. danbri 2002-07-08 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/publications" vs:term_status="testing" rdfs:label="publications" rdfs:comment="A link to the publications of this person.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
+    <rdfs:range rdf:resource="http://xmlns.com/foaf/0.1/Document"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+<!-- by libby for ILRT mappings 2001-10-31 -->
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/currentProject" vs:term_status="testing" rdfs:label="current project" rdfs:comment="A current project this person works on.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/pastProject" vs:term_status="testing" rdfs:label="past project" rdfs:comment="A project this person has previously worked on.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/fundedBy" vs:term_status="archaic" rdfs:label="funded by" rdfs:comment="An organization funding a project or person.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/logo" vs:term_status="testing" rdfs:label="logo" rdfs:comment="A logo representing some thing.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#InverseFunctionalProperty"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/topic" vs:term_status="testing" rdfs:label="topic" rdfs:comment="A topic of some page or document.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Document"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
+    <owl:inverseOf rdf:resource="http://xmlns.com/foaf/0.1/page"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/primaryTopic"
+ vs:term_status="stable" rdfs:label="primary topic" rdfs:comment="The primary topic of some page or document.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#FunctionalProperty"/>
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Document"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
+    <owl:inverseOf rdf:resource="http://xmlns.com/foaf/0.1/isPrimaryTopicOf"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/focus"  vs:term_status="testing" rdfs:label="focus" rdfs:comment="The underlying or 'focal' entity associated with some SKOS-described concept.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://www.w3.org/2004/02/skos/core#Concept" rdfs:label="Concept"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/isPrimaryTopicOf"
+ vs:term_status="stable" rdfs:label="is primary topic of" rdfs:comment="A document that this thing is the primary topic of.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#InverseFunctionalProperty"/>
+    <rdfs:subPropertyOf rdf:resource="http://xmlns.com/foaf/0.1/page"/>
+    <owl:inverseOf rdf:resource="http://xmlns.com/foaf/0.1/primaryTopic"/>
+    <rdfs:domain rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
+    <rdfs:range rdf:resource="http://xmlns.com/foaf/0.1/Document"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/page" vs:term_status="testing" rdfs:label="page" rdfs:comment="A page or document about this thing.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
+    <rdfs:range rdf:resource="http://xmlns.com/foaf/0.1/Document"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+    <owl:inverseOf rdf:resource="http://xmlns.com/foaf/0.1/topic"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/theme" vs:term_status="archaic" rdfs:label="theme" rdfs:comment="A theme.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/account" vs:term_status="testing" rdfs:label="account" rdfs:comment="Indicates an account held by this agent.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+    <rdfs:range rdf:resource="http://xmlns.com/foaf/0.1/OnlineAccount"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/holdsAccount" vs:term_status="archaic" rdfs:label="account" rdfs:comment="Indicates an account held by this agent.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+    <rdfs:range rdf:resource="http://xmlns.com/foaf/0.1/OnlineAccount"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/accountServiceHomepage" vs:term_status="testing" rdfs:label="account service homepage" rdfs:comment="Indicates a homepage of the service provide for this online account.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/OnlineAccount"/>
+    <rdfs:range rdf:resource="http://xmlns.com/foaf/0.1/Document"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/accountName" vs:term_status="testing" rdfs:label="account name" rdfs:comment="Indicates the name (identifier) associated with this online account.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/OnlineAccount"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/member" vs:term_status="stable" rdfs:label="member" rdfs:comment="Indicates a member of a Group">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Group"/>
+    <rdfs:range rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/membershipClass" vs:term_status="unstable" rdfs:label="membershipClass" rdfs:comment="Indicates the class of individuals that are a member of a Group">
+    <!-- maybe we should just use SPARQL or Rules, instead of trying to use OWL here -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#AnnotationProperty"/>
+    <!-- Added to keep OWL DL from bluescreening. DON'T CROSS THE STREAMERS, etc. -->
+    <!-- This may get dropped if it means non-DL tools don't expose it as a real property.
+	 Should be fine though; I think only OWL stuff cares about AnnotationProperty.
+	 Dan									 -->
+
+<!--    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Group"/> prose only for now...-->
+<!--    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/> -->
+<!--    <rdfs:range rdf:resource="http://www.w3.org/2002/07/owl#Class"/> -->
+
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+
+
+  <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/birthday" vs:term_status="unstable" rdfs:label="birthday" rdfs:comment="The birthday of this Agent, represented in mm-dd string form, eg. '12-31'.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#FunctionalProperty"/>
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+    <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+  </rdf:Property>
+
+   <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/age" vs:term_status="unstable" rdfs:label="age" rdfs:comment="The age in years of some agent.">
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#FunctionalProperty"/>
+     <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+     <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+     <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+     <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+   </rdf:Property>
+
+   <rdf:Property rdf:about="http://xmlns.com/foaf/0.1/status" vs:term_status="unstable" rdfs:label="status" rdfs:comment="A string expressing what the user is happy for the general public (normally) to know about their current activity.">
+     <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+     <rdfs:domain rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
+     <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+     <rdfs:isDefinedBy rdf:resource="http://xmlns.com/foaf/0.1/"/>
+   </rdf:Property>
+
+</rdf:RDF>
+

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/ore-owl.owl
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/ore-owl.owl b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/ore-owl.owl
new file mode 100644
index 0000000..ae2e7ce
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/ore-owl.owl
@@ -0,0 +1,145 @@
+
+<!-- Processed by Id: cwm.py,v 1.197 2007/12/13 15:38:39 syosi Exp -->
+<!--     using base file:///home/stain/stuff/src/wf4ever/ro/ore-owl.owl-->
+
+
+<rdf:RDF xmlns="http://www.w3.org/2000/01/rdf-schema#"
+    xmlns:dct="http://purl.org/dc/terms/"
+    xmlns:owl="http://www.w3.org/2002/07/owl#"
+    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
+
+    <owl:Class rdf:about="http://purl.org/dc/dcmitype/Collection">
+    </owl:Class>
+
+    <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/hasPart">
+    </owl:ObjectProperty>
+
+    <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/isPartOf">
+    </owl:ObjectProperty>
+
+    <owl:AnnotationProperty rdf:about="http://purl.org/dc/terms/publisher">
+    </owl:AnnotationProperty>
+
+    <owl:AnnotationProperty rdf:about="http://purl.org/dc/terms/title">
+    </owl:AnnotationProperty>
+
+    <owl:Ontology rdf:about="http://purl.org/wf4ever/ore-owl">
+        <dct:publisher rdf:resource="http://www.wf4ever-project.org/"/>
+        <dct:publisher rdf:parseType="Resource">
+            <label>The Open Archives Initiative ORE Project</label>
+        </dct:publisher>
+        <dct:title>The OAI ORE terms vocabulary</dct:title>
+        <comment>The set of terms provided by the OAI ORE initiative</comment>
+        <comment xml:lang="en">This is an OWL-ified version of the OAI-ORE 1.0 ontology. It was downloaded as application/rdf+xml from http://www.openarchives.org/ore/terms/ on 2011-11-17, converted with cwm 1.197 to N3, then edited with vim and Protege to:
+  Make all properties Object Properties instead of rdf:Properties (avoids them becoming Annotation Properties in OWL)
+  All classes are owl:Class instead of just rdfs:Class
+  These properties are made functional: ore:describes, ore:proxyFor, ore:proxyIn
+  Only one of the owl:inverseOf directions stated for ore:aggregates--ore:isAggregatedBy and ore:describes--ore:isDescribedBy
+  &#60;http://purl.org/wf4ever/ore-owl&#62; is an owl:Ontology and has a owl:priorVersion &#60;http://www.openarchives.org/ore/terms/&#62; </comment>
+        <label>The OAI ORE terms vocabulary</label>
+        <seeAlso rdf:resource="http://www.openarchives.org/ore/toc"/>
+        <owl:backwardCompatibleWith rdf:resource="http://purl.org/wf4ever/"/>
+        <owl:priorVersion rdf:resource="http://purl.org/wf4ever/"/>
+        <owl:versionIRI rdf:resource="https://raw.github.com/wf4ever/ro/master/ore-owl.owl"/>
+    </owl:Ontology>
+
+    <owl:Class rdf:about="http://www.openarchives.org/ore/terms/AggregatedResource">
+        <comment>A resource which is included in an Aggregation. Note that asserting that a resource is a member of the class of Aggregated Resources does not imply anything other than that it is aggregated by at least one Aggregation.</comment>
+        <isDefinedBy rdf:resource="http://purl.org/wf4ever/"/>
+        <label>Aggregated Resource</label>
+    </owl:Class>
+
+    <owl:Class rdf:about="http://www.openarchives.org/ore/terms/Aggregation">
+        <comment>A set of related resources (Aggregated Resources), grouped together such that the set can be treated as a single resource. This is the entity described within the ORE interoperability framework by a Resource Map.</comment>
+        <isDefinedBy rdf:resource="http://purl.org/wf4ever/"/>
+        <label>Aggregation</label>
+        <subClassOf rdf:resource="http://purl.org/dc/dcmitype/Collection"/>
+    </owl:Class>
+
+    <owl:Class rdf:about="http://www.openarchives.org/ore/terms/Proxy">
+        <comment>A Proxy represents an Aggregated Resource as it exists in a specific Aggregation. All assertions made about an entity are globally true, not only within the context of the Aggregation. As such, in order to make assertions which are only true of a resource as it exists in an Aggregation, a Proxy object is required. For example, one might want to cite an article as it appears in a specific journal, or assign aggregation-specific metadata to a Resource.</comment>
+        <isDefinedBy rdf:resource="http://purl.org/wf4ever/"/>
+        <label>Proxy</label>
+    </owl:Class>
+
+    <owl:Class rdf:about="http://www.openarchives.org/ore/terms/ResourceMap">
+        <comment>A description of an Aggregation according to the OAI-ORE data model. Resource Maps are serialised to a machine readable format according to the implementation guidelines.</comment>
+        <isDefinedBy rdf:resource="http://purl.org/wf4ever/"/>
+        <label>Resource Map</label>
+        <subClassOf rdf:resource="http://www.w3.org/2004/03/trix/rdfg-1/Graph"/>
+    </owl:Class>
+
+    <owl:ObjectProperty rdf:about="http://www.openarchives.org/ore/terms/aggregates">
+        <comment>Aggregations, by definition, aggregate resources. The ore:aggregates relationship expresses that the object resource is a member of the set of Aggregated Resources of the subject (the Aggregation). This relationship between the Aggregation and its Aggregated Resources is thus more specific than a simple part/whole relationship, as expressed by dcterms:hasPart for example.</comment>
+        <domain rdf:resource="http://www.openarchives.org/ore/terms/Aggregation"/>
+        <isDefinedBy rdf:resource="http://purl.org/wf4ever/"/>
+        <label>Aggregates</label>
+        <range rdf:resource="http://www.openarchives.org/ore/terms/AggregatedResource"/>
+        <subPropertyOf rdf:resource="http://purl.org/dc/terms/hasPart"/>
+        <owl:inverseOf rdf:resource="http://www.openarchives.org/ore/terms/isAggregatedBy"/>
+    </owl:ObjectProperty>
+
+    <owl:FunctionalProperty rdf:about="http://www.openarchives.org/ore/terms/describes">
+        <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+        <comment>This relationship asserts that the subject (a Resource Map) describes the object (an Aggregation).</comment>
+        <domain rdf:resource="http://www.openarchives.org/ore/terms/ResourceMap"/>
+        <isDefinedBy rdf:resource="http://purl.org/wf4ever/"/>
+        <label>Describes</label>
+        <range rdf:resource="http://www.openarchives.org/ore/terms/Aggregation"/>
+        <owl:inverseOf rdf:resource="http://www.openarchives.org/ore/terms/isDescribedBy"/>
+    </owl:FunctionalProperty>
+
+    <owl:ObjectProperty rdf:about="http://www.openarchives.org/ore/terms/isAggregatedBy">
+        <comment>The inverse relationship of ore:aggregates, ore:isAggregatedBy asserts that an Aggregated Resource is aggregated by an Aggregation.</comment>
+        <domain rdf:resource="http://www.openarchives.org/ore/terms/AggregatedResource"/>
+        <isDefinedBy rdf:resource="http://purl.org/wf4ever/"/>
+        <label>Is Aggregated By</label>
+        <range rdf:resource="http://www.openarchives.org/ore/terms/Aggregation"/>
+        <subPropertyOf rdf:resource="http://purl.org/dc/terms/isPartOf"/>
+    </owl:ObjectProperty>
+
+    <owl:ObjectProperty rdf:about="http://www.openarchives.org/ore/terms/isDescribedBy">
+        <comment>The inverse relationship of ore:describes, in this case the object of the relationship is the Resource Map and the subject is the Aggregation which it describes.</comment>
+        <domain rdf:resource="http://www.openarchives.org/ore/terms/Aggregation"/>
+        <isDefinedBy rdf:resource="http://purl.org/wf4ever/"/>
+        <label>Is Described By</label>
+        <range rdf:resource="http://www.openarchives.org/ore/terms/ResourceMap"/>
+    </owl:ObjectProperty>
+
+    <owl:ObjectProperty rdf:about="http://www.openarchives.org/ore/terms/lineage">
+        <comment>ore:lineage is a relationship between two Proxy objects, both of which MUST have the same Resource for which they are proxies. The meaning is that the Resource for which the subject of the relationship is a Proxy was discovered in the Aggregation in which the object Proxy's resource is aggregated.</comment>
+        <domain rdf:resource="http://www.openarchives.org/ore/terms/Proxy"/>
+        <isDefinedBy rdf:resource="http://purl.org/wf4ever/"/>
+        <label>Lineage</label>
+        <range rdf:resource="http://www.openarchives.org/ore/terms/Proxy"/>
+    </owl:ObjectProperty>
+
+    <owl:FunctionalProperty rdf:about="http://www.openarchives.org/ore/terms/proxyFor">
+        <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+        <comment>Proxy objects are used to represent a Resource as it is aggregated in a particular Aggregation. The ore:proxyFor relationship is used to link the proxy to the Aggregated Resource it is a proxy for. The subject of the relationship is a Proxy object, and the object of the relationship is the Aggregated Resource.</comment>
+        <domain rdf:resource="http://www.openarchives.org/ore/terms/Proxy"/>
+        <isDefinedBy rdf:resource="http://purl.org/wf4ever/"/>
+        <label>Proxy For</label>
+        <range rdf:resource="http://www.openarchives.org/ore/terms/AggregatedResource"/>
+    </owl:FunctionalProperty>
+
+    <owl:FunctionalProperty rdf:about="http://www.openarchives.org/ore/terms/proxyIn">
+        <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+        <comment>Proxy objects must link to the Aggregation in which the resource being proxied is aggregated. The ore:proxyIn relationship is used for this purpose. The subject of the relationship is a Proxy object, and the object of the relationship is the Aggregation.</comment>
+        <domain rdf:resource="http://www.openarchives.org/ore/terms/Proxy"/>
+        <isDefinedBy rdf:resource="http://purl.org/wf4ever/"/>
+        <label>Proxy In</label>
+        <range rdf:resource="http://www.openarchives.org/ore/terms/Aggregation"/>
+    </owl:FunctionalProperty>
+
+    <owl:ObjectProperty rdf:about="http://www.openarchives.org/ore/terms/similarTo">
+        <comment>The subject of this relationship MUST be an Aggregation.  This Aggregation should be considered an expression within the ORE context of the object of the relationship, as it is broadly equivalent to the resource. For example, the Aggregation may consist of the resources which, together, make up a journal article which has a DOI assigned to it. The Aggregation is not the article to which the DOI was assigned, but is a representation of it in some manner.</comment>
+        <domain rdf:resource="http://www.openarchives.org/ore/terms/Aggregation"/>
+        <isDefinedBy rdf:resource="http://purl.org/wf4ever/"/>
+        <label>Similar To</label>
+    </owl:ObjectProperty>
+
+    <owl:Class rdf:about="http://www.w3.org/2004/03/trix/rdfg-1/Graph">
+    </owl:Class>
+</rdf:RDF>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/pav.rdf
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/pav.rdf b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/pav.rdf
new file mode 100644
index 0000000..d5bbbd7
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/pav.rdf
@@ -0,0 +1,552 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="owl2html.xslt"?>
+
+
+<!DOCTYPE rdf:RDF [
+    <!ENTITY pav "http://purl.org/pav/" >
+    <!ENTITY dct "http://purl.org/dc/terms/" >
+    <!ENTITY prov "http://www.w3.org/ns/prov#" >
+    <!ENTITY foaf "http://xmlns.com/foaf/0.1/" >
+    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
+    <!ENTITY dc "http://purl.org/dc/elements/1.1/" >
+    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
+    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
+    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
+    <!ENTITY pav1 "http://swan.mindinformatics.org/ontologies/1.2/pav/" >
+]>
+
+
+<rdf:RDF xmlns="&pav;"
+     xml:base="&pav;"
+     xmlns:dc="http://purl.org/dc/elements/1.1/"
+     xmlns:prov="http://www.w3.org/ns/prov#"
+     xmlns:foaf="http://xmlns.com/foaf/0.1/"
+     xmlns:pav1="http://swan.mindinformatics.org/ontologies/1.2/pav/"
+     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+     xmlns:pav="http://purl.org/pav/"
+     xmlns:dct="http://purl.org/dc/terms/"
+     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
+     xmlns:owl="http://www.w3.org/2002/07/owl#"
+     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+    <owl:Ontology rdf:about="http://purl.org/pav/">
+        <prov:has_provenance rdf:resource="provenance.ttl" />
+        <rdfs:label xml:lang="en">Provenance, Authoring and Versioning (PAV)</rdfs:label>
+        <owl:versionInfo rdf:datatype="&xsd;string">2.1.1</owl:versionInfo>
+        <dct:modified rdf:datatype="&xsd;dateTime">2013-03-26T14:49:00Z</dct:modified>
+        <dc:contributor rdf:datatype="&xsd;string">Marco Ocana</dc:contributor>
+        <dc:creator rdf:datatype="&xsd;string">Paolo Ciccarese</dc:creator>
+        <dc:contributor rdf:datatype="&xsd;string">Stian Soiland-Reyes</dc:contributor>
+        <dct:format rdf:datatype="&xsd;string">application/rdf+xml</dct:format>
+        <dct:language rdf:datatype="&xsd;language">en</dct:language>
+        <dct:issued rdf:datatype="&xsd;dateTime">2013-03-27T16:03:24Z</dct:issued>
+        <dct:title xml:lang="en">PAV - Provenance, Authoring and Versioning</dct:title>
+        <rdfs:comment xml:lang="en">PAV is a lightweight ontology for tracking Provenance, Authoring and Versioning. PAV specializes the W3C provenance ontology PROV-O in order to describe authorship, curation and digital creation of online resources.
+
+This ontology describes the defined PAV properties and their usage. Note that PAV does not define any explicit classes or domain/ranges, as every property is meant to be used directly on the described online resource.</rdfs:comment>
+        <dc:description xml:lang="en">PAV supplies terms for distinguishing between the different roles of the agents contributing content in current web based systems: contributors, authors, curators and digital artifact creators. The ontology also provides terms for tracking provenance of digital entities that are published on the web and then accessed, transformed and consumed. In order to support broader interoperability, PAV specializes the general purpose W3C PROV provenance model (PROV-O).
+
+PAV distinguishes between the data related to the digital artifact - named Provenance - and those related to the actual knowledge creation and therefore to the intellectual property aspects – named Authoring. The Versioning axis describes the evolution of digital entities in time. 
+
+Using PAV, descriptions can define the Authors that originate or gave existence to the work that is expressed in the digital resource (pav:authoredBy); curators (pav:curatedBy) who are content specialists responsible for shaping the expression in an appropriate format, and contributors (super-property pav:contributedBy) that provided some help in conceiving the resource or in the expressed knowledge creation/extraction.
+
+These provenance aspects can be detailed with dates using pav:curatedOn, pav:authoredOn, etc. Further details about the creation activities, such as different authors contributing specific parts of the resource at different dates are out of scope for PAV and should be defined using vocabularies like PROV-O and additional intermediate entities to describe the different states. 
+
+For resources based on other resources, PAV allows specification of direct retrieval (pav:retrievedFrom), import through transformations (pav:importedFrom) and sources that were merely consulted (pav:sourceAccessedAt). These aspects can also define the agents responsible using pav:retrievedBy, pav:importedBy and pav:sourceAccessedBy. Version information can be specified using pav:previousVersion and pav:version. 
+
+The creation of the digital representation, for instance an RDF graph, can in many cases be different from the authorship of the knowledge, and in PAV this digital creation is specified using pav:createdBy, pav:createdWith and pav:createdOn. 
+
+PAV 2.1 updates PAV 2.0 with PROV-O specializations and more detailed descriptions of the defined terms. Note that PROV-O is not imported directly by this ontology as PAV can be used independent of PROV. PAV 2 is based on PAV 1.2 but in a new namespace ( http://purl.org/pav/ ). Terms compatible with 1.2 are indicated in this ontology using owl:equivalentProperty. 
+
+The ontology IRI http://purl.org/pav/ always resolve to the latest version of PAV 2. Particular versionIRIs such as http://purl.org/pav/2.1 can be used by clients to force imports of a particular version - note however that all terms are defined directly in the http://purl.org/pav/ namespace.
+
+The goal of PAV is to provide a lightweight, straight forward way to give the essential information about authorship, provenance and versioning, and therefore these properties are described directly on the published resource. As such, PAV does not define any classes or restrict domain/ranges, as all properties are applicable to any online resource.</dc:description>
+        <dc:description rdf:resource="http://pav-ontology.googlecode.com/svn/branches/2.1/images/pav-overview.svg" />
+        <rdfs:seeAlso rdf:resource="http://code.google.com/p/pav-ontology/"/>
+        <rdfs:seeAlso rdf:resource="http://pav-ontology.googlecode.com/svn/trunk/1.2/pav.owl"/>
+        <!--
+        <owl:imports rdf:resource="http://pav-ontology.googlecode.com/svn/trunk/1.2/pav.owl"/>
+        <owl:imports rdf:resource="http://www.w3.org/ns/prov#"/>
+        -->
+        <owl:versionIRI rdf:resource="&pav;2.1"/>
+        <rdfs:seeAlso rdf:resource="&pav;doc"/>
+        <owl:backwardCompatibleWith rdf:resource="&pav;2.0/"/>
+        <owl:priorVersion rdf:resource="&pav;2.0/"/>
+        <owl:backwardCompatibleWith rdf:resource="&pav;authoring/2.0/"/>
+        <owl:backwardCompatibleWith rdf:resource="&pav;provenance/2.0/"/>
+        <owl:backwardCompatibleWith rdf:resource="&pav;versioning/2.0/"/>
+        <dct:contributor rdf:resource="http://soiland-reyes.com/stian/#me"/>
+        <dct:publisher rdf:resource="http://swan.mindinformatics.org/"/>
+        <owl:incompatibleWith rdf:resource="http://swan.mindinformatics.org/ontologies/1.2/pav.owl"/>
+        <dct:license rdf:resource="http://www.apache.org/licenses/LICENSE-2.0"/>
+        <dct:creator rdf:resource="http://www.hcklab.org/foaf.rdf#me"/>
+        <dct:creator rdf:resource="http://www.paolociccarese.info/"/>
+        <rdfs:seeAlso rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:Ontology>
+    
+
+
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Object Properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://purl.org/pav/authoredBy -->
+
+    <owl:ObjectProperty rdf:about="&pav;authoredBy">
+        <rdfs:label xml:lang="en">Authored by</rdfs:label>
+        <rdfs:comment xml:lang="en">An agent that originated or gave existence to the work that is expressed by the digital resource.
+
+The author of the content of a resource may be different from the creator of the resource representation (although they are often the same). See pav:createdBy for a discussion.
+
+The date of authoring can be expressed using pav:authoredOn - note however in the case of multiple authors that there is no relationship in PAV identifying which agent contributed when or what. If capturing such lineage is desired, it should be additionally expressed using activity-centric provenance vocabularies, for instance with prov:wasGeneratedBy and prov:qualifiedAssocation.</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="&pav;authoredOn"/>
+        <rdfs:subPropertyOf rdf:resource="&pav;contributedBy"/>
+        <rdfs:seeAlso rdf:resource="&pav;createdBy"/>
+        <owl:equivalentProperty rdf:resource="&pav1;authoredBy"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/pav/contributedBy -->
+
+    <owl:ObjectProperty rdf:about="&pav;contributedBy">
+        <rdfs:label xml:lang="en">Contributed by</rdfs:label>
+        <rdfs:comment xml:lang="en">The resource was contributed to by the given agent.
+
+The agent provided any sort of help in conceiving the work that is expressed by the digital artifact. Superproperty of pav:authoredBy and pav:curatedBy.
+
+Note that as pav:contributedBy identifies only agents that contributed to the work, knowledge or intellectual property, and not agents that made the digital artifact or representation (pav:createdBy), thus this property can be considered more precise than dct:contributor. See pav:createdBy for a discussion.
+
+The date of contribution can be expressed using pav:contributedOn - note however in the case of multiple contributors that there is no relationship in PAV identifying which agent contributed when or what. If capturing such lineage is desired, it should be additionally expressed using activity-centric provenance vocabularies, for instance with prov:wasGeneratedBy and prov:qualifiedAssocation.</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="&pav;contributedOn"/>
+        <rdfs:seeAlso rdf:resource="&pav;createdBy"/>
+        <owl:equivalentProperty rdf:resource="&pav1;contributedBy"/>
+        <rdfs:subPropertyOf rdf:resource="&prov;wasAttributedTo"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/pav/createdAt -->
+
+    <owl:ObjectProperty rdf:about="&pav;createdAt">
+        <rdfs:label xml:lang="en">Created at</rdfs:label>
+        <rdfs:comment xml:lang="en">The geo-location of the agents when creating the resource (pav:createdBy). For instance  a photographer takes a picture of the Eiffel Tower while standing in front of it.</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="&pav;createdBy"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/pav/createdBy -->
+
+    <owl:ObjectProperty rdf:about="&pav;createdBy">
+        <rdfs:label xml:lang="en">Created by</rdfs:label>
+        <rdfs:comment xml:lang="en">An agent primary responsible for making the digital artifact or resource representation.
+
+This property is distinct from forming the content, which is indicated with pav:contributedBy or its subproperties; pav:authoredBy, which identifies who authored the knowledge expressed by this resource; and pav:curatedBy, which identifies who curated the knowledge into its current form. 
+
+pav:createdBy is more specific than dct:createdBy - which might or might not be interpreted to cover this creator.
+
+For instance, the author wrote &apos;this species has bigger wings than normal&apos; in his log book. The curator, going through the log book and identifying important knowledge, formalizes this as &apos;locus perculus has wingspan &gt; 0.5m&apos;. The creator enters this knowledge as a digital resource in the knowledge system, thus creating the digital artifact (say as JSON, RDF, XML or HTML).
+
+A different example is a news article. pav:authoredBy indicates the journalist who wrote the article. pav:contributedBy can indicate the artist who added an illustration. pav:curatedBy can indicate the editor who made the article conform to the news paper&apos;s style. pav:createdBy can indicate who put the article on the web site.
+
+The software tool used by the creator to make the digital resource (say Protege, Wordpress or OpenOffice) can be indicated with pav:createdWith.
+
+The date the digital resource was created can be indicated with pav:createdOn.
+
+The location the agent was at when creating the digital resource can be made using pav:createdAt.</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="&pav;authoredBy"/>
+        <rdfs:seeAlso rdf:resource="&pav;createdAt"/>
+        <rdfs:seeAlso rdf:resource="&pav;createdOn"/>
+        <rdfs:seeAlso rdf:resource="&pav;curatedBy"/>
+        <owl:equivalentProperty rdf:resource="&pav1;createdBy"/>
+        <rdfs:subPropertyOf rdf:resource="&prov;wasAttributedTo"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/pav/createdWith -->
+
+    <owl:ObjectProperty rdf:about="&pav;createdWith">
+        <rdfs:label xml:lang="en">Created with</rdfs:label>
+        <rdfs:comment xml:lang="en">The software/tool used by the creator (pav:createdBy) when making the digital resource, for instance a word processor or an annotation tool. A more independent software agent that creates the resource without direct interaction by a human creator should instead should instead by indicated using pav:createdBy.
+</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="&pav;createdBy"/>
+        <rdfs:subPropertyOf rdf:resource="&prov;wasAttributedTo"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/pav/curatedBy -->
+
+    <owl:ObjectProperty rdf:about="&pav;curatedBy">
+        <rdfs:label xml:lang="en">Curated by</rdfs:label>
+        <rdfs:comment xml:lang="en">An agent specialist responsible for shaping the expression in an appropriate format. Often the primary agent responsible for ensuring the quality of the representation.
+
+The curator may be different from the creator of the author (pav:authoredBy) and the creator of the digital resource (pav:createdBy).  
+
+The date of curating can be expressed using pav:curatedOn - note however in the case of multiple curators that there is no relationship in PAV identifying which agent contributed when or what. If capturing such lineage is desired, it should be additionally expressed using activity-centric provenance vocabularies, for instance with prov:wasGeneratedBy and prov:qualifiedAssocation.</rdfs:comment>
+        <rdfs:subPropertyOf rdf:resource="&pav;contributedBy"/>
+        <rdfs:seeAlso rdf:resource="&pav;createdBy"/>
+        <rdfs:seeAlso rdf:resource="&pav;curatedOn"/>
+        <owl:equivalentProperty rdf:resource="&pav1;curatedBy"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/pav/curates -->
+
+    <owl:ObjectProperty rdf:about="&pav;curates">
+        <rdfs:label xml:lang="en">Curates</rdfs:label>
+        <owl:deprecated rdf:datatype="&xsd;boolean">true</owl:deprecated>
+        <rdfs:comment xml:lang="en">Provided for backwards compatibility with PAV 1.2 only. Use instead the inverse pav:curatedBy.</rdfs:comment>
+        <owl:inverseOf rdf:resource="&pav;curatedBy"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/pav/derivedFrom -->
+
+    <owl:ObjectProperty rdf:about="&pav;derivedFrom">
+        <rdfs:label xml:lang="en">Derived from</rdfs:label>
+        <rdfs:comment xml:lang="en">Derived from a different resource. Derivation conserns itself with derived knowledge. If this resource has the same content as the other resource, but has simply been transcribed to fit a different model (like XML -&gt; RDF or SQL -&gt; CVS), use pav:importedFrom. If a resource was simply retrieved, use pav:retrievedFrom. If the content has however been further refined or modified, pav:derivedFrom should be used.
+
+Details about who performed the derivation may be indicated with pav:contributedBy and its subproperties.
+</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="&pav;importedFrom"/>
+        <rdfs:seeAlso rdf:resource="&pav;previousVersion"/>
+        <rdfs:subPropertyOf rdf:resource="&prov;wasDerivedFrom"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/pav/importedBy -->
+
+    <owl:ObjectProperty rdf:about="&pav;importedBy">
+        <rdfs:label xml:lang="en">Imported by</rdfs:label>
+        <rdfs:comment xml:lang="en">An entity responsible for importing the data. 
+
+The importer is usually a software entity which has done the transcription from the original source. 
+Note that pav:importedBy may overlap with pav:createdWith.
+
+The source for the import should be given with pav:importedFrom. The time of the import should be given with pav:importedOn.
+
+See pav:importedFrom for a discussion of import vs. retrieve vs. derived.</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="&pav;importedFrom"/>
+        <owl:equivalentProperty rdf:resource="&pav1;importedBy"/>
+        <rdfs:subPropertyOf rdf:resource="&prov;wasAttributedTo"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/pav/importedFrom -->
+
+    <owl:ObjectProperty rdf:about="&pav;importedFrom">
+        <rdfs:label xml:lang="en">Imported from</rdfs:label>
+        <rdfs:comment xml:lang="en">The original source of imported information. 
+
+Import means that the content has been preserved, but transcribed somehow, for instance to fit a different representation model. Examples of import are when the original was JSON and the current resource is RDF, or where the original was an document scan, and this resource is the plain text found through OCR. 
+
+The imported resource does not have to be complete, but should be consistent with the knowledge conveyed by the original resource.
+
+If additional knowledge has been contributed, pav:derivedFrom would be more appropriate.
+
+If the resource has been copied verbatim from the original representation (e.g. downloaded), use pav:retrievedFrom.
+
+To indicate which agent(s) performed the import, use pav:importedBy. Use pav:importedOn to indicate when it happened. </rdfs:comment>
+        <rdfs:seeAlso rdf:resource="&pav;derivedFrom"/>
+        <rdfs:seeAlso rdf:resource="&pav;importedBy"/>
+        <rdfs:seeAlso rdf:resource="&pav;importedOn"/>
+        <rdfs:seeAlso rdf:resource="&pav;retrievedFrom"/>
+        <owl:equivalentProperty rdf:resource="&pav1;importedFromSource"/>
+        <rdfs:subPropertyOf rdf:resource="&prov;wasDerivedFrom"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/pav/previousVersion -->
+
+    <owl:ObjectProperty rdf:about="&pav;previousVersion">
+        <rdfs:label xml:lang="en">Previous version</rdfs:label>
+        <rdfs:comment xml:lang="en">The previous version of a resource in a lineage. For instance a news article updated to correct factual information would point to the previous version of the article with pav:previousVersion. If however the content has significantly changed so that the two resources no longer share lineage (say a new news article that talks about the same facts), they should be related using pav:derivedFrom.
+
+A version number of this resource can be provided using the data property pav:version.</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="&pav;derivedFrom"/>
+        <rdfs:seeAlso rdf:resource="&pav;version"/>
+        <owl:equivalentProperty rdf:resource="&pav1;previousVersion"/>
+        <rdfs:subPropertyOf rdf:resource="&prov;wasRevisionOf"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/pav/providedBy -->
+
+    <owl:ObjectProperty rdf:about="&pav;providedBy">
+        <rdfs:label xml:lang="en">Provided by</rdfs:label>
+        <rdfs:comment xml:lang="en">The original provider of the encoded information (e.g. PubMed, UniProt, Science Commons).
+
+The provider might not coincide with the dct:publisher, which would describe the current publisher of the resource. For instance if the resource was retrieved, imported or derived from a source, that source was published by the original provider. pav:providedBy provides a shortcut to indicate the original provider on the new resource.  </rdfs:comment>
+        <rdfs:seeAlso rdf:resource="&dct;publisher"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/pav/retrievedBy -->
+
+    <owl:ObjectProperty rdf:about="&pav;retrievedBy">
+        <rdfs:label xml:lang="en">Retrieved by</rdfs:label>
+        <rdfs:comment xml:lang="en">An entity responsible for retrieving the data from an external source. 
+
+The retrieving agent is usually a software entity, which has done the retrieval from the original source without performing any transcription.
+
+The source that was retrieved should be given with pav:retrievedFrom. The time of the retrieval should be indicated using pav:retrievedOn.
+
+See pav:importedFrom for a discussion of import vs. retrieve vs. derived.</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="&pav;importedFrom"/>
+        <rdfs:subPropertyOf rdf:resource="&prov;wasAttributedTo"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/pav/retrievedFrom -->
+
+    <owl:ObjectProperty rdf:about="&pav;retrievedFrom">
+        <rdfs:label xml:lang="en">Retrieved from</rdfs:label>
+        <rdfs:comment xml:lang="en">The URI where a resource has been retrieved from.
+
+Retrieval indicates that this resource has the same representation as the original resource. If the resource has been somewhat transformed, use pav:importedFrom instead.
+
+The time of the retrieval should be indicated using pav:retrievedOn. The agent may be indicated with pav:retrievedBy.</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="&pav;retrievedBy"/>
+        <rdfs:seeAlso rdf:resource="&pav;retrievedOn"/>
+        <rdfs:subPropertyOf rdf:resource="&prov;wasDerivedFrom"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/pav/sourceAccessedAt -->
+
+    <owl:ObjectProperty rdf:about="&pav;sourceAccessedAt">
+        <rdfs:label xml:lang="en">Source accessed at</rdfs:label>
+        <rdfs:comment xml:lang="en">The resource is related to a given source which was accessed or consulted (but not retrieved, imported or derived from). This access can be detailed with pav:sourceAccessedBy and pav:sourceAccessedOn.
+
+For instance, a curator (pav:curatedBy) might have consulted figures in a published paper to confirm that a dataset was correctly pav:importedFrom the paper&apos;s supplementary CSV file.</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="&pav;importedFrom"/>
+        <rdfs:seeAlso rdf:resource="&pav;retrievedFrom"/>
+        <rdfs:seeAlso rdf:resource="&pav;sourceAccessedBy"/>
+        <rdfs:seeAlso rdf:resource="&pav;sourceAccessedOn"/>
+        <rdfs:seeAlso rdf:resource="&pav;sourceLastAccessedOn"/>
+        <rdfs:subPropertyOf rdf:resource="&prov;wasInfluencedBy"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/pav/sourceAccessedBy -->
+
+    <owl:ObjectProperty rdf:about="&pav;sourceAccessedBy">
+        <rdfs:label xml:lang="en">Source accessed by</rdfs:label>
+        <rdfs:comment xml:lang="en">The resource is related to a source which was accessed or consulted 
+by the given agent. The source(s) should be specified using pav:sourceAccessedAt, and the time with pav:sourceAccessedOn.
+
+For instance, the given agent could be a curator (also pav:curatedBy) which consulted figures in a published paper to confirm that a dataset was correctly pav:importedFrom the paper&apos;s supplementary CSV file.</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="&pav;sourceAccessedAt"/>
+    </owl:ObjectProperty>
+    
+
+
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Data properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://purl.org/pav/authoredOn -->
+
+    <owl:DatatypeProperty rdf:about="&pav;authoredOn">
+        <rdfs:label xml:lang="en">Authored on</rdfs:label>
+        <rdfs:comment xml:lang="en">The date this resource was authored.
+
+pav:authoredBy gives the authoring agent.
+
+Note that pav:authoredOn is different from pav:createdOn, although they are often the same. See pav:createdBy for a discussion.</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="&pav;authoredBy"/>
+        <rdfs:subPropertyOf rdf:resource="&pav;contributedOn"/>
+        <rdfs:seeAlso rdf:resource="&pav;createdBy"/>
+        <rdfs:seeAlso rdf:resource="&pav;createdOn"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://purl.org/pav/contributedOn -->
+
+    <owl:DatatypeProperty rdf:about="&pav;contributedOn">
+        <rdfs:label xml:lang="en">Contributed on</rdfs:label>
+        <rdfs:comment xml:lang="en">The date this resource was contributed to.
+
+pav:contributedBy provides the agent(s) that contributed.</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="&pav;contributedBy"/>
+        <rdfs:range rdf:resource="&xsd;dateTime"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://purl.org/pav/createdOn -->
+
+    <owl:DatatypeProperty rdf:about="&pav;createdOn">
+        <rdfs:label xml:lang="en">Created On</rdfs:label>
+        <rdfs:comment xml:lang="en">The date of creation of the resource.
+
+pav:createdBy provides the agent(s) that created the resource.
+</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="&pav;createdBy"/>
+        <owl:equivalentProperty rdf:resource="&pav1;createdOn"/>
+        <rdfs:range rdf:resource="&xsd;dateTime"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://purl.org/pav/curatedOn -->
+
+    <owl:DatatypeProperty rdf:about="&pav;curatedOn">
+        <rdfs:label xml:lang="en">Curated on</rdfs:label>
+        <rdfs:comment xml:lang="en">The date this resource was curated. 
+
+pav:curatedBy gives the agent(s) that performed the curation.</rdfs:comment>
+        <rdfs:subPropertyOf rdf:resource="&pav;contributedOn"/>
+        <rdfs:seeAlso rdf:resource="&pav;curatedBy"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://purl.org/pav/importedOn -->
+
+    <owl:DatatypeProperty rdf:about="&pav;importedOn">
+        <rdfs:label xml:lang="en">Imported on</rdfs:label>
+        <rdfs:comment xml:lang="en">The date this resource was imported from a source (pav:importedFrom). 
+
+Note that pav:importedOn may overlap with pav:createdOn, but in cases where they differ, the import time indicates the time of the retrieval and transcription of the original source, while the creation time indicates when the final resource was made, for instance after user approval.
+
+If the source is later reimported, this should be indicated with pav:lastRefreshedOn.
+
+The source of the import should be given with pav:importedFrom. The agent that performed the import should be given with pav:importedBy.
+
+See pav:importedFrom for a discussion about import vs. retrieval.</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="&pav;importedBy"/>
+        <rdfs:seeAlso rdf:resource="&pav;importedFrom"/>
+        <owl:equivalentProperty rdf:resource="&pav1;importedOn"/>
+        <rdfs:range rdf:resource="&xsd;dateTime"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://purl.org/pav/lastRefreshedOn -->
+
+    <owl:DatatypeProperty rdf:about="&pav;lastRefreshedOn">
+        <rdfs:label xml:lang="en">Last refreshed on</rdfs:label>
+        <rdfs:comment xml:lang="en">The date of the last re-import of the resource. This property is used in addition to pav:importedOn if this version has been updated due to a re-import. If the re-import created a new resource rather than refreshing an existing, then pav:importedOn should be used together with pav:previousVersion.</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="&pav;importedBy"/>
+        <rdfs:seeAlso rdf:resource="&pav;importedFrom"/>
+        <rdfs:seeAlso rdf:resource="&pav;importedOn"/>
+        <rdfs:seeAlso rdf:resource="&pav;previousVersion"/>
+        <owl:equivalentProperty rdf:resource="&pav1;importedLastOn"/>
+        <rdfs:range rdf:resource="&xsd;dateTime"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://purl.org/pav/lastUpdateOn -->
+
+    <owl:DatatypeProperty rdf:about="&pav;lastUpdateOn">
+        <rdfs:label xml:lang="en">Last updated on</rdfs:label>
+        <rdfs:comment xml:lang="en">The date of the last update of the resource. An update is a change which did not warrant making a new resource related using pav:previousVersion, for instance correcting a spelling mistake.</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="&pav;createdOn"/>
+        <rdfs:seeAlso rdf:resource="&pav;previousVersion"/>
+        <owl:equivalentProperty rdf:resource="&pav1;lastUpdateOn"/>
+        <rdfs:range rdf:resource="&xsd;dateTime"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://purl.org/pav/retrievedOn -->
+
+    <owl:DatatypeProperty rdf:about="&pav;retrievedOn">
+        <rdfs:label xml:lang="en">Retrieved on</rdfs:label>
+        <rdfs:comment xml:lang="en">The date the source for this resource was retrieved. 
+
+The source that was retrieved should be indicated with pav:retrievedFrom. The agent that performed the retrieval may be specified with pav:retrievedBy.
+</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="&pav;retrievedBy"/>
+        <rdfs:seeAlso rdf:resource="&pav;retrievedFrom"/>
+        <rdfs:range rdf:resource="&xsd;dateTime"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://purl.org/pav/sourceAccessedOn -->
+
+    <owl:DatatypeProperty rdf:about="&pav;sourceAccessedOn">
+        <rdfs:label xml:lang="en">Source accessed on</rdfs:label>
+        <rdfs:comment xml:lang="en">The resource is related to a source which was originally accessed or consulted on the given date as part of creating or authoring the resource. The source(s) should be specified using pav:sourceAccessedAt. If the source is subsequently checked again (say to verify validity), this should be indicated with pav:sourceLastAccessedOn.
+
+In the case multiple sources being accessed at different times or by different agents, PAV does not distinguish who accessed when what. If such details are required, they may be provided by additionally using prov:qualifiedInfluence.</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="&pav;createdAt"/>
+        <rdfs:seeAlso rdf:resource="&pav;sourceAccessedAt"/>
+        <rdfs:seeAlso rdf:resource="&pav;sourceAccessedBy"/>
+        <rdfs:seeAlso rdf:resource="&pav;sourceLastAccessedOn"/>
+        <owl:equivalentProperty rdf:resource="&pav1;sourceAccessedOn"/>
+        <owl:equivalentProperty rdf:resource="&pav1;sourceFirstAccessedOn"/>
+        <rdfs:range rdf:resource="&xsd;dateTime"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://purl.org/pav/sourceLastAccessedOn -->
+
+    <owl:DatatypeProperty rdf:about="&pav;sourceLastAccessedOn">
+        <rdfs:label xml:lang="en">Source last accessed on</rdfs:label>
+        <rdfs:comment xml:lang="en">The resource is related to a source which was last accessed or consulted on the given date. The source(s) should be specified using pav:sourceAccessedAt. Usage of this property indicates that the source has been checked previously, which the initial time should be indicated with pav:sourceAccessedOn.
+
+This property can be useful together with pav:lastRefreshedOn or pav:lastUpdateOn in order to indicate a re-import or update, but could also be used alone, for instance when a source was simply verified and no further action was taken for the resource,</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="&pav;createdAt"/>
+        <rdfs:seeAlso rdf:resource="&pav;sourceAccessedAt"/>
+        <rdfs:seeAlso rdf:resource="&pav;sourceAccessedBy"/>
+        <owl:equivalentProperty rdf:resource="&pav1;sourceLastAccessedOn"/>
+        <rdfs:range rdf:resource="&xsd;dateTime"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://purl.org/pav/version -->
+
+    <owl:DatatypeProperty rdf:about="&pav;version">
+        <rdfs:label xml:lang="en">Version</rdfs:label>
+        <rdfs:comment rdf:datatype="&xsd;string">The version number of a resource. This is a freetext string, typical values are &quot;1.5&quot; or &quot;21&quot;. The URI identifying the previous version can be provided using prov:previousVersion.</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="&pav;previousVersion"/>
+        <owl:equivalentProperty rdf:resource="&pav1;versionNumber"/>
+        <rdfs:range rdf:resource="&xsd;string"/>
+    </owl:DatatypeProperty>
+    
+
+
+</rdf:RDF>
+
+
+
+<!-- Generated by the OWL API (version 3.3.1957) http://owlapi.sourceforge.net -->
+


[19/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/skos-owl1-dl.rdf
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/skos-owl1-dl.rdf b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/skos-owl1-dl.rdf
new file mode 100644
index 0000000..199b7fa
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/skos-owl1-dl.rdf
@@ -0,0 +1,465 @@
+<?xml version="1.0" encoding="utf-8"?>
+        <!-- This is a **subset** of the SKOS rdf schema generated through an XSL
+            translation. Certain axioms have been removed to provide a valid OWL DL ontology. -->
+<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dct="http://purl.org/dc/terms/" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xml:base="http://www.w3.org/2004/02/skos/core">
+  <!-- This schema represents a formalisation of a subset of the semantic conditions 
+    described in the SKOS Reference document dated 18 August 2009, accessible at
+    http://www.w3.org/TR/2009/REC-skos-reference-20090818/. XML comments of the form Sn are used to 
+    indicate the semantic conditions that are being expressed. Comments of the form 
+    [Sn] refer to assertions that are, strictly speaking, redundant as they follow 
+    from the RDF(S) or OWL semantics.
+    
+    A number of semantic conditions are *not* expressed formally in this schema. These are:
+    
+    S12
+    S13
+    S14
+    S27
+    S36
+    S46
+    
+    For the conditions listed above, rdfs:comments are used to indicate the conditions.
+    
+   -->
+  <owl:Ontology rdf:about="http://www.w3.org/2004/02/skos/core">   
+    <rdfs:seeAlso rdf:resource="http://www.w3.org/TR/skos-reference/"/>
+  </owl:Ontology>
+
+  <rdf:Description rdf:about="http://www.w3.org/2004/02/skos/core">
+    <owl:versionIRI rdf:resource="http://www.w3.org/TR/skos-reference/skos-owl1-dl.rdf"/>
+  </rdf:Description>
+    
+  <rdf:Description rdf:about="#Concept">
+    <rdfs:label xml:lang="en">Concept</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">An idea or notion; a unit of thought.</skos:definition>
+    <!-- S1 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#ConceptScheme">
+    <rdfs:label xml:lang="en">Concept Scheme</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">A set of concepts, optionally including statements about semantic relationships between those concepts.</skos:definition>
+    <skos:scopeNote xml:lang="en">A concept scheme may be defined to include concepts from different sources.</skos:scopeNote>
+    <skos:example xml:lang="en">Thesauri, classification schemes, subject heading lists, taxonomies, 'folksonomies', and other types of controlled vocabulary are all examples of concept schemes. Concept schemes are also embedded in glossaries and terminologies.</skos:example>
+    <!-- S2 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+    <!-- S9 -->
+    <owl:disjointWith rdf:resource="#Concept"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#Collection">
+    <rdfs:label xml:lang="en">Collection</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">A meaningful collection of concepts.</skos:definition>
+    <skos:scopeNote xml:lang="en">Labelled collections can be used where you would like a set of concepts to be displayed under a 'node label' in the hierarchy.</skos:scopeNote>
+    <!-- S28 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+    <!-- S37 -->
+    <owl:disjointWith rdf:resource="#Concept"/>
+    <!-- S37 -->
+    <owl:disjointWith rdf:resource="#ConceptScheme"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#OrderedCollection">
+    <rdfs:label xml:lang="en">Ordered Collection</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">An ordered collection of concepts, where both the grouping and the ordering are meaningful.</skos:definition>
+    <skos:scopeNote xml:lang="en">Ordered collections can be used where you would like a set of concepts to be displayed in a specific order, and optionally under a 'node label'.</skos:scopeNote>
+    <!-- S28 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+    <!-- S29 -->
+    <rdfs:subClassOf rdf:resource="#Collection"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#inScheme">
+    <rdfs:label xml:lang="en">is in scheme</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">Relates a resource (for example a concept) to a concept scheme in which it is included.</skos:definition>
+    <skos:scopeNote xml:lang="en">A concept may be a member of more than one concept scheme.</skos:scopeNote>
+    <!-- S3 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <!-- S4 -->
+    <rdfs:range rdf:resource="#ConceptScheme"/>
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#hasTopConcept">
+    <rdfs:label xml:lang="en">has top concept</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">Relates, by convention, a concept scheme to a concept which is topmost in the broader/narrower concept hierarchies for that scheme, providing an entry point to these hierarchies.</skos:definition>
+    <!-- S3 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <!-- S5 -->
+    <rdfs:domain rdf:resource="#ConceptScheme"/>
+    <!-- S6 -->
+    <rdfs:range rdf:resource="#Concept"/>
+    <!-- S8 -->
+    <owl:inverseOf rdf:resource="#topConceptOf"/>
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#topConceptOf">
+    <rdfs:label xml:lang="en">is top concept in scheme</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">Relates a concept to the concept scheme that it is a top level concept of.</skos:definition>
+    <!-- S3 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <!-- S7 -->
+    <rdfs:subPropertyOf rdf:resource="#inScheme"/>
+    <!-- S8 -->
+    <owl:inverseOf rdf:resource="#hasTopConcept"/>
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+    <rdfs:domain rdf:resource="#Concept"/>
+    <rdfs:range rdf:resource="#ConceptScheme"/> 
+  </rdf:Description>
+  <rdf:Description rdf:about="#prefLabel">
+    <rdfs:label xml:lang="en">preferred label</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">The preferred lexical label for a resource, in a given language.</skos:definition>
+    <!-- S10 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#AnnotationProperty"/>
+    <!-- S11 -->
+    <!-- Axiom Deleted -->
+    <!-- S14 (not formally stated) -->
+    <rdfs:comment xml:lang="en">A resource has no more than one value of skos:prefLabel per language tag, and no more than one value of skos:prefLabel without language tag.</rdfs:comment>
+    <!-- S12 (not formally stated) -->
+    <rdfs:comment xml:lang="en">The range of skos:prefLabel is the class of RDF plain literals.</rdfs:comment>
+    <!-- S13 (not formally stated) -->
+    <rdfs:comment xml:lang="en">skos:prefLabel, skos:altLabel and skos:hiddenLabel are pairwise
+      disjoint properties.</rdfs:comment>
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#altLabel">
+    <rdfs:label xml:lang="en">alternative label</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">An alternative lexical label for a resource.</skos:definition>
+    <skos:example xml:lang="en">Acronyms, abbreviations, spelling variants, and irregular plural/singular forms may be included among the alternative labels for a concept. Mis-spelled terms are normally included as hidden labels (see skos:hiddenLabel).</skos:example>
+    <!-- S10 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#AnnotationProperty"/>
+    <!-- S11 -->
+    <!-- Axiom Deleted -->
+    <!-- S12 (not formally stated) -->
+    <rdfs:comment xml:lang="en">The range of skos:altLabel is the class of RDF plain literals.</rdfs:comment>
+    <!-- S13 (not formally stated) -->
+    <rdfs:comment xml:lang="en">skos:prefLabel, skos:altLabel and skos:hiddenLabel are pairwise disjoint properties.</rdfs:comment>
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#hiddenLabel">
+    <rdfs:label xml:lang="en">hidden label</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">A lexical label for a resource that should be hidden when generating visual displays of the resource, but should still be accessible to free text search operations.</skos:definition>
+    <!-- S10 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#AnnotationProperty"/>
+    <!-- S11 -->
+    <!-- Axiom Deleted -->
+    <!-- S12 (not formally stated) -->
+    <rdfs:comment xml:lang="en">The range of skos:hiddenLabel is the class of RDF plain literals.</rdfs:comment>
+    <!-- S13 (not formally stated) -->
+    <rdfs:comment xml:lang="en">skos:prefLabel, skos:altLabel and skos:hiddenLabel are pairwise disjoint properties.</rdfs:comment>
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#notation">
+    <rdfs:label xml:lang="en">notation</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">A notation, also known as classification code, is a string of characters such as "T58.5" or "303.4833" used to uniquely identify a concept within the scope of a given concept scheme.</skos:definition>
+    <skos:scopeNote xml:lang="en">By convention, skos:notation is used with a typed literal in the object position of the triple.</skos:scopeNote>
+    <!-- S15 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#note">
+    <rdfs:label xml:lang="en">note</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">A general note, for any purpose.</skos:definition>
+    <skos:scopeNote xml:lang="en">This property may be used directly, or as a super-property for more specific note types.</skos:scopeNote>
+    <!-- S16 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#AnnotationProperty"/>
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#changeNote">
+    <rdfs:label xml:lang="en">change note</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">A note about a modification to a concept.</skos:definition>
+    <!-- S16 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#AnnotationProperty"/>
+    <!-- S17 -->
+    <!-- Axiom Deleted -->
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#definition">
+    <rdfs:label xml:lang="en">definition</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">A statement or formal explanation of the meaning of a concept.</skos:definition>
+    <!-- S16 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#AnnotationProperty"/>
+    <!-- S17 -->
+    <!-- Axiom Deleted -->
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#editorialNote">
+    <rdfs:label xml:lang="en">editorial note</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">A note for an editor, translator or maintainer of the vocabulary.</skos:definition>
+    <!-- S16 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#AnnotationProperty"/>
+    <!-- S17 -->
+    <!-- Axiom Deleted -->
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#example">
+    <rdfs:label xml:lang="en">example</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">An example of the use of a concept.</skos:definition>
+    <!-- S16 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#AnnotationProperty"/>
+    <!-- S17 -->
+    <!-- Axiom Deleted -->
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#historyNote">
+    <rdfs:label xml:lang="en">history note</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">A note about the past state/use/meaning of a concept.</skos:definition>
+    <!-- S16 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#AnnotationProperty"/>
+    <!-- S17 -->
+    <!-- Axiom Deleted -->
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#scopeNote">
+    <rdfs:label xml:lang="en">scope note</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">A note that helps to clarify the meaning and/or the use of a concept.</skos:definition>
+    <!-- S16 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#AnnotationProperty"/>
+    <!-- S17 -->
+    <!-- Axiom Deleted -->
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#semanticRelation">
+    <rdfs:label xml:lang="en">is in semantic relation with</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">Links a concept to a concept related by meaning.</skos:definition>
+    <skos:scopeNote xml:lang="en">This property should not be used directly, but as a super-property for all properties denoting a relationship of meaning between concepts.</skos:scopeNote>
+    <!-- S18 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <!-- S19 -->
+    <rdfs:domain rdf:resource="#Concept"/>
+    <!-- S20 -->
+    <rdfs:range rdf:resource="#Concept"/>
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#broader">
+    <rdfs:label xml:lang="en">has broader</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">Relates a concept to a concept that is more general in meaning.</skos:definition>
+    <rdfs:comment xml:lang="en">Broader concepts are typically rendered as parents in a concept hierarchy (tree).</rdfs:comment>
+    <skos:scopeNote xml:lang="en">By convention, skos:broader is only used to assert an immediate (i.e. direct) hierarchical link between two conceptual resources.</skos:scopeNote>
+    <!-- S18 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <!-- S22 -->
+    <rdfs:subPropertyOf rdf:resource="#broaderTransitive"/>
+    <!-- S25 -->
+    <owl:inverseOf rdf:resource="#narrower"/>
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#narrower">
+    <rdfs:label xml:lang="en">has narrower</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">Relates a concept to a concept that is more specific in meaning.</skos:definition>
+    <skos:scopeNote xml:lang="en">By convention, skos:broader is only used to assert an immediate (i.e. direct) hierarchical link between two conceptual resources.</skos:scopeNote>
+    <rdfs:comment xml:lang="en">Narrower concepts are typically rendered as children in a concept hierarchy (tree).</rdfs:comment>
+    <!-- S18 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <!-- S22 -->
+    <rdfs:subPropertyOf rdf:resource="#narrowerTransitive"/>
+    <!-- S25 -->
+    <owl:inverseOf rdf:resource="#broader"/>
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#related">
+    <rdfs:label xml:lang="en">has related</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">Relates a concept to a concept with which there is an associative semantic relationship.</skos:definition>
+    <!-- S18 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <!-- S21 -->
+    <rdfs:subPropertyOf rdf:resource="#semanticRelation"/>
+    <!-- S23 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#SymmetricProperty"/>
+    <!-- S27 (not formally stated) -->
+    <rdfs:comment xml:lang="en">skos:related is disjoint with skos:broaderTransitive</rdfs:comment>
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#broaderTransitive">
+    <rdfs:label xml:lang="en">has broader transitive</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition>skos:broaderTransitive is a transitive superproperty of skos:broader.</skos:definition>
+    <skos:scopeNote xml:lang="en">By convention, skos:broaderTransitive is not used to make assertions. Rather, the properties can be used to draw inferences about the transitive closure of the hierarchical relation, which is useful e.g. when implementing a simple query expansion algorithm in a search application.</skos:scopeNote>
+    <!-- S18 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <!-- S21 -->
+    <rdfs:subPropertyOf rdf:resource="#semanticRelation"/>
+    <!-- S24 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#TransitiveProperty"/>
+    <!-- S26 -->
+    <owl:inverseOf rdf:resource="#narrowerTransitive"/>
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#narrowerTransitive">
+    <rdfs:label xml:lang="en">has narrower transitive</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition>skos:narrowerTransitive is a transitive superproperty of skos:narrower.</skos:definition>
+    <skos:scopeNote xml:lang="en">By convention, skos:narrowerTransitive is not used to make assertions. Rather, the properties can be used to draw inferences about the transitive closure of the hierarchical relation, which is useful e.g. when implementing a simple query expansion algorithm in a search application.</skos:scopeNote>
+    <!-- S18 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <!-- S21 -->
+    <rdfs:subPropertyOf rdf:resource="#semanticRelation"/>
+    <!-- S24 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#TransitiveProperty"/>
+    <!-- S26 -->
+    <owl:inverseOf rdf:resource="#broaderTransitive"/>
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#member">
+    <rdfs:label xml:lang="en">has member</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">Relates a collection to one of its members.</skos:definition>
+    <!-- S30 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <!-- S31 -->
+    <rdfs:domain rdf:resource="#Collection"/>
+    <!-- S32 -->
+    <rdfs:range>
+      <owl:Class>
+	<owl:unionOf rdf:parseType="Collection">
+	  <owl:Class rdf:about="#Concept"/>
+	  <owl:Class rdf:about="#Collection"/>
+	</owl:unionOf>
+      </owl:Class>
+    </rdfs:range>
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#memberList">
+    <rdfs:label xml:lang="en">has member list</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">Relates an ordered collection to the RDF list containing its members.</skos:definition>
+    <!-- S30 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <!-- S33 -->
+    <rdfs:domain rdf:resource="#OrderedCollection"/>
+    <!-- S35 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#FunctionalProperty"/>
+    <!-- S34 -->
+    <!-- Axiom Deleted -->
+    <!-- S36 (not formally stated) -->
+    <rdfs:comment xml:lang="en">For any resource, every item in the list given as the value of the
+      skos:memberList property is also a value of the skos:member property.</rdfs:comment>
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#mappingRelation">
+    <rdfs:label xml:lang="en">is in mapping relation with</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">Relates two concepts coming, by convention, from different schemes, and that have comparable meanings</skos:definition>
+    <rdfs:comment xml:lang="en">These concept mapping relations mirror semantic relations, and the data model defined below is similar (with the exception of skos:exactMatch) to the data model defined for semantic relations. A distinct vocabulary is provided for concept mapping relations, to provide a convenient way to differentiate links within a concept scheme from links between concept schemes. However, this pattern of usage is not a formal requirement of the SKOS data model, and relies on informal definitions of best practice.</rdfs:comment>
+    <!-- S38 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <!-- S39 -->
+    <rdfs:subPropertyOf rdf:resource="#semanticRelation"/>
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#broadMatch">
+    <rdfs:label xml:lang="en">has broader match</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">skos:broadMatch is used to state a hierarchical mapping link between two conceptual resources in different concept schemes.</skos:definition>
+    <!-- S38 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <!-- S40 -->
+    <rdfs:subPropertyOf rdf:resource="#mappingRelation"/>
+    <!-- S41 -->
+    <rdfs:subPropertyOf rdf:resource="#broader"/>
+    <!-- S43 -->
+    <owl:inverseOf rdf:resource="#narrowMatch"/>
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#narrowMatch">
+    <rdfs:label xml:lang="en">has narrower match</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">skos:narrowMatch is used to state a hierarchical mapping link between two conceptual resources in different concept schemes.</skos:definition>
+    <!-- S38 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <!-- S40 -->
+    <rdfs:subPropertyOf rdf:resource="#mappingRelation"/>
+    <!-- S41 -->
+    <rdfs:subPropertyOf rdf:resource="#narrower"/>
+    <!-- S43 -->
+    <owl:inverseOf rdf:resource="#broadMatch"/>
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#relatedMatch">
+    <rdfs:label xml:lang="en">has related match</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">skos:relatedMatch is used to state an associative mapping link between two conceptual resources in different concept schemes.</skos:definition>
+    <!-- S38 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <!-- S40 -->
+    <rdfs:subPropertyOf rdf:resource="#mappingRelation"/>
+    <!-- S41 -->
+    <rdfs:subPropertyOf rdf:resource="#related"/>
+    <!-- S44 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#SymmetricProperty"/>
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#exactMatch">
+    <rdfs:label xml:lang="en">has exact match</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">skos:exactMatch is used to link two concepts, indicating a high degree of confidence that the concepts can be used interchangeably across a wide range of information retrieval applications. skos:exactMatch is a transitive property, and is a sub-property of skos:closeMatch.</skos:definition>
+    <!-- S38 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <!-- S42 -->
+    <rdfs:subPropertyOf rdf:resource="#closeMatch"/>
+    <!-- S44 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#SymmetricProperty"/>
+    <!-- S45 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#TransitiveProperty"/>
+    <!-- S46 (not formally stated) -->
+    <rdfs:comment xml:lang="en">skos:exactMatch is disjoint with each of the properties skos:broadMatch and skos:relatedMatch.</rdfs:comment>
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="#closeMatch">
+    <rdfs:label xml:lang="en">has close match</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
+    <skos:definition xml:lang="en">skos:closeMatch is used to link two concepts that are sufficiently similar that they can be used interchangeably in some information retrieval applications. In order to avoid the possibility of "compound errors" when combining mappings across more than two concept schemes, skos:closeMatch is not declared to be a transitive property.</skos:definition>
+    <!-- S38 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+    <!-- S40 -->
+    <rdfs:subPropertyOf rdf:resource="#mappingRelation"/>
+    <!-- S44 -->
+    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#SymmetricProperty"/>
+    <!-- For non-OWL aware applications -->
+    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
+  </rdf:Description>
+</rdf:RDF>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/taverna-prov.owl
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/taverna-prov.owl b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/taverna-prov.owl
new file mode 100644
index 0000000..de99869
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/taverna-prov.owl
@@ -0,0 +1,333 @@
+<?xml version="1.0"?>
+
+
+<!DOCTYPE rdf:RDF [
+    <!ENTITY prov "http://www.w3.org/ns/prov#" >
+    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
+    <!ENTITY wfdesc "http://purl.org/wf4ever/wfdesc#" >
+    <!ENTITY wfprov "http://purl.org/wf4ever/wfprov#" >
+    <!ENTITY cnt "http://www.w3.org/2011/content#" >
+    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
+    <!ENTITY xml "http://www.w3.org/XML/1998/namespace" >
+    <!ENTITY scufl2 "http://ns.taverna.org.uk/2010/scufl2#" >
+    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
+    <!ENTITY tavernaprov "http://ns.taverna.org.uk/2012/tavernaprov/" >
+    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
+]>
+
+
+<rdf:RDF xmlns="&tavernaprov;#"
+     xml:base="http://ns.taverna.org.uk/2012/tavernaprov/"
+     xmlns:prov="http://www.w3.org/ns/prov#"
+     xmlns:cnt="http://www.w3.org/2011/content#"
+     xmlns:wfprov="http://purl.org/wf4ever/wfprov#"
+     xmlns:xml="http://www.w3.org/XML/1998/namespace"
+     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+     xmlns:wfdesc="http://purl.org/wf4ever/wfdesc#"
+     xmlns:tavernaprov="http://ns.taverna.org.uk/2012/tavernaprov/"
+     xmlns:owl="http://www.w3.org/2002/07/owl#"
+     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
+     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+     xmlns:scufl2="http://ns.taverna.org.uk/2010/scufl2#">
+    <owl:Ontology rdf:about="http://ns.taverna.org.uk/2012/tavernaprov/">
+        <owl:imports rdf:resource="http://ns.taverna.org.uk/2010/scufl2"/>
+        <owl:versionIRI rdf:resource="&tavernaprov;0.2-SNAPSHOT/"/>
+        <owl:imports rdf:resource="http://purl.org/wf4ever/wfdesc"/>
+        <owl:imports rdf:resource="http://purl.org/wf4ever/wfprov"/>
+        <owl:imports rdf:resource="http://www.w3.org/2011/content"/>
+        <owl:imports rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:Ontology>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Annotation properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://ns.taverna.org.uk/2012/tavernaprov/errorMessage -->
+
+    <owl:AnnotationProperty rdf:about="&tavernaprov;errorMessage">
+        <rdfs:domain rdf:resource="&tavernaprov;Error"/>
+    </owl:AnnotationProperty>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Object Properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://ns.taverna.org.uk/2012/tavernaprov/content -->
+
+    <owl:ObjectProperty rdf:about="&tavernaprov;content">
+        <rdfs:range rdf:resource="&tavernaprov;Content"/>
+        <rdfs:domain rdf:resource="&wfprov;Artifact"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/wf4ever/wfdesc#hasDataLink -->
+
+    <rdf:Description rdf:about="&wfdesc;hasDataLink">
+        <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/hasPart"/>
+    </rdf:Description>
+    
+
+
+    <!-- http://purl.org/wf4ever/wfdesc#hasInput -->
+
+    <rdf:Description rdf:about="&wfdesc;hasInput">
+        <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/hasPart"/>
+    </rdf:Description>
+    
+
+
+    <!-- http://purl.org/wf4ever/wfdesc#hasOutput -->
+
+    <rdf:Description rdf:about="&wfdesc;hasOutput">
+        <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/hasPart"/>
+    </rdf:Description>
+    
+
+
+    <!-- http://purl.org/wf4ever/wfdesc#hasSubProcess -->
+
+    <rdf:Description rdf:about="&wfdesc;hasSubProcess">
+        <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/hasPart"/>
+    </rdf:Description>
+    
+
+
+    <!-- http://purl.org/wf4ever/wfprov#usedInput -->
+
+    <rdf:Description rdf:about="&wfprov;usedInput">
+        <rdfs:subPropertyOf rdf:resource="&prov;used"/>
+    </rdf:Description>
+    
+
+
+    <!-- http://purl.org/wf4ever/wfprov#wasOutputFrom -->
+
+    <rdf:Description rdf:about="&wfprov;wasOutputFrom">
+        <rdfs:subPropertyOf rdf:resource="&prov;wasGeneratedBy"/>
+    </rdf:Description>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Data properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://ns.taverna.org.uk/2012/tavernaprov/byteCount -->
+
+    <owl:DatatypeProperty rdf:about="&tavernaprov;byteCount">
+        <rdfs:domain rdf:resource="&tavernaprov;Content"/>
+        <rdfs:range rdf:resource="&xsd;nonNegativeInteger"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2012/tavernaprov/checksum -->
+
+    <owl:DatatypeProperty rdf:about="&tavernaprov;checksum">
+        <rdfs:domain rdf:resource="&tavernaprov;Content"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2012/tavernaprov/errorMessage -->
+
+    <owl:DatatypeProperty rdf:about="&tavernaprov;errorMessage">
+        <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/description"/>
+        <rdfs:range rdf:resource="&rdf;PlainLiteral"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2012/tavernaprov/sha1 -->
+
+    <owl:DatatypeProperty rdf:about="&tavernaprov;sha1">
+        <rdfs:subPropertyOf rdf:resource="&tavernaprov;checksum"/>
+        <rdfs:range rdf:resource="&rdf;PlainLiteral"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2012/tavernaprov/sha512 -->
+
+    <owl:DatatypeProperty rdf:about="&tavernaprov;sha512">
+        <rdfs:subPropertyOf rdf:resource="&tavernaprov;checksum"/>
+        <rdfs:range rdf:resource="&rdf;PlainLiteral"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2012/tavernaprov/stackTrace -->
+
+    <owl:DatatypeProperty rdf:about="&tavernaprov;stackTrace">
+        <rdfs:domain rdf:resource="&tavernaprov;Error"/>
+        <rdfs:range rdf:resource="&rdf;PlainLiteral"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://purl.org/dc/terms/description -->
+
+    <owl:DatatypeProperty rdf:about="http://purl.org/dc/terms/description"/>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Classes
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#DataLink -->
+
+    <rdf:Description rdf:about="&scufl2;DataLink">
+        <rdfs:subClassOf rdf:resource="&wfdesc;DataLink"/>
+    </rdf:Description>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#Processor -->
+
+    <rdf:Description rdf:about="&scufl2;Processor">
+        <rdfs:subClassOf rdf:resource="&wfdesc;Process"/>
+    </rdf:Description>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#ReceiverPort -->
+
+    <rdf:Description rdf:about="&scufl2;ReceiverPort">
+        <rdfs:subClassOf rdf:resource="&wfdesc;Input"/>
+    </rdf:Description>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#SenderPort -->
+
+    <rdf:Description rdf:about="&scufl2;SenderPort">
+        <rdfs:subClassOf rdf:resource="&wfdesc;Output"/>
+    </rdf:Description>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#Workflow -->
+
+    <rdf:Description rdf:about="&scufl2;Workflow">
+        <rdfs:subClassOf rdf:resource="&wfdesc;WorkflowTemplate"/>
+    </rdf:Description>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2012/tavernaprov/Content -->
+
+    <owl:Class rdf:about="&tavernaprov;Content">
+        <rdfs:subClassOf rdf:resource="&cnt;Content"/>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2012/tavernaprov/Error -->
+
+    <owl:Class rdf:about="&tavernaprov;Error">
+        <rdfs:subClassOf rdf:resource="&wfdesc;Artifact"/>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2012/tavernaprov/TavernaEngine -->
+
+    <owl:Class rdf:about="&tavernaprov;TavernaEngine">
+        <rdfs:subClassOf rdf:resource="&wfprov;WorkflowEngine"/>
+    </owl:Class>
+    
+
+
+    <!-- http://purl.org/wf4ever/wfdesc#Parameter -->
+
+    <rdf:Description rdf:about="&wfdesc;Parameter">
+        <rdfs:subClassOf rdf:resource="&prov;Role"/>
+    </rdf:Description>
+    
+
+
+    <!-- http://purl.org/wf4ever/wfdesc#Process -->
+
+    <rdf:Description rdf:about="&wfdesc;Process">
+        <rdfs:subClassOf rdf:resource="&prov;Plan"/>
+    </rdf:Description>
+    
+
+
+    <!-- http://purl.org/wf4ever/wfprov#Artifact -->
+
+    <rdf:Description rdf:about="&wfprov;Artifact">
+        <rdfs:subClassOf rdf:resource="&prov;Entity"/>
+    </rdf:Description>
+    
+
+
+    <!-- http://purl.org/wf4ever/wfprov#ProcessRun -->
+
+    <rdf:Description rdf:about="&wfprov;ProcessRun">
+        <rdfs:subClassOf rdf:resource="&prov;Activity"/>
+    </rdf:Description>
+    
+
+
+    <!-- http://purl.org/wf4ever/wfprov#WorkflowEngine -->
+
+    <rdf:Description rdf:about="&wfprov;WorkflowEngine">
+        <rdfs:subClassOf rdf:resource="&prov;Agent"/>
+    </rdf:Description>
+    
+
+
+    <!-- http://www.w3.org/2011/content#ContentAsBase64 -->
+
+    <rdf:Description rdf:about="&cnt;ContentAsBase64">
+        <rdfs:subClassOf rdf:resource="&tavernaprov;Content"/>
+    </rdf:Description>
+    
+
+
+    <!-- http://www.w3.org/2011/content#ContentAsText -->
+
+    <rdf:Description rdf:about="&cnt;ContentAsText">
+        <rdfs:subClassOf rdf:resource="&tavernaprov;Content"/>
+    </rdf:Description>
+</rdf:RDF>
+
+
+
+<!-- Generated by the OWL API (version 3.4.2) http://owlapi.sourceforge.net -->
+

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/taverna-prov.ttl
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/taverna-prov.ttl b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/taverna-prov.ttl
new file mode 100644
index 0000000..52e0f69
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/taverna-prov.ttl
@@ -0,0 +1,277 @@
+@prefix : <http://ns.taverna.org.uk/2012/tavernaprov/#> .
+@prefix cnt: <http://www.w3.org/2011/content#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix xml: <http://www.w3.org/XML/1998/namespace> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix prov: <http://www.w3.org/ns/prov#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix scufl2: <http://ns.taverna.org.uk/2010/scufl2#> .
+@prefix wfdesc: <http://purl.org/wf4ever/wfdesc#> .
+@prefix wfprov: <http://purl.org/wf4ever/wfprov#> .
+@prefix tavernaprov: <http://ns.taverna.org.uk/2012/tavernaprov/> .
+@base <http://ns.taverna.org.uk/2012/tavernaprov/> .
+
+<http://ns.taverna.org.uk/2012/tavernaprov/> rdf:type owl:Ontology ;
+                                             
+                                             owl:imports <http://ns.taverna.org.uk/2010/scufl2> ;
+                                             
+                                             owl:versionIRI <http://ns.taverna.org.uk/2012/tavernaprov/0.2-SNAPSHOT/> ;
+                                             
+                                             owl:imports <http://purl.org/wf4ever/wfdesc> ,
+                                                         <http://purl.org/wf4ever/wfprov> ,
+                                                         <http://www.w3.org/2011/content> ,
+                                                         prov: .
+
+
+#################################################################
+#
+#    Annotation properties
+#
+#################################################################
+
+
+###  http://ns.taverna.org.uk/2012/tavernaprov/errorMessage
+
+tavernaprov:errorMessage rdf:type owl:AnnotationProperty ;
+                         
+                         rdfs:domain tavernaprov:Error .
+
+
+
+
+
+#################################################################
+#
+#    Object Properties
+#
+#################################################################
+
+
+###  http://ns.taverna.org.uk/2012/tavernaprov/content
+
+tavernaprov:content rdf:type owl:ObjectProperty ;
+                    
+                    rdfs:range tavernaprov:Content ;
+                    
+                    rdfs:domain wfprov:Artifact .
+
+
+
+###  http://purl.org/wf4ever/wfdesc#hasDataLink
+
+wfdesc:hasDataLink rdfs:subPropertyOf <http://purl.org/dc/terms/hasPart> .
+
+
+
+###  http://purl.org/wf4ever/wfdesc#hasInput
+
+wfdesc:hasInput rdfs:subPropertyOf <http://purl.org/dc/terms/hasPart> .
+
+
+
+###  http://purl.org/wf4ever/wfdesc#hasOutput
+
+wfdesc:hasOutput rdfs:subPropertyOf <http://purl.org/dc/terms/hasPart> .
+
+
+
+###  http://purl.org/wf4ever/wfdesc#hasSubProcess
+
+wfdesc:hasSubProcess rdfs:subPropertyOf <http://purl.org/dc/terms/hasPart> .
+
+
+
+###  http://purl.org/wf4ever/wfprov#usedInput
+
+wfprov:usedInput rdfs:subPropertyOf prov:used .
+
+
+
+###  http://purl.org/wf4ever/wfprov#wasOutputFrom
+
+wfprov:wasOutputFrom rdfs:subPropertyOf prov:wasGeneratedBy .
+
+
+
+
+
+#################################################################
+#
+#    Data properties
+#
+#################################################################
+
+
+###  http://ns.taverna.org.uk/2012/tavernaprov/byteCount
+
+tavernaprov:byteCount rdf:type owl:DatatypeProperty ;
+                      
+                      rdfs:domain tavernaprov:Content ;
+                      
+                      rdfs:range xsd:nonNegativeInteger .
+
+
+
+###  http://ns.taverna.org.uk/2012/tavernaprov/checksum
+
+tavernaprov:checksum rdf:type owl:DatatypeProperty ;
+                     
+                     rdfs:domain tavernaprov:Content .
+
+
+
+###  http://ns.taverna.org.uk/2012/tavernaprov/errorMessage
+
+tavernaprov:errorMessage rdf:type owl:DatatypeProperty ;
+                         
+                         rdfs:subPropertyOf <http://purl.org/dc/terms/description> ;
+                         
+                         rdfs:range rdf:PlainLiteral .
+
+
+
+###  http://ns.taverna.org.uk/2012/tavernaprov/sha1
+
+tavernaprov:sha1 rdf:type owl:DatatypeProperty ;
+                 
+                 rdfs:subPropertyOf tavernaprov:checksum ;
+                 
+                 rdfs:range rdf:PlainLiteral .
+
+
+
+###  http://ns.taverna.org.uk/2012/tavernaprov/sha512
+
+tavernaprov:sha512 rdf:type owl:DatatypeProperty ;
+                   
+                   rdfs:subPropertyOf tavernaprov:checksum ;
+                   
+                   rdfs:range rdf:PlainLiteral .
+
+
+
+###  http://ns.taverna.org.uk/2012/tavernaprov/stackTrace
+
+tavernaprov:stackTrace rdf:type owl:DatatypeProperty ;
+                       
+                       rdfs:domain tavernaprov:Error ;
+                       
+                       rdfs:range rdf:PlainLiteral .
+
+
+
+###  http://purl.org/dc/terms/description
+
+<http://purl.org/dc/terms/description> rdf:type owl:DatatypeProperty .
+
+
+
+
+
+#################################################################
+#
+#    Classes
+#
+#################################################################
+
+
+###  http://ns.taverna.org.uk/2010/scufl2#DataLink
+
+scufl2:DataLink rdfs:subClassOf wfdesc:DataLink .
+
+
+
+###  http://ns.taverna.org.uk/2010/scufl2#Processor
+
+scufl2:Processor rdfs:subClassOf wfdesc:Process .
+
+
+
+###  http://ns.taverna.org.uk/2010/scufl2#ReceiverPort
+
+scufl2:ReceiverPort rdfs:subClassOf wfdesc:Input .
+
+
+
+###  http://ns.taverna.org.uk/2010/scufl2#SenderPort
+
+scufl2:SenderPort rdfs:subClassOf wfdesc:Output .
+
+
+
+###  http://ns.taverna.org.uk/2010/scufl2#Workflow
+
+scufl2:Workflow rdfs:subClassOf wfdesc:WorkflowTemplate .
+
+
+
+###  http://ns.taverna.org.uk/2012/tavernaprov/Content
+
+tavernaprov:Content rdf:type owl:Class ;
+                    
+                    rdfs:subClassOf cnt:Content .
+
+
+
+###  http://ns.taverna.org.uk/2012/tavernaprov/Error
+
+tavernaprov:Error rdf:type owl:Class ;
+                  
+                  rdfs:subClassOf wfprov:Artifact .
+
+
+
+###  http://ns.taverna.org.uk/2012/tavernaprov/TavernaEngine
+
+tavernaprov:TavernaEngine rdf:type owl:Class ;
+                          
+                          rdfs:subClassOf wfprov:WorkflowEngine .
+
+
+
+###  http://purl.org/wf4ever/wfdesc#Parameter
+
+wfdesc:Parameter rdfs:subClassOf prov:Role .
+
+
+
+###  http://purl.org/wf4ever/wfdesc#Process
+
+wfdesc:Process rdfs:subClassOf prov:Plan .
+
+
+
+###  http://purl.org/wf4ever/wfprov#Artifact
+
+wfprov:Artifact rdfs:subClassOf prov:Entity .
+
+
+
+###  http://purl.org/wf4ever/wfprov#ProcessRun
+
+wfprov:ProcessRun rdfs:subClassOf prov:Activity .
+
+
+
+###  http://purl.org/wf4ever/wfprov#WorkflowEngine
+
+wfprov:WorkflowEngine rdfs:subClassOf prov:Agent .
+
+
+
+###  http://www.w3.org/2011/content#ContentAsBase64
+
+cnt:ContentAsBase64 rdfs:subClassOf tavernaprov:Content .
+
+
+
+###  http://www.w3.org/2011/content#ContentAsText
+
+cnt:ContentAsText rdfs:subClassOf tavernaprov:Content .
+
+
+
+
+###  Generated by the OWL API (version 3.4.2) http://owlapi.sourceforge.net
+

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/terms.rdf
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/terms.rdf b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/terms.rdf
new file mode 100644
index 0000000..f8a893e
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/terms.rdf
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+         xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+         xmlns:owl="http://www.w3.org/2002/07/owl#"
+         xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
+         xmlns:dc="http://purl.org/dc/elements/1.1/"
+         xmlns:dcterms="http://purl.org/dc/terms/"
+         xmlns:dctype="http://purl.org/dc/dcmitype/"
+         xmlns:rdfg="http://www.w3.org/2004/03/trix/rdfg-1/"
+         xmlns:ore="http://www.openarchives.org/ore/terms/">
+
+  <rdf:Description rdf:about="http://www.openarchives.org/ore/terms/">
+    <dcterms:title>The OAI ORE terms vocabulary</dcterms:title>
+    <rdfs:label>The OAI ORE terms vocabulary</rdfs:label>
+    <rdfs:comment>The set of terms provided by the OAI ORE initiative</rdfs:comment>
+    <dcterms:publisher rdf:parseType="Resource"><rdfs:label>The Open Archives Initiative ORE Project</rdfs:label></dcterms:publisher>
+    <rdfs:seeAlso rdf:resource="http://www.openarchives.org/ore/toc" />
+  </rdf:Description>
+
+  <rdfs:Class rdf:about="http://www.openarchives.org/ore/terms/Aggregation">
+    <rdfs:label>Aggregation</rdfs:label>
+    <rdfs:comment>A set of related resources (Aggregated Resources), grouped together such that the set can be treated as a single resource. This is the entity described within the ORE interoperability framework by a Resource Map.</rdfs:comment>
+    <rdfs:subClassOf rdf:resource="http://purl.org/dc/dcmitype/Collection" />
+    <rdfs:isDefinedBy rdf:resource="http://www.openarchives.org/ore/terms/"/>
+  </rdfs:Class>
+
+  <rdfs:Class rdf:about="http://www.openarchives.org/ore/terms/AggregatedResource">
+    <rdfs:label>Aggregated Resource</rdfs:label>
+    <rdfs:comment>A resource which is included in an Aggregation. Note that asserting that a resource is a member of the class of Aggregated Resources does not imply anything other than that it is aggregated by at least one Aggregation.</rdfs:comment>
+    <rdfs:isDefinedBy rdf:resource="http://www.openarchives.org/ore/terms/"/>
+  </rdfs:Class>
+
+  <rdfs:Class rdf:about="http://www.openarchives.org/ore/terms/Proxy">
+    <rdfs:label>Proxy</rdfs:label>
+    <rdfs:comment>A Proxy represents an Aggregated Resource as it exists in a specific Aggregation. All assertions made about an entity are globally true, not only within the context of the Aggregation. As such, in order to make assertions which are only true of a resource as it exists in an Aggregation, a Proxy object is required. For example, one might want to cite an article as it appears in a specific journal, or assign aggregation-specific metadata to a Resource.</rdfs:comment>
+    <rdfs:isDefinedBy rdf:resource="http://www.openarchives.org/ore/terms/"/>
+  </rdfs:Class>
+
+  <rdfs:Class rdf:about="http://www.openarchives.org/ore/terms/ResourceMap">
+    <rdfs:label>Resource Map</rdfs:label>
+    <rdfs:comment>A description of an Aggregation according to the OAI-ORE data model. Resource Maps are serialised to a machine readable format according to the implementation guidelines.</rdfs:comment>
+    <rdfs:subClassOf rdf:resource="http://www.w3.org/2004/03/trix/rdfg-1/Graph" />
+    <rdfs:isDefinedBy rdf:resource="http://www.openarchives.org/ore/terms/"/>
+  </rdfs:Class>
+
+
+  <rdf:Property rdf:about="http://www.openarchives.org/ore/terms/aggregates">
+    <rdfs:label>Aggregates</rdfs:label>
+    <rdfs:comment>Aggregations, by definition, aggregate resources. The ore:aggregates relationship expresses that the object resource is a member of the set of Aggregated Resources of the subject (the Aggregation). This relationship between the Aggregation and its Aggregated Resources is thus more specific than a simple part/whole relationship, as expressed by dcterms:hasPart for example.</rdfs:comment>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/hasPart" />
+    <rdfs:domain rdf:resource="http://www.openarchives.org/ore/terms/Aggregation" />
+    <rdfs:range rdf:resource="http://www.openarchives.org/ore/terms/AggregatedResource" />
+    <owl:inverseOf rdf:resource="http://www.openarchives.org/ore/terms/isAggregatedBy" />
+    <rdfs:isDefinedBy rdf:resource="http://www.openarchives.org/ore/terms/"/>
+  </rdf:Property>
+
+  <rdf:Property rdf:about="http://www.openarchives.org/ore/terms/isAggregatedBy">
+    <rdfs:label>Is Aggregated By</rdfs:label>
+    <rdfs:comment>The inverse relationship of ore:aggregates, ore:isAggregatedBy asserts that an Aggregated Resource is aggregated by an Aggregation.</rdfs:comment>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/isPartOf" />
+    <rdfs:domain rdf:resource="http://www.openarchives.org/ore/terms/AggregatedResource" />
+    <rdfs:range rdf:resource="http://www.openarchives.org/ore/terms/Aggregation" />
+    <owl:inverseOf rdf:resource="http://www.openarchives.org/ore/terms/aggregates" />
+    <rdfs:isDefinedBy rdf:resource="http://www.openarchives.org/ore/terms/"/>
+  </rdf:Property>
+
+  <rdf:Property rdf:about="http://www.openarchives.org/ore/terms/describes">
+    <rdfs:label>Describes</rdfs:label>
+    <rdfs:comment>This relationship asserts that the subject (a Resource Map) describes the object (an Aggregation).</rdfs:comment>
+    <rdfs:domain rdf:resource="http://www.openarchives.org/ore/terms/ResourceMap" />
+    <rdfs:range rdf:resource="http://www.openarchives.org/ore/terms/Aggregation" />
+    <owl:inverseOf rdf:resource="http://www.openarchives.org/ore/terms/isDescribedBy" />
+    <rdfs:isDefinedBy rdf:resource="http://www.openarchives.org/ore/terms/"/>
+  </rdf:Property>
+
+  <rdf:Property rdf:about="http://www.openarchives.org/ore/terms/isDescribedBy">
+    <rdfs:label>Is Described By</rdfs:label>
+    <rdfs:comment>The inverse relationship of ore:describes, in this case the object of the relationship is the Resource Map and the subject is the Aggregation which it describes.</rdfs:comment>
+    <rdfs:domain rdf:resource="http://www.openarchives.org/ore/terms/Aggregation" />
+    <rdfs:range rdf:resource="http://www.openarchives.org/ore/terms/ResourceMap" />
+    <owl:inverseOf rdf:resource="http://www.openarchives.org/ore/terms/describes" />
+    <rdfs:isDefinedBy rdf:resource="http://www.openarchives.org/ore/terms/"/>
+  </rdf:Property>
+
+  <rdf:Property rdf:about="http://www.openarchives.org/ore/terms/lineage">
+    <rdfs:label>Lineage</rdfs:label>
+    <rdfs:comment>ore:lineage is a relationship between two Proxy objects, both of which MUST have the same Resource for which they are proxies. The meaning is that the Resource for which the subject of the relationship is a Proxy was discovered in the Aggregation in which the object Proxy's resource is aggregated.</rdfs:comment>
+    <rdfs:domain rdf:resource="http://www.openarchives.org/ore/terms/Proxy" />
+    <rdfs:range rdf:resource="http://www.openarchives.org/ore/terms/Proxy" />
+    <rdfs:isDefinedBy rdf:resource="http://www.openarchives.org/ore/terms/"/>
+  </rdf:Property>
+
+  <rdf:Property rdf:about="http://www.openarchives.org/ore/terms/proxyFor">
+    <rdfs:label>Proxy For</rdfs:label>
+    <rdfs:comment>Proxy objects are used to represent a Resource as it is aggregated in a particular Aggregation. The ore:proxyFor relationship is used to link the proxy to the Aggregated Resource it is a proxy for. The subject of the relationship is a Proxy object, and the object of the relationship is the Aggregated Resource.</rdfs:comment>
+    <rdfs:domain rdf:resource="http://www.openarchives.org/ore/terms/Proxy" />
+    <rdfs:range rdf:resource="http://www.openarchives.org/ore/terms/AggregatedResource" />
+    <rdfs:isDefinedBy rdf:resource="http://www.openarchives.org/ore/terms/"/>
+  </rdf:Property>
+
+  <rdf:Property rdf:about="http://www.openarchives.org/ore/terms/proxyIn">
+    <rdfs:label>Proxy In</rdfs:label>
+    <rdfs:comment>Proxy objects must link to the Aggregation in which the resource being proxied is aggregated. The ore:proxyIn relationship is used for this purpose. The subject of the relationship is a Proxy object, and the object of the relationship is the Aggregation.</rdfs:comment>
+    <rdfs:domain rdf:resource="http://www.openarchives.org/ore/terms/Proxy" />
+    <rdfs:range rdf:resource="http://www.openarchives.org/ore/terms/Aggregation" />
+    <rdfs:isDefinedBy rdf:resource="http://www.openarchives.org/ore/terms/"/>
+  </rdf:Property>
+
+  <rdf:Property rdf:about="http://www.openarchives.org/ore/terms/similarTo">
+    <rdfs:label>Similar To</rdfs:label>
+    <rdfs:comment>The subject of this relationship MUST be an Aggregation.  This Aggregation should be considered an expression within the ORE context of the object of the relationship, as it is broadly equivalent to the resource. For example, the Aggregation may consist of the resources which, together, make up a journal article which has a DOI assigned to it. The Aggregation is not the article to which the DOI was assigned, but is a representation of it in some manner.</rdfs:comment>
+    <rdfs:domain rdf:resource="http://www.openarchives.org/ore/terms/Aggregation" />
+    <rdfs:isDefinedBy rdf:resource="http://www.openarchives.org/ore/terms/"/>
+  </rdf:Property>
+
+</rdf:RDF>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/wf4ever.owl
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/wf4ever.owl b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/wf4ever.owl
new file mode 100644
index 0000000..ef15a62
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/wf4ever.owl
@@ -0,0 +1,130 @@
+<?xml version="1.0"?>
+
+
+<!DOCTYPE rdf:RDF [
+    <!ENTITY ro "http://purl.org/wf4ever/ro#" >
+    <!ENTITY wfdesc "http://purl.org/wf4ever/wfdesc#" >
+    <!ENTITY wf4ever "http://purl.org/wf4ever/wf4ever#" >
+    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
+    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
+    <!ENTITY terms "http://www.openarchives.org/ore/terms/" >
+    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
+]>
+
+
+<rdf:RDF xmlns="http://www.w3.org/2002/07/owl#"
+     xml:base="http://www.w3.org/2002/07/owl"
+     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+     xmlns:ro="http://purl.org/wf4ever/ro#"
+     xmlns:wfdesc="http://purl.org/wf4ever/wfdesc#"
+     xmlns:terms="http://www.openarchives.org/ore/terms/"
+     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
+     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+     xmlns:wf4ever="http://purl.org/wf4ever/wf4ever#">
+    <Ontology rdf:about="http://purl.org/wf4ever/wf4ever">
+        <rdfs:comment xml:lang="en">The wf4ever ontology. This is based on the wf4ever ontologies ro, wf and wfprov - but adds custom classes like wf4ever:Image and wf4ever:WebServiceProcess</rdfs:comment>
+        <imports rdf:resource="http://purl.org/wf4ever/ro"/>
+        <imports rdf:resource="http://purl.org/wf4ever/wfdesc"/>
+        <imports rdf:resource="http://purl.org/wf4ever/wfprov"/>
+        <versionInfo rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0.1.1</versionInfo>
+        <versionIRI rdf:resource="https://raw.github.com/wf4ever/ro/0.1.1/wf4ever.owl"/>
+    </Ontology>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Annotation properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Datatypes
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Classes
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://purl.org/wf4ever/wf4ever#Dataset -->
+
+    <Class rdf:about="&wf4ever;Dataset">
+        <rdfs:subClassOf rdf:resource="&wfdesc;Artifact"/>
+    </Class>
+    
+
+
+    <!-- http://purl.org/wf4ever/wf4ever#Document -->
+
+    <Class rdf:about="&wf4ever;Document">
+        <rdfs:subClassOf rdf:resource="&wfdesc;Artifact"/>
+    </Class>
+    
+
+
+    <!-- http://purl.org/wf4ever/wf4ever#File -->
+
+    <Class rdf:about="&wf4ever;File">
+        <rdfs:subClassOf rdf:resource="&wfdesc;Artifact"/>
+    </Class>
+    
+
+
+    <!-- http://purl.org/wf4ever/wf4ever#Image -->
+
+    <Class rdf:about="&wf4ever;Image">
+        <rdfs:subClassOf rdf:resource="&wfdesc;Artifact"/>
+    </Class>
+    
+
+
+    <!-- http://purl.org/wf4ever/wf4ever#WebServiceProcess -->
+
+    <Class rdf:about="&wf4ever;WebServiceProcess">
+        <rdfs:subClassOf rdf:resource="&wfdesc;Process"/>
+        <rdfs:comment>WebServiceProcess is a wfdesc:Process description, the enactment of which gives rise to a web service call.</rdfs:comment>
+    </Class>
+    
+
+
+    <!-- http://purl.org/wf4ever/wf4ever#WorkflowResearchObject -->
+
+    <Class rdf:about="&wf4ever;WorkflowResearchObject">
+        <equivalentClass>
+            <Class>
+                <intersectionOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="&ro;ResearchObject"/>
+                    <Restriction>
+                        <onProperty rdf:resource="&terms;aggregates"/>
+                        <someValuesFrom rdf:resource="&wfdesc;Workflow"/>
+                    </Restriction>
+                </intersectionOf>
+            </Class>
+        </equivalentClass>
+        <rdfs:comment>A workflow research object is a research object that contains at least one workflow description.</rdfs:comment>
+    </Class>
+</rdf:RDF>
+
+
+
+<!-- Generated by the OWL API (version 3.2.3.1824) http://owlapi.sourceforge.net -->
+

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/wfdesc.owl
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/wfdesc.owl b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/wfdesc.owl
new file mode 100644
index 0000000..fed894d
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/wfdesc.owl
@@ -0,0 +1,192 @@
+<?xml version="1.0"?>
+
+<rdf:RDF xmlns="http://www.w3.org/2000/01/rdf-schema#"
+    xmlns:owl="http://www.w3.org/2002/07/owl#"
+    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
+
+    <owl:Ontology rdf:about="http://purl.org/wf4ever/wfdesc">
+        <comment xml:lang="en">This ontology ("wfdesc") describes an abstract workflow description structure, which on the top level is defined as a wfdesc:Workflow. 
+
+A wfdesc:Workflow contains several wfdesc:Process instances, associated using the wfdesc:hasSubProcess property. Each of these (and the workflow itself) wfdesc:hasInput and wfdesc:hasOutput some wfdesc:Parameter (wfdesc:Input or wfdesc:Output). An wfdesc:Artifact is associated with a wfdesc:Parameter using wfdesc:hasArtifact. The wfdesc:Workflow also wfdesc:hasDataLink several wfdesc:DataLink instances, which forms the connection between parameters.
+
+Thus this ontology allows the description a direct acyclic graph, or a dataflow. 
+
+This ontology is meant as an upper ontology for more specific workflow definitions, and as a way to express abstract workflows. The wfprov ontology shows how to link these descriptions to a provenance trace of a workflow execution.</comment>
+        <owl:versionInfo rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0.1.1</owl:versionInfo>
+        <owl:versionIRI rdf:resource="https://raw.github.com/wf4ever/ro/0.1.1/wfdesc.owl"/>
+    </owl:Ontology>
+
+    <owl:Class rdf:about="http://purl.org/wf4ever/wfdesc#Artifact">
+        <comment xml:lang="en">wfdesc:Artifact is used to provide information about a class of artifacts. For example, it can be used to specify the datatype of a dataset or the structure of a document.
+
+An wfdesc:Artifact is associated with a wfdesc:Parameter using wfdesc:hasArtifact.
+
+The distinction between a parameter and artifact is that the parameter can be customized to describe the particular role the artifact plays with regards to the process (and can be linked using wfdesc:DataLink) - while the wfdesc:Artifact can describe the syntactic and semantic datatype.</comment>
+    </owl:Class>
+
+    <owl:Class rdf:about="http://purl.org/wf4ever/wfdesc#DataLink">
+        <comment xml:lang="en">wfdesc:DataLink is used to represent data dependencies between wfdesc:Process descriptions. It means that the artifact generated at an wfdesc:Output (identified using wfdesc:hasSource) will be used by a wfdescInput (identified using wfdesc:hasSink).
+
+The wfdesc:Processes that owns the wfdesc:Parameter instances which are the source and sink of a wfdesc:DataLink must be wfdesc:hasSubProcess of a the same wfdesc:Workflow which wfdesc:hasDataLink the data link, or be be parameters of that same workflow.
+
+Thus links can only be made within a wfdesc:Workflow - although ports owned by the workflow itself appear both inside and outside the workflow (in opposite roles).</comment>
+    </owl:Class>
+
+    <owl:Class rdf:about="http://purl.org/wf4ever/wfdesc#Input">
+        <comment xml:lang="en">wfdesc:Input represents an input parameter to a wfdesc:Process. This can be compared to a function parameter, command line argument, files read, or parameter set by a user interface.
+
+It is out of scope of wfdesc to define the nature or classification of the parameter, such as giving it a name, position or data type. This can be done with subclasses and/or subproperties.</comment>
+        <subClassOf rdf:resource="http://purl.org/wf4ever/wfdesc#Parameter"/>
+    </owl:Class>
+
+    <owl:Class rdf:about="http://purl.org/wf4ever/wfdesc#Output">
+        <comment xml:lang="en">wfdesc:Output represents an output parameter from a wfdesc:Process. This can be compared to functional return values, stdout/stdin, files written, or results shown in a user interface.
+
+It is out of scope of wfdesc to define the nature or classification of the parameter, such as giving it a name, position or data type. This can be done with subclasses and/or subproperties.</comment>
+        <subClassOf rdf:resource="http://purl.org/wf4ever/wfdesc#Parameter"/>
+    </owl:Class>
+
+    <owl:Class rdf:about="http://purl.org/wf4ever/wfdesc#Parameter">
+        <comment xml:lang="en">This class represent a parameter of a wfdesc:Process. A wfdesc:Parameter must be a wfdesc:Input, a wfdesc:Output, or both. 
+
+A parameter is both an wfdesc:Input and wfdesc:Output when it is used on both sides of a subworkflow - see wfdesc:Workflow and wfdesc:DataLink for details.</comment>
+        <owl:equivalentClass rdf:parseType="Resource">
+            <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+            <owl:unionOf rdf:parseType="Resource">
+                <rdf:first rdf:resource="http://purl.org/wf4ever/wfdesc#Input"/>
+                <rdf:rest rdf:parseType="Resource">
+                    <rdf:first rdf:resource="http://purl.org/wf4ever/wfdesc#Output"/>
+                    <rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>
+                </rdf:rest>
+            </owl:unionOf>
+        </owl:equivalentClass>
+    </owl:Class>
+
+    <owl:Class rdf:about="http://purl.org/wf4ever/wfdesc#Process">
+        <comment xml:lang="en">A wfdesc:Process is used to describe a class of actions that when enacted give rise to processes. A process can have 0 or more wfdesc:Parameter instances associated using wfdesc:hasInput and wfdesc:hasOutput, signifying what kind of parameters the process will require and return.
+
+It is out of scope for wfdesc to classify or specify the nature of the process, this should be done by subclassing and additional subproperties, for instance ex:perlScript or ex:restServiceURI</comment>
+    </owl:Class>
+
+    <owl:Class rdf:about="http://purl.org/wf4ever/wfdesc#Workflow">
+        <comment xml:lang="en">A wfdesc:Workflow is a directed graph in which the nodes are wfdesc:Process instances and the edges (wfdesc:DataLink instances) represent data dependencies between the constituent wfdesc:Process descriptions.
+
+A wfdesc:Workflow defines associated wfdesc:Process using wfdesc:hasSubProcess. A specialisation of this property is wfdesc:hasSubWorkflow, signifying that the process is a wfdesc:Workflow itself, which is further described in a similar fashion.
+
+As a subclass of wfdesc:Process a wfdesc:Workflow can also define wfdesc:hasInput/wfdesc:hasOutput parameters - these would be inputs taken at workflow execution time, and final outputs of the workflow. (Note: Not all dataflow systems have this concept of workflow parameters)
+
+wfdesc:Parameter descriptions are linked using wfdesc:DataLink descriptions associated with the wfdesc:Workflow using wfdesc:hasDataLink.
+
+A wfdesc:Parameter defined with wfdesc:hasInput on a wfdesc:Workflow is considered an wfdesc:Input "outside" the workflow (ie. if it is a subworkflow), but an wfdesc:Output "inside" the workflow (where it can be connected to a wfdesc:Input of a wfdesc:Process). Thus such parameters can be linked "through" the workflow without having a "mirrored" port inside.
+
+
+Example:
+##
+@prefix wfdesc: &#60;http://purl.org/wf4ever/wfdesc#&#62; .
+:outerWorkflow a wfdesc:Workflow ;
+  wfdesc:hasSubWorkflow :innerWorkflow ;
+  wfdesc:hasSubProcess :procA, :procC .
+
+:procA a wfdesc:Process ;
+  wfdesc:hasOutput :param1 .
+
+:procC a wfdesc:Process ;
+  wfdesc:hasInput :param2 ;
+  wfdesc:hasOutput :param3 .
+
+
+:innerWorkflow a wfdesc:Workflow ;
+  wfdesc:hasInput :param4 ;
+  wfdesc:hasOutput :param5 ;
+  wfdesc:hasProcess :procB .
+
+:procB a wfdesc:Process ;
+  wfdesc:hasInput :param6 ;
+  wfdesc:hasOutput :param7 .
+
+:innerWorkflow wfdesc:hasDataLink 
+   [ wfdesc:hasSource :param4; wfdesc:hasSink :param6 ], 
+   [ wfdesc:hasSource :param7; wfdesc:hasSink :param5 ] .
+
+:outerWorkflow wfdesc:hasDataLink
+  [ wfdesc:hasSource :param1; wfdesc:hasSink :param4 ],
+  [ wfdesc:hasSource :param5; wfdesc:hasSink :param2 ] .
+
+##
+
+
+In this example :param1 is the output of :procA. :param1 is the source in a datalink that goes to the input :param4 of the :innerWorkflow. :param4 is however also the source of an inner datalink, going to input :param6 of the nested :procB.
+
+From this :param4 is both an wfdesc:Input and wfdesc:Output (which is why these two classes are not disjoint)</comment>
+        <subClassOf rdf:resource="http://purl.org/wf4ever/wfdesc#Process"/>
+    </owl:Class>
+
+    <owl:Class rdf:about="http://purl.org/wf4ever/wfdesc#WorkflowInstance">
+        <comment xml:lang="en">A wfdesc:WorkflowInstance is a specialisation of a wfdesc:Workflow description which defines all data/parameters/settings that are required to form a wfprov:WorkflowRun.</comment>
+        <subClassOf rdf:resource="http://purl.org/wf4ever/wfdesc#Workflow"/>
+    </owl:Class>
+
+    <owl:ObjectProperty rdf:about="http://purl.org/wf4ever/wfdesc#hasArtifact">
+        <comment xml:lang="en">This property associates a wfdesc:Parameter with an wfdesc:Artifact which can describe the artifact which would be used/generated on execution of the workflow.</comment>
+        <domain rdf:resource="http://purl.org/wf4ever/wfdesc#Parameter"/>
+        <range rdf:resource="http://purl.org/wf4ever/wfdesc#Artifact"/>
+        <subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topObjectProperty"/>
+    </owl:ObjectProperty>
+
+    <owl:ObjectProperty rdf:about="http://purl.org/wf4ever/wfdesc#hasDataLink">
+        <comment xml:lang="en">This property is used to specify the wfdesc:DataLink instances of a given wfdesc:Workflow.</comment>
+        <domain rdf:resource="http://purl.org/wf4ever/wfdesc#Workflow"/>
+        <range rdf:resource="http://purl.org/wf4ever/wfdesc#DataLink"/>
+        <subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topObjectProperty"/>
+    </owl:ObjectProperty>
+
+    <owl:ObjectProperty rdf:about="http://purl.org/wf4ever/wfdesc#hasInput">
+        <comment xml:lang="en">This object property is used to specify the wfdesc:Input parameter of a given wfdesc:Process.</comment>
+        <domain rdf:resource="http://purl.org/wf4ever/wfdesc#Process"/>
+        <range rdf:resource="http://purl.org/wf4ever/wfdesc#Input"/>
+    </owl:ObjectProperty>
+
+    <owl:ObjectProperty rdf:about="http://purl.org/wf4ever/wfdesc#hasOutput">
+        <comment xml:lang="en">This object property is used to specify the wfdesc:Output parameter of a given wfdesc:Process.
+</comment>
+        <domain rdf:resource="http://purl.org/wf4ever/wfdesc#Process"/>
+        <range rdf:resource="http://purl.org/wf4ever/wfdesc#Output"/>
+    </owl:ObjectProperty>
+
+    <owl:ObjectProperty rdf:about="http://purl.org/wf4ever/wfdesc#hasSink">
+        <comment xml:lang="en">This property is used to specify the wfdesc:Input parameter that acts as a sink from a given wfdesc:DataLink, consuming data from the link.</comment>
+        <domain rdf:resource="http://purl.org/wf4ever/wfdesc#DataLink"/>
+        <range rdf:resource="http://purl.org/wf4ever/wfdesc#Input"/>
+        <subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topObjectProperty"/>
+    </owl:ObjectProperty>
+
+    <owl:ObjectProperty rdf:about="http://purl.org/wf4ever/wfdesc#hasSource">
+        <comment xml:lang="en">This property is used to specify the wfdesc:Output parameter that acts as a source to a given wfdesc:DataLink, providing data into the link.</comment>
+        <domain rdf:resource="http://purl.org/wf4ever/wfdesc#DataLink"/>
+        <range rdf:resource="http://purl.org/wf4ever/wfdesc#Output"/>
+        <subPropertyOf rdf:resource="http://www.w3.org/2002/07/owl#topObjectProperty"/>
+    </owl:ObjectProperty>
+
+    <owl:ObjectProperty rdf:about="http://purl.org/wf4ever/wfdesc#hasSubProcess">
+        <comment xml:lang="en">This object property is used to specify that the given workflow  contains the given process as part of its definition.
+
+Although not a requirement, such sub processes should have wfdesc:DataLink within the containing workflow connecting their parameters with parameters of the containing workflow, or with parameters other contained wfdesc:Process instances.
+
+A specialialisation of sub process is wfdesc:hasSubWorkflow where the sub process is a nested wfdesc:Workflow.</comment>
+        <domain rdf:resource="http://purl.org/wf4ever/wfdesc#Workflow"/>
+        <range rdf:resource="http://purl.org/wf4ever/wfdesc#Process"/>
+    </owl:ObjectProperty>
+
+    <owl:ObjectProperty rdf:about="http://purl.org/wf4ever/wfdesc#hasSubWorkflow">
+        <comment xml:lang="en">This object property is used to associate a wfdesc:Workflow description to another wfdesc:Workflow, specifying that the first workflow has the given sub-workflow as a contained process. 
+
+This is a specialisation of wfdesc:hasSubProcess.</comment>
+        <domain rdf:resource="http://purl.org/wf4ever/wfdesc#Workflow"/>
+        <range rdf:resource="http://purl.org/wf4ever/wfdesc#Workflow"/>
+        <subPropertyOf rdf:resource="http://purl.org/wf4ever/wfdesc#hasSubProcess"/>
+    </owl:ObjectProperty>
+
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/2000/01/rdf-schema#comment">
+    </owl:AnnotationProperty>
+</rdf:RDF>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/wfprov.owl
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/wfprov.owl b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/wfprov.owl
new file mode 100644
index 0000000..e0a7f4c
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/wfprov.owl
@@ -0,0 +1,212 @@
+<?xml version="1.0"?>
+
+
+<!DOCTYPE rdf:RDF [
+    <!ENTITY foaf "http://xmlns.com/foaf/0.1/" >
+    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
+    <!ENTITY wfprov "http://purl.org/wf4ever/wfprov#" >
+    <!ENTITY wfdesc "http://purl.org/wf4ever/wfdesc#" >
+    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
+    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
+    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
+]>
+
+
+<rdf:RDF xmlns="http://www.w3.org/2000/01/rdf-schema#"
+     xml:base="http://www.w3.org/2000/01/rdf-schema"
+     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+     xmlns:foaf="http://xmlns.com/foaf/0.1/"
+     xmlns:wfdesc="http://purl.org/wf4ever/wfdesc#"
+     xmlns:wfprov="http://purl.org/wf4ever/wfprov#"
+     xmlns:owl="http://www.w3.org/2002/07/owl#"
+     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
+     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+    <owl:Ontology rdf:about="http://purl.org/wf4ever/wfprov">
+        <comment xml:lang="en">The wfprov ontology shows how to express minimal provenance information about the execution of a workflow described using the wf ontology. 
+
+Here the concern is mainly the provenance which affects the research object, so in particular how some ro:Resource&#39;s might have been generated or used by the execution of a wfdesc:Workflow.
+
+The main class here is a wfprov:WorkflowRun which shows how wfprov:Artifact instances (the data) wfprov:wasOutputFrom a wfprov:ProcessRun for generated artifacts, or wfprov:usedInput for consumed artifacts. The WorkflowRun is also a ProcessRun, and so the overall inputs and outputs of thw workflow execution can be described in the same manner.
+
+These provenance details are linked to the corresponding wfdesc descriptions using wfdesc:describedbyProcess, wfdesc:describedByWorkflow and wfdesc:describedByParameter.
+
+
+This ontology can be further linked to more specific provenance ontologies like OPM-V or W3C PROV-O, but this should be done separately.</comment>
+        <seeAlso rdf:resource="http://purl.org/wf4ever/ro"/>
+        <owl:imports rdf:resource="http://purl.org/wf4ever/wfdesc"/>
+        <owl:imports rdf:resource="http://xmlns.com/foaf/0.1/"/>
+        <owl:versionInfo rdf:datatype="&xsd;string">0.1.1</owl:versionInfo>
+        <owl:versionIRI rdf:resource="https://raw.github.com/wf4ever/ro/0.1.1/wfprov.owl"/>
+    </owl:Ontology>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Annotation properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Datatypes
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Object Properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://purl.org/wf4ever/wfprov#describedByParameter -->
+
+    <owl:ObjectProperty rdf:about="&wfprov;describedByParameter">
+        <comment xml:lang="en">This object property is used to associate a wfprov:Artifact to the wfdesc:Parameter description.</comment>
+        <range rdf:resource="&wfdesc;Parameter"/>
+        <domain rdf:resource="&wfprov;Artifact"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/wf4ever/wfprov#describedByProcess -->
+
+    <owl:ObjectProperty rdf:about="&wfprov;describedByProcess">
+        <comment xml:lang="en">This object property associate a wfprov:Processrun to its wfdesc:Process description .</comment>
+        <range rdf:resource="&wfdesc;Process"/>
+        <domain rdf:resource="&wfprov;ProcessRun"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/wf4ever/wfprov#describedByWorkflow -->
+
+    <owl:ObjectProperty rdf:about="&wfprov;describedByWorkflow">
+        <comment xml:lang="en">This property associates a wfprov:WorkflowRun to its corresponding wfdesc:Workflow description.</comment>
+        <range rdf:resource="&wfdesc;WorkflowTemplate"/>
+        <domain rdf:resource="&wfprov;WorkflowRun"/>
+        <subPropertyOf rdf:resource="&wfprov;describedByProcess"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/wf4ever/wfprov#usedInput -->
+
+    <owl:ObjectProperty rdf:about="&wfprov;usedInput">
+        <comment xml:lang="en">This property specifies that a wfprov:ProcessRun used an wfprov:Artifact as an input</comment>
+        <range rdf:resource="&wfprov;Artifact"/>
+        <domain rdf:resource="&wfprov;ProcessRun"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/wf4ever/wfprov#wasEnactedBy -->
+
+    <owl:ObjectProperty rdf:about="&wfprov;wasEnactedBy">
+        <comment xml:lang="en">wfprov:wasEnactedBy associates a wfprov:ProcessRun with a wfprov:WorkflowEngine, specifying that the execution of the process was enacted by the engine.</comment>
+        <domain rdf:resource="&wfprov;ProcessRun"/>
+        <range rdf:resource="&wfprov;WorkflowEngine"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/wf4ever/wfprov#wasOutputFrom -->
+
+    <owl:ObjectProperty rdf:about="&wfprov;wasOutputFrom">
+        <comment xml:lang="en">This property specifies that a wfprov:Artifact was generated as an output from a wfprov:ProcessRun</comment>
+        <domain rdf:resource="&wfprov;Artifact"/>
+        <range rdf:resource="&wfprov;ProcessRun"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/wf4ever/wfprov#wasPartOfWorkflowRun -->
+
+    <owl:ObjectProperty rdf:about="&wfprov;wasPartOfWorkflowRun">
+        <comment xml:lang="en">This property specifies that a wfprov:ProcessRun was executed as part of a wfprov:WorkflowRun. This typically corresponds to wfdesc:hasSubProcess in the workflow description.</comment>
+        <domain rdf:resource="&wfprov;ProcessRun"/>
+        <range rdf:resource="&wfprov;WorkflowRun"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Classes
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://purl.org/wf4ever/wfprov#Artifact -->
+
+    <owl:Class rdf:about="&wfprov;Artifact">
+        <comment xml:lang="en">Artifact is a general concept that represents immutable piece of state, which may have a physical embodiment in a physical object, or a digital representation in a computer system. In the case of wfprov, an artifact is used as input to a process run, or produced by the output of a process run.</comment>
+        <seeAlso rdf:resource="http://purl.org/wf4ever/ro#ResearchObject"/>
+        <seeAlso rdf:resource="http://purl.org/wf4ever/ro#Resource"/>
+        <seeAlso rdf:resource="&wfprov;ProcessRun"/>
+        <seeAlso rdf:resource="&wfprov;usedInput"/>
+        <seeAlso rdf:resource="&wfprov;wasOutputFrom"/>
+        <seeAlso rdf:resource="&wfprov;workflowRun"/>
+    </owl:Class>
+    
+
+
+    <!-- http://purl.org/wf4ever/wfprov#ProcessRun -->
+
+    <owl:Class rdf:about="&wfprov;ProcessRun">
+        <comment xml:lang="en">A process run is a particular execution of a wfdesc:Process description (wfprov:describedByProcess), which can wfprov:usedInput some wfprov:Artifact instances, and produce new artifacts (wfprov:wasOutputFrom). A wfprov:WorkflowRun is a specialisation of this class.</comment>
+        <seeAlso rdf:resource="&wfdesc;Process"/>
+        <seeAlso rdf:resource="&wfprov;Artifact"/>
+        <seeAlso rdf:resource="&wfprov;WorkflowRun"/>
+        <seeAlso rdf:resource="&wfprov;describedByProcess"/>
+        <seeAlso rdf:resource="&wfprov;usedInput"/>
+        <seeAlso rdf:resource="&wfprov;wasOutputFrom"/>
+    </owl:Class>
+    
+
+
+    <!-- http://purl.org/wf4ever/wfprov#WorkflowEngine -->
+
+    <owl:Class rdf:about="&wfprov;WorkflowEngine">
+        <subClassOf rdf:resource="&foaf;Agent"/>
+        <comment xml:lang="en">A workflow engine is an foaf:Agent that is responsible for enacting a workflow definition (which could be described in a wfdesc:Workflow). The result of workflow enactment gives rise to a wfprov:WorkflowRun.</comment>
+        <seeAlso rdf:resource="&wfdesc;Workflow"/>
+        <seeAlso rdf:resource="&wfprov;WorkflowRun"/>
+    </owl:Class>
+    
+
+
+    <!-- http://purl.org/wf4ever/wfprov#WorkflowRun -->
+
+    <owl:Class rdf:about="&wfprov;WorkflowRun">
+        <subClassOf rdf:resource="&wfprov;ProcessRun"/>
+        <comment xml:lang="en">A workflow run is a wfprov:ProcessRun which have been enacted by a wfprov:WorkflowEngine, according to a workflow definition (which could be wfdesc:describedByWorkflow a wfdesc:Workflow). Such a process typically contains several subprocesses (wfprov:wasPartOfWorkflowRun) corresponding to wfdesc:Process descriptions</comment>
+        <seeAlso rdf:resource="&wfdesc;Process"/>
+        <seeAlso rdf:resource="&wfdesc;Workflow"/>
+        <seeAlso rdf:resource="&wfprov;WorkflowEngine"/>
+    </owl:Class>
+</rdf:RDF>
+
+
+
+<!-- Generated by the OWL API (version 3.2.3.1824) http://owlapi.sourceforge.net -->
+

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/test/java/org/purl/wf4ever/provtaverna/owl/TestProvModel.java
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/test/java/org/purl/wf4ever/provtaverna/owl/TestProvModel.java b/taverna-prov-owl-bindings/src/test/java/org/purl/wf4ever/provtaverna/owl/TestProvModel.java
new file mode 100644
index 0000000..167b577
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/test/java/org/purl/wf4ever/provtaverna/owl/TestProvModel.java
@@ -0,0 +1,38 @@
+package org.purl.wf4ever.provtaverna.owl;
+import static org.junit.Assert.assertEquals;
+
+import java.net.URI;
+import java.util.UUID;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import com.hp.hpl.jena.ontology.Individual;
+
+
+public class TestProvModel {
+
+    private ProvModel provModel;
+
+    @Before
+    public void provModel() {
+        provModel = new ProvModel();
+    }
+    
+    @Test
+    public void createBundle() throws Exception {
+        Individual bundle = provModel.createBundle(uuid());
+        assertEquals("Bundle", bundle.getOntClass().getLocalName());
+        
+    }
+
+    private URI uuid() {
+        return URI.create("urn:uuid:" + UUID.randomUUID());
+    }
+    
+    @Test
+    public void createEntity() throws Exception {
+        Individual ent = provModel.createEntity(URI.create("http://example.com/entity"));
+        provModel.model.write(System.out, "TURTLE");
+    }
+}


[14/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/ProvenanceAnalysis.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/ProvenanceAnalysis.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/ProvenanceAnalysis.java
new file mode 100644
index 0000000..990ca30
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/ProvenanceAnalysis.java
@@ -0,0 +1,1200 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.provenance.lineageservice;
+
+import java.io.IOException;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import net.sf.taverna.t2.invocation.InvocationContext;
+import net.sf.taverna.t2.provenance.api.NativeAnswer;
+import net.sf.taverna.t2.provenance.api.QueryAnswer;
+import net.sf.taverna.t2.provenance.lineageservice.utils.DataLink;
+import net.sf.taverna.t2.provenance.lineageservice.utils.Port;
+import net.sf.taverna.t2.provenance.lineageservice.utils.PortBinding;
+import net.sf.taverna.t2.provenance.lineageservice.utils.ProvenanceProcessor;
+import net.sf.taverna.t2.provenance.lineageservice.utils.QueryPort;
+import net.sf.taverna.t2.provenance.lineageservice.utils.WorkflowRun;
+import net.sf.taverna.t2.provenance.opm.OPMManager;
+import net.sf.taverna.t2.reference.T2Reference;
+
+import org.apache.log4j.Logger;
+import org.tupeloproject.kernel.OperatorException;
+import org.tupeloproject.provenance.ProvenanceArtifact;
+import org.tupeloproject.provenance.ProvenanceException;
+import org.tupeloproject.provenance.ProvenanceRole;
+
+/**
+ * The main class for querying the lineage DB.
+ * Assumes a provenance DB ready to be queried.
+ * @author paolo
+ */
+public class ProvenanceAnalysis {
+
+	private static Logger logger = Logger.getLogger(ProvenanceAnalysis.class);
+
+	private static final String OUTPUT_CONTAINER_PROCESSOR = "_OUTPUT_";
+	public static final String ALL_PATHS_KEYWORD = "ALL";
+
+	private ProvenanceQuery pq = null;
+	private AnnotationsLoader al = new AnnotationsLoader();  // FIXME singleton
+
+	// paths collected by lineageQuery and to be used by naive provenance query
+	private Map<ProvenanceProcessor, List<List<String>>> validPaths = new HashMap<>();
+
+	private List<String> currentPath;
+	private Map<String,List<String>> annotations = null;  // user-made annotations to processors
+
+	private boolean ready = false; // set to true as soon as init succeeds. this means pa is ready to answer queries
+
+	private boolean returnOutputs = false; // by default only return input bindings
+
+	private boolean includeDataValue = false; // forces the lineage queries to return de-referenced data values
+
+	private boolean generateOPMGraph = true;
+
+	// TODO extract this to prefs -- selects which OPMManager is to be used to export to OPM
+	private String OPMManagerClass = "net.sf.taverna.t2.provenance.lineageservice.ext.pc3.PANSTARRSOPMManager";
+
+	private OPMManager aOPMManager = null;
+
+	private boolean recordArtifactValues = false;
+
+	private InvocationContext ic = null;
+
+	public ProvenanceAnalysis() {
+	}
+
+	public ProvenanceAnalysis(ProvenanceQuery pq)
+			throws InstantiationException, IllegalAccessException,
+			ClassNotFoundException, SQLException {
+		this.pq = pq;
+		setReady(tryInit());
+	}
+
+	private boolean tryInit() throws SQLException {
+		List<?> wris = getWorkflowRunIds();
+		if (wris != null && !wris.isEmpty()) {
+			initGraph(); // init OPM provenance graph
+			return true;
+		} else
+			return false;
+	}
+
+	/**
+	 * Call to create the opm graph and annotation loader. this may fail due to
+	 * queries being issued before DB is populated, minimally with workflowRunId
+	 */
+	public void initGraph() {
+		// OPM management
+		try {
+			aOPMManager  = (OPMManager) Class.forName(OPMManagerClass).newInstance();
+		} catch (InstantiationException e1) {
+			logger.error("Problem initialising opm graph: ",  e1);
+		} catch (IllegalAccessException e1) {
+			logger.error("Problem initialising opm graph: ", e1);
+		} catch (ClassNotFoundException e1) {
+			logger.info("chosen OPMmanager: "+OPMManagerClass+" not available, reverting to default");
+			aOPMManager  = new OPMManager();
+		}
+
+		try {
+			aOPMManager.createAccount(getWorkflowRunIds().get(0).getWorkflowRunId());
+		} catch (SQLException e) {
+			logger.error("Could not initialise OPM Manager: ", e);
+		} catch (ProvenanceException e) {
+			logger.warn("Could not add account", e);
+		}
+	}
+
+
+	/**
+	 * asks the OPM manager to convert its current RDF OPMGraph to XML 
+	 * @return the filename of the OPM XML file
+	 * @throws OperatorException
+	 * @throws IOException
+	 * @throws JAXBException
+	 */
+	//	public String OPMRdf2Xml() throws OperatorException, IOException, JAXBException {
+	//	if (isReady()) {
+	//	return aOPMManager.Rdf2Xml();
+	//	}  
+	//	return null;
+	//	}
+
+	/**
+	 * asks the OPM manager to create a dot file representing its current RDF OPMGraph<br/>
+	 * needs fixing
+	 * @return
+	 * @throws IOException 
+	 * @throws OperatorException 
+	 */
+	/*
+	public String OPMRdf2Dot() throws OperatorException, IOException {
+		if (aOPMManager != null && aOPMManager.isActive() && isReady()) {
+			return aOPMManager.Rdf2Dot();
+		}  
+		return null;		
+	}
+	 */
+
+	public void setAnnotationFile(String annotationFile) {
+		annotations = al.getAnnotations(annotationFile);
+		if (annotations == null) {
+			logger.warn("no annotations have been loaded");
+			return;
+		}
+
+		logger.info("processor annotations for lineage refinement: ");
+		for (Map.Entry<String, List<String>> entry : annotations.entrySet()) {
+			logger.info("annotations for proc " + entry.getKey());
+			for (String ann : entry.getValue())
+				logger.info(ann);
+		}
+	}
+
+	/**
+	 * returns all available instances across all workflows
+	 * 
+	 * @return
+	 * @throws SQLException
+	 */
+	public List<WorkflowRun> getWorkflowRunIds() throws SQLException {
+		return getPq().getRuns(null, null);
+	}
+
+	/**
+	 * returns all available instances for workflow workflowId
+	 * 
+	 * @param workflowId
+	 * @return
+	 * @throws SQLException
+	 */
+	public List<WorkflowRun> getWorkflowRunsForWorkflow(String workflowId)
+			throws SQLException {
+		return getPq().getRuns(workflowId, null);
+	}
+
+	/**
+	 * @param workflowRun
+	 *            lineage scope -- a specific instance
+	 * @param pname
+	 *            for a specific processor [required]
+	 * @param a
+	 *            specific (input or output) variable [optional]
+	 * @param iteration
+	 *            and a specific iteration [optional]
+	 * @param workflowId
+	 * @return a lineage query ready to be executed, or null if we cannot return
+	 *         an answer because we are not ready (for instance the DB is not
+	 *         yet populated)
+	 * @throws SQLException
+	 */
+	public Dependencies fetchIntermediateResult(String workflowRun,
+			String workflowId, String pname, String vname, String iteration)
+			throws SQLException {
+		if (!isReady()) {
+			setReady(tryInit());
+			if (!isReady())
+				return null;
+		}
+
+		LineageSQLQuery lq = getPq().simpleLineageQuery(workflowRun,
+				workflowId, pname, vname, iteration);
+
+		return getPq().runLineageQuery(lq, isIncludeDataValue());
+	}
+
+	public QueryAnswer lineageQuery(List<QueryPort> qvList, String workflowRun,
+			List<ProvenanceProcessor> selectedProcessors) throws SQLException {
+		QueryAnswer completeAnswer = new QueryAnswer();
+		NativeAnswer nativeAnswer = new NativeAnswer();
+
+		Map<QueryPort, Map<String, List<Dependencies>>> answerContent = new HashMap<>();
+
+		// launch a lineage query for each target variable
+		for (QueryPort qv : qvList) {
+
+			// full lineage query			
+			logger.info(String.format(
+					"************\n lineage query: [instance, workflow, proc, port, path] = "
+							+ "[%s,%s,%s,%s,[%s]]\n***********", workflowRun,
+					qv.getWorkflowId(), qv.getProcessorName(),
+					qv.getPortName(), qv.getPath()));
+
+			// the OPM manager builds an OPM graph behind the scenes as a side-effect
+			Map<String, List<Dependencies>> a = computeLineageSingleVar(
+					workflowRun, qv.getWorkflowId(), qv.getPortName(),
+					qv.getProcessorName(), qv.getPath(), selectedProcessors);
+
+			answerContent.put(qv, a);
+		}
+
+		nativeAnswer.setAnswer(answerContent);
+		completeAnswer.setNativeAnswer(nativeAnswer);
+
+		if (aOPMManager != null && aOPMManager.isActive()) {
+			//			String _OPM_asXML_File;
+			//			try {
+
+			//			_OPM_asXML_File = aOPMManager.Rdf2Xml();
+			String _OPM_asRDF_File = aOPMManager.writeGraph();
+
+			completeAnswer.setOPMAnswer_AsRDF(_OPM_asRDF_File);
+			//			completeAnswer.setOPMAnswer_AsXML(_OPM_asXML_File);
+
+			//			} catch (OperatorException e) {
+			//			logger.error("Problem running query: " + e);
+			//			} catch (IOException e) {
+			//			logger.error("Problem running query: " + e);
+			//			} catch (JAXBException e) {
+			//			logger.error("Problem running query: " + e);
+			//			}
+		}
+		return completeAnswer;
+	}
+
+	/**
+	 * facade for computeLineage: if path == ALL then it retrieves all VBs for
+	 * (proc,var) ignoring path (i.e., all values within the collection bound to
+	 * var) and invokes computeLineageSingleBinding() on each path</br> if path
+	 * is specified, however, this just passes the request to
+	 * computeLineageSingleBinding. in this case the result map only contains
+	 * one entry
+	 * 
+	 * @param workflowRun
+	 * @param var
+	 * @param proc
+	 * @param path
+	 * @param string
+	 * @param selectedProcessors
+	 * @return a map <tt>{ path -> List&lt;LineageQueryResult&gt; }</tt>, one entry for each path
+	 * @throws SQLException
+	 */
+	public Map<String, List<Dependencies>> computeLineageSingleVar(
+			String workflowRun,   // dynamic scope 
+			String workflowId,    // static scope
+			String var,   // target var
+			String proc,   // qualified with its processor name
+			String path,   // possibly empty when no collections or no granular lineage required
+			List<ProvenanceProcessor> selectedProcessors) throws SQLException {
+		if (!isReady()) {
+			setReady(tryInit());
+			if (!isReady())
+				return null;
+		}
+
+		// are we returning all outputs in addition to the inputs?
+		logger.debug("return outputs: " + isReturnOutputs());
+
+		Map<String, List<Dependencies>> qa = new HashMap<>();
+
+		// run a query for each variable in the entire workflow graph
+		if (path.equals(ALL_PATHS_KEYWORD)) {
+			Map<String, String> vbConstraints = new HashMap<>();
+			vbConstraints.put("VB.processorNameRef", proc);
+			vbConstraints.put("VB.portName", var);
+			vbConstraints.put("VB.workflowRunId", workflowRun);
+
+			List<PortBinding> vbList = getPq().getPortBindings(vbConstraints); // DB
+
+			if (vbList.isEmpty())
+				logger.warn(ALL_PATHS_KEYWORD
+						+ " specified for paths but no varBindings found. nothing to compute");
+
+			for (PortBinding vb : vbList) {
+				// path is of the form [x,y..] we need it as x,y...
+				path = vb.getIteration().substring(1,
+						vb.getIteration().length() - 1);
+
+				List<Dependencies> result = computeLineageSingleBinding(
+						workflowRun, workflowId, var, proc, path,
+						selectedProcessors);
+				qa.put(vb.getIteration(), result);
+			}
+		} else {
+			qa.put(path,
+					computeLineageSingleBinding(workflowRun, workflowId, var,
+							proc, path, selectedProcessors));
+		}
+		return qa;
+	}
+
+	/**
+	 * main lineage query method. queries the provenance DB with a single
+	 * originating proc/var/path and a set of selected Processors
+	 * 
+	 * @param workflowRunId
+	 * @param var
+	 * @param proc
+	 * @param path
+	 * @param path2
+	 * @param selectedProcessors
+	 * @return a list of bindings. each binding involves an input var for one of
+	 *         the selectedProcessors. Note each var can contribute multiple
+	 *         bindings, i.e., when all elements in a collection bound to the
+	 *         var are retrieved. Note also that bindings for input vars are
+	 *         returned as well, when the query is configured with returnOutputs
+	 *         = true {@link ProvenanceAnalysis#isReturnOutputs() }
+	 * @throws SQLException
+	 */
+	public List<Dependencies> computeLineageSingleBinding(
+			String workflowRunId,   // dynamic scope
+			String workflowId,  // static scope
+			String var,   // target var
+			String proc,   // qualified with its processor name
+			String path,   // possibly empty when no collections or no granular lineage required
+			List<ProvenanceProcessor> selectedProcessors) throws SQLException {
+		long start = System.currentTimeMillis();
+		List<LineageSQLQuery> lqList = searchDataflowGraph(workflowRunId,
+				workflowId, var, proc, path, selectedProcessors);
+		long stop = System.currentTimeMillis();
+
+		long gst = stop - start;
+
+		// execute queries in the LineageSQLQuery list
+		logger.debug("\n****************  executing lineage queries:  (includeDataValue is "
+				+ isIncludeDataValue() + "**************\n");
+
+		start = System.currentTimeMillis();
+		List<Dependencies> results = getPq().runLineageQueries(lqList,
+				isIncludeDataValue());
+		stop = System.currentTimeMillis();
+
+		long qrt = stop - start;
+		logger.debug("search time: " + gst
+				+ "ms\nlineage query response time: " + qrt + " ms");
+		logger.debug("total exec time " + (gst + qrt) + "ms");
+
+		return results;
+	}
+
+	/**
+	 * compute lineage queries using path projections
+	 * @param workflowRunId the (single) instance defines the scope of a query<br/>
+	 * added 2/9: collect a list of paths in the process to be used by the naive query. In practice
+	 * we use this as the graph search phase that is needed by the naive query anyway
+	 * @param var
+	 * @param proc
+	 * @param path  within var (can be empty but not null)
+	 * @param selectedProcessors pairs (wfID, proceName), encoded as a Map. only report lineage when you reach any of these processors
+	 * @throws SQLException
+	 */
+	public List<LineageSQLQuery> searchDataflowGraph(
+			String workflowRunId,   // dymamic scope
+			String workflowId,  // static scope
+			String var,   // target var
+			String proc,   // qualified with its processor name
+			String path,  // can be empty but not null
+			List<ProvenanceProcessor> selectedProcessors) throws SQLException {
+		List<LineageSQLQuery> lqList = new ArrayList<>();
+
+		// TODO we are ignoring the wfId context information in the list of selected processors!!
+
+		// init paths accumulation. here "path" is a path in the graph, not within a collection!
+		//  associate an empty list of paths to each selected processor
+		for (ProvenanceProcessor s : selectedProcessors)
+			validPaths.put(s, new ArrayList<List<String>>());
+
+		currentPath = new ArrayList<>();
+
+		// start with xfer or xform depending on whether initial var is output or input
+
+		// get (var, proc) from Port  to see if it's input/output
+		Map<String, String> varQueryConstraints = new HashMap<>();
+		varQueryConstraints.put("V.processorName", proc);
+		varQueryConstraints.put("V.portName", var);
+		varQueryConstraints.put("V.workflowId", workflowId);
+
+		List<Port> vars = getPq().getPorts(varQueryConstraints);
+
+		if (vars.isEmpty())  {
+			logger.info("variable ("+var+","+proc+") not found, lineage query terminated, constraints: " + varQueryConstraints);
+			return null;
+		}
+
+		logger.info("Found " + vars);
+		Port v = vars.get(0); 		// expect exactly one record
+		// CHECK there can be multiple (pname, portName) pairs, i.e., in case of nested workflows
+		// here we pick the first that turns up -- we would need to let users choose, or process all of them...
+
+		if (v.isInputPort() || v.getProcessorId() == null) {
+			// if vName is input, then do a xfer() step
+
+			// rec. accumulates SQL queries into lqList
+			xferStep(workflowRunId, workflowId, v, path, selectedProcessors,
+					lqList);
+		} else { // start with xform
+			// rec. accumulates SQL queries into lqList
+			xformStep(workflowRunId, workflowId, v, proc, path,
+					selectedProcessors, lqList);
+		}
+
+		return lqList;
+	}  // end searchDataflowGraph
+
+	/**
+	 * accounts for an inverse transformation from one output to all inputs of a
+	 * processor
+	 * 
+	 * @param workflowRunId
+	 * @param var
+	 *            the output var
+	 * @param proc
+	 *            the processor
+	 * @param selectedProcessors
+	 *            the processors for which we are interested in producing
+	 *            lineage
+	 * @param path
+	 *            iteration vector within a PortBinding collection
+	 * @param lqList
+	 *            partial list of spot lineage queries, to be added to
+	 * @throws SQLException
+	 */
+	@SuppressWarnings("deprecation")
+	private void xformStep(
+			String workflowRunId,
+			String workflowId,
+			Port outputVar, // we need the dnl from this output var
+			String proc, String path,
+			List<ProvenanceProcessor> selectedProcessors,
+			List<LineageSQLQuery> lqList) throws SQLException {
+		// retrieve input vars for current processor
+		Map<String, String> varsQueryConstraints = new HashMap<>();
+
+		List<Port> inputVars = null;
+
+		/*
+		 * here we fetch the input vars for the current proc. however, it may be
+		 * the case that we are looking at a dataflow port (for the entire
+		 * dataflow or for a subdataflow) rather than a real processor. in this
+		 * case we treat this as a special processor that does nothing -- so we
+		 * "input var" in this case is a copy of the port, and we are ready to
+		 * go for the next xfer step. in this way we can seamlessly traverse the
+		 * graph over intermediate I/O that are part of nested dataflows
+		 */
+
+		if (getPq().isDataflow(proc)) { // if we are looking at the output of an entire dataflow
+			// force the "input vars" for this step to be the output var itself
+			// this causes the following xfer step to trace back to the next processor _within_ proc 
+			inputVars = new ArrayList<>();
+			inputVars.add(outputVar);
+		} else if (proc.equals(OUTPUT_CONTAINER_PROCESSOR)) {  // same action as prev case, but may change in the future
+			inputVars = new ArrayList<>();
+			inputVars.add(outputVar);
+		} else {
+			varsQueryConstraints.put("W.workflowId", workflowId);
+			varsQueryConstraints.put("processorName", proc);
+			varsQueryConstraints.put("isInputPort", "1");
+
+			inputVars = getPq().getPorts(varsQueryConstraints);
+		}
+
+		///////////
+		/// path projections
+		///////////
+		// maps each var to its projected path
+		Map<Port,String> var2Path = new HashMap<>();
+		Map<Port,Integer> var2delta = new HashMap<>();
+
+		if (path == null) {  // nothing to split
+			for (Port inputVar : inputVars)
+				var2Path.put(inputVar, null);
+		} else {
+			int minPathLength = 0;  // if input path is shorter than this we give up granularity altogether
+			for (Port inputVar : inputVars) {
+				int resolvedDepth = 0;
+				if (inputVar.getResolvedDepth() != null)
+					resolvedDepth = inputVar.getResolvedDepth();
+				int delta = resolvedDepth - inputVar.getDepth();
+				var2delta.put(inputVar, delta);
+				minPathLength += delta;
+			}
+
+			String iterationVector[] = path.split(",");
+
+			if (iterationVector.length < minPathLength) {  // no path is propagated
+				for (Port inputVar: inputVars)
+					var2Path.put(inputVar, null);
+			} else { // compute projected paths
+				String[] projectedPath; 
+
+				int start = 0;
+				for (Port inputVar: inputVars) {
+					// 24/7/08 get DNL (declared nesting level) and ANL (actual nesting level) from VAR
+					// TODO account for empty paths
+					int projectedPathLength = var2delta.get(inputVar);  // this is delta			
+
+					if (projectedPathLength == 0) {
+						// associate empty path to this var
+						var2Path.put(inputVar, null);
+						continue;
+					}
+
+					// this var is involved in iteration
+					projectedPath = new String[projectedPathLength];
+					for (int i = 0; i < projectedPathLength; i++)
+						projectedPath[i] = iterationVector[start + i];
+					start += projectedPathLength;
+
+					StringBuilder iterationFragment = new StringBuilder();
+					for (String s : projectedPath)
+						iterationFragment.append(s + ",");
+					iterationFragment
+							.deleteCharAt(iterationFragment.length() - 1);
+
+					var2Path.put(inputVar, iterationFragment.toString());
+				}
+			}
+		}
+
+		// accumulate this proc to current path 
+		currentPath.add(proc);
+
+		/*
+		 * if this is a selected processor, add a copy of the current path to
+		 * the list of paths for the processor
+		 */
+
+		// is <workflowId, proc>  in selectedProcessors?
+		boolean isSelected = false;
+		for (ProvenanceProcessor pp : selectedProcessors)
+			if (pp.getWorkflowId().equals(workflowId)
+					&& pp.getProcessorName().equals(proc)) {
+				List<List<String>> paths = validPaths.get(pp);
+
+				// copy the path since the original will change
+				// also remove spurious dataflow processors at this point
+				List<String> pathCopy = new ArrayList<>();
+				for (String s : currentPath)
+					if (!getPq().isDataflow(s))
+						pathCopy.add(s);
+				paths.add(pathCopy);
+				isSelected = true;
+				break;
+			}
+
+		///////////
+		/// generate SQL if necessary -- for all input vars, based on the current path
+		/// the projected paths are required to determine the level in the collection at which 
+		/// we look at the value assignment
+		///////////
+
+		Map<String, ProvenanceArtifact> var2Artifact = new HashMap<>();
+		Map<String, ProvenanceRole> var2ArtifactRole = new HashMap<>();
+
+		// if this transformation is important to the user, produce an output and also an OPM graph fragment
+		if (selectedProcessors.isEmpty() || isSelected) {
+			List<LineageSQLQuery> newLqList = getPq().lineageQueryGen(
+					workflowRunId, proc, var2Path, outputVar, path,
+					isReturnOutputs() || var2Path.isEmpty());
+			lqList.addAll(newLqList);
+
+			// BEGIN OPM update section
+			//
+			// create OPM artifact and role for the output var of this xform
+			//
+			boolean doOPM = (aOPMManager != null && aOPMManager.isActive());  // any problem below will set this to false
+
+			if (doOPM) {
+				// fetch value for this variable and assert it as an Artifact in the OPM graph
+				Map<String, String> vbConstraints = new HashMap<>();
+				vbConstraints.put("VB.processorNameRef",
+						outputVar.getProcessorName());
+				vbConstraints.put("VB.portName", outputVar.getPortName());
+				vbConstraints.put("VB.workflowRunId", workflowRunId);
+
+				if (path != null) {
+					/*
+					 * account for x,y,.. format as well as [x,y,...] depending
+					 * on where the request is coming from
+					 */
+					// TODO this is just irritating must be removed
+					if (path.startsWith("["))
+						vbConstraints.put("VB.iteration", path);
+					else
+						vbConstraints.put("VB.iteration", "[" + path + "]");
+				}
+
+				List<PortBinding> vbList = getPq().getPortBindings(vbConstraints); // DB
+
+				/*
+				 * use only the first result (expect only one) -- in this method
+				 * we assume path is not null
+				 */
+
+				// map the resulting varBinding to an Artifact
+				if (vbList == null || vbList.size() == 0) {
+					logger.debug("no entry corresponding to conditions: proc="
+							+ outputVar.getProcessorName() + " var = "
+							+ outputVar.getPortName() + " iteration = " + path);
+					doOPM = false;
+				} else {
+					PortBinding vb = vbList.get(0);
+
+					if (aOPMManager != null && !pq.isDataflow(proc)) {
+						if (isRecordArtifactValues()) {
+							T2Reference ref = getInvocationContext()
+									.getReferenceService().referenceFromString(
+											vb.getValue());
+
+							Object data = ic.getReferenceService()
+									.renderIdentifier(ref, Object.class, ic);
+
+							// ReferenceSetImpl o = (ReferenceSetImpl) ic.getReferenceService().resolveIdentifier(ref, null, ic);
+							logger.debug("deref value for ref: " + ref + " "
+									+ data + " of class "
+									+ data.getClass().getName());
+							
+							try {
+								aOPMManager.addArtifact(vb.getValue(), data);
+							} catch (ProvenanceException e) {
+								logger.warn("Could not add artifact", e);
+							}
+						} else {
+							try {
+								aOPMManager.addArtifact(vb.getValue());
+							} catch (ProvenanceException e) {
+								logger.warn("Could not add artifact", e);
+							}
+						}
+						aOPMManager.createRole(vb.getWorkflowRunId(),
+								vb.getWorkflowId(), vb.getProcessorName(),
+								vb.getIteration());
+					}
+
+					/*
+					 * assert proc as Process -- include iteration vector to
+					 * separate different activations of the same process
+					 */					
+					try {
+						aOPMManager.addProcess(proc, vb.getIteration(),
+								workflowId, vb.getWorkflowRunId());
+					} catch (ProvenanceException e) {
+						logger.warn("Could not add process", e);
+					}
+
+					/*
+					 * create OPM generatedBy property between output value and
+					 * this process node avoid the pathological case where a
+					 * dataflow generates its own inputs
+					 */
+					try {
+						aOPMManager.assertGeneratedBy(
+								aOPMManager.getCurrentArtifact(),
+								aOPMManager.getCurrentProcess(),
+								aOPMManager.getCurrentRole(),
+								aOPMManager.getCurrentAccount(), true);
+					} catch (ProvenanceException e) {
+						logger.warn("Could not add assertion", e);
+					}
+				}
+			}
+			// 
+			// create OPM process for this xform
+			//
+			for (LineageSQLQuery lq : newLqList) {
+				// if OPM is on, execute the query so we get the value we need for the Artifact node
+				Dependencies inputs = getPq().runLineageQuery(lq,
+						isIncludeDataValue());
+
+				if (doOPM && inputs.getRecords().size() > 0) { // && !pq.isDataflow(proc)) {
+					//	update OPM graph with inputs and used properties
+					for (LineageQueryResultRecord resultRecord: inputs.getRecords()) {
+						// process inputs only
+						if (!resultRecord.isInputPort())
+							continue;
+
+						// map each input var in the resultRecord to an Artifact
+						// create new Resource for the resultRecord
+						//    use the value as URI for the Artifact, and resolvedValue as the actual value
+
+						//
+						// create OPM artifact and role for the input var obtained by path projection
+						//
+						if (resultRecord.isCollection()) {
+							try {
+								aOPMManager.addArtifact(resultRecord
+										.getCollectionT2Reference());
+							} catch (ProvenanceException e) {
+								logger.warn("Could not add artifact", e);
+							}
+						} else if (isRecordArtifactValues()) {
+							T2Reference ref = getInvocationContext()
+									.getReferenceService().referenceFromString(
+											resultRecord.getValue());
+							Object data = ic.getReferenceService()
+									.renderIdentifier(ref, Object.class, ic);
+							logger.debug("deref value for ref: " + ref + " "
+									+ data + " of class "
+									+ data.getClass().getName());
+							try {
+								aOPMManager.addArtifact(
+										resultRecord.getValue(), data);
+							} catch (ProvenanceException e) {
+								logger.warn("Could not add artifact", e);
+							}
+						} else {
+							try {
+								aOPMManager
+										.addArtifact(resultRecord.getValue());
+							} catch (ProvenanceException e) {
+								logger.warn("Could not add artifact", e);
+							}
+							var2Artifact.put(resultRecord.getPortName(),
+									aOPMManager.getCurrentArtifact());
+
+							aOPMManager.createRole(
+									resultRecord.getWorkflowRunId(),
+									resultRecord.getworkflowId(),
+									resultRecord.getProcessorName(),
+									resultRecord.getIteration());
+							var2ArtifactRole.put(resultRecord.getPortName(),
+									aOPMManager.getCurrentRole());
+
+							//
+							// create OPM used property between process and the input var obtained by path projection
+							//
+							// avoid output variables, it would assert that P used one of its outputs!
+
+							try {
+								aOPMManager.assertUsed(
+										aOPMManager.getCurrentArtifact(),
+										aOPMManager.getCurrentProcess(),
+										aOPMManager.getCurrentRole(),
+										aOPMManager.getCurrentAccount(), true);
+							} catch (ProvenanceException e) {
+								logger.warn("Could not add artifact", e);
+							}
+
+							// true -> prevent duplicates CHECK	
+						}
+					}
+				}
+				// END OPM update section
+			}
+
+			// recursion -- xfer path is next up
+			for (Port inputVar : inputVars)
+				xferStep(workflowRunId, workflowId, inputVar,
+						var2Path.get(inputVar), selectedProcessors, lqList);
+		}
+		currentPath.remove(currentPath.size()-1);  // CHECK	
+	}  // end xformStep
+
+	private void xferStep(String workflowRunId, String workflowId, Port port,
+			String path, List<ProvenanceProcessor> selectedProcessors,
+			List<LineageSQLQuery> lqList) throws SQLException {
+
+		// retrieve all Datalinks ending with (var,proc) -- ideally there is exactly one
+		// (because multiple incoming datalinks are disallowed)
+		Map<String, String> datalinksQueryConstraints = new HashMap<>();
+		datalinksQueryConstraints
+				.put("destinationPortId", port.getIdentifier());
+		List<DataLink> datalinks = getPq().getDataLinks(
+				datalinksQueryConstraints);
+
+		if (datalinks.isEmpty())
+			return; // CHECK
+
+		DataLink a = datalinks.get(0);
+
+		// get source node
+		String sourceProcName = a.getSourceProcessorName();
+//		String sourcePortName = a.getSourcePortName();
+
+		// CHECK transfer same path with only exception: when anl(sink) > anl(source)
+		// in this case set path to null
+
+		// retrieve full record for var:
+		// retrieve input vars for current processor 
+		Map<String, String> varsQueryConstraints = new HashMap<>();
+
+//		varsQueryConstraints.put("W.workflowId", workflowRunId);
+		varsQueryConstraints.put("portId", a.getSourcePortId());
+//		varsQueryConstraints.put("processorNameRef", sourceProcName);  
+//		varsQueryConstraints.put("portName", sourcePortName);
+		List<Port> varList = getPq().getPorts(varsQueryConstraints);
+
+		Port outputVar = varList.get(0);
+
+		// recurse on xform
+		xformStep(workflowRunId, workflowId, outputVar, sourceProcName, path,
+				selectedProcessors, lqList);
+	} // end xferStep2
+
+	/**
+	 * this class represents the annotation (single or sequence, to be
+	 * determined) that are produced upon visiting the graph structure and that
+	 * drive the generation of a pinpoint lineage query<br/>
+	 * this is still a placeholder
+	 */
+	class LineageAnnotation {
+		private List<String> path = new ArrayList<>();
+
+		private boolean isXform = true;
+
+		private String iteration = "";  // this is the iteration projected on a single variable. Used for propagation upwards default is no iteration --
+		private String iterationVector = ""; // iteration vector accounts for cross-products. Used to be matched exactly in queries. 
+		private int iic = 0;  // index in collection -- default is 0 
+		private int collectionNesting = 0;  // n indicates granularity is n levels from leaf. 
+		// This quantifies loss of lineage precision when working with collections
+		private String collectionRef = null;
+		private String proc;
+		private String var;
+		private String varType = null;   // dtring, XML,... see Taverna type system
+
+		private int DNL = 0; // declared nesting level -- copied from VAR
+		private int ANL  = 0;  // actual nesting level -- copied from Port
+
+		private String workflowRun;  // TODO generalize to list / time interval?
+
+		@Override
+		public String toString() {
+			StringBuilder sb = new StringBuilder();
+			if (isXform)
+				sb.append(" xform: ");
+			else
+				sb.append(" xfer: ");
+			sb.append("<PROC/VAR/VARTYPE, IT, IIC, ITVECTOR, COLLNESTING> = "
+					+ proc + "/" + var + "/" + varType + "," + "[" + iteration
+					+ "]" + "," + iic + ", [" + iterationVector + "]" + ","
+					+ collectionNesting);
+			return sb.toString();
+		}
+
+		public void addStep(String step) {
+			path.add(step);
+		}
+
+		public void removeLastStep() {
+			path.remove(path.size() - 1);
+		}
+
+		/**
+		 * @return the path
+		 */
+		public List<String> getPath() {
+			return path;
+		}
+
+		/**
+		 * @param path
+		 *            the path to set
+		 */
+		public void setPath(List<String> path) {
+			this.path = path;
+		}
+
+		/**
+		 * @return the iteration
+		 */
+		public String getIteration() {
+			return iteration;
+		}
+
+		/**
+		 * @param iteration
+		 *            the iteration to set
+		 */
+		public void setIteration(String iteration) {
+			this.iteration = iteration;
+		}
+
+		/**
+		 * @return the iic
+		 */
+		public int getIic() {
+			return iic;
+		}
+
+		/**
+		 * @param iic
+		 *            the iic to set
+		 */
+		public void setIic(int iic) {
+			this.iic = iic;
+		}
+
+		/**
+		 * @return the collectionRef
+		 */
+		public String getCollectionRef() {
+			return collectionRef;
+		}
+
+		/**
+		 * @param collectionRef
+		 *            the collectionRef to set
+		 */
+		public void setCollectionRef(String collectionRef) {
+			this.collectionRef = collectionRef;
+		}
+
+		/**
+		 * @return the proc
+		 */
+		public String getProc() {
+			return proc;
+		}
+
+		/**
+		 * @param proc
+		 *            the proc to set
+		 */
+		public void setProc(String proc) {
+			this.proc = proc;
+		}
+
+		/**
+		 * @return the var
+		 */
+		public String getVar() {
+			return var;
+		}
+
+		/**
+		 * @param var
+		 *            the var to set
+		 */
+		public void setVar(String var) {
+			this.var = var;
+		}
+
+		/**
+		 * @return the varType
+		 */
+		public String getVarType() {
+			return varType;
+		}
+
+		/**
+		 * @param varType
+		 *            the varType to set
+		 */
+		public void setVarType(String varType) {
+			this.varType = varType;
+		}
+
+		/**
+		 * @return the workflowRun
+		 */
+		public String getWorkflowRun() {
+			return workflowRun;
+		}
+
+		/**
+		 * @param workflowRun
+		 *            the workflowRun to set
+		 */
+		public void setWorkflowRun(String workflowRun) {
+			this.workflowRun = workflowRun;
+		}
+
+		/**
+		 * @return the isXform
+		 */
+		public boolean isXform() {
+			return isXform;
+		}
+
+		/**
+		 * @param isXform
+		 *            the isXform to set
+		 */
+		public void setXform(boolean isXform) {
+			this.isXform = isXform;
+		}
+
+		/**
+		 * @return the collectionNesting
+		 */
+		public int getCollectionNesting() {
+			return collectionNesting;
+		}
+
+		/**
+		 * @param collectionNesting
+		 *            the collectionNesting to set
+		 */
+		public void setCollectionNesting(int collectionNesting) {
+			this.collectionNesting = collectionNesting;
+		}
+
+		/**
+		 * @return the iterationVector
+		 */
+		public String getIterationVector() {
+			return iterationVector;
+		}
+
+		/**
+		 * @param iterationVector
+		 *            the iterationVector to set
+		 */
+		public void setIterationVector(String iterationVector) {
+			this.iterationVector = iterationVector;
+		}
+
+		/**
+		 * @return the dNL
+		 */
+		public int getDNL() {
+			return DNL;
+		}
+
+		/**
+		 * @param dnl
+		 *            the dNL to set
+		 */
+		public void setDNL(int dnl) {
+			DNL = dnl;
+		}
+
+		/**
+		 * @return the aNL
+		 */
+		public int getANL() {
+			return ANL;
+		}
+
+		/**
+		 * @param anl
+		 *            the aNL to set
+		 */
+		public void setANL(int anl) {
+			ANL = anl;
+		}
+	}
+
+	/**
+	 * @return the validPaths
+	 */
+	public Map<ProvenanceProcessor, List<List<String>>> getValidPaths() {
+		return validPaths;
+	}
+
+	/**
+	 * @param validPaths
+	 *            the validPaths to set
+	 */
+	public void setValidPaths(
+			Map<ProvenanceProcessor, List<List<String>>> validPaths) {
+		this.validPaths = validPaths;
+	}
+
+	public void setPq(ProvenanceQuery pq) {
+		this.pq = pq;
+	}
+
+	public ProvenanceQuery getPq() {
+		return pq;
+	}
+
+	/**
+	 * @return the ready
+	 */
+	public boolean isReady() {
+		return ready;
+	}
+
+	/**
+	 * @param ready
+	 *            the ready to set
+	 */
+	public void setReady(boolean ready) {
+		this.ready = ready;
+	}
+
+	/**
+	 * @return the returnOutputs
+	 */
+	public boolean isReturnOutputs() {
+		return returnOutputs;
+	}
+
+	/**
+	 * @param returnOutputs
+	 *            the returnOutputs to set
+	 */
+	public void setReturnOutputs(boolean returnOutputs) {
+		this.returnOutputs = returnOutputs;
+	}
+
+	/**
+	 * @return the recordArtifactValues
+	 */
+	public boolean isRecordArtifactValues() {
+		return recordArtifactValues;
+	}
+
+	/**
+	 * @param recordArtifactValues
+	 *            the recordArtifactValues to set
+	 */
+	public void setRecordArtifactValues(boolean recordArtifactValues) {
+		this.recordArtifactValues = recordArtifactValues;
+
+	}
+
+	/**
+	 * @return the includeDataValue
+	 */
+	public boolean isIncludeDataValue() {
+		return includeDataValue;
+	}
+
+	/**
+	 * @param includeDataValue
+	 *            the includeDataValue to set
+	 */
+	public void setIncludeDataValue(boolean includeDataValue) {
+		this.includeDataValue = includeDataValue;
+	}
+
+	/**
+	 * @return the generateOPMGraph
+	 */
+	public boolean isGenerateOPMGraph() {
+		return generateOPMGraph;
+	}
+
+	/**
+	 * @param generateOPMGraph
+	 *            the generateOPMGraph to set
+	 */
+	public void setGenerateOPMGraph(boolean generateOPMGraph) {
+		this.generateOPMGraph = generateOPMGraph;
+		if (aOPMManager != null)
+			aOPMManager.setActive(generateOPMGraph);
+	}
+
+	public void setInvocationContext(InvocationContext context) {
+		this.ic = context;
+	}
+
+	public InvocationContext getInvocationContext() {
+		return this.ic;
+	}
+}


[37/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/resources/t2flow/secure-digest-authentication-https.t2flow
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/resources/t2flow/secure-digest-authentication-https.t2flow b/taverna-integration-tests/src/test/resources/t2flow/secure-digest-authentication-https.t2flow
new file mode 100644
index 0000000..5d2f893
--- /dev/null
+++ b/taverna-integration-tests/src/test/resources/t2flow/secure-digest-authentication-https.t2flow
@@ -0,0 +1,107 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3-SNAPSHOT-20110621T1150"><dataflow id="47ad844e-df8e-4c65-803a-8a20c8197e8e" role="top"><name>Workflow18</name><inputPorts /><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>Service_protected_with_Digest_AuthN_and_HTTPS</name><inputPorts /><outputPorts><port><name>responseBody</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>rest-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.rest.RESTActivity</class><inputMap /><outputMap><map from="responseBody" to="responseBody" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.rest.RESTActivityConfigurationBean xmlns="">
+  <httpMethod>GET</httpMethod>
+  <urlSignature>https://heater.cs.man.ac.uk:7443/examples-digest-authentication/taverna-test-page.html</urlSignature>
+  <acceptsHeaderValue>text/plain</acceptsHeaderValue>
+  <contentTypeForUpdates>application/xml</contentTypeForUpdates>
+  <outgoingDataFormat>String</outgoingDataFormat>
+  <sendHTTPExpectRequestHeader>false</sendHTTPExpectRequestHeader>
+  <showRedirectionOutputPort>false</showRedirectionOutputPort>
+  <escapeParameters>true</escapeParameters>
+  <otherHTTPHeaders />
+  <activityInputs />
+</net.sf.taverna.t2.activities.rest.RESTActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>Service_protected_with_Digest_AuthN_and_HTTPS</processor><port>responseBody</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>b7887959-6d6c-4466-8d15-16b4e20051db</identification>
+      </annotationBean>
+      <date>2010-11-22 14:16:43.484 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>eaff435f-9025-429b-9a12-97fc94d90e73</identification>
+      </annotationBean>
+      <date>2010-11-22 14:18:46.551 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>d9be6132-9d40-43f6-bd0b-8d29dca1163b</identification>
+      </annotationBean>
+      <date>2010-11-22 14:16:58.860 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>1f90ea89-a32f-41c1-b30c-2a5afd622984</identification>
+      </annotationBean>
+      <date>2010-11-22 14:20:41.517 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>e7fb38b1-b3ec-4c47-a584-36c68eeda25e</identification>
+      </annotationBean>
+      <date>2010-11-22 14:19:49.664 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>5b302294-d370-4639-acb1-2a8452cc6d92</identification>
+      </annotationBean>
+      <date>2010-11-29 10:34:55.185 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>837b1710-ff29-4eef-85a0-51fc76139364</identification>
+      </annotationBean>
+      <date>2010-11-22 14:15:20.380 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>47ad844e-df8e-4c65-803a-8a20c8197e8e</identification>
+      </annotationBean>
+      <date>2010-11-29 15:36:29.390 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/resources/t2flow/secure-digest-authentication.t2flow
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/resources/t2flow/secure-digest-authentication.t2flow b/taverna-integration-tests/src/test/resources/t2flow/secure-digest-authentication.t2flow
new file mode 100644
index 0000000..449e9db
--- /dev/null
+++ b/taverna-integration-tests/src/test/resources/t2flow/secure-digest-authentication.t2flow
@@ -0,0 +1,129 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3-SNAPSHOT-20110621T1150"><dataflow id="a218f0b5-b675-4eed-b7a8-a5c63181ff3e" role="top"><name>Workflow18</name><inputPorts /><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>Service_protected_with_Digest_AuthN</name><inputPorts /><outputPorts><port><name>responseBody</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>rest-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.rest.RESTActivity</class><inputMap /><outputMap><map from="responseBody" to="responseBody" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.rest.RESTActivityConfigurationBean xmlns="">
+  <httpMethod>GET</httpMethod>
+  <urlSignature>http://heater.cs.man.ac.uk:7070/examples-digest-authentication/taverna-test-page.html</urlSignature>
+  <acceptsHeaderValue>text/plain</acceptsHeaderValue>
+  <contentTypeForUpdates>application/xml</contentTypeForUpdates>
+  <outgoingDataFormat>String</outgoingDataFormat>
+  <sendHTTPExpectRequestHeader>false</sendHTTPExpectRequestHeader>
+  <showRedirectionOutputPort>false</showRedirectionOutputPort>
+  <escapeParameters>true</escapeParameters>
+  <otherHTTPHeaders />
+  <activityInputs />
+</net.sf.taverna.t2.activities.rest.RESTActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>Service_protected_with_Digest_AuthN</processor><port>responseBody</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>b7887959-6d6c-4466-8d15-16b4e20051db</identification>
+      </annotationBean>
+      <date>2010-11-22 14:16:43.484 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>d9be6132-9d40-43f6-bd0b-8d29dca1163b</identification>
+      </annotationBean>
+      <date>2010-11-22 14:16:58.860 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>837b1710-ff29-4eef-85a0-51fc76139364</identification>
+      </annotationBean>
+      <date>2010-11-22 14:15:20.380 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>1f90ea89-a32f-41c1-b30c-2a5afd622984</identification>
+      </annotationBean>
+      <date>2010-11-22 14:20:41.517 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>e7fb38b1-b3ec-4c47-a584-36c68eeda25e</identification>
+      </annotationBean>
+      <date>2010-11-22 14:19:49.664 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>eaff435f-9025-429b-9a12-97fc94d90e73</identification>
+      </annotationBean>
+      <date>2010-11-22 14:18:46.551 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>5b302294-d370-4639-acb1-2a8452cc6d92</identification>
+      </annotationBean>
+      <date>2010-11-29 10:34:55.185 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>fd59d61c-50f8-457b-a183-c162453b026b</identification>
+      </annotationBean>
+      <date>2010-11-29 15:29:08.570 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>435023d5-0063-4914-ae4c-28a7a031ec0d</identification>
+      </annotationBean>
+      <date>2010-11-29 10:40:30.468 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>a218f0b5-b675-4eed-b7a8-a5c63181ff3e</identification>
+      </annotationBean>
+      <date>2010-11-29 15:39:35.589 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/resources/t2flow/secure-ws-https.t2flow
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/resources/t2flow/secure-ws-https.t2flow b/taverna-integration-tests/src/test/resources/t2flow/secure-ws-https.t2flow
new file mode 100644
index 0000000..13637c4
--- /dev/null
+++ b/taverna-integration-tests/src/test/resources/t2flow/secure-ws-https.t2flow
@@ -0,0 +1,180 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3-SNAPSHOT-20110621T1150"><dataflow id="c71621ca-196c-46cd-9073-48af82b4bd4f" role="top"><name>Workflow13</name><inputPorts /><outputPorts><port><name>out_plaintext</name><annotations /></port><port><name>out_plaintext_timestamp</name><annotations /></port><port><name>out_digest</name><annotations /></port><port><name>out_digest_timestamp</name><annotations /></port></outputPorts><processors><processor><name>hello_plaintext_password</name><inputPorts><port><name>in0</name><depth>0</depth></port></inputPorts><outputPorts><port><name>helloReturn</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.wsdl.WSDLActivity</class><inputMap><map from="in0" to="in0" /></inputMap><outputMap><m
 ap from="helloReturn" to="helloReturn" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean xmlns="">
+  <wsdl>https://heater.cs.man.ac.uk:7443/axis/services/HelloService-PlaintextPassword?wsdl</wsdl>
+  <operation>hello</operation>
+  <securityProfile>WSSecurityUsernameTokenPlainTextPassword</securityProfile>
+</net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in0" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>in0_value</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="
 value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>Alan</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>hello_plaintext_password_timestamp</name><inputPorts><port><name>in0</name><depth>0</depth></port></inputPorts><outputPorts><port><name>helloReturn</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.wsdl.WSDLActivity</class><inputMap><map from="in0" to="
 in0" /></inputMap><outputMap><map from="helloReturn" to="helloReturn" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean xmlns="">
+  <wsdl>https://heater.cs.man.ac.uk:7443/axis/services/HelloService-PlaintextPassword-Timestamp?wsdl</wsdl>
+  <operation>hello</operation>
+  <securityProfile>WSSecurityTimestampUsernameTokenPlainTextPassword</securityProfile>
+</net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in0" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>in0_value_1</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from
 ="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>Alex</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>hello_digest_password</name><inputPorts><port><name>in0</name><depth>0</depth></port></inputPorts><outputPorts><port><name>helloReturn</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.wsdl.WSDLActivity</class><inputMap><map from="in0" to="in0" /></inpu
 tMap><outputMap><map from="helloReturn" to="helloReturn" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean xmlns="">
+  <wsdl>https://heater.cs.man.ac.uk:7443/axis/services/HelloService-DigestPassword?wsdl</wsdl>
+  <operation>hello</operation>
+  <securityProfile>WSSecurityUsernameTokenDigestPassword</securityProfile>
+</net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in0" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>in0_value_2</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from
 ="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>Stian</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>hello_digest_password_timestamp</name><inputPorts><port><name>in0</name><depth>0</depth></port></inputPorts><outputPorts><port><name>helloReturn</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.wsdl.WSDLActivity</class><inputMap><map from="in0" to="in0
 " /></inputMap><outputMap><map from="helloReturn" to="helloReturn" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean xmlns="">
+  <wsdl>https://heater.cs.man.ac.uk:7443/axis/services/HelloService-DigestPassword-Timestamp?wsdl</wsdl>
+  <operation>hello</operation>
+  <securityProfile>WSSecurityTimestampUsernameTokenDigestPassword</securityProfile>
+</net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in0" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>in0_value_3</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from
 ="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>David</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions><condition control="hello_plaintext_password" target="hello_digest_password" /><condition control="hello_digest_password_timestamp" target="hello_plaintext_password_timestamp" /><condition control="hello_digest_password" target="hello_digest_password_timestamp" /></conditions><datalinks><datalink><sink type="processor"><processor>hello_plaintext_password</processor><port>in0</port></sink><source type="processor"><processor>in0_value</processor><port>value</port>
 </source></datalink><datalink><sink type="processor"><processor>hello_plaintext_password_timestamp</processor><port>in0</port></sink><source type="processor"><processor>in0_value_1</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>hello_digest_password</processor><port>in0</port></sink><source type="processor"><processor>in0_value_2</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>hello_digest_password_timestamp</processor><port>in0</port></sink><source type="processor"><processor>in0_value_3</processor><port>value</port></source></datalink><datalink><sink type="dataflow"><port>out_plaintext</port></sink><source type="processor"><processor>hello_plaintext_password</processor><port>helloReturn</port></source></datalink><datalink><sink type="dataflow"><port>out_plaintext_timestamp</port></sink><source type="processor"><processor>hello_plaintext_password_timestamp</processor><port>helloReturn</port><
 /source></datalink><datalink><sink type="dataflow"><port>out_digest</port></sink><source type="processor"><processor>hello_digest_password</processor><port>helloReturn</port></source></datalink><datalink><sink type="dataflow"><port>out_digest_timestamp</port></sink><source type="processor"><processor>hello_digest_password_timestamp</processor><port>helloReturn</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>c71621ca-196c-46cd-9073-48af82b4bd4f</identification>
+      </annotationBean>
+      <date>2011-06-21 12:11:30.87 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>56cadac0-c944-4b9e-83c3-078f57738405</identification>
+      </annotationBean>
+      <date>2011-01-21 16:02:09.633 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>3d76be4c-83c4-413b-91f2-b0ce69dcbd97</identification>
+      </annotationBean>
+      <date>2010-11-22 13:29:43.282 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>ca8fb5c5-0e8c-4e68-84f0-bdc85a77e2b3</identification>
+      </annotationBean>
+      <date>2010-11-22 13:29:26.400 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>e61023d9-d603-4df6-87e5-175603f106a5</identification>
+      </annotationBean>
+      <date>2010-11-22 13:28:31.68 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>394aced4-ee5d-4355-8ebe-9fc8bcfe5303</identification>
+      </annotationBean>
+      <date>2011-06-21 12:07:46.327 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>8175c97b-6385-460a-98ab-5cf974010d51</identification>
+      </annotationBean>
+      <date>2010-11-22 12:11:59.610 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>a388d568-ca08-43b4-abaf-3744a6801d45</identification>
+      </annotationBean>
+      <date>2010-11-22 13:30:28.898 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>7153a2dd-18bd-4f25-80ab-1efa8afc567d</identification>
+      </annotationBean>
+      <date>2011-01-21 16:02:39.43 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/resources/t2flow/secure-ws.t2flow
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/resources/t2flow/secure-ws.t2flow b/taverna-integration-tests/src/test/resources/t2flow/secure-ws.t2flow
new file mode 100644
index 0000000..764b810
--- /dev/null
+++ b/taverna-integration-tests/src/test/resources/t2flow/secure-ws.t2flow
@@ -0,0 +1,180 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3-SNAPSHOT-20110621T1150"><dataflow id="c71621ca-196c-46cd-9073-48af82b4bd4f" role="top"><name>Workflow13</name><inputPorts /><outputPorts><port><name>out_plaintext</name><annotations /></port><port><name>out_plaintext_timestamp</name><annotations /></port><port><name>out_digest</name><annotations /></port><port><name>out_digest_timestamp</name><annotations /></port></outputPorts><processors><processor><name>hello_plaintext_password</name><inputPorts><port><name>in0</name><depth>0</depth></port></inputPorts><outputPorts><port><name>helloReturn</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.wsdl.WSDLActivity</class><inputMap><map from="in0" to="in0" /></inputMap><outputMap><m
 ap from="helloReturn" to="helloReturn" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean xmlns="">
+  <wsdl>http://heater.cs.man.ac.uk:7070/axis/services/HelloService-PlaintextPassword?wsdl</wsdl>
+  <operation>hello</operation>
+  <securityProfile>WSSecurityUsernameTokenPlainTextPassword</securityProfile>
+</net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in0" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>in0_value</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="
 value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>Alan</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>hello_plaintext_password_timestamp</name><inputPorts><port><name>in0</name><depth>0</depth></port></inputPorts><outputPorts><port><name>helloReturn</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.wsdl.WSDLActivity</class><inputMap><map from="in0" to="
 in0" /></inputMap><outputMap><map from="helloReturn" to="helloReturn" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean xmlns="">
+  <wsdl>http://heater.cs.man.ac.uk:7070/axis/services/HelloService-PlaintextPassword-Timestamp?wsdl</wsdl>
+  <operation>hello</operation>
+  <securityProfile>WSSecurityTimestampUsernameTokenPlainTextPassword</securityProfile>
+</net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in0" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>in0_value_1</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from
 ="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>Alex</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>hello_digest_password</name><inputPorts><port><name>in0</name><depth>0</depth></port></inputPorts><outputPorts><port><name>helloReturn</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.wsdl.WSDLActivity</class><inputMap><map from="in0" to="in0" /></inpu
 tMap><outputMap><map from="helloReturn" to="helloReturn" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean xmlns="">
+  <wsdl>http://heater.cs.man.ac.uk:7070/axis/services/HelloService-DigestPassword?wsdl</wsdl>
+  <operation>hello</operation>
+  <securityProfile>WSSecurityUsernameTokenDigestPassword</securityProfile>
+</net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in0" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>in0_value_2</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from
 ="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>Stian</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>hello_digest_password_timestamp</name><inputPorts><port><name>in0</name><depth>0</depth></port></inputPorts><outputPorts><port><name>helloReturn</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.wsdl.WSDLActivity</class><inputMap><map from="in0" to="in0
 " /></inputMap><outputMap><map from="helloReturn" to="helloReturn" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean xmlns="">
+  <wsdl>http://heater.cs.man.ac.uk:7070/axis/services/HelloService-DigestPassword-Timestamp?wsdl</wsdl>
+  <operation>hello</operation>
+  <securityProfile>WSSecurityTimestampUsernameTokenDigestPassword</securityProfile>
+</net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in0" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>in0_value_3</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from
 ="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>David</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions><condition control="hello_plaintext_password" target="hello_digest_password" /><condition control="hello_digest_password_timestamp" target="hello_plaintext_password_timestamp" /><condition control="hello_digest_password" target="hello_digest_password_timestamp" /></conditions><datalinks><datalink><sink type="processor"><processor>hello_plaintext_password</processor><port>in0</port></sink><source type="processor"><processor>in0_value</processor><port>value</port>
 </source></datalink><datalink><sink type="processor"><processor>hello_plaintext_password_timestamp</processor><port>in0</port></sink><source type="processor"><processor>in0_value_1</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>hello_digest_password</processor><port>in0</port></sink><source type="processor"><processor>in0_value_2</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>hello_digest_password_timestamp</processor><port>in0</port></sink><source type="processor"><processor>in0_value_3</processor><port>value</port></source></datalink><datalink><sink type="dataflow"><port>out_plaintext</port></sink><source type="processor"><processor>hello_plaintext_password</processor><port>helloReturn</port></source></datalink><datalink><sink type="dataflow"><port>out_plaintext_timestamp</port></sink><source type="processor"><processor>hello_plaintext_password_timestamp</processor><port>helloReturn</port><
 /source></datalink><datalink><sink type="dataflow"><port>out_digest</port></sink><source type="processor"><processor>hello_digest_password</processor><port>helloReturn</port></source></datalink><datalink><sink type="dataflow"><port>out_digest_timestamp</port></sink><source type="processor"><processor>hello_digest_password_timestamp</processor><port>helloReturn</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>c71621ca-196c-46cd-9073-48af82b4bd4f</identification>
+      </annotationBean>
+      <date>2011-06-21 12:11:30.87 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>56cadac0-c944-4b9e-83c3-078f57738405</identification>
+      </annotationBean>
+      <date>2011-01-21 16:02:09.633 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>3d76be4c-83c4-413b-91f2-b0ce69dcbd97</identification>
+      </annotationBean>
+      <date>2010-11-22 13:29:43.282 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>ca8fb5c5-0e8c-4e68-84f0-bdc85a77e2b3</identification>
+      </annotationBean>
+      <date>2010-11-22 13:29:26.400 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>e61023d9-d603-4df6-87e5-175603f106a5</identification>
+      </annotationBean>
+      <date>2010-11-22 13:28:31.68 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>394aced4-ee5d-4355-8ebe-9fc8bcfe5303</identification>
+      </annotationBean>
+      <date>2011-06-21 12:07:46.327 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>8175c97b-6385-460a-98ab-5cf974010d51</identification>
+      </annotationBean>
+      <date>2010-11-22 12:11:59.610 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>a388d568-ca08-43b4-abaf-3744a6801d45</identification>
+      </annotationBean>
+      <date>2010-11-22 13:30:28.898 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>7153a2dd-18bd-4f25-80ab-1efa8afc567d</identification>
+      </annotationBean>
+      <date>2011-01-21 16:02:39.43 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file


[15/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/EventProcessor.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/EventProcessor.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/EventProcessor.java
new file mode 100644
index 0000000..291da99
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/EventProcessor.java
@@ -0,0 +1,1547 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.provenance.lineageservice;
+
+import static java.util.Collections.synchronizedList;
+import static net.sf.taverna.t2.provenance.lineageservice.utils.ProvenanceProcessor.DATAFLOW_ACTIVITY;
+import static net.sf.taverna.t2.provenance.lineageservice.utils.ProvenanceUtils.getDataItemAsXML;
+import static net.sf.taverna.t2.provenance.lineageservice.utils.ProvenanceUtils.iterationToString;
+import static net.sf.taverna.t2.provenance.lineageservice.utils.ProvenanceUtils.parentProcess;
+import static net.sf.taverna.t2.provenance.vocabulary.SharedVocabulary.ACTIVITY_EVENT_TYPE;
+import static net.sf.taverna.t2.provenance.vocabulary.SharedVocabulary.END_WORKFLOW_EVENT_TYPE;
+import static net.sf.taverna.t2.provenance.vocabulary.SharedVocabulary.INVOCATION_STARTED_EVENT_TYPE;
+import static net.sf.taverna.t2.provenance.vocabulary.SharedVocabulary.ITERATION_EVENT_TYPE;
+import static net.sf.taverna.t2.provenance.vocabulary.SharedVocabulary.PROCESSOR_EVENT_TYPE;
+import static net.sf.taverna.t2.provenance.vocabulary.SharedVocabulary.PROCESS_EVENT_TYPE;
+import static net.sf.taverna.t2.provenance.vocabulary.SharedVocabulary.WORKFLOW_DATA_EVENT_TYPE;
+
+import java.beans.ExceptionListener;
+import java.beans.XMLEncoder;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.sql.Blob;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
+
+import javax.sql.rowset.serial.SerialBlob;
+
+import net.sf.taverna.t2.provenance.item.DataProvenanceItem;
+import net.sf.taverna.t2.provenance.item.DataflowRunComplete;
+import net.sf.taverna.t2.provenance.item.InputDataProvenanceItem;
+import net.sf.taverna.t2.provenance.item.InvocationStartedProvenanceItem;
+import net.sf.taverna.t2.provenance.item.IterationProvenanceItem;
+import net.sf.taverna.t2.provenance.item.OutputDataProvenanceItem;
+import net.sf.taverna.t2.provenance.item.ProvenanceItem;
+import net.sf.taverna.t2.provenance.item.WorkflowProvenanceItem;
+import net.sf.taverna.t2.provenance.lineageservice.utils.DataBinding;
+import net.sf.taverna.t2.provenance.lineageservice.utils.DataLink;
+import net.sf.taverna.t2.provenance.lineageservice.utils.NestedListNode;
+import net.sf.taverna.t2.provenance.lineageservice.utils.Port;
+import net.sf.taverna.t2.provenance.lineageservice.utils.PortBinding;
+import net.sf.taverna.t2.provenance.lineageservice.utils.ProcessorBinding;
+import net.sf.taverna.t2.provenance.lineageservice.utils.ProcessorEnactment;
+import net.sf.taverna.t2.provenance.lineageservice.utils.ProvenanceProcessor;
+import net.sf.taverna.t2.provenance.lineageservice.utils.ProvenanceUtils;
+import net.sf.taverna.t2.provenance.vocabulary.SharedVocabulary;
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.workflowmodel.Dataflow;
+import net.sf.taverna.t2.workflowmodel.DataflowInputPort;
+import net.sf.taverna.t2.workflowmodel.DataflowOutputPort;
+import net.sf.taverna.t2.workflowmodel.Datalink;
+import net.sf.taverna.t2.workflowmodel.InputPort;
+import net.sf.taverna.t2.workflowmodel.MergeInputPort;
+import net.sf.taverna.t2.workflowmodel.MergeOutputPort;
+import net.sf.taverna.t2.workflowmodel.OutputPort;
+import net.sf.taverna.t2.workflowmodel.Processor;
+import net.sf.taverna.t2.workflowmodel.ProcessorInputPort;
+import net.sf.taverna.t2.workflowmodel.ProcessorOutputPort;
+import net.sf.taverna.t2.workflowmodel.processor.activity.Activity;
+import net.sf.taverna.t2.workflowmodel.processor.activity.NestedDataflow;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//import org.apache.commons.io.FileUtils;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.jdom.Document;
+import org.jdom.Element;
+import org.jdom.JDOMException;
+import org.jdom.Namespace;
+import org.jdom.input.SAXBuilder;
+import org.jdom.output.XMLOutputter;
+
+import uk.org.taverna.scufl2.api.io.WorkflowBundleIO;
+
+/**
+ * @author Paolo Missier
+ */
+public class EventProcessor {
+	/**
+	 * A map of UUIDs of the originating processor to the ProcBinding object
+	 * that contains its parameters
+	 */
+	private Map<String, ProcessorBinding> procBindingMap = new ConcurrentHashMap<>();
+
+	/** A map of child ids to their parents in the hierarchy of events:
+	 *  workflow -> process -> processor -> activity -> iteration
+	 */
+	private Map<String, String> parentChildMap= new ConcurrentHashMap<>();
+
+	private static Logger logger = Logger.getLogger(EventProcessor.class);
+
+	private static final String OUTPUT_CONTAINER_PROCESSOR = "_OUTPUT_";
+	private static final String INPUT_CONTAINER_PROCESSOR = "_INPUT_";
+
+	private volatile boolean workflowStructureDone = false; // used to inhibit processing of multiple workflow events -- we only need the first
+	private volatile String workflowRunId = null; // unique run ID. set when we see the first event of type "process"
+
+	String topLevelDataflowName = null;
+	String topLevelDataflowID   = null;
+
+	Map<String, String> wfNestingMap = new ConcurrentHashMap<>();
+
+	// all input bindings are accumulated here so they can be "backpatched" (see backpatching() )
+	List<PortBinding> allInputVarBindings = synchronizedList(new ArrayList<PortBinding>());
+
+	// dedicated class for processing WorkflowData events which carry workflow output info
+	private WorkflowDataProcessor  wfdp;
+	private ProvenanceWriter pw = null;
+	private ProvenanceQuery  pq = null;
+
+	private HashMap<String, Port> mapping;
+
+	private Map<String, ProcessorEnactment> processorEnactmentMap = new ConcurrentHashMap<>();
+
+	private Map<String, ProvenanceProcessor> processorMapById = new ConcurrentHashMap<>();
+
+	private WorkflowBundleIO io;
+
+	// Backpatching temporarily disabled
+	private static final boolean backpatching = false;
+
+	public EventProcessor(WorkflowBundleIO io) {
+		this.io = io;
+	}
+
+	/**
+	 * @param pw
+	 * @throws SQLException
+	 * @throws ClassNotFoundException
+	 * @throws IllegalAccessException
+	 * @throws InstantiationException
+	 *
+	 */
+	public EventProcessor(ProvenanceWriter pw, ProvenanceQuery pq,
+			WorkflowDataProcessor wfdp,WorkflowBundleIO io) throws InstantiationException,
+			IllegalAccessException, ClassNotFoundException, SQLException {
+		this.pw = pw;
+		this.pq = pq;
+		this.wfdp = wfdp;
+		this.io = io;
+
+		//logger.setLevel((Level) Level.INFO);
+	}
+
+	/**
+	 * this is the new version that makes use of the T2 deserializer
+	 * populate static portion of the DB<br/>
+	 * the static structure may already be in the DB -- this is detected as a duplicate top-level workflow ID.
+	 * In this case, we skip this processing altogether
+	 * @param content
+	 *            is a serialized dataflow (XML) -- this is parsed using the T2
+	 *            Deserializer
+	 * @return the workflowRunId for this workflow structure
+	 */
+	public String processWorkflowStructure(ProvenanceItem provenanceItem) {
+		/*
+		 * this flag is set to prevent processing of separate
+		 * workflowProvenanceItems that describe nested workflows. the
+		 * processing of all nested workflows is done as part of the very first
+		 * workflowProvenanceItem that we receive, which is self-consistent. so
+		 * we ignore all others
+		 */
+		if (workflowStructureDone)
+			return null;
+		WorkflowProvenanceItem wpi = (WorkflowProvenanceItem) provenanceItem;
+		setWorkflowRunId(wpi.getIdentifier());
+		workflowStructureDone = true;
+		return processWorkflowStructure(wpi.getDataflow());
+	}
+
+	public String processWorkflowStructure(Dataflow df) {
+		topLevelDataflowName = df.getLocalName();
+		topLevelDataflowID   = df.getIdentifier();
+
+		// check whether we already have this WF in the DB
+		List<String> workflowIds = null;
+		try {
+			workflowIds = pq.getAllworkflowIds();
+		} catch (SQLException e) {
+			logger.warn("Problem processing workflow structure", e);
+		}
+
+		if (workflowIds == null || workflowIds.contains(topLevelDataflowID)) {
+			// not already in the DB
+			logger.info("new workflow structure with ID " + topLevelDataflowID);
+			ProvenanceProcessor provProc = new ProvenanceProcessor();
+			provProc.setIdentifier(UUID.randomUUID().toString());
+			provProc.setProcessorName(topLevelDataflowName);
+			provProc.setFirstActivityClassName(DATAFLOW_ACTIVITY);
+			provProc.setWorkflowId(topLevelDataflowID);
+			provProc.setTopLevelProcessor(true);
+			// record the top level dataflow as a processor in the DB
+			try {
+				pw.addProcessor(provProc);
+				// pw.addProcessor(topLevelDataflowName, DATAFLOW_PROCESSOR_TYPE, topLevelDataflowID, true);  // true -> is top level
+			} catch (SQLException e) {
+				logger.warn("Can't add processor " + topLevelDataflowID, e);
+			}
+		}
+
+		return processDataflowStructure(df, topLevelDataflowID, df.getLocalName());  // null: no external name given to top level dataflow
+	}
+
+	private Blob serialize(Dataflow df) {
+		Element serializeDataflow = null;xmlSerializer.serializeDataflow(df);//FIXME
+		String dataflowString = null;
+		try {
+		    XMLOutputter outputter = new XMLOutputter();
+		    StringWriter stringWriter = new StringWriter();
+		    outputter.output(serializeDataflow, stringWriter);
+		    dataflowString = stringWriter.toString();
+		} catch (java.io.IOException e) {
+		    logger.error("Could not serialise dataflow", e);
+		    // FIXME Bad Exception handling!
+		}
+		return new SerialBlob(dataflowString.getBytes("UTF-8"));
+	}
+
+	/**
+	 * note: this method can be called as part of a recursion on sub-workflows
+	 * 
+	 * @param df
+	 * @param dataflowID
+	 *            the UUID for the entire dataflow (may be a sub-dataflow)
+	 * @param localName
+	 *            the external name of the dataflow. Null if this is top level,
+	 *            not null if a sub-dataflow
+	 * @return the workflowRunId for this workflow structure
+	 */
+	private String processDataflowStructure(Dataflow df, String dataflowID, String externalName) {
+		String localWorkflowRunID = getWorkflowRunId();
+
+		//dataflowDepth++;
+
+		try {
+			// check whether we already have this WF in the DB
+			boolean alreadyInDb;
+			try {
+				List<String> workflowIds = pq.getAllworkflowIds();
+				alreadyInDb = workflowIds != null && workflowIds.contains(dataflowID);
+			} catch (SQLException e) {
+				logger.warn("Problem processing dataflow structure for " + dataflowID, e);
+				alreadyInDb = false;
+			}
+
+			// add workflow ID -- this is NOT THE SAME AS the workflowRunId
+
+			/*
+			 * this could be a nested workflow -- in this case, override its
+			 * workflowRunId with that of its parent
+			 */
+			if (!alreadyInDb) {
+				String parentDataflow = wfNestingMap.get(dataflowID);
+				Blob blob = serialize(df);
+				if (parentDataflow == null) {
+					// this is a top level dataflow description
+					pw.addWFId(dataflowID, null, externalName, blob); // set its dataflowID with no parent
+
+				} else {
+					// we are processing a nested workflow structure
+					logger.debug("dataflow "+dataflowID+" with external name "+externalName+" is nested within "+parentDataflow);
+
+					pw.addWFId(dataflowID, parentDataflow, externalName, blob); // set its dataflowID along with its parent
+
+					// override workflowRunId to point to top level -- UNCOMMENTED PM 9/09  CHECK
+					localWorkflowRunID = pq.getRuns(parentDataflow, null).get(0).getWorkflowRunId();
+				}
+			}
+			// Log the run itself
+			pw.addWorkflowRun(dataflowID, localWorkflowRunID);
+
+			// add processors along with their variables
+			List<Port> vars = new ArrayList<Port>();
+			for (Processor p : df.getProcessors()) {
+				String pName = p.getLocalName();
+
+				//CHECK get type of first activity and set this as the type of the processor itself
+				List<? extends Activity<?>> activities = p.getActivityList();
+
+				if (! alreadyInDb) {
+					ProvenanceProcessor provProc;
+					String pType = null;
+					if (activities != null && !activities.isEmpty())
+						pType = activities.get(0).getClass().getCanonicalName();
+					provProc = new ProvenanceProcessor();
+					provProc.setIdentifier(UUID.randomUUID().toString());
+					provProc.setProcessorName(pName);
+					provProc.setFirstActivityClassName(pType);
+					provProc.setWorkflowId(dataflowID);
+					provProc.setTopLevelProcessor(false);
+
+					pw.addProcessor(provProc);
+
+					//pw.addProcessor(pName, pType, dataflowID, false);  // false: not a top level processor
+
+					/*
+					 * add all input ports for this processor as input variables
+					 */
+					for (ProcessorInputPort ip : p.getInputPorts()) {
+						Port inputVar = new Port();
+						inputVar.setIdentifier(UUID.randomUUID().toString());
+						inputVar.setProcessorId(provProc.getIdentifier());
+						inputVar.setProcessorName(pName);
+						inputVar.setWorkflowId(dataflowID);
+						inputVar.setPortName(ip.getName());
+						inputVar.setDepth(ip.getDepth());
+						inputVar.setInputPort(true);
+					 	vars.add(inputVar);
+					}
+
+					/*
+					 * add all output ports for this processor as output
+					 * variables
+					 */
+					for (ProcessorOutputPort op : p.getOutputPorts()) {
+						Port outputVar = new Port();
+						outputVar.setIdentifier(UUID.randomUUID().toString());
+						outputVar.setProcessorName(pName);
+						outputVar.setProcessorId(provProc.getIdentifier());
+						outputVar.setWorkflowId(dataflowID);
+						outputVar.setPortName(op.getName());
+						outputVar.setDepth(op.getDepth());
+						outputVar.setInputPort(false);
+
+						vars.add(outputVar);
+					}
+				}
+
+				/*
+				 * check for nested structures: if the activity is
+				 * DataflowActivity then this processor is a nested workflow;
+				 * make an entry into wfNesting map with its ID and recurse on
+				 * the nested workflow
+				 */
+
+				if (activities != null)
+					for (Activity<?> a : activities) {
+						if (!(a instanceof NestedDataflow))
+							continue;
+
+						Dataflow nested = ((NestedDataflow) a)
+								.getNestedDataflow();
+						wfNestingMap.put(nested.getIdentifier(), dataflowID); // child -> parent
+
+						// RECURSIVE CALL
+						processDataflowStructure(nested,
+								nested.getIdentifier(), p.getLocalName());
+					}
+			} // end for each processor
+
+			// add inputs to entire dataflow
+			String pName = INPUT_CONTAINER_PROCESSOR;  // overridden -- see below
+
+			/*
+			 * check whether we are processing a nested workflow. in this case
+			 * the input vars are not assigned to the INPUT processor but to the
+			 * containing dataflow
+			 */
+			if (! alreadyInDb) {
+				if (externalName != null) // override the default if we are nested or someone external name is provided
+					pName = externalName;
+
+				for (DataflowInputPort ip : df.getInputPorts()) {
+					Port inputVar = new Port();
+					inputVar.setIdentifier(UUID.randomUUID().toString());
+					inputVar.setProcessorId(null); // meaning workflow port
+					inputVar.setProcessorName(pName);
+					inputVar.setWorkflowId(dataflowID);
+					inputVar.setPortName(ip.getName());
+					inputVar.setDepth(ip.getDepth());
+					inputVar.setInputPort(true);  // CHECK PM modified 11/08 -- input vars are actually outputs of input processors...
+
+					vars.add(inputVar);
+				}
+
+				// add outputs of entire dataflow
+				pName = OUTPUT_CONTAINER_PROCESSOR;  // overridden -- see below
+
+				/*
+				 * check whether we are processing a nested workflow. in this
+				 * case the output vars are not assigned to the OUTPUT processor
+				 * but to the containing dataflow
+				 */
+				if (externalName != null) // we are nested
+					pName = externalName;
+
+				for (DataflowOutputPort op : df.getOutputPorts()) {
+					Port outputVar = new Port();
+					outputVar.setIdentifier(UUID.randomUUID().toString());
+					outputVar.setProcessorId(null); // meaning workflow port
+					outputVar.setProcessorName(pName);
+					outputVar.setWorkflowId(dataflowID);
+					outputVar.setPortName(op.getName());
+					outputVar.setDepth(op.getDepth());
+					outputVar.setInputPort(false);  // CHECK PM modified 11/08 -- output vars are actually outputs of output processors...
+					vars.add(outputVar);
+				}
+
+				pw.addPorts(vars, dataflowID);
+				makePortMapping(vars);
+
+				/*
+				 * add datalink records using the dataflow links retrieving the
+				 * processor names requires navigating from links to source/sink
+				 * and from there to the processors
+				 */
+				for (Datalink l : df.getLinks()) {
+					// TODO cover the case of datalinks from an input and to an output to the entire dataflow
+
+					Port sourcePort = null;
+					Port destinationPort = null;
+
+					OutputPort source = l.getSource();
+					if (source instanceof ProcessorOutputPort) {
+						String sourcePname = ((ProcessorOutputPort) source)
+								.getProcessor().getLocalName();
+						sourcePort = lookupPort(sourcePname, source.getName(), false);
+					} else if (source instanceof MergeOutputPort) {
+						// TODO: Handle merge output ports
+					} else
+						// Assume it is internal port from DataflowInputPort
+						sourcePort = lookupPort(externalName, source.getName(), true);
+
+					InputPort sink = l.getSink();
+					if (sink instanceof ProcessorInputPort) {
+						String sinkPname = ((ProcessorInputPort) sink)
+								.getProcessor().getLocalName();
+						destinationPort = lookupPort(sinkPname, sink.getName(), true);
+					} else if (sink instanceof MergeInputPort) {
+						// TODO: Handle merge input ports
+					} else
+						// Assume it is internal port from DataflowOutputPort
+						destinationPort = lookupPort(externalName, sink.getName(), false);
+
+					if (sourcePort != null && destinationPort != null)
+						pw.addDataLink(sourcePort, destinationPort, dataflowID);
+					else
+						logger.info("Can't record datalink " + l);
+				}
+			}
+		} catch (Exception e) {
+			logger.error("Problem processing provenance for dataflow", e);
+		}
+
+		return dataflowID;
+	}
+
+	private void makePortMapping(List<Port> ports) {
+		mapping = new HashMap<>();
+		for (Port port: ports) {
+			String key = port.getProcessorName()
+					+ (port.isInputPort() ? "/i:" : "/o:") + port.getPortName();
+			mapping.put(key, port);
+		}
+	}
+
+	private Port lookupPort(String processorName, String portName, boolean isInputPort) {
+		String key = processorName + (isInputPort ? "/i:" : "/o:") + portName;
+		return mapping.get(key);
+	}
+
+	/**
+	 * processes an elementary process execution event from T2. Collects info
+	 * from events as they happen and sends them to the writer for processing
+	 * when the iteration event is received. Uses the map of procBindings to
+	 * process event id and the map of child ids to parent ids to ensure that
+	 * the correct proc binding is used
+	 * @param currentWorkflowID
+	 *
+	 * @param d
+	 * @param context
+	 */
+	public void processProcessEvent(ProvenanceItem provenanceItem, String currentWorkflowID) {
+		switch (provenanceItem.getEventType()) {
+		case PROCESS_EVENT_TYPE: {
+			String parentId = provenanceItem.getParentId();  // this is the workflowID
+			String identifier = provenanceItem.getIdentifier();  // use this as workflowRunId if this is the top-level process
+			
+			parentChildMap.put(identifier, parentId);
+			ProcessorBinding pb = new ProcessorBinding();
+			pb.setWorkflowRunId(getWorkflowRunId());
+			pb.setWorkflowId(currentWorkflowID);
+			procBindingMap.put(identifier, pb);
+			return;
+		}
+		case PROCESSOR_EVENT_TYPE: {
+			String identifier = provenanceItem.getIdentifier();
+			String parentId = provenanceItem.getParentId();
+			String processID = provenanceItem.getProcessId(); // this is the external process ID
+
+			// this has the weird form facade0:dataflowname:pname  need to extract pname from here
+			String[] processName = processID.split(":");
+			procBindingMap.get(parentId).setProcessorName(
+					processName[processName.length - 1]);
+			// 3rd component of composite name
+
+			parentChildMap.put(identifier, parentId);
+			return;
+		}
+		case ACTIVITY_EVENT_TYPE: {
+			String identifier = provenanceItem.getIdentifier();
+			String parentId = provenanceItem.getParentId();
+			procBindingMap.get(parentChildMap.get(parentId))
+					.setFirstActivityClassName(identifier);
+			parentChildMap.put(identifier, parentId);
+			return;
+		}
+		case ITERATION_EVENT_TYPE: {
+			IterationProvenanceItem iterationProvenanceItem = (IterationProvenanceItem)provenanceItem;
+			if (iterationProvenanceItem.getParentIterationItem() != null)
+				// Skipping pipelined outputs, we'll process the parent output later instead
+				return;
+
+			// traverse up to root to retrieve ProcBinding that was created when we saw the process event
+			String activityID = provenanceItem.getParentId();
+			String processorID = parentChildMap.get(activityID);
+			String processID = parentChildMap.get(processorID);
+			String iterationID = provenanceItem.getIdentifier();
+			parentChildMap.put(iterationID, activityID);
+
+			ProcessorEnactment processorEnactment = processorEnactmentMap
+					.get(iterationID);
+			if (processorEnactment == null)
+				processorEnactment = new ProcessorEnactment();
+
+			ProcessorBinding procBinding = procBindingMap.get(processID);
+
+			String itVector = extractIterationVector(iterationToString(iterationProvenanceItem
+					.getIteration()));
+			procBinding.setIterationVector(itVector);
+
+			processorEnactment.setEnactmentStarted(iterationProvenanceItem
+					.getEnactmentStarted());
+			processorEnactment.setEnactmentEnded(iterationProvenanceItem
+					.getEnactmentEnded());
+			processorEnactment.setWorkflowRunId(workflowRunId);
+			processorEnactment.setIteration(itVector);
+
+			String processId = iterationProvenanceItem.getProcessId();
+			String parentProcessId = parentProcess(processId, 3);
+			if (parentProcessId != null) {
+				ProcessorEnactment parentProcEnact = getWfdp().invocationProcessToProcessEnactment
+						.get(parentProcessId);
+				if (parentProcEnact != null)
+					processorEnactment
+							.setParentProcessorEnactmentId(parentProcEnact
+									.getProcessEnactmentId());
+			}
+			processorEnactment.setProcessEnactmentId(iterationProvenanceItem
+					.getIdentifier());
+			processorEnactment.setProcessIdentifier(processId);
+
+			ProvenanceProcessor provenanceProcessor;
+			if (processorEnactment.getProcessorId() == null) {
+				provenanceProcessor = pq.getProvenanceProcessorByName(
+						currentWorkflowID, procBinding.getProcessorName());
+				if (provenanceProcessor == null)
+					// already logged warning
+					return;
+				processorMapById.put(provenanceProcessor.getIdentifier(),
+						provenanceProcessor);
+				processorEnactment.setProcessorId(provenanceProcessor
+						.getIdentifier());
+			} else {
+				provenanceProcessor = processorMapById.get(processorEnactment
+						.getProcessorId());
+				if (provenanceProcessor == null) {
+					provenanceProcessor = pq
+							.getProvenanceProcessorById(processorEnactment
+									.getProcessorId());
+					processorMapById.put(provenanceProcessor.getIdentifier(),
+							provenanceProcessor);
+				}
+			}
+
+			InputDataProvenanceItem inputDataEl = iterationProvenanceItem.getInputDataItem();
+			OutputDataProvenanceItem outputDataEl = iterationProvenanceItem.getOutputDataItem();
+
+			if (inputDataEl != null
+					&& processorEnactment.getInitialInputsDataBindingId() == null) {
+				processorEnactment
+						.setInitialInputsDataBindingId(processDataBindings(
+								inputDataEl, provenanceProcessor));
+				processInput(inputDataEl, procBinding, currentWorkflowID);
+			}
+
+			if (outputDataEl != null
+					&& processorEnactment.getFinalOutputsDataBindingId() == null) {
+				processorEnactment
+						.setFinalOutputsDataBindingId(processDataBindings(
+								outputDataEl, provenanceProcessor));
+				processOutput(outputDataEl, procBinding, currentWorkflowID);
+			}
+
+			try {
+				if (processorEnactmentMap.containsKey(iterationID)) {
+					getPw().updateProcessorEnactment(processorEnactment);
+				} else {
+					getPw().addProcessorEnactment(processorEnactment);
+					processorEnactmentMap.put(iterationID, processorEnactment);
+				}
+			} catch (SQLException e) {
+				logger.warn("Could not store processor enactment", e);
+			}
+			return;
+		}
+		case END_WORKFLOW_EVENT_TYPE: {
+			DataflowRunComplete completeEvent = (DataflowRunComplete) provenanceItem;
+			// use this event to do housekeeping on the input/output varbindings
+
+			// process the input and output values accumulated by WorkflowDataProcessor
+			getWfdp().processTrees(completeEvent, getWorkflowRunId());
+
+			reconcileLocalOutputs(provenanceItem.getWorkflowId());
+
+			if (! provenanceItem.getProcessId().contains(":")) {
+				// Top-level workflow finished
+				// No longer needed, done by processTrees()
+//				patchTopLevelnputs();
+
+				workflowStructureDone = false; // CHECK reset for next run...
+//				reconcileTopLevelOutputs(); // Done by reconcileLocalOutputs
+				getPw().closeCurrentModel();  // only real impl is for RDF
+			}
+			return;
+		}
+		case WORKFLOW_DATA_EVENT_TYPE: {
+			// give this event to a WorkflowDataProcessor object for pre-processing
+			//			try {
+			// TODO may generate an exception when the data is an error CHECK
+			getWfdp().addWorkflowDataItem(provenanceItem);
+			//			} catch (NumberFormatException e) {
+			//			logger.error(e);
+			//			}
+			//			logger.info("Received workflow data - not processing");
+			//FIXME not sure  - needs to be stored somehow
+			return;
+		}
+		case INVOCATION_STARTED_EVENT_TYPE: {
+			InvocationStartedProvenanceItem startedItem = (InvocationStartedProvenanceItem) provenanceItem;
+			ProcessorEnactment processorEnactment = processorEnactmentMap
+					.get(startedItem.getParentId());
+			if (processorEnactment == null) {
+				logger.error("Could not find ProcessorEnactment for invocation "
+						+ startedItem);
+				return;
+			}
+			getWfdp().invocationProcessToProcessEnactment.put(
+					startedItem.getInvocationProcessId(), processorEnactment);
+			return;
+		}
+		case ERROR_EVENT_TYPE:
+			//TODO process the error
+			return;
+		default:
+			// TODO broken, should we throw something here?
+			return;
+		}
+	}
+
+	private String processDataBindings(
+			DataProvenanceItem provenanceItem, ProvenanceProcessor provenanceProcessor) {
+		// TODO: Cache known provenaneItems and avoid registering again
+		String dataBindingId = UUID.randomUUID().toString();
+		boolean isInput = provenanceItem instanceof InputDataProvenanceItem;
+
+		for (Entry<String, T2Reference> entry : provenanceItem.getDataMap().entrySet()) {
+			DataBinding dataBinding = new DataBinding();
+			dataBinding.setDataBindingId(dataBindingId);
+			Port port = findPort(provenanceProcessor, entry.getKey(), isInput); // findPort
+			if (port == null) {
+				logger.warn("Could not find port for " + entry.getKey());
+				continue;
+			}
+			dataBinding.setPort(port);
+			dataBinding.setT2Reference(entry.getValue().toUri().toASCIIString());
+			dataBinding.setWorkflowRunId(workflowRunId);
+			try {
+				getPw().addDataBinding(dataBinding);
+			} catch (SQLException e) {
+				logger.warn("Could not register data binding for " + port, e);
+			}
+		}
+		return dataBindingId;
+	}
+
+	private Port findPort(ProvenanceProcessor provenanceProcessor,
+			String portName, boolean isInput) {
+		// TODO: Query pr dataflow and cache
+		Map<String, String> queryConstraints = new HashMap<>();
+		queryConstraints.put("V.workflowId",
+				provenanceProcessor.getWorkflowId());
+		String processorName = provenanceProcessor.getProcessorName();
+		queryConstraints.put("processorName", processorName);
+		queryConstraints.put("portName", portName);
+		queryConstraints.put("isInputPort", isInput ? "1" : "0");
+		try {
+			List<Port> vars = pq.getPorts(queryConstraints);
+			if (vars.isEmpty()) {
+				logger.warn("Can't find port " + portName + " in "
+						+ processorName);
+			} else if (vars.size() > 1) {
+				logger.warn("Multiple matches for port " + portName + " in "
+						+ processorName + ", got:" + vars);
+			} else
+				return vars.get(0);
+		} catch (SQLException e) {
+			logger.error(
+					"Problem getting ports for processor: " + processorName
+							+ " worflow: "
+							+ provenanceProcessor.getWorkflowId(), e);
+		}
+		return null;
+	}
+
+
+	/**
+	 * fills in the VBs for the global inputs -- this removes the need for explicit events
+	 * that account for these value bindings...
+	 */
+	public void patchTopLevelnputs() {
+
+		// for each input I to topLevelDataflow:
+		// pick first outgoing datalink with sink P:X
+		// copy value X to I -- this can be a collection, so copy everything
+
+		// get all global input vars
+
+		//		logger.info("\n\n BACKPATCHING GLOBAL INPUTS with dataflowDepth = "+dataflowDepth+"*******\n");
+
+		List<Port> inputs=null;
+		try {
+			inputs = getPq().getInputPorts(topLevelDataflowName, topLevelDataflowID);
+
+			for (Port input:inputs)  {
+
+				//				logger.info("global input: "+input.getVName());
+
+				Map<String,String> queryConstraints = new HashMap<String,String>();
+
+//				queryConstraints.put("sourcePortName", input.getVName());
+//				queryConstraints.put("sourceProcessorName", input.getPName());
+				queryConstraints.put("sourcePortId", input.getIdentifier());
+				queryConstraints.put("workflowId", input.getWorkflowId());
+				List<DataLink> outgoingDataLinks = getPq().getDataLinks(queryConstraints);
+
+				// any datalink will do, use the first
+				String targetPname = outgoingDataLinks.get(0).getDestinationProcessorName();
+				String targetVname = outgoingDataLinks.get(0).getDestinationPortName();
+
+//				logger.info("copying values from ["+targetPname+":"+targetVname+"] for instance ID: ["+workflowRunId+"]");
+
+				queryConstraints.clear();
+				queryConstraints.put("V.portName", targetVname);
+				queryConstraints.put("V.processorName", targetPname);
+				queryConstraints.put("VB.workflowRunId", getWorkflowRunId());
+				queryConstraints.put("V.workflowId", topLevelDataflowID);
+
+				for (PortBinding vb : getPq().getPortBindings(queryConstraints)) {
+					PortBinding inputPortBinding = new PortBinding(vb);
+
+					// insert PortBinding back into VB with the global input portName
+					inputPortBinding.setProcessorName(input.getProcessorName());
+					inputPortBinding.setPortName(input.getPortName());
+					try {
+						getPw().addPortBinding(inputPortBinding);
+					} catch (SQLException ex) {
+						logger.info("Already logged port binding", ex);
+					}
+				}
+			}
+		} catch (SQLException e) {
+			logger.warn("Patch top level inputs problem for provenance", e);
+		} catch (IndexOutOfBoundsException e) {
+			logger.error("Could not patch top level", e);
+		}
+	}
+
+	public void reconcileTopLevelOutputs() {
+		reconcileLocalOutputs(topLevelDataflowID);
+	}
+
+	// PM added 23/4/09
+	/**
+	 * reconcile the top level outputs with the results from its immediate precedessors in the graph.<br/>
+	 * various cases have to be considered: predecessors may include records that are not in the output,
+	 * while the output may include nested list structures that are not in the precedessors. This method accounts
+	 * for a 2-way reconciliation that considers all possible cases.<br/>
+	 * at the end, outputs and their predecessors contain the same data.<p/>
+	 * NOTE: if we assume that data values (URIs) are <em>always</em> unique then this is greatly simplified by just
+	 * comparing two sets of value records by their URIs and reconciling them. But this is not the way it is done here
+	 */
+	public void reconcileLocalOutputs(String dataflowID) {
+		/*
+	for each output O
+
+	for each variable V in predecessors(O)
+
+	fetch all VB records for O into list OValues
+	fetch all VB records for V  into list Yalues
+
+	compare OValues and VValues:
+	it SHOULD be the case that OValues is a subset of YValues. Under this assumption:
+
+	for each vb in YValues:
+	- if there is a matching o in OValues then (vb may be missing collection information)
+	    copy o to vb
+	  else
+	    if vb has no collection info && there is a matching tree node tn  in OTree (use iteration index for the match) then
+	       set vb to be in collection tb
+	       copy vb to o
+
+     finally copy all Collection records for O in OTree -- catch duplicate errors
+		 */
+
+		Map<String, String> queryConstraints = new HashMap<>();
+
+		try {
+			// for each output O
+			for (Port output:pq.getOutputPorts(topLevelDataflowName, topLevelDataflowID))  {
+				// collect all VBs for O
+//				String oPName = output.getPName();
+//				String oVName = output.getVName();
+//				queryConstraints.put("V.portName", oVName);
+//				queryConstraints.put("V.processorName", oPName);
+//				queryConstraints.put("VB.workflowRunId", workflowRunId);
+//				queryConstraints.put("V.workflowId", topLevelDataflowID);
+
+//				List<PortBinding> OValues = pq.getPortBindings(queryConstraints);
+
+				// find all records for the immediate precedessor Y of O
+				queryConstraints.clear();
+//				queryConstraints.put("destinationPortName", output.getVName());
+//				queryConstraints.put("destinationProcessorName", output.getPName());
+				queryConstraints.put("destinationPortId", output.getIdentifier());
+				queryConstraints.put("workflowId", output.getWorkflowId());
+				List<DataLink> incomingDataLinks = pq.getDataLinks(queryConstraints);
+
+				// there can be only one -- but check that there is one!
+				if (incomingDataLinks.isEmpty())
+					continue;
+
+				String sourcePname = incomingDataLinks.get(0).getSourceProcessorName();
+				String sourceVname = incomingDataLinks.get(0).getSourcePortName();
+
+				queryConstraints.clear();
+				queryConstraints.put("V.portName", sourceVname);
+				queryConstraints.put("V.processorName", sourcePname);
+				queryConstraints.put("VB.workflowRunId", getWorkflowRunId());
+				queryConstraints.put("V.workflowId", topLevelDataflowID);
+
+				List<PortBinding> YValues = pq.getPortBindings(queryConstraints);
+
+				// for each YValue look for a match in OValues
+				// (assume the YValues values are a superset of OValues)!)
+
+				for (PortBinding yValue:YValues) {
+					// look for a matching record in PortBinding for output O
+					queryConstraints.clear();
+					queryConstraints.put("V.portName", output.getPortName());
+					queryConstraints.put("V.processorName", output.getProcessorName());
+					queryConstraints.put("VB.workflowRunId", getWorkflowRunId());
+					queryConstraints.put("V.workflowid", topLevelDataflowID);
+					queryConstraints.put("VB.iteration", yValue.getIteration());
+					if (yValue.getCollIDRef()!= null) {
+						queryConstraints.put("VB.collIDRef", yValue.getCollIDRef());
+						queryConstraints.put("VB.positionInColl", Integer.toString(yValue.getPositionInColl()));
+					}
+					List<PortBinding> matchingOValues = pq.getPortBindings(queryConstraints);
+
+					// result at most size 1
+					if (!matchingOValues.isEmpty()) {
+						PortBinding oValue = matchingOValues.get(0);
+
+						// copy collection info from oValue to yValue
+						yValue.setCollIDRef(oValue.getCollIDRef());
+						yValue.setPositionInColl(oValue.getPositionInColl());
+
+						pw.updatePortBinding(yValue);
+					} else {
+						// copy the yValue to O
+						// insert PortBinding back into VB with the global output portName
+						yValue.setProcessorName(output.getProcessorName());
+						yValue.setPortName(output.getPortName());
+						pw.addPortBinding(yValue);
+					}
+
+				} // for each yValue in YValues
+
+				// copy all Collection records for O to Y
+
+				// get all collections refs for O
+				queryConstraints.clear();
+				queryConstraints.put("workflowRunId", getWorkflowRunId());
+				queryConstraints.put("processorNameRef", output.getProcessorName());
+				queryConstraints.put("portName", output.getPortName());
+
+				List<NestedListNode> oCollections = pq.getNestedListNodes(queryConstraints);
+
+				// insert back as collection refs for Y -- catch duplicates
+				for (NestedListNode nln:oCollections) {
+					nln.setProcessorName(sourcePname);
+					nln.setProcessorName(sourceVname);
+
+					getPw().replaceCollectionRecord(nln, sourcePname, sourceVname);
+				}
+
+			} // for each output var
+
+		} catch (SQLException e) {
+			logger.warn("Problem reconciling top level outputs", e);
+		}
+
+	}
+
+	@SuppressWarnings("unchecked")
+	private void processOutput(OutputDataProvenanceItem provenanceItem,
+			ProcessorBinding procBinding, String currentWorkflowID) {
+		Element dataItemAsXML = getDataItemAsXML(provenanceItem);
+		List<Element> outputPorts = dataItemAsXML.getChildren("port");
+		for (Element outputport : outputPorts) {
+			String portName = outputport.getAttributeValue("name");
+
+			// value type may vary
+			List<Element> valueElements = outputport.getChildren();
+			if (valueElements != null && !valueElements.isEmpty()) {
+				Element valueEl = valueElements.get(0); // only really 1 child
+
+				processPortBinding(valueEl, procBinding.getProcessorName(),
+						portName, procBinding.getIterationVector(),
+						getWorkflowRunId(), currentWorkflowID);
+			}
+		}
+	}
+
+	/**
+	 * this method reconciles values in varBindings across an datalink: Firstly,
+	 * if vb's value is within a collection, _and_ it is copied from a value
+	 * generated during a previous iteration, then this method propagates the
+	 * list reference to that iteration value, which wouldn't have it.
+	 * Conversely, if vb is going to be input to an iteration, then it's lost
+	 * its containing list node, and we put it back in by looking at the
+	 * corresponding predecessor
+	 * 
+	 * @param vb
+	 * @throws SQLException
+	 */
+	private void backpatchIterationResults(List<PortBinding> newBindings) throws SQLException {
+		logger.debug("backpatchIterationResults: start");
+		for (PortBinding vb : newBindings) {
+			logger.debug("backpatchIterationResults: processing vb "
+					+ vb.getProcessorName() + "/" + vb.getPortName() + "="
+					+ vb.getValue());
+
+			if (vb.getCollIDRef()!= null) // this is a member of a collection
+				logger.debug("...which is inside a collection ");
+
+			// look for its antecedent
+			Map<String,String> queryConstraints = new HashMap<>();
+			queryConstraints.put("destinationPortName", vb.getPortName());
+			queryConstraints.put("destinationProcessorName", vb.getProcessorName());
+			queryConstraints.put("workflowId", pq.getWorkflowIdsForRun(vb.getWorkflowRunId()).get(0));  // CHECK picking first element in list...
+			List<DataLink> incomingDataLinks = pq.getDataLinks(queryConstraints);
+
+			// there can be only one -- but check that there is one!
+			if (incomingDataLinks.isEmpty())
+				return;
+
+			String sourcePname = incomingDataLinks.get(0).getSourceProcessorName();
+			String sourceVname = incomingDataLinks.get(0).getSourcePortName();
+
+			logger.debug("antecedent: "+sourcePname+":"+sourceVname);
+
+			// get the varbindings for this port and select the one with the same iteration vector as its successor
+			queryConstraints.clear();
+			queryConstraints.put("VB.portName", sourceVname);
+			queryConstraints.put("V.processorName", sourcePname);
+			queryConstraints.put("VB.value", vb.getValue());
+			queryConstraints.put("VB.workflowRunId", vb.getWorkflowRunId());
+
+			// reconcile
+			for (PortBinding b : pq.getPortBindings(queryConstraints)) {
+				logger.debug("backpatching " + sourceVname + " " + sourcePname);
+
+				if (vb.getCollIDRef() != null && b.getCollIDRef() == null) {
+					logger.debug("successor " + vb.getPortName()
+							+ " is in collection " + vb.getCollIDRef()
+							+ " but pred " + b.getPortName() + " is not");
+					logger.debug("putting " + b.getPortName()
+							+ " in collection " + vb.getCollIDRef()
+							+ " at pos " + vb.getPositionInColl());
+					b.setCollIDRef(vb.getCollIDRef());
+					b.setPositionInColl(vb.getPositionInColl());
+					getPw().updatePortBinding(b);
+
+				} else if (vb.getCollIDRef() == null && b.getCollIDRef() != null) {
+					logger.debug("successor " + vb.getPortName()
+							+ " is NOT in collection but pred "
+							+ b.getPortName() + " IS");
+					logger.debug("putting " + vb.getPortName()
+							+ " in collection " + b.getCollIDRef() + " at pos "
+							+ b.getPositionInColl());
+					vb.setCollIDRef(b.getCollIDRef());
+					vb.setPositionInColl(b.getPositionInColl());
+					getPw().updatePortBinding(vb);
+				}
+			}
+		}
+	}
+
+
+	/**
+	 * create one new PortBinding record for each input port binding
+	 * @param currentWorkflowID
+	 */
+	@SuppressWarnings("unchecked")
+	private void processInput(InputDataProvenanceItem provenanceItem,
+			ProcessorBinding procBinding, String currentWorkflowID) {
+		Element dataItemAsXML = getDataItemAsXML(provenanceItem);
+		int order = 0;
+		for (Element inputport : (List<Element>) dataItemAsXML.getChildren("port")) {
+			String portName = inputport.getAttributeValue("name");
+
+			try {
+				// add process order sequence to Port for this portName
+				Map<String, String> queryConstraints = new HashMap<>();
+				queryConstraints.put("V.workflowId", currentWorkflowID);
+				queryConstraints.put("processorName", procBinding.getProcessorName());
+				queryConstraints.put("portName", portName);
+				queryConstraints.put("isInputPort", "1");
+
+				Port v = getPq().getPorts(queryConstraints).get(0);
+				v.setIterationStrategyOrder(order++);
+				getPw().updatePort(v);
+			} catch (IndexOutOfBoundsException e) {
+				logger.error("Could not process input " + portName, e);
+			} catch (SQLException e1) {
+				logger.error("Could not process input " + portName, e1);
+			}
+
+			// value type may vary
+			List<Element> valueElements = inputport.getChildren(); // hopefully
+			// in the right order...
+			if (valueElements != null && valueElements.size() > 0) {
+				Element valueEl = valueElements.get(0); // expect only 1 child
+				//				processVarBinding(valueEl, processor, portName, iterationVector,
+				//				dataflow);
+
+				List<PortBinding> newBindings = processPortBinding(valueEl,
+						procBinding.getProcessorName(), portName,
+						procBinding.getIterationVector(), getWorkflowRunId(),
+						currentWorkflowID);
+				// this is a list whenever valueEl is of type list: in this case processVarBinding recursively
+				// processes all values within the collection, and generates one PortBinding record for each of them
+
+				allInputVarBindings.addAll(newBindings);
+
+				//				// if the new binding involves list values, then check to see if they need to be propagated back to
+//				// results of iterations
+
+				// Backpatching disabled as it is very inefficient and not needed
+				// for current Taverna usage
+
+				try {
+					if (backpatching)
+						backpatchIterationResults(newBindings);
+				} catch (SQLException e) {
+					logger.warn("Problem with back patching iteration results", e);
+				}
+			} else {
+				if (valueElements != null)
+					logger.debug("port name " + portName + "  "
+							+ valueElements.size());
+				else
+					logger.debug("valueElements is null for port name "
+							+ portName);
+			}
+		}
+	}
+
+	/**
+	 * capture the default case where the value is not a list
+	 *
+	 * @param valueEl
+	 * @param processorId
+	 * @param portName
+	 * @param iterationId
+	 * @param workflowRunId
+	 * @param currentWorkflowID
+	 */
+	private List<PortBinding> processPortBinding(Element valueEl,
+			String processorId, String portName, String iterationId,
+			String workflowRunId, String currentWorkflowID) {
+		// uses the defaults:
+		// collIdRef = null
+		// parentcollectionRef = null
+		// positionInCollection = 1
+		return processPortBinding(valueEl, processorId, portName, null, 1, null,
+				iterationId, workflowRunId, null, currentWorkflowID);
+	}
+
+	/**
+	 * general case where value can be a list
+	 * @param valueEl
+	 * @param processorId
+	 * @param portName
+	 * @param collIdRef
+	 * @param positionInCollection
+	 * @param parentCollectionRef
+	 * @param iterationId
+	 * @param workflowRunId
+	 * @param currentWorkflowID
+	 */
+	@SuppressWarnings("unchecked")
+	private List<PortBinding> processPortBinding(Element valueEl,
+			String processorId, String portName, String collIdRef,
+			int positionInCollection, String parentCollectionRef,
+			String iterationId, String workflowRunId, String itVector,
+			String currentWorkflowID) {
+		List<PortBinding> newBindings = new ArrayList<>();
+
+		String valueType = valueEl.getName();
+		//		logger.info("value element for " + processorId + ": "
+		//		+ valueType);
+
+		String iterationVector = (itVector == null ? extractIterationVector(iterationId)
+				: itVector);
+
+		PortBinding vb = new PortBinding();
+
+		vb.setWorkflowId(currentWorkflowID);
+		vb.setWorkflowRunId(workflowRunId);
+		vb.setProcessorName(processorId);
+		vb.setValueType(valueType);
+		vb.setPortName(portName);
+		vb.setCollIDRef(collIdRef);
+		vb.setPositionInColl(positionInCollection);
+
+		newBindings.add(vb);
+
+		if (valueType.equals("literal")) {
+			try {
+				vb.setIteration(iterationVector);
+				vb.setValue(valueEl.getAttributeValue("id"));
+				logger.debug("new input VB with workflowId="+currentWorkflowID+" processorId="+processorId+
+						" valueType="+valueType+" portName="+portName+" collIdRef="+collIdRef+
+						" position="+positionInCollection+" itvector="+iterationVector+
+						" value="+vb.getValue());
+				getPw().addPortBinding(vb);
+			} catch (SQLException e) {
+				logger.warn("Process Port Binding problem with provenance", e);
+			}
+
+		} else if (valueType.equals("referenceSet")) {
+			vb.setIteration(iterationVector);
+			vb.setValue(valueEl.getAttributeValue("id"));
+			vb.setReference(valueEl.getChildText("reference"));
+
+			logger.debug("new input VB with workflowId=" + currentWorkflowID
+					+ " processorId=" + processorId + " valueType=" + valueType
+					+ " portName=" + portName + " collIdRef=" + collIdRef
+					+ " position=" + positionInCollection + " itvector="
+					+ iterationVector + " value=" + vb.getValue());
+
+			try {
+				getPw().addPortBinding(vb);
+			} catch (SQLException e) {
+				logger.debug("Problem processing var binding -- performing update instead of insert", e); //, e);
+				// try to update the existing record instead using the current collection info
+
+				getPw().updatePortBinding(vb);
+			}
+
+		} else if (valueType.equals("list")) {
+			logger.debug("input of type list");
+
+			// add entries to the Collection and to the PortBinding tables
+			// list id --> Collection.collId
+
+			String collId = valueEl.getAttributeValue("id");
+			try {
+				parentCollectionRef = getPw().addCollection(processorId, collId,
+						parentCollectionRef, iterationVector, portName,
+						workflowRunId);
+
+				// iterate over each list element
+				List<Element> listElements = valueEl.getChildren();
+
+				positionInCollection = 1;  // also use this as a suffix to extend the iteration vector
+
+				// extend iteration vector to account for additional levels within the list
+
+				String originalIterationVector = iterationVector;
+
+				// children can be any base type, including list itself -- so
+				// use recursion
+				for (Element el : listElements) {
+					if (originalIterationVector.length() > 2) // vector is not empty
+						iterationVector = originalIterationVector.substring(0,
+								originalIterationVector.length()-1) + ","+
+								Integer.toString(positionInCollection-1) + "]";
+					else
+						iterationVector = "["+ (positionInCollection-1) + "]";
+
+					newBindings.addAll(processPortBinding(el, processorId,
+							portName, collId, positionInCollection,
+							parentCollectionRef, iterationId, workflowRunId,
+							iterationVector, currentWorkflowID));
+
+					positionInCollection++;
+				}
+			} catch (SQLException e) {
+				logger.warn("Problem processing var binding", e);
+			}
+		} else if (valueType.equals("error")) {
+			vb.setIteration(iterationVector);
+			vb.setValue(valueEl.getAttributeValue("id"));
+			vb.setReference(valueEl.getChildText("reference"));
+			try {
+				getPw().addPortBinding(vb);
+			} catch (SQLException e) {
+				logger.debug("Problem processing var binding -- performing update instead of insert", e); //, e);
+				// try to update the existing record instead using the current collection info
+
+				getPw().updatePortBinding(vb);
+			}
+		} else {
+			logger.warn("unrecognized value type element for "
+					+ processorId + ": " + valueType);
+		}
+
+		return newBindings;
+	}
+
+
+	/**
+	 * OBSOLETE: returns the iteration vector x,y,z,... from [x,y,z,...]
+	 * <p/>
+	 * now returns the vector itself -- this is still experimental
+	 *
+	 * @param iteration
+	 * @return
+	 */
+	@Deprecated
+	String extractIterationVector(String iteration) {
+		return iteration;
+	}
+
+	/**
+	 * silly class to hold pairs of strings. any better way??
+	 * @author paolo
+	 *
+	 */
+	class Pair {
+		String v1, v2;
+
+		public Pair(String current, String workflowId) {
+			v1=current; v2=workflowId;
+		}
+
+		/**
+		 * @return the v1
+		 */
+		public String getV1() {
+			return v1;
+		}
+
+		/**
+		 * @param v1 the v1 to set
+		 */
+		public void setV1(String v1) {
+			this.v1 = v1;
+		}
+
+		/**
+		 * @return the v2
+		 */
+		public String getV2() {
+			return v2;
+		}
+
+		/**
+		 * @param v2 the v2 to set
+		 */
+		public void setV2(String v2) {
+			this.v2 = v2;
+		}
+	}
+
+	@SuppressWarnings("deprecation")
+	public List<Pair> toposort(String dataflowName, String workflowRunId) throws SQLException  {
+
+//		String workflowId = pq.getworkflowIdForDataflow(dataflowName, workflowRunId);
+		String workflowId = pq.getWorkflowIdForExternalName(dataflowName);
+
+		// fetch processors along with the count of their predecessors
+		Map<String, Integer> predecessorsCount = getPq().getPredecessorsCount(workflowRunId);
+		Map<String, List<String>> successorsOf = new HashMap<String, List<String>>();
+//		List<String> procList = pq.getContainedProcessors(dataflowName, workflowRunId);
+		List<String> procList = pq.getContainedProcessors(dataflowName);
+
+		for (String s:procList) {
+			List<String> successors = getPq().getSuccProcessors(s, workflowId, workflowRunId);
+			successorsOf.put(s, successors);
+		}
+
+		List<Pair>  sorted = tsort(procList, dataflowName, predecessorsCount, successorsOf, workflowId, workflowRunId);
+
+		for (int i=0; i< sorted.size(); i++) {
+			String procName = sorted.get(i).getV1();
+
+			if (pq.isDataflow(procName) && !procName.equals(dataflowName)) {  // handle weirdness: a dataflow is contained within itself..
+				// recurse on procName
+				List<Pair> sortedSublist = toposort(procName, workflowRunId);
+
+				// replace procName with sortedSublist in sorted
+				sorted.remove(i);
+				sorted.addAll(i, sortedSublist);
+			}
+		}
+		return sorted;
+	}
+
+
+
+	/**
+	 * @param procList
+	 * @param predecessorsCount
+	 * @param successorsOf
+	 * @param workflowRunId
+	 * @return
+	 * @throws SQLException
+	 */
+	public List<Pair> tsort(List<String> procList, String dataflowName,
+			Map<String, Integer> predecessorsCount,
+			Map<String, List<String>> successorsOf, String workflowId,
+			String workflowRunId) throws SQLException {
+		List<Pair> l = new ArrayList<>();		// holds sorted elements
+		List<String> q = new ArrayList<>(); 	// temp queue
+
+		// init queue with procList processors that have no predecessors
+		for (String proc:procList)
+			if (predecessorsCount.get(proc) == null || predecessorsCount.get(proc) == 0 &&
+					!proc.equals(dataflowName))
+				q.add(proc);
+
+		while (!q.isEmpty()) {
+			String current = q.remove(0);
+			l.add(new Pair(current, workflowId));
+
+			List<String> successors = successorsOf.get(current);
+
+			if (successors == null)
+				continue;
+
+			// reduce the number of predecessors to each of the successors by one
+			// NB we must traverse an additional datalink through a nested workflow input if the successor is a dataflow!!
+			for (String succ : successors) {
+				// decrease edge count for each successor processor
+				predecessorsCount.put(succ, predecessorsCount.get(succ) - 1);
+
+				if (predecessorsCount.get(succ) == 0 && !succ.equals(dataflowName))
+					q.add(succ);
+			}
+		} // end loop on q
+		return l;
+	}
+
+	@SuppressWarnings("deprecation")
+	public void propagateANL(String workflowRunId) throws SQLException {
+		String top = pq.getTopLevelDataflowName(workflowRunId);
+
+		// //////////////////////
+		// PHASE I: toposort the processors in the whole graph
+		// //////////////////////
+		List<Pair> sorted = toposort(top, workflowRunId);
+
+		List<String> sortedProcessors = new ArrayList<>();
+
+		for (Pair p : sorted)
+			sortedProcessors.add(p.getV1());
+
+		logger.debug("final sorted list of processors");
+		for (Pair p : sorted)
+			logger.debug(p.getV1() + " in workflowId " + p.getV2());
+
+		// //////////////////////
+		// PHASE II: traverse and set anl on each port
+		// //////////////////////
+
+		//		// sorted processor names in L at this point
+		//		// process them in order
+		for (Pair pnameInContext : sorted) {
+			//			// process pname's inputs -- set ANL to be the DNL if not set in prior steps
+			String pname     = pnameInContext.getV1();
+			String workflowId = pnameInContext.getV2();
+
+			List<Port> inputs = getPq().getInputPorts(pname, workflowId); // null -> do not use instance (??) CHECK
+
+			int totalANL = 0;
+			for (Port iv : inputs) {
+
+				if (! iv.isResolvedDepthSet()) {
+					iv.setResolvedDepth(iv.getDepth());
+					getPw().updatePort(iv);
+				}
+
+				int delta_nl = iv.getResolvedDepth() - iv.getDepth();
+
+				// if delta_nl < 0 then Taverna wraps the value into a list --> use dnl(X) in this case
+				if (delta_nl < 0 ) delta_nl = 0;// CHECK iv.getTypedepth();
+
+				totalANL += delta_nl;
+
+				// this should take care of the special case of the top level dataflow with inputs that have successors in the graph
+				// propagate this through all the links from this var
+//				List<Port> successors = getPq().getSuccVars(pname, iv.getVName(), workflowRunId);
+
+//				for (Port v : successors) {
+//				v.setresolvedDepth(iv.getresolvedDepth());
+//				getPw().updateVar(v);
+//				}
+			}
+
+			// process pname's outputs -- set ANL based on the sum formula (see
+			// paper)
+			for (Port ov : getPq().getOutputPorts(pname, workflowId)) {
+
+				ov.setResolvedDepth(ov.getDepth() + totalANL);
+
+				logger.debug("anl for "+pname+":"+ov.getPortName()+" = "+(ov.getDepth() + totalANL));
+				getPw().updatePort(ov);
+
+				// propagate this through all the links from this var
+				for (Port v : getPq().getSuccPorts(pname, ov.getPortName(), workflowId)) {
+					List<Port> toBeProcessed = new ArrayList<>();
+					toBeProcessed.add(v);
+
+					if (v.getProcessorId() == null && v.isInputPort()) {  // this is the input to a nested workflow
+//						String tempWorkflowId = pq.getworkflowIdForDataflow(v.getPName(), workflowRunId);
+						String tempWorkflowId = pq
+								.getWorkflowIdForExternalName(v
+										.getProcessorName());
+						List<Port> realSuccessors = getPq().getSuccPorts(
+								v.getProcessorName(), v.getPortName(),
+								tempWorkflowId);
+
+						toBeProcessed.remove(0);
+						toBeProcessed.addAll(realSuccessors);
+
+					} else if (v.getProcessorId() == null && !v.isInputPort()) {  // this is the output to a nested workflow
+//						String tempworkflowId = pq.getworkflowIdForDataflow(v.getPName(), workflowRunId);
+						List<Port> realSuccessors = getPq().getSuccPorts(
+								v.getProcessorName(), v.getPortName(), null);
+
+						toBeProcessed.remove(0);
+						toBeProcessed.addAll(realSuccessors);
+					}
+
+					for (Port v1 : toBeProcessed) {
+						v1.setResolvedDepth(ov.getResolvedDepth());
+						logger.debug("anl for " + v1.getProcessorName() + ":"
+								+ v1.getPortName() + " = "
+								+ ov.getResolvedDepth());
+						getPw().updatePort(v1);
+					}
+				}
+			}
+		}
+	}
+
+	public void setPw(ProvenanceWriter pw) {
+		this.pw = pw;
+	}
+
+	public ProvenanceWriter getPw() {
+		return pw;
+	}
+
+	public void setPq(ProvenanceQuery pq) {
+		this.pq = pq;
+	}
+
+	public ProvenanceQuery getPq() {
+		return pq;
+	}
+
+	public void setWorkflowRunId(String workflowRunId) {
+		this.workflowRunId = workflowRunId;
+	}
+
+	public String getWorkflowRunId() {
+		return workflowRunId;
+	}
+
+	public void setWfdp(WorkflowDataProcessor wfdp) {
+		this.wfdp = wfdp;
+	}
+
+	public WorkflowDataProcessor getWfdp() {
+		return wfdp;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/LineageQueryResultRecord.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/LineageQueryResultRecord.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/LineageQueryResultRecord.java
new file mode 100644
index 0000000..975a83a
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/LineageQueryResultRecord.java
@@ -0,0 +1,243 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.provenance.lineageservice;
+
+/**
+ * 
+ * This Java bean holds a single provenance record, i.e., the finest element of
+ * a provenance graph that is stored in the provenance DB. Essentially this
+ * represents one data element (value) flowing through a port (vname) of a
+ * processor (pname), in the context of one run (wfInstance) of a workflow
+ * (wfname). The record may include an <b>iteration</b> vector, used when the
+ * same processor receives multiple values on the same port, as part of
+ * iterative processing. When the value belongs to a collection (a nested list),
+ * the <b>collIdRef</b> field contains a reference to that collection.
+ * 
+ * @author Paolo Missier
+ * 
+ */
+public class LineageQueryResultRecord {
+	private String workflowId;
+	private String processorName;
+	private String portName;
+	private String workflowRunId;
+	private String iteration;
+	private String value;     // atomic or XML-formatted collection -- this is actually a reference to the value...
+	private String collIdRef;
+	private String parentCollIDRef;
+	private String resolvedValue;
+	private String type;  // one of referenceSet, referenceSetCollection
+	boolean printResolvedValue;
+	boolean isInput; 
+	boolean isCollection;
+
+	@Override
+	public String toString() {
+		if (isCollection) {
+			return "COLLECTION: proc " + getProcessorName() + " var "
+					+ getPortName() + " " + " iteration: " + getIteration()
+					+ " value: " + getValue() + " collection id: "
+					+ getCollectionT2Reference() + " parent collection: "
+					+ getParentCollIDRef();
+		} else if (printResolvedValue)
+			return "workflow " + getworkflowId() + " proc "
+					+ getProcessorName() + " var " + getPortName() + " "
+					+ " iteration: " + getIteration() + " value: " + getValue()
+					+ " collection id: " + getCollectionT2Reference()
+					+ " resolvedValue: " + getResolvedValue();
+		else
+			return "workflow " + getworkflowId() + " proc "
+					+ getProcessorName() + " var " + getPortName() + " "
+					+ " iteration: " + getIteration() + " collection id: "
+					+ getCollectionT2Reference() + " value: " + getValue();
+	}
+
+	/**
+	 * @return the pname
+	 */
+	public String getProcessorName() {
+		return processorName;
+	}
+	/**
+	 * @param pname the pname to set
+	 */
+	public void setProcessorName(String pname) {
+		this.processorName = pname;
+	}
+	/**
+	 * @return the vname
+	 */
+	public String getPortName() {
+		return portName;
+	}
+	/**
+	 * @param vname the vname to set
+	 */
+	public void setPortName(String vname) {
+		this.portName = vname;
+	}
+	/**
+	 * @return the workflowRun
+	 */
+	public String getWorkflowRunId() {
+		return workflowRunId;
+	}
+	/**
+	 * @param workflowRun the workflowRun to set
+	 */
+	public void setWorkflowRunId(String workflowRun) {
+		this.workflowRunId = workflowRun;
+	}
+	/**
+	 * @return the value
+	 */
+	public String getValue() {
+		return value;
+	}
+	/**
+	 * @param value the value to set
+	 */
+	public void setValue(String value) {
+		this.value = value;
+	}
+	/**
+	 * @return the type
+	 */
+	public String getType() {
+		return type;
+	}
+	/**
+	 * @param type the type to set
+	 */
+	public void setType(String type) {
+		this.type = type;
+	}
+	/**
+	 * @return the iteration
+	 */
+	public String getIteration() {
+		return iteration;
+	}
+	/**
+	 * @param iteration the iteration to set
+	 */
+	public void setIteration(String iteration) {
+		this.iteration = iteration;
+	}
+	/**
+	 * @return the resolvedValue
+	 */
+	public String getResolvedValue() {
+		return resolvedValue;
+	}
+	/**
+	 * @param resolvedValue the resolvedValue to set
+	 */
+	public void setResolvedValue(String resolvedValue) {
+		this.resolvedValue = resolvedValue;
+	}
+
+
+	public void setPrintResolvedValue(boolean printResolvedValue) {
+		this.printResolvedValue = printResolvedValue;
+	}
+
+
+	/**
+	 * @return the isInput
+	 */
+	public boolean isInputPort() {
+		return isInput;
+	}
+
+
+	/**
+	 * @param isInput the isInput to set
+	 */
+	public void setIsInputPort(boolean isInput) {
+		this.isInput = isInput;
+	}
+
+
+	/**
+	 * @return the collIdRef
+	 */
+	public String getCollectionT2Reference() {
+		return collIdRef;
+	}
+
+
+	/**
+	 * @param collIdRef the collIdRef to set
+	 */
+	public void setCollectionT2Reference(String collIdRef) {
+		this.collIdRef = collIdRef;
+	}
+
+
+	/**
+	 * @return the isCollection
+	 */
+	public boolean isCollection() {
+		return isCollection;
+	}
+
+
+	/**
+	 * @param isCollection the isCollection to set
+	 */
+	public void setCollection(boolean isCollection) {
+		this.isCollection = isCollection;
+	}
+
+
+	/**
+	 * @return the parentCollIDRef
+	 */
+	public String getParentCollIDRef() {
+		return parentCollIDRef;
+	}
+
+
+	/**
+	 * @param parentCollIDRef the parentCollIDRef to set
+	 */
+	public void setParentCollIDRef(String parentCollIDRef) {
+		this.parentCollIDRef = parentCollIDRef;
+	}
+
+
+	/**
+	 * @return the workflowId
+	 */
+	public String getworkflowId() {
+		return workflowId;
+	}
+
+
+	/**
+	 * @param workflowId the workflowId to set
+	 */
+	public void setWorkflowId(String workflowId) {
+		this.workflowId = workflowId;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/LineageSQLQuery.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/LineageSQLQuery.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/LineageSQLQuery.java
new file mode 100644
index 0000000..58d7c3d
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/LineageSQLQuery.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.provenance.lineageservice;
+
+/**
+ * encapsulates an SQL query along with directives on how to interpret the
+ * results, i.e., which elements of the select clause are to be considered
+ * relevant. For instance when the query includes a join with Collection, the
+ * intent is that lineage should return the collection itself as opposed to any
+ * of its elements.
+ * 
+ * @author paolo
+ * 
+ */
+public class LineageSQLQuery {
+	private String vbQuery = null;
+	private String collQuery = null;
+
+	/** =0 => use var values, >0 => use enclosing collection */
+	private int depth = 0;
+
+	/**
+	 * @return the depth
+	 */
+	public int getdepth() {
+		return depth;
+	}
+
+	/**
+	 * @param depth
+	 *            the depth to set
+	 */
+	public void setdepth(int depth) {
+		this.depth = depth;
+	}
+
+	/**
+	 * @return the collQuery
+	 */
+	public String getCollQuery() {
+		return collQuery;
+	}
+
+	/**
+	 * @param collQuery the collQuery to set
+	 */
+	public void setCollQuery(String collQuery) {
+		this.collQuery = collQuery;
+	}
+
+	/**
+	 * @return the vbQuery
+	 */
+	public String getVbQuery() {
+		return vbQuery;
+	}
+
+	/**
+	 * @param vbQuery the vbQuery to set
+	 */
+	public void setVbQuery(String vbQuery) {
+		this.vbQuery = vbQuery;
+	}	
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/Provenance.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/Provenance.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/Provenance.java
new file mode 100644
index 0000000..621e351
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/Provenance.java
@@ -0,0 +1,199 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.provenance.lineageservice;
+
+import java.io.IOException;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import net.sf.taverna.t2.provenance.connector.AbstractProvenanceConnector;
+import net.sf.taverna.t2.provenance.item.ProvenanceItem;
+import net.sf.taverna.t2.provenance.item.WorkflowProvenanceItem;
+import net.sf.taverna.t2.provenance.vocabulary.SharedVocabulary;
+import net.sf.taverna.t2.workflowmodel.Dataflow;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Implemented by the database class that a {@link AbstractProvenanceConnector}
+ * implementation uses for storage purposes
+ * 
+ * @author Paolo Missier
+ * @author Ian Dunlop
+ * 
+ */
+//FIXME is this class really needed. Can't we just push the
+//acceptRawProvanceEvent up into the ProvenanceConnector?
+public class Provenance {
+	private static Logger logger = Logger.getLogger(Provenance.class);
+
+	protected ProvenanceQuery pq;
+	protected ProvenanceWriter pw;
+	protected EventProcessor ep;
+
+	private String saveEvents;
+	
+	private volatile boolean firstWorkflowStructure = true;
+
+	public boolean isFirstWorkflowStructure() {
+		return firstWorkflowStructure;
+	}
+
+	public void setFirstWorkflowStructure(boolean firstWorkflowStructure) {
+		this.firstWorkflowStructure = firstWorkflowStructure;
+	}
+
+	private List<String> workflowIDStack = Collections.synchronizedList(new ArrayList<String>());
+	
+	private Map<String, String> workflowIDMap = new ConcurrentHashMap<String, String>();
+
+	public Provenance() {	}
+
+	public Provenance(EventProcessor eventProcessor) {
+		this.ep = eventProcessor;
+		this.pq = ep.getPq();
+		this.pw = ep.getPw();		
+	}
+
+	public void clearDB() throws SQLException {
+		getPw().clearDBStatic();
+		getPw().clearDBDynamic();
+	}
+	
+
+	/**
+	 * @return the saveEvents
+	 */
+	public String getSaveEvents() {
+		return saveEvents;
+	}
+
+	/**
+	 * @param saveEvents
+	 *            the saveEvents to set
+	 */
+	public void setSaveEvents(String saveEvents) {
+		this.saveEvents = saveEvents;
+	}
+
+	// FIXME I think the provenance query and writer should both come from the
+	// EventProcessor
+	// seems silly setting the ep, pq and pw separately.
+	public void setPq(ProvenanceQuery pq) {
+		this.pq = pq;
+	}
+
+	public ProvenanceQuery getPq() {
+		return pq;
+	}
+
+	public void setPw(ProvenanceWriter pw) {
+		this.pw = pw;
+	}
+
+	public ProvenanceWriter getPw() {
+		return pw;
+	}
+
+	public void setEp(EventProcessor ep) {
+		this.ep = ep;
+	}
+
+	public EventProcessor getEp() {
+		return ep;
+	}
+
+	/**
+	 * maps each incoming event to an insert query into the provenance store
+	 * 
+	 * @param eventType
+	 * @param content
+	 * @throws SQLException
+	 * @throws IOException
+	 */
+	public void acceptRawProvenanceEvent(SharedVocabulary eventType,
+			ProvenanceItem provenanceItem) throws SQLException, IOException {
+		processEvent(provenanceItem, eventType);
+	}
+
+	/**
+	 * parse d and generate SQL insert calls into the provenance DB
+	 * 
+	 * @param d
+	 *            DOM for the event
+	 * @param eventType
+	 *            see {@link SharedVocabulary}
+	 * @throws SQLException
+	 * @throws IOException
+	 */
+	protected void processEvent(ProvenanceItem provenanceItem,
+			SharedVocabulary eventType) throws SQLException, IOException {
+		if (eventType.equals(SharedVocabulary.WORKFLOW_EVENT_TYPE)) {
+			// process the workflow structure
+			//workflowStartedMap.put()
+			WorkflowProvenanceItem workflowProvenanceItem = (WorkflowProvenanceItem) provenanceItem;
+			
+			getEp().getWfdp().workflowStarted.put(workflowProvenanceItem.getIdentifier(), workflowProvenanceItem.getInvocationStarted());
+			if (isFirstWorkflowStructure()) {
+				String dataflowId = workflowProvenanceItem.getDataflow().getIdentifier();
+				String instanceId = provenanceItem.getIdentifier();
+				
+				workflowIDMap.put(instanceId, dataflowId);
+				setFirstWorkflowStructure(false);
+				String processWorkflowStructure = getEp().processWorkflowStructure(provenanceItem);
+				synchronized(workflowIDStack) {
+					workflowIDStack.add(0,processWorkflowStructure);
+				}
+				
+				getEp().propagateANL(provenanceItem.getIdentifier());
+			} else {
+				String dataflowId = workflowProvenanceItem.getDataflow().getIdentifier();
+				String instanceId = provenanceItem.getIdentifier();
+				
+				workflowIDMap.put(instanceId, dataflowId);
+
+				Dataflow df = workflowProvenanceItem.getDataflow();
+				synchronized(workflowIDStack) {
+					workflowIDStack.add(0,df.getIdentifier());
+				}
+			}
+		} else if (provenanceItem.getEventType().equals(SharedVocabulary.END_WORKFLOW_EVENT_TYPE)) {
+//			String currentWorkflowID = workflowIDStack.get(0);
+//			workflowIDStack.remove(0);
+			String currentWorkflowID = provenanceItem.getParentId();
+			
+			getEp().processProcessEvent(provenanceItem, currentWorkflowID);
+			
+		} else {  // all other event types (iteration etc.)
+			logger.debug("processEvent of type "+provenanceItem.getEventType()+" for item of type "+provenanceItem.getClass().getName());
+			String currentWorkflowID = provenanceItem.getWorkflowId();
+//			String currentWorkflowID = workflowIDMap.get(provenanceItem.getParentId());
+
+			getEp().processProcessEvent(provenanceItem, currentWorkflowID);
+		
+//			getEp().processProcessEvent(provenanceItem, workflowIDStack.get(0));
+		}
+	}
+}


[46/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/CredentialManagerImplTest.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/CredentialManagerImplTest.java b/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/CredentialManagerImplTest.java
new file mode 100644
index 0000000..931fa07
--- /dev/null
+++ b/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/CredentialManagerImplTest.java
@@ -0,0 +1,872 @@
+/*******************************************************************************
+ * Copyright (C) 2008-2010 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.security.credentialmanager.impl;
+
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.security.Key;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.Security;
+import java.security.UnrecoverableKeyException;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Random;
+
+import javax.net.ssl.SSLSocketFactory;
+
+import net.sf.taverna.t2.lang.observer.Observable;
+import net.sf.taverna.t2.lang.observer.Observer;
+import net.sf.taverna.t2.security.credentialmanager.CMException;
+import net.sf.taverna.t2.security.credentialmanager.CredentialManager;
+import net.sf.taverna.t2.security.credentialmanager.CredentialManager.KeystoreType;
+import net.sf.taverna.t2.security.credentialmanager.JavaTruststorePasswordProvider;
+import net.sf.taverna.t2.security.credentialmanager.KeystoreChangedEvent;
+import net.sf.taverna.t2.security.credentialmanager.MasterPasswordProvider;
+import net.sf.taverna.t2.security.credentialmanager.ServiceUsernameAndPasswordProvider;
+import net.sf.taverna.t2.security.credentialmanager.TrustConfirmationProvider;
+import net.sf.taverna.t2.security.credentialmanager.UsernamePassword;
+
+import org.apache.commons.io.FileUtils;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Tests here should not require Java strong/unlimited cryptography policy to be installed, 
+ * although if something goes wrong that is the first thing to be checked for.
+ * 
+ * Java by default comes with the weak policy 
+ * that disables the use of certain cryto algorithms and bigger key sizes. Although 
+ * it is claimed that as of Java 6 the default policy is strong, we have seen otherwise, 
+ * so make sure you install it.
+ * 
+ * For Java 6, strong/unlimited cryptography policy can be downloaded 
+ * (together with the installation instructions) from:
+ * http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html
+ * 
+ * An empty Keystore/Truststore is created before each test so we always start afresh 
+ * (see the setUp() method).
+ * s
+ * @author Alex Nenadic
+ *
+ */
+public class CredentialManagerImplTest {
+	
+	private CredentialManagerImpl credentialManager;
+	private String masterPassword = "uber";
+	private DummyMasterPasswordProvider masterPasswordProvider;
+	private File credentialManagerDirectory;
+	
+	private static UsernamePassword usernamePassword;
+	private static URI serviceURI;
+	
+	private static Key privateKey;
+	private static Certificate[] privateKeyCertChain;
+	private static URL privateKeyFileURL = CredentialManagerImplTest.class.getResource(
+			"/security/test-private-key-cert.p12");
+	private static final String privateKeyAndPKCS12KeystorePassword = "test"; // password for the test PKCS#12 keystore in resources
+	
+	private static X509Certificate trustedCertficate;
+	private static URL trustedCertficateFileURL = CredentialManagerImplTest.class.getResource(
+			"/security/google-trusted-certificate.pem");
+
+	private static Observer<KeystoreChangedEvent> keystoreChangedObserver;
+	
+	/**
+	 * @throws java.lang.Exception
+	 */
+	@BeforeClass
+	public static void setUpBeforeClass() throws Exception {
+		
+		// Just in case, add the BouncyCastle provider
+		// It gets added from the CredentialManagerImpl constructor as well
+		// but we may need some crypto operations before we invoke the Cred. Manager 
+		Security.addProvider(new BouncyCastleProvider());
+
+		// Create a test username and password for a service
+		serviceURI =  new URI("http://someservice");
+		usernamePassword = new UsernamePassword("testuser", "testpasswd");
+		
+		// Load the test private key and its certificate
+		File privateKeyCertFile = new File(privateKeyFileURL.getPath());
+		KeyStore pkcs12Keystore = java.security.KeyStore.getInstance("PKCS12", "BC"); // We have to use the BC provider here as the certificate chain is not loaded if we use whichever provider is first in Java!!!
+		FileInputStream inStream = new FileInputStream(privateKeyCertFile);
+		pkcs12Keystore.load(inStream, privateKeyAndPKCS12KeystorePassword.toCharArray());
+		// KeyStore pkcs12Keystore = credentialManager.loadPKCS12Keystore(privateKeyCertFile, privateKeyPassword);
+		Enumeration<String> aliases = pkcs12Keystore.aliases();
+		while (aliases.hasMoreElements()) {
+			// The test-private-key-cert.p12 file contains only one private key
+			// and corresponding certificate entry
+			String alias = aliases.nextElement();
+			if (pkcs12Keystore.isKeyEntry(alias)) { // is it a (private) key entry?
+				privateKey = pkcs12Keystore.getKey(alias,
+						privateKeyAndPKCS12KeystorePassword.toCharArray());
+				privateKeyCertChain = pkcs12Keystore.getCertificateChain(alias);
+				break;
+			}
+		}
+		inStream.close();
+		
+		// Load the test trusted certificate (belonging to *.Google.com)
+		File trustedCertFile = new File(trustedCertficateFileURL.getPath());		
+		inStream = new FileInputStream(trustedCertFile);
+		CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
+		trustedCertficate = (X509Certificate) certFactory.generateCertificate(inStream);
+		try{
+			inStream.close();
+		}
+		catch (Exception e) {
+			// Ignore
+		}
+		
+		keystoreChangedObserver = new Observer<KeystoreChangedEvent>() {
+			
+			@Override
+			public void notify(Observable<KeystoreChangedEvent> sender,
+					KeystoreChangedEvent message) throws Exception {
+				// TODO Auto-generated method stub
+				
+			}
+		};
+	}
+
+	/**
+	 * @throws java.lang.Exception
+	 */
+	@Before
+	public void setUp() throws Exception {
+
+		try {
+			credentialManager = new CredentialManagerImpl();
+		} catch (CMException e) {
+			System.out.println(e.getStackTrace());
+		}
+		Random randomGenerator = new Random();
+		String credentialManagerDirectoryPath = System
+				.getProperty("java.io.tmpdir")
+				+ System.getProperty("file.separator")
+				+ "taverna-security-"
+				+ randomGenerator.nextInt(1000000);
+		System.out.println("Credential Manager's directory path: "
+				+ credentialManagerDirectoryPath);
+		credentialManagerDirectory = new File(credentialManagerDirectoryPath);
+		try {
+			credentialManager
+					.setConfigurationDirectoryPath(credentialManagerDirectory);
+		} catch (CMException e) {
+			System.out.println(e.getStackTrace());
+		}
+
+		// Create the dummy master password provider
+		masterPasswordProvider = new DummyMasterPasswordProvider();
+		masterPasswordProvider.setMasterPassword(masterPassword);
+		List<MasterPasswordProvider> masterPasswordProviders = new ArrayList<MasterPasswordProvider>();
+		masterPasswordProviders.add(masterPasswordProvider);
+		credentialManager.setMasterPasswordProviders(masterPasswordProviders);
+		
+		// Set an empty list for service username and password providers
+		credentialManager.setServiceUsernameAndPasswordProviders(new ArrayList<ServiceUsernameAndPasswordProvider>());
+
+		credentialManager.setJavaTruststorePasswordProviders(new ArrayList<JavaTruststorePasswordProvider>());
+
+		credentialManager.setTrustConfirmationProviders(new ArrayList<TrustConfirmationProvider>());
+
+	}
+
+	@After
+	// Clean up the credentialManagerDirectory we created for testing
+	public void cleanUp(){
+//		assertTrue(credentialManagerDirectory.exists());
+//		assertFalse(credentialManagerDirectory.listFiles().length == 0); // something was created there
+	
+		if (credentialManagerDirectory.exists()){
+			try {
+				FileUtils.deleteDirectory(credentialManagerDirectory);				
+				System.out.println("Deleting Credential Manager's directory: "
+						+ credentialManagerDirectory.getAbsolutePath());
+			} catch (IOException e) {
+				System.out.println(e.getStackTrace());
+			}	
+		}
+	}
+	
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#CredentialManagerImpl()}.
+	 * @throws CMException 
+	 */
+	@Test
+	public void testCredentialManagerImpl() throws CMException {
+		new CredentialManagerImpl();
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#getUsernameAndPasswordForService(java.net.URI, boolean, java.lang.String)}.
+	 * @throws URISyntaxException 
+	 * @throws CMException 
+	 */
+	@Test
+	public void testGetUsernameAndPasswordForServiceURI() throws URISyntaxException, CMException {
+		// The Credential Manage's Keystore is empty so we should not be able to find anything initially
+		assertNull(credentialManager.getUsernameAndPasswordForService(serviceURI, false, ""));
+		
+		credentialManager.addUsernameAndPasswordForService(usernamePassword,serviceURI);
+		
+		UsernamePassword testUsernamePassword = credentialManager.getUsernameAndPasswordForService(serviceURI, false, "");
+		assertNotNull(testUsernamePassword);
+		assertTrue(Arrays.equals(usernamePassword.getPassword(), testUsernamePassword.getPassword()));
+		assertTrue(usernamePassword.getUsername().equals(testUsernamePassword.getUsername()));
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#addUsernameAndPasswordForService(net.sf.taverna.t2.security.credentialmanager.UsernamePassword, java.net.URI)}.
+	 * @throws URISyntaxException 
+	 * @throws CMException 
+	 */
+	@Test
+	public void testAddUsernameAndPasswordForService() throws CMException, URISyntaxException {
+
+		String alias = credentialManager.addUsernameAndPasswordForService(usernamePassword,serviceURI);
+		
+		UsernamePassword testUsernamePassword = credentialManager.getUsernameAndPasswordForService(serviceURI, false, "");
+		assertNotNull(testUsernamePassword);
+		assertTrue(credentialManager.hasEntryWithAlias(CredentialManager.KeystoreType.KEYSTORE, alias));
+		assertTrue(Arrays.equals(usernamePassword.getPassword(), testUsernamePassword.getPassword()));
+		assertTrue(usernamePassword.getUsername().equals(testUsernamePassword.getUsername()));
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#hasUsernamePasswordForService(java.net.URI)}.
+	 * @throws CMException 
+	 */
+	@Test
+	public void testHasUsernamePasswordForService() throws CMException {
+	
+		UsernamePassword testUsernamePassword = credentialManager.getUsernameAndPasswordForService(serviceURI, false, "");
+		assertNull(testUsernamePassword);
+
+		String alias = credentialManager.addUsernameAndPasswordForService(usernamePassword,serviceURI);
+		testUsernamePassword = credentialManager.getUsernameAndPasswordForService(serviceURI, false, "");
+		assertNotNull(testUsernamePassword);
+		assertTrue(credentialManager.hasEntryWithAlias(CredentialManager.KeystoreType.KEYSTORE, alias));
+		assertTrue(Arrays.equals(usernamePassword.getPassword(), testUsernamePassword.getPassword()));
+		assertTrue(usernamePassword.getUsername().equals(testUsernamePassword.getUsername()));
+	}
+	
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#deleteUsernameAndPasswordForService(java.net.URI)}.
+	 * @throws URISyntaxException 
+	 * @throws CMException 
+	 */
+	@Test
+	public void testDeleteUsernameAndPasswordForServiceURI() throws URISyntaxException, CMException {
+
+		// The Credential Manage's Keystore is empty initially so this should 
+		// have no effect apart from initializing the Keystore/Truststore
+		credentialManager.deleteUsernameAndPasswordForService(serviceURI);
+		
+		credentialManager.addUsernameAndPasswordForService(usernamePassword,serviceURI);	
+		credentialManager.deleteUsernameAndPasswordForService(serviceURI);
+		
+		assertNull(credentialManager.getUsernameAndPasswordForService(serviceURI, false, ""));
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#addKeyPair(java.security.Key, java.security.cert.Certificate[])}.
+	 * @throws CMException 
+	 * @throws KeyStoreException 
+	 * @throws NoSuchAlgorithmException 
+	 * @throws UnrecoverableKeyException 
+	 * @throws IOException 
+	 * @throws FileNotFoundException 
+	 * @throws CertificateException 
+	 */
+	@Test
+	public void testAddKeyPair() throws CMException, KeyStoreException, UnrecoverableKeyException, NoSuchAlgorithmException, CertificateException, FileNotFoundException, IOException {
+
+		String alias = credentialManager.addKeyPair(privateKey, privateKeyCertChain);
+		assertTrue(credentialManager.hasKeyPair(privateKey, privateKeyCertChain));
+		assertTrue(credentialManager.hasEntryWithAlias(CredentialManager.KeystoreType.KEYSTORE, alias));
+
+		credentialManager.deleteKeyPair(alias);
+		assertFalse(credentialManager.hasKeyPair(privateKey, privateKeyCertChain));
+		assertFalse(credentialManager.hasEntryWithAlias(CredentialManager.KeystoreType.KEYSTORE, alias));
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#hasKeyPair(java.security.Key, java.security.cert.Certificate[])}.
+	 * @throws CMException 
+	 * @throws KeyStoreException 
+	 * @throws NoSuchAlgorithmException 
+	 * @throws UnrecoverableKeyException 
+	 * @throws IOException 
+	 * @throws FileNotFoundException 
+	 * @throws CertificateException 
+	 */
+	@Test
+	public void testHasKeyPair() throws CMException, KeyStoreException, UnrecoverableKeyException, NoSuchAlgorithmException, CertificateException, FileNotFoundException, IOException {
+		assertFalse(credentialManager.hasKeyPair(privateKey, privateKeyCertChain));
+		credentialManager.addKeyPair(privateKey, privateKeyCertChain);
+		assertTrue(credentialManager.hasKeyPair(privateKey, privateKeyCertChain));
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#deleteKeyPair(java.lang.String)}.
+	 * @throws CMException 
+	 * @throws KeyStoreException 
+	 * @throws NoSuchAlgorithmException 
+	 * @throws UnrecoverableKeyException 
+	 * @throws IOException 
+	 * @throws FileNotFoundException 
+	 * @throws CertificateException 
+	 */
+	@Test
+	public void testDeleteKeyPair() throws CMException, KeyStoreException, UnrecoverableKeyException, NoSuchAlgorithmException, CertificateException, FileNotFoundException, IOException {
+		// The Credential Manage's Keystore is empty initially so this should 
+		// have no effect apart from initializing the Keystore/Truststore
+		credentialManager.deleteKeyPair("somealias");
+		
+		String alias = credentialManager.addKeyPair(privateKey, privateKeyCertChain);
+		credentialManager.deleteKeyPair(alias);
+		assertFalse(credentialManager.hasEntryWithAlias(CredentialManager.KeystoreType.KEYSTORE, alias));
+	}
+	
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#deleteKeyPair(Key, Certificate[])}.
+	 * @throws CMException 
+	 */
+	@Test
+	public void testDeleteKeyPair2() throws CMException, KeyStoreException, UnrecoverableKeyException, NoSuchAlgorithmException, CertificateException, FileNotFoundException, IOException {
+		credentialManager.addKeyPair(privateKey, privateKeyCertChain);
+		assertTrue(credentialManager.hasKeyPair(privateKey, privateKeyCertChain));
+		credentialManager.deleteKeyPair(privateKey, privateKeyCertChain);
+		assertFalse(credentialManager.hasKeyPair(privateKey, privateKeyCertChain));
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#exportKeyPair(java.lang.String, java.io.File, java.lang.String)}.
+	 * @throws CMException 
+	 * @throws KeyStoreException 
+	 * @throws NoSuchAlgorithmException 
+	 * @throws UnrecoverableKeyException 
+	 */
+	@Test
+	public void testExportKeyPair() throws CMException, KeyStoreException, UnrecoverableKeyException, NoSuchAlgorithmException {
+		String alias = credentialManager.addKeyPair(privateKey, privateKeyCertChain);
+		File fileToExportTo = new File(credentialManagerDirectory, "test-export-key.p12");
+		credentialManager.exportKeyPair(alias, fileToExportTo, privateKeyAndPKCS12KeystorePassword);
+		assertTrue(fileToExportTo.exists());
+		// Load it back from the file we just saved
+		KeyStore ks = credentialManager.loadPKCS12Keystore(fileToExportTo, privateKeyAndPKCS12KeystorePassword);
+		Enumeration<String> aliases = ks.aliases();
+		Key newPrivateKey = null;
+		Certificate[] newPrivateKeyCerts = null;
+		while (aliases.hasMoreElements()) {
+			// The test-private-key-cert.p12 file contains only one private key
+			// and corresponding certificate entry
+			alias = aliases.nextElement();
+			if (ks.isKeyEntry(alias)) { // is it a (private) key entry?
+				newPrivateKey = ks.getKey(alias,
+						privateKeyAndPKCS12KeystorePassword.toCharArray());
+				newPrivateKeyCerts = ks.getCertificateChain(alias);
+				break;
+			}
+		}
+		assertNotNull(newPrivateKey);
+		assertNotNull(newPrivateKeyCerts);
+		//assertTrue(Arrays.equals(newPrivateKey.getEncoded(), privateKey.getEncoded()));
+		assertTrue(newPrivateKey.equals(privateKey));
+		assertTrue(Arrays.equals(newPrivateKeyCerts, privateKeyCertChain));
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#getCertificate(java.lang.String, java.lang.String)}.
+	 * @throws CMException 
+	 */
+	@Test
+	public void testGetCertificate() throws CMException {
+		String alias = credentialManager.addKeyPair(privateKey, privateKeyCertChain);
+		// Get certificate from the Keystore associated with the private key we just inserted
+		Certificate privateKeyCertificate = credentialManager.getCertificate(CredentialManager.KeystoreType.KEYSTORE, alias);
+		assertNotNull(privateKeyCertificate);
+		assertTrue(privateKeyCertChain[0].equals(privateKeyCertificate));
+		
+		// We should also have some trusted certificates in the Truststore
+		// Need to get their aliases
+		ArrayList<String> truststoreAliases = credentialManager.getAliases(CredentialManager.KeystoreType.TRUSTSTORE);
+		assertTrue(!truststoreAliases.isEmpty());
+		// Just get the first one
+		Certificate trustedCertificate = credentialManager.getCertificate(CredentialManager.KeystoreType.TRUSTSTORE, truststoreAliases.get(0));
+		assertNotNull(trustedCertificate);
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#getKeyPairsCertificateChain(java.lang.String)}.
+	 * @throws CMException 
+	 */
+	@Test
+	public void testGetKeyPairCertificateChain() throws CMException {
+		String alias = credentialManager.addKeyPair(privateKey, privateKeyCertChain);
+		Certificate[] keyPairCertificateChain = credentialManager.getKeyPairsCertificateChain(alias);
+		assertNotNull(keyPairCertificateChain);
+		assertTrue(Arrays.equals(privateKeyCertChain, keyPairCertificateChain));
+	}
+	
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#getKeyPairsPrivateKey(java.lang.String)}.
+	 * @throws CMException 
+	 */
+	@Test
+	public void testGetKeyPairsPrivateKey() throws CMException {
+		String alias = credentialManager.addKeyPair(privateKey, privateKeyCertChain);
+		Key prvKey = credentialManager.getKeyPairsPrivateKey(alias);
+		assertNotNull(prvKey);
+		assertEquals(privateKey, prvKey);
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#addTrustedCertificate(java.security.cert.X509Certificate)}.
+	 * @throws CMException 
+	 */
+	@Test
+	public void testAddTrustedCertificate() throws CMException {
+		
+		String alias = credentialManager.addTrustedCertificate(trustedCertficate);
+		assertTrue(credentialManager.hasTrustedCertificate(trustedCertficate));
+		assertTrue(credentialManager.hasEntryWithAlias(CredentialManager.KeystoreType.TRUSTSTORE, alias));
+
+		credentialManager.deleteTrustedCertificate(alias);
+		assertFalse(credentialManager.hasTrustedCertificate(trustedCertficate));
+		assertFalse(credentialManager.hasEntryWithAlias(CredentialManager.KeystoreType.TRUSTSTORE, alias));
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#createTrustedCertificateAlias(java.security.cert.X509Certificate)}.
+	 * @throws CMException 
+	 */
+	@Test
+	public void testGetX509CertificateAlias() throws CMException {
+
+		String alias = credentialManager.createTrustedCertificateAlias(trustedCertficate);
+		String alias2 = credentialManager.addTrustedCertificate(trustedCertficate);
+		assertEquals(alias, alias2);
+
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#deleteTrustedCertificate(java.lang.String)}.
+	 * @throws CMException 
+	 */
+	@Test
+	public void testDeleteTrustedCertificate() throws CMException {
+		// The Credential Manage's Truststore is empty initially so this should 
+		// have no effect apart from initializing the Keystore/Truststore
+		credentialManager.deleteTrustedCertificate("somealias");
+		
+		String alias = credentialManager.addTrustedCertificate(trustedCertficate);
+		assertTrue(credentialManager.hasEntryWithAlias(CredentialManager.KeystoreType.TRUSTSTORE, alias));
+		credentialManager.deleteTrustedCertificate(alias);
+		assertFalse(credentialManager.hasTrustedCertificate(trustedCertficate));
+		assertFalse(credentialManager.hasEntryWithAlias(CredentialManager.KeystoreType.TRUSTSTORE, alias));
+	}
+	
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#deleteTrustedCertificate(X509Certificate)}.
+	 * @throws CMException 
+	 */
+	@Test
+	public void testDeleteTrustedCertificate2() throws CMException {
+
+		credentialManager.addTrustedCertificate(trustedCertficate);
+		assertTrue(credentialManager.hasTrustedCertificate(trustedCertficate));
+		credentialManager.deleteTrustedCertificate(trustedCertficate);
+		assertFalse(credentialManager.hasTrustedCertificate(trustedCertficate));
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#isKeyEntry(java.lang.String)}.
+	 * @throws CMException 
+	 */
+	@Test
+	public void testIsKeyEntry() throws CMException {
+		// The Credential Manage's Keystore/Truststore is empty initially so this should 
+		// have no effect apart from initializing them
+		// This should throw an exception
+		assertFalse(credentialManager.isKeyEntry("somealias"));
+
+		String aliasPassword = credentialManager.addUsernameAndPasswordForService(usernamePassword, serviceURI);
+		String aliasKeyPair = credentialManager.addKeyPair(privateKey, privateKeyCertChain);
+		String aliasTrustedCert = credentialManager.addTrustedCertificate(trustedCertficate);
+
+		assertTrue(credentialManager.isKeyEntry(aliasPassword)); // passwords are saves as symmetric key entries
+		assertTrue(credentialManager.isKeyEntry(aliasKeyPair));
+		assertFalse(credentialManager.isKeyEntry(aliasTrustedCert));
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#hasEntryWithAlias(java.lang.String, java.lang.String)}.
+	 * @throws CMException 
+	 */
+	@Test
+	public void testHasEntryWithAlias() throws CMException {
+		
+		String aliasTrustedCert = credentialManager.createTrustedCertificateAlias(trustedCertficate);
+		assertFalse(credentialManager.hasEntryWithAlias(KeystoreType.TRUSTSTORE, aliasTrustedCert));
+		
+		String aliasTrustedCert2 = credentialManager.addTrustedCertificate(trustedCertficate);
+		assertTrue(credentialManager.hasEntryWithAlias(KeystoreType.TRUSTSTORE, aliasTrustedCert2));
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#getAliases(net.sf.taverna.t2.security.credentialmanager.CredentialManager.KeystoreType)}.
+	 * @throws CMException 
+	 */
+	@Test
+	public void testGetAliases() throws CMException {
+		
+		ArrayList<String> keystoreAliases = credentialManager.getAliases(KeystoreType.KEYSTORE);
+		ArrayList<String> truststoreAliases = credentialManager.getAliases(KeystoreType.TRUSTSTORE);
+		
+		// Initially Keystore/Truststore is empty
+		assertTrue(keystoreAliases.isEmpty());
+		
+		String aliasPassword = credentialManager.addUsernameAndPasswordForService(usernamePassword, serviceURI);
+		String aliasKeyPair = credentialManager.addKeyPair(privateKey, privateKeyCertChain);
+		String aliasTrustedCert = credentialManager.addTrustedCertificate(trustedCertficate);
+		
+		keystoreAliases = credentialManager.getAliases(KeystoreType.KEYSTORE);
+		truststoreAliases = credentialManager.getAliases(KeystoreType.TRUSTSTORE);
+		
+		assertTrue(keystoreAliases.size() == 2);
+		assertTrue(truststoreAliases.size() >= 1); // we at least have the one we inserted but could be more copied from Java's defauls truststore
+		
+		assertTrue(keystoreAliases.contains(aliasPassword));
+		assertTrue(keystoreAliases.contains(aliasKeyPair));
+		assertTrue(truststoreAliases.contains(aliasTrustedCert));
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#getServiceURIsForAllUsernameAndPasswordPairs()}.
+	 * @throws CMException 
+	 * @throws URISyntaxException 
+	 */
+	@Test
+	public void testGetServiceURIsForAllUsernameAndPasswordPairs() throws CMException, URISyntaxException {
+		// Initially empty so this
+		assertTrue(credentialManager.getServiceURIsForAllUsernameAndPasswordPairs().isEmpty());
+		
+		credentialManager.addUsernameAndPasswordForService(usernamePassword, serviceURI);
+		
+		URI serviceURI2 = new URI("http://someservice2");
+		UsernamePassword usernamePassword2 = new UsernamePassword("testuser2", "testpasswd2");
+		credentialManager.addUsernameAndPasswordForService(usernamePassword2, serviceURI2);
+		
+		List<URI> serviceURIs = credentialManager.getServiceURIsForAllUsernameAndPasswordPairs();
+		assertTrue(credentialManager.getServiceURIsForAllUsernameAndPasswordPairs().size() == 2);
+		assertTrue(serviceURIs.contains(serviceURI));
+		assertTrue(serviceURIs.contains(serviceURI2));
+
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#loadPKCS12Keystore(java.io.File, java.lang.String)}.
+	 * @throws CMException 
+	 * @throws KeyStoreException 
+	 * @throws NoSuchAlgorithmException 
+	 * @throws UnrecoverableKeyException 
+	 */
+	@Test
+	public void testLoadPKCS12Keystore() throws CMException, KeyStoreException, UnrecoverableKeyException, NoSuchAlgorithmException {
+		KeyStore pkcs12Keystore = credentialManager.loadPKCS12Keystore(new File(privateKeyFileURL.getPath()), privateKeyAndPKCS12KeystorePassword);
+		
+		Key privateKey2 = null;
+		Certificate[] privateKeyCertChain2 = null;
+		
+		Enumeration<String> aliases = pkcs12Keystore.aliases();
+		while (aliases.hasMoreElements()) {
+			// The test-private-key-cert.p12 file contains only one private key
+			// and corresponding certificate entry
+			String alias = aliases.nextElement();
+			if (pkcs12Keystore.isKeyEntry(alias)) { // is it a (private) key entry?
+				privateKey2 = pkcs12Keystore.getKey(alias,
+						privateKeyAndPKCS12KeystorePassword.toCharArray());
+				privateKeyCertChain2 = pkcs12Keystore.getCertificateChain(alias);
+				break;
+			}
+		}
+		assertNotNull(privateKey2);
+		assertNotNull(privateKeyCertChain2);
+	}
+	
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#addObserver(net.sf.taverna.t2.lang.observer.Observer)}.
+	 */
+	@Test
+	public void testAddObserver() {
+
+		credentialManager.addObserver(keystoreChangedObserver);
+		assertEquals(keystoreChangedObserver, credentialManager.getObservers().get(0));
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#getObservers()}.
+	 */
+	@Test
+	public void testGetObservers() {
+		// Initially there are no observers
+		assertTrue(credentialManager.getObservers().isEmpty());
+
+		credentialManager.addObserver(keystoreChangedObserver);
+		
+		assertEquals(keystoreChangedObserver, credentialManager.getObservers().get(0));	
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#removeObserver(net.sf.taverna.t2.lang.observer.Observer)}.
+	 */
+	@Test
+	public void testRemoveObserver() {
+		credentialManager.addObserver(keystoreChangedObserver);
+		assertTrue(credentialManager.getObservers().size() == 1);	
+		credentialManager.removeObserver(keystoreChangedObserver);
+		assertTrue(credentialManager.getObservers().size() == 0);	
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#confirmMasterPassword(java.lang.String)}.
+	 * @throws CMException 
+	 */
+	@Test
+	public void testConfirmMasterPassword() throws CMException {
+		credentialManager.confirmMasterPassword("uber");
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#changeMasterPassword(java.lang.String)}.
+	 * @throws CMException 
+	 */
+	@Test
+	public void testChangeMasterPassword() throws CMException {
+		// Test the changeMasterPassword() method first to see if 
+		// it will initialize Credential Manager properly
+		credentialManager.changeMasterPassword("blah");
+		credentialManager.confirmMasterPassword("blah");
+		
+		// Add new stuff - key pair and password entries - under the new master password
+		String keyPairAlias = credentialManager.addKeyPair(privateKey, privateKeyCertChain);
+		credentialManager.addUsernameAndPasswordForService(usernamePassword, serviceURI);
+		
+		// Change the master password again and try to retrieve the private key and password
+		credentialManager.changeMasterPassword("hlab");
+		assertArrayEquals(credentialManager.getUsernameAndPasswordForService(serviceURI, false, "").getPassword(), usernamePassword.getPassword());
+		assertEquals(privateKey, credentialManager.getKeyPairsPrivateKey(keyPairAlias));
+		assertTrue(Arrays.equals(privateKeyCertChain, credentialManager.getKeyPairsCertificateChain(keyPairAlias)));
+		
+		// Load the Credential Manager back from the saved file to see of entries will be picked up properly
+		CredentialManagerImpl credentialManagerNew = null;
+		try {
+			credentialManagerNew = new CredentialManagerImpl();
+		} catch (CMException e) {
+			System.out.println(e.getStackTrace());
+		}
+		try {
+			credentialManagerNew
+					.setConfigurationDirectoryPath(credentialManagerDirectory);
+		} catch (CMException e) {
+			System.out.println(e.getStackTrace());
+		}
+
+		// Create the dummy master password provider
+		masterPasswordProvider = new DummyMasterPasswordProvider();
+		masterPasswordProvider.setMasterPassword("hlab");
+		List<MasterPasswordProvider> masterPasswordProviders = new ArrayList<MasterPasswordProvider>();
+		masterPasswordProviders.add(masterPasswordProvider);
+		credentialManager.setMasterPasswordProviders(masterPasswordProviders);
+		
+		// Set an empty list for service username and password providers
+		credentialManagerNew.setServiceUsernameAndPasswordProviders(new ArrayList<ServiceUsernameAndPasswordProvider>());
+
+		credentialManager.setJavaTruststorePasswordProviders(new ArrayList<JavaTruststorePasswordProvider>());
+
+		credentialManager.setTrustConfirmationProviders(new ArrayList<TrustConfirmationProvider>());		
+		
+		assertArrayEquals(credentialManager.getUsernameAndPasswordForService(serviceURI, false, "").getPassword(), usernamePassword.getPassword());
+		assertEquals(privateKey, credentialManager.getKeyPairsPrivateKey(keyPairAlias));
+		assertTrue(Arrays.equals(privateKeyCertChain, credentialManager.getKeyPairsCertificateChain(keyPairAlias)));
+
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#initializeSSL()}.
+	 * @throws CMException 
+	 */
+	@Test
+	public void testInitializeSSL() throws CMException {
+		//credentialManager.initializeSSL();
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#getTavernaSSLSocketFactory()}.
+	 * @throws CMException 
+	 */
+	@Test
+	public void testGetTavernaSSLSocketFactory() throws CMException {
+		SSLSocketFactory sslSocketFactory = credentialManager.getTavernaSSLSocketFactory();
+		assertNotNull(sslSocketFactory);
+		
+		// This should also create Taverna's SSLSocketFactory backed by Credential Manager's Keystore and Truststore
+		// if not already created
+		credentialManager.initializeSSL();
+		assertEquals(sslSocketFactory, credentialManager.getTavernaSSLSocketFactory());
+
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#setMasterPasswordProviders(java.util.List)}.
+	 */
+	@Test
+	public void testSetMasterPasswordProviders() {
+		
+		List<MasterPasswordProvider> masterPasswordProviders = new ArrayList<MasterPasswordProvider>();
+		masterPasswordProviders.add(masterPasswordProvider);
+		
+		credentialManager.setMasterPasswordProviders(masterPasswordProviders);
+		
+		assertTrue(credentialManager.getMasterPasswordProviders().contains(masterPasswordProvider));
+		
+		// Set it to null and see what happens
+		credentialManager.setMasterPasswordProviders(null);		
+		assertNull(credentialManager.getMasterPasswordProviders());		
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#getMasterPasswordProviders()}.
+	 */
+	@Test
+	public void testGetMasterPasswordProviders() {
+		
+		assertFalse(credentialManager.getMasterPasswordProviders().isEmpty());
+		assertTrue(credentialManager.getMasterPasswordProviders().contains(masterPasswordProvider));	
+	}
+	
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#setJavaTruststorePasswordProviders(java.util.List)}.
+	 */
+	@Test
+	public void testSetJavaTruststorePasswordProviders() {
+		
+		List<JavaTruststorePasswordProvider> javaTruststorePasswordProviders = new ArrayList<JavaTruststorePasswordProvider>();
+		JavaTruststorePasswordProvider javaTruststorePasswordProvider = new DummyJavaTruststorePasswordProvider();
+		javaTruststorePasswordProvider.setJavaTruststorePassword("blah");
+		javaTruststorePasswordProviders.add(javaTruststorePasswordProvider);
+		
+		credentialManager.setJavaTruststorePasswordProviders(javaTruststorePasswordProviders);
+		
+		assertTrue(credentialManager.getJavaTruststorePasswordProviders().contains(javaTruststorePasswordProvider));
+		
+		// Set it to null and see what happens
+		credentialManager.setJavaTruststorePasswordProviders(null);		
+		assertNull(credentialManager.getJavaTruststorePasswordProviders());	
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#getJavaTruststorePasswordProviders()}.
+	 */
+	@Test
+	public void testGetJavaTruststorePasswordProviders() {
+		
+		assertTrue(credentialManager.getJavaTruststorePasswordProviders().isEmpty());
+	}
+	
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#setServiceUsernameAndPasswordProviders(java.util.List)}.
+	 * @throws URISyntaxException 
+	 */
+	@Test
+	public void testSetServiceUsernameAndPasswordProviders() throws URISyntaxException {
+		
+		List<ServiceUsernameAndPasswordProvider> serviceUsernameAndPasswordProviders = new ArrayList<ServiceUsernameAndPasswordProvider>();
+		ServiceUsernameAndPasswordProvider serviceUsernameAndPasswordProvider = new DummyServiceUsernameAndPasswordProvider();
+		serviceUsernameAndPasswordProvider.setServiceUsernameAndPassword(new URI("http://someservice"), new UsernamePassword("blah", "blah"));
+		serviceUsernameAndPasswordProviders.add(serviceUsernameAndPasswordProvider);
+		
+		credentialManager.setServiceUsernameAndPasswordProviders(serviceUsernameAndPasswordProviders);
+		
+		assertTrue(credentialManager.getServiceUsernameAndPasswordProviders().contains(serviceUsernameAndPasswordProvider));
+		
+		// Set it to null and see what happens
+		credentialManager.setServiceUsernameAndPasswordProviders(null);		
+		assertNull(credentialManager.getServiceUsernameAndPasswordProviders());	
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#getServiceUsernameAndPasswordProviders()}.
+	 */
+	@Test
+	public void testGetServiceUsernameAndPasswordProviders() {
+		
+		assertTrue(credentialManager.getServiceUsernameAndPasswordProviders().isEmpty());
+	}
+	
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#setTrustConfirmationProviders(java.util.List)}.
+	 * @throws IOException 
+	 */
+	@Test
+	public void testSetTrustConfirmationProviders() throws IOException {
+		List<TrustConfirmationProvider> trustConfirmationProviders = new ArrayList<TrustConfirmationProvider>();
+		TrustConfirmationProvider trustConfirmationProvider = new TrustAlwaysTrustConfirmationProvider();
+		trustConfirmationProviders.add(trustConfirmationProvider);
+		
+		credentialManager.setTrustConfirmationProviders(trustConfirmationProviders);
+		
+		assertTrue(credentialManager.getTrustConfirmationProviders().contains(trustConfirmationProvider));
+		
+		// Set it to null and see what happens
+		credentialManager.setTrustConfirmationProviders(null);		
+		assertNull(credentialManager.getTrustConfirmationProviders());	
+	}
+	
+	/**
+	 * Test method for {@link net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl#getTrustConfirmationProviders()}.
+	 */
+	@Test
+	public void testGetTrustConfirmationProviders() {
+		
+		assertTrue(credentialManager.getTrustConfirmationProviders().isEmpty());
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/DummyJavaTruststorePasswordProvider.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/DummyJavaTruststorePasswordProvider.java b/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/DummyJavaTruststorePasswordProvider.java
new file mode 100644
index 0000000..6a1b9dc
--- /dev/null
+++ b/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/DummyJavaTruststorePasswordProvider.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (C) 2008-2010 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.security.credentialmanager.impl;
+
+import net.sf.taverna.t2.security.credentialmanager.JavaTruststorePasswordProvider;
+
+public class DummyJavaTruststorePasswordProvider implements JavaTruststorePasswordProvider{
+
+	String javaTruststorePassword;
+	
+	@Override
+	public String getJavaTruststorePassword() {
+		return javaTruststorePassword;
+	}
+
+	@Override
+	public void setJavaTruststorePassword(String password) {
+		javaTruststorePassword = password;		
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/DummyMasterPasswordProvider.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/DummyMasterPasswordProvider.java b/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/DummyMasterPasswordProvider.java
new file mode 100644
index 0000000..ddcd7e6
--- /dev/null
+++ b/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/DummyMasterPasswordProvider.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (C) 2008-2010 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.security.credentialmanager.impl;
+
+import net.sf.taverna.t2.security.credentialmanager.MasterPasswordProvider;
+
+public class DummyMasterPasswordProvider implements MasterPasswordProvider{
+
+	private String masterPassword;
+	private int priority = 0;
+
+	@Override
+	public String getMasterPassword(boolean firstTime) {
+		return masterPassword;
+	}
+
+	@Override
+	public int getProviderPriority() {
+		return priority;
+	}
+	
+	@Override
+	public void setMasterPassword(String password) {
+		masterPassword = password;
+	}
+
+//	@Override
+//	public void setProviderPriority(int priority) {
+//		this.priority = priority;
+//	}
+	
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/DummyServiceUsernameAndPasswordProvider.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/DummyServiceUsernameAndPasswordProvider.java b/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/DummyServiceUsernameAndPasswordProvider.java
new file mode 100644
index 0000000..f2227fc
--- /dev/null
+++ b/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/DummyServiceUsernameAndPasswordProvider.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (C) 2008-2010 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.security.credentialmanager.impl;
+
+import java.net.URI;
+
+import net.sf.taverna.t2.security.credentialmanager.ServiceUsernameAndPasswordProvider;
+import net.sf.taverna.t2.security.credentialmanager.UsernamePassword;
+
+public class DummyServiceUsernameAndPasswordProvider implements ServiceUsernameAndPasswordProvider{
+
+	private UsernamePassword usernamePassword;
+	private URI serviceURI;
+	private String requestingMessage;
+
+	@Override
+	public UsernamePassword getServiceUsernameAndPassword(URI serviceURI,
+			String requestingMessage) {
+		this.requestingMessage = requestingMessage;
+		this.serviceURI = serviceURI;
+		return usernamePassword;
+	}
+
+	@Override
+	public void setServiceUsernameAndPassword(URI serviceURI,
+			UsernamePassword usernamePassword) {
+
+		//this.serviceURI = serviceURI;
+		this.usernamePassword = usernamePassword;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/HTTPAuthenticatorIT.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/HTTPAuthenticatorIT.java b/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/HTTPAuthenticatorIT.java
new file mode 100644
index 0000000..18068db
--- /dev/null
+++ b/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/HTTPAuthenticatorIT.java
@@ -0,0 +1,535 @@
+/*******************************************************************************
+ * Copyright (C) 2008-2010 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.security.credentialmanager.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.Authenticator;
+import java.net.PasswordAuthentication;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
+import net.sf.taverna.t2.security.credentialmanager.CMException;
+import net.sf.taverna.t2.security.credentialmanager.CredentialManager;
+import net.sf.taverna.t2.security.credentialmanager.JavaTruststorePasswordProvider;
+import net.sf.taverna.t2.security.credentialmanager.MasterPasswordProvider;
+import net.sf.taverna.t2.security.credentialmanager.ServiceUsernameAndPasswordProvider;
+import net.sf.taverna.t2.security.credentialmanager.TrustConfirmationProvider;
+import net.sf.taverna.t2.security.credentialmanager.UsernamePassword;
+
+import org.apache.commons.io.FileUtils;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.mortbay.jetty.Connector;
+import org.mortbay.jetty.Handler;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.handler.DefaultHandler;
+import org.mortbay.jetty.handler.HandlerCollection;
+import org.mortbay.jetty.nio.SelectChannelConnector;
+import org.mortbay.jetty.security.Constraint;
+import org.mortbay.jetty.security.ConstraintMapping;
+import org.mortbay.jetty.security.HashUserRealm;
+import org.mortbay.jetty.security.SecurityHandler;
+import org.mortbay.jetty.webapp.WebAppContext;
+
+/**
+ * 
+ * Based on net.sf.tavenra.security.credentialmanager.FixedPasswordProvider from the
+ * Taverna 2 codebase. 
+ * 
+ * @author Stian Soiland-Reyes
+ * @author Alex Nenadic
+ *
+ */
+public class HTTPAuthenticatorIT {
+
+	protected static final String WRONG_PASSWORD = "wrongOne";
+	protected final static String PASSWORD = "basicPassword";
+	protected static final String PASSWORD2 = "password2";
+	protected static final String PASSWORD3 = "password3";
+	protected static final String PASSWORD4 = "password4";
+	protected static final String REALM = "realm1";
+	protected static final String REALM2 = "realm2";
+	protected final static String USERNAME = "basicUser";
+
+	protected static final int PORT = 9638;
+
+	private final class CountingAuthenticator extends
+			CredentialManagerAuthenticator {
+		
+		public CountingAuthenticator(CredentialManager credManager) {
+			super(credManager);
+		}
+
+		private int calls;
+
+		@Override
+		protected PasswordAuthentication getPasswordAuthentication() {
+			calls++;
+			return super.getPasswordAuthentication();
+		}
+	}
+
+	public class NullAuthenticator extends Authenticator {
+	}
+
+	protected static final String ROLE_NAME = "user";
+	protected static final String HTML = "/html/";
+	protected static Server server;
+	protected static HashUserRealm userRealm;
+	private static SecurityHandler sh;
+	
+	private static CredentialManagerImpl credentialManager;
+	private static File credentialManagerDirectory;
+	private static DummyMasterPasswordProvider masterPasswordProvider;
+	private static HTTPAuthenticatorServiceUsernameAndPasswordProvider httpAuthProvider;
+
+	@BeforeClass
+	public static void startCredentialManager() throws CMException, IOException {
+		
+		try {
+			credentialManager = new CredentialManagerImpl();
+		} catch (CMException e) {
+			System.out.println(e.getStackTrace());
+		}
+		Random randomGenerator = new Random();
+		String credentialManagerDirectoryPath = System
+				.getProperty("java.io.tmpdir")
+				+ System.getProperty("file.separator")
+				+ "taverna-security-"
+				+ randomGenerator.nextInt(1000000);
+		System.out.println("Credential Manager's directory path: "
+				+ credentialManagerDirectoryPath);
+		credentialManagerDirectory = new File(credentialManagerDirectoryPath);
+		try {
+			credentialManager
+					.setConfigurationDirectoryPath(credentialManagerDirectory);
+		} catch (CMException e) {
+			System.out.println(e.getStackTrace());
+		}
+
+		// Create the dummy master password provider
+		masterPasswordProvider = new DummyMasterPasswordProvider();
+		/* Short password to avoid issues with key sizes and Java strong crypto policy*/
+		masterPasswordProvider.setMasterPassword("uber");
+		List<MasterPasswordProvider> masterPasswordProviders = new ArrayList<MasterPasswordProvider>();
+		masterPasswordProviders.add(masterPasswordProvider);
+		credentialManager.setMasterPasswordProviders(masterPasswordProviders);
+		
+		// Put our HTTP authenticator in the list of service username and password providers
+		httpAuthProvider = new HTTPAuthenticatorServiceUsernameAndPasswordProvider();
+		ArrayList<ServiceUsernameAndPasswordProvider> serviceUsernameAndPasswordProviders = new ArrayList<ServiceUsernameAndPasswordProvider>();
+		serviceUsernameAndPasswordProviders.add(httpAuthProvider);
+		credentialManager.setServiceUsernameAndPasswordProviders(serviceUsernameAndPasswordProviders);
+
+		// These can be empty
+		credentialManager.setJavaTruststorePasswordProviders(new ArrayList<JavaTruststorePasswordProvider>());
+		credentialManager.setTrustConfirmationProviders(new ArrayList<TrustConfirmationProvider>());
+	}
+	
+	@AfterClass
+	// Clean up the credentialManagerDirectory we created for testing
+	public static void cleanUp(){
+
+		if (credentialManagerDirectory.exists()){
+			try {
+				FileUtils.deleteDirectory(credentialManagerDirectory);				
+				System.out.println("Deleting Credential Manager's directory: "
+						+ credentialManagerDirectory.getAbsolutePath());
+			} catch (IOException e) {
+				System.out.println(e.getStackTrace());
+			}	
+		}
+	}
+
+	@BeforeClass
+	public static void jettyServer() throws Exception {
+
+		server = new Server();
+
+		Connector connector = new SelectChannelConnector();
+		connector.setPort(PORT);
+		server.setConnectors(new Connector[] { connector });
+		ConstraintMapping cm = new ConstraintMapping();
+		Constraint constraint = new Constraint();
+		constraint.setName(Constraint.__BASIC_AUTH);
+		constraint.setRoles(new String[] { ROLE_NAME });
+		constraint.setAuthenticate(true);
+		cm.setConstraint(constraint);
+		cm.setPathSpec("/*");
+
+		sh = new SecurityHandler();
+		userRealm = new HashUserRealm(REALM);
+		userRealm.put(USERNAME, PASSWORD);
+		userRealm.addUserToRole(USERNAME, ROLE_NAME);
+		sh.setUserRealm(userRealm);
+		sh.setConstraintMappings(new ConstraintMapping[] { cm });
+
+		WebAppContext webappcontext = new WebAppContext();
+		webappcontext.setContextPath("/");
+
+		URL htmlRoot = HTTPAuthenticatorIT.class.getResource(HTML);
+		assertNotNull("Could not find " + HTML, htmlRoot);
+		webappcontext.setWar(htmlRoot.toExternalForm());
+		
+		webappcontext.addHandler(sh);
+
+		HandlerCollection handlers = new HandlerCollection();
+		handlers.setHandlers(new Handler[] { webappcontext,
+				new DefaultHandler() });
+
+		server.setHandler(handlers);
+		server.start();
+	}
+
+
+	@AfterClass
+	public static void shutdownJetty() throws Exception {
+		server.stop();
+	}
+
+	@Before
+	@After
+	public void resetAuthenticator() throws CMException {
+		Authenticator.setDefault(new NullAuthenticator());
+		HTTPAuthenticatorServiceUsernameAndPasswordProvider.resetCalls();
+	}
+	
+	@Before
+	public void resetAuthCache() throws CMException {
+		credentialManager.resetAuthCache();
+	}
+	
+	@Before
+	public void resetUserRealmPassword() {
+		userRealm.put(USERNAME, PASSWORD);
+		userRealm.setName(REALM);
+	}
+
+	@Test()
+	public void failsWithoutAuthenticator() throws Exception {
+		URL url = new URL("http://localhost:" + PORT + "/test.html");
+		URLConnection c = url.openConnection();
+		assertEquals("HTTP/1.1 401 Unauthorized", c.getHeaderField(0));
+	}
+
+	@Test()
+	public void withAuthenticator() throws Exception {
+		assertEquals("Unexpected calls to password provider", 0,
+				HTTPAuthenticatorServiceUsernameAndPasswordProvider.getCalls());
+		// Set the authenticator to our Credential Manager-backed one that also
+		// counts calls to itself
+		CountingAuthenticator authenticator = new CountingAuthenticator(credentialManager);
+		assertEquals("Unexpected calls to authenticator", 0,
+				authenticator.calls);
+		Authenticator.setDefault(authenticator);
+//		FixedPasswordProvider.setUsernamePassword(new UsernamePassword(
+//				USERNAME, PASSWORD));
+		
+		URL url = new URL("http://localhost:" + PORT + "/test.html");
+		httpAuthProvider.setServiceUsernameAndPassword(url.toURI(), new UsernamePassword(
+				USERNAME, PASSWORD));
+		URLConnection c = url.openConnection();
+
+		c.connect();
+		try {
+			c.getContent();
+		} catch (Exception ex) {
+		}
+		System.out.println(c.getHeaderField(0));
+		assertEquals("Did not invoke authenticator", 1, authenticator.calls);
+		assertEquals("Did not invoke our password provider", 1,
+				HTTPAuthenticatorServiceUsernameAndPasswordProvider.getCalls());
+		assertEquals("HTTP/1.1 200 OK", c.getHeaderField(0));
+
+
+		assertEquals("Unexpected prompt/realm", REALM, httpAuthProvider.getRequestMessage());
+		assertEquals("Unexpected URI", url.toURI().toASCIIString() + "#" + REALM, HTTPAuthenticatorServiceUsernameAndPasswordProvider
+				.getServiceURI().toASCIIString());
+
+		// And test Java's cache:
+		URLConnection c2 = url.openConnection();
+		c2.connect();
+		assertEquals("HTTP/1.1 200 OK", c2.getHeaderField(0));
+		assertEquals("JVM invoked our authenticator again instead of caching", 1,
+				authenticator.calls);
+		assertEquals("Invoked our password provider again instead of caching",
+				1, HTTPAuthenticatorServiceUsernameAndPasswordProvider.getCalls());
+
+	}
+	
+	@Test()
+	public void withAuthenticatorResetJava() throws Exception {
+		assertTrue("Could not reset JVMs authCache, ignore on non-Sun JVM", 
+				credentialManager.resetAuthCache());
+		
+		assertEquals("Unexpected calls to password provider", 0,
+				HTTPAuthenticatorServiceUsernameAndPasswordProvider.getCalls());
+		CountingAuthenticator authenticator = new CountingAuthenticator(credentialManager);
+		assertEquals("Unexpected calls to authenticator", 0,
+				authenticator.calls);
+		Authenticator.setDefault(authenticator);
+//		FixedPasswordProvider.setUsernamePassword(new UsernamePassword(
+//				USERNAME, PASSWORD));
+		
+		URL url = new URL("http://localhost:" + PORT + "/test.html");
+		httpAuthProvider.setServiceUsernameAndPassword(url.toURI(), new UsernamePassword(
+				USERNAME, PASSWORD));
+		URLConnection c = url.openConnection();
+
+		c.connect();
+		try {
+			c.getContent();
+		} catch (Exception ex) {
+		}
+
+		assertEquals("HTTP/1.1 200 OK", c.getHeaderField(0));
+
+		assertEquals("Did not invoke authenticator", 1, authenticator.calls);
+		assertEquals("Did not invoke our password provider", 1,
+				HTTPAuthenticatorServiceUsernameAndPasswordProvider.getCalls());
+
+		assertEquals("Unexpected prompt/realm", REALM, httpAuthProvider.getRequestMessage());
+		assertEquals("Unexpected URI", url.toURI().toASCIIString() + "#" + REALM, HTTPAuthenticatorServiceUsernameAndPasswordProvider
+				.getServiceURI().toASCIIString());
+
+		
+		
+		// And without Java's cache:
+		assertTrue("Could not reset VMs authCache, ignore on non-Sun VM", 
+				credentialManager.resetAuthCache());
+		
+		URLConnection c2 = url.openConnection();
+		c2.connect();
+		assertEquals("HTTP/1.1 200 OK", c2.getHeaderField(0));
+		assertEquals("Did not invoke our authenticator again", 2,
+				authenticator.calls);
+		assertEquals("Did not invoke our password provider again",
+				2, HTTPAuthenticatorServiceUsernameAndPasswordProvider.getCalls());
+
+	}
+	
+	
+	@Test()
+	public void differentRealm() throws Exception {
+		
+		assertEquals("Unexpected calls to password provider", 0,
+				HTTPAuthenticatorServiceUsernameAndPasswordProvider.getCalls());
+		CountingAuthenticator authenticator = new CountingAuthenticator(credentialManager);
+		assertEquals("Unexpected calls to authenticator", 0,
+				authenticator.calls);
+		Authenticator.setDefault(authenticator);
+		// Different password in case resetAuthCache() did not run
+		UsernamePassword userPassword = new UsernamePassword(
+				USERNAME, PASSWORD4);
+		userRealm.put(USERNAME, PASSWORD4);
+//		userPassword.setShouldSave(true);
+		//FixedPasswordProvider.setUsernamePassword(userPassword);
+		
+		URL url = new URL("http://localhost:" + PORT + "/test.html");
+		httpAuthProvider.setServiceUsernameAndPassword(url.toURI(), userPassword);
+		URLConnection c = url.openConnection();
+
+		c.connect();
+		try {
+			c.getContent();
+		} catch (Exception ex) {
+		}
+
+		assertEquals("Unexpected prompt/realm", REALM, httpAuthProvider.getRequestMessage());
+		assertEquals("Unexpected URI", url.toURI().toASCIIString() + "#" + REALM, HTTPAuthenticatorServiceUsernameAndPasswordProvider
+				.getServiceURI().toASCIIString());
+		
+		assertEquals("HTTP/1.1 200 OK", c.getHeaderField(0));
+
+		assertEquals("Did not invoke authenticator", 1, authenticator.calls);
+		assertEquals("Did not invoke our password provider", 1,
+				HTTPAuthenticatorServiceUsernameAndPasswordProvider.getCalls());
+
+		
+		// different realm should be treated as a second connection, and not even use saved credentials
+		
+		credentialManager.resetAuthCache();
+		userRealm.setName(REALM2);
+		
+		URLConnection c2 = url.openConnection();
+		c2.connect();
+		try {
+			c.getContent();
+		} catch (Exception ex) {
+		}
+
+		assertEquals("HTTP/1.1 200 OK", c2.getHeaderField(0));
+		
+		assertEquals("Did not invoke authenticator again", 2,
+				authenticator.calls);
+		assertEquals("Did not invoke provider again",
+				2, HTTPAuthenticatorServiceUsernameAndPasswordProvider.getCalls());
+	
+		assertEquals("Unexpected prompt/realm", REALM2, httpAuthProvider
+				.getRequestMessage());
+		assertEquals("Unexpected URI", url.toURI().toASCIIString() + "#" + REALM2, HTTPAuthenticatorServiceUsernameAndPasswordProvider
+				.getServiceURI().toASCIIString());	
+	}
+	
+
+	@Test()
+	public void wrongPasswordDontSave() throws Exception {
+		assertEquals("Unexpected calls to password provider", 0,
+				HTTPAuthenticatorServiceUsernameAndPasswordProvider.getCalls());
+		CountingAuthenticator authenticator = new CountingAuthenticator(credentialManager);
+		assertEquals("Unexpected calls to authenticator", 0,
+				authenticator.calls);
+		Authenticator.setDefault(authenticator);
+
+		// Make the server expect different password so our cache is no longer
+		// valid
+		userRealm.put(USERNAME, PASSWORD2);
+		// But we'll try with the old one, which we'll this time ask to save in
+		// DB
+		UsernamePassword usernamePassword = new UsernamePassword(USERNAME,
+				PASSWORD);
+		assertFalse("Should not be set to save by default", usernamePassword
+				.isShouldSave());
+		//FixedPasswordProvider.setUsernamePassword(usernamePassword);
+
+		URL url = new URL("http://localhost:" + PORT + "/test.html");
+		httpAuthProvider.setServiceUsernameAndPassword(url.toURI(), usernamePassword);
+		URLConnection c = url.openConnection();
+		try {
+			c.getContent();
+		} catch (Exception ex) {
+		}
+
+		assertEquals("Unexpected prompt/realm", REALM, httpAuthProvider
+				.getRequestMessage());
+		assertEquals("Unexpected URI", url.toURI().toASCIIString() + "#" + REALM, HTTPAuthenticatorServiceUsernameAndPasswordProvider
+				.getServiceURI().toASCIIString());
+		
+		assertEquals("HTTP/1.1 401 Unauthorized", c.getHeaderField(0));
+
+		assertTrue("Did not invoke authenticator enough times",
+				authenticator.calls > 1);
+		assertEquals("Should have asked provider as much as authenticator",
+				authenticator.calls, HTTPAuthenticatorServiceUsernameAndPasswordProvider.getCalls());
+
+
+		// Update provider to now provide the right one
+//		HTTPAuthenticatorServiceUsernameAndPasswordProvider.setUsernamePassword(new UsernamePassword(
+//				USERNAME, PASSWORD2));
+		httpAuthProvider.setServiceUsernameAndPassword(url.toURI(), new UsernamePassword(
+				USERNAME, PASSWORD2));
+		HTTPAuthenticatorServiceUsernameAndPasswordProvider.resetCalls();
+		authenticator.calls = 0;
+
+		URLConnection c2 = url.openConnection();
+		try {
+			c2.getContent();
+		} catch (Exception ex) {
+		}
+		assertEquals("Did not call authenticator again with cache pw invalid",
+				1, authenticator.calls);
+		assertEquals(
+				"id not called our password provider once",
+				1, HTTPAuthenticatorServiceUsernameAndPasswordProvider.getCalls());
+		assertEquals("HTTP/1.1 200 OK", c2.getHeaderField(0));
+	}
+
+	@Test()
+	public void saveToDatabase() throws Exception {
+		assertEquals("Unexpected calls to password provider", 0,
+				HTTPAuthenticatorServiceUsernameAndPasswordProvider.getCalls());
+		CountingAuthenticator authenticator = new CountingAuthenticator(credentialManager);
+		assertEquals("Unexpected calls to authenticator", 0,
+				authenticator.calls);
+		Authenticator.setDefault(authenticator);
+
+		// Make the server expect different password so our cache is no longer
+		// valid (In case CredManager.resetAuthCache() did not succeed on non-Sun VMs)
+		userRealm.put(USERNAME, PASSWORD3);
+		// But we'll try with the old one, which we'll this time ask to save in
+		// DB
+		UsernamePassword usernamePassword = new UsernamePassword(USERNAME,
+				PASSWORD2);
+		usernamePassword.setShouldSave(true);
+		//HTTPAuthenticatorServiceUsernameAndPasswordProvider.setUsernamePassword(usernamePassword);
+
+		URL url = new URL("http://localhost:" + PORT + "/test.html");
+		httpAuthProvider.setServiceUsernameAndPassword(url.toURI(), usernamePassword);
+		URLConnection c = url.openConnection();
+		try {
+			c.getContent();
+		} catch (Exception ex) {
+		}
+
+		assertEquals("Unexpected prompt/realm", REALM, httpAuthProvider
+				.getRequestMessage());
+		assertEquals("Unexpected URI", url.toURI().toASCIIString() + "#" + REALM, HTTPAuthenticatorServiceUsernameAndPasswordProvider
+				.getServiceURI().toASCIIString());
+		
+		assertEquals("HTTP/1.1 401 Unauthorized", c.getHeaderField(0));
+		
+		assertTrue("Did not invoke authenticator enough times",
+				authenticator.calls > 1);
+		assertEquals(
+				"Asked our provider more than once, not saved in credMan?", 1,
+				HTTPAuthenticatorServiceUsernameAndPasswordProvider.getCalls());
+
+		
+
+		// Expect the old one again
+		userRealm.put(USERNAME, PASSWORD2);
+		// We'll now set our provider to give an invalid password, but we should
+		// not be asked
+		// as the old one (now correct agian) is stored in DB
+//		HTTPAuthenticatorServiceUsernameAndPasswordProvider.setUsernamePassword(new UsernamePassword(
+//				USERNAME, WRONG_PASSWORD));
+		httpAuthProvider.setServiceUsernameAndPassword(url.toURI(), new UsernamePassword(
+				USERNAME, WRONG_PASSWORD));
+		
+		HTTPAuthenticatorServiceUsernameAndPasswordProvider.resetCalls();
+		authenticator.calls = 0;
+
+		URLConnection c2 = url.openConnection();
+		try {
+			c2.getContent();
+		} catch (Exception ex) {
+		}
+		assertEquals("Did not call authenticator again with cache pw invalid",
+				1, authenticator.calls);
+		assertEquals(
+				"Called our password provider instead of using credMan saved one",
+				0, HTTPAuthenticatorServiceUsernameAndPasswordProvider.getCalls());
+		assertEquals("HTTP/1.1 200 OK", c2.getHeaderField(0));
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/HTTPAuthenticatorServiceUsernameAndPasswordProvider.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/HTTPAuthenticatorServiceUsernameAndPasswordProvider.java b/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/HTTPAuthenticatorServiceUsernameAndPasswordProvider.java
new file mode 100644
index 0000000..5d3d6f2
--- /dev/null
+++ b/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/HTTPAuthenticatorServiceUsernameAndPasswordProvider.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (C) 2008-2010 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.security.credentialmanager.impl;
+
+import java.net.URI;
+
+import net.sf.taverna.t2.security.credentialmanager.ServiceUsernameAndPasswordProvider;
+import net.sf.taverna.t2.security.credentialmanager.UsernamePassword;
+
+/**
+ * 
+ * @author Stian Soiland-Reyes
+ * @author Alex Nenadic
+ *
+ */
+public class HTTPAuthenticatorServiceUsernameAndPasswordProvider implements ServiceUsernameAndPasswordProvider {
+
+	private static UsernamePassword usernamePassword;
+	private static URI serviceURI;
+	private static String requestMessage;
+	private static long calls = 0;
+	
+	public static long getCalls() {
+		return calls;
+	}
+	
+
+	public static void resetCalls() {
+		calls = 0;
+	}
+
+	@Override
+	public UsernamePassword getServiceUsernameAndPassword(URI serviceURI,
+			String requestMessage) {
+		HTTPAuthenticatorServiceUsernameAndPasswordProvider.serviceURI = serviceURI;
+		HTTPAuthenticatorServiceUsernameAndPasswordProvider.requestMessage = requestMessage;
+		calls++;
+		return usernamePassword.clone();
+	}
+
+	@Override
+	public void setServiceUsernameAndPassword(URI serviceURI,
+			UsernamePassword usernamePassword) {
+		HTTPAuthenticatorServiceUsernameAndPasswordProvider.serviceURI = serviceURI;
+		HTTPAuthenticatorServiceUsernameAndPasswordProvider.usernamePassword = usernamePassword;		
+	}
+
+	public static URI getServiceURI() {
+		return serviceURI;
+	}
+
+	public String getRequestMessage() {
+		return requestMessage;
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/HTTPSConnectionAndTrustConfirmationIT.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/HTTPSConnectionAndTrustConfirmationIT.java b/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/HTTPSConnectionAndTrustConfirmationIT.java
new file mode 100644
index 0000000..a9211b1
--- /dev/null
+++ b/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/HTTPSConnectionAndTrustConfirmationIT.java
@@ -0,0 +1,336 @@
+/*******************************************************************************
+ * Copyright (C) 2008-2010 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.security.credentialmanager.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.net.URL;
+import java.security.KeyManagementException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.NoSuchProviderException;
+import java.security.SecureRandom;
+import java.security.Security;
+import java.security.UnrecoverableKeyException;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLHandshakeException;
+import javax.net.ssl.TrustManagerFactory;
+
+import net.sf.taverna.t2.security.credentialmanager.CMException;
+import net.sf.taverna.t2.security.credentialmanager.MasterPasswordProvider;
+import net.sf.taverna.t2.security.credentialmanager.TrustConfirmationProvider;
+
+import org.apache.commons.io.FileUtils;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+//import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class HTTPSConnectionAndTrustConfirmationIT {
+
+	
+	private static CredentialManagerImpl credentialManager;
+	private static DummyMasterPasswordProvider masterPasswordProvider;
+	private static File credentialManagerDirectory;
+	//private static URL trustedCertficateFileURL = HTTPSConnectionAndTrustConfirmationIT.class.getResource("/security/tomcat_heater_certificate.pem");
+	
+	// Log4J Logger
+	//private static Logger logger = Logger.getLogger(HTTPSConnectionAndTrustConfirmationIT.class);
+
+//	public static void main(String[] args){
+//		
+//		try {
+//			CredentialManagerOld.initialiseSSL();
+//			//CredentialManager.getInstance();
+//			//HttpsURLConnection.setDefaultSSLSocketFactory(CredentialManager.createTavernaSSLSocketFactory());
+//			URL url = new URL ("https://rpc103.cs.man.ac.uk:8443/wsrf/services/cagrid/SecureHelloWorld?wsdl");
+//			HttpsURLConnection httpsConnection = (HttpsURLConnection) url.openConnection();
+//			// user should be asked automatically if they want to trust the connection
+//			httpsConnection.connect();
+//			
+//		} catch (CMException e) {
+//			logger.error("", e);
+//		} catch (MalformedURLException e) {
+//			logger.error("", e);
+//		} catch (IOException e) {
+//			logger.error("", e);
+//		}
+//		catch(Exception ex){ // anything we did not expect
+//			logger.error("", ex);
+//		}
+//		
+//	}
+
+	/**
+	 * @throws java.lang.Exception
+	 */
+	@BeforeClass
+	public static void setUpBeforeClass() throws Exception {
+		
+		// Just in case, add the BouncyCastle provider
+		// It gets added from the CredentialManagerImpl constructor as well
+		// but we may need some crypto operations before we invoke the Cred. Manager 
+		Security.addProvider(new BouncyCastleProvider());
+	}
+	
+	/**
+	 * @throws java.lang.Exception
+	 */
+	@Before
+	public void setUp() throws Exception {
+
+		try {
+			credentialManager = new CredentialManagerImpl();
+		} catch (CMException e) {
+			System.out.println(e.getStackTrace());
+		}
+		Random randomGenerator = new Random();
+		String credentialManagerDirectoryPath = System
+				.getProperty("java.io.tmpdir")
+				+ System.getProperty("file.separator")
+				+ "taverna-security-"
+				+ randomGenerator.nextInt(1000000);
+		System.out.println("Credential Manager's directory path: "
+				+ credentialManagerDirectoryPath);
+		credentialManagerDirectory = new File(credentialManagerDirectoryPath);
+		try {
+			credentialManager
+					.setConfigurationDirectoryPath(credentialManagerDirectory);
+		} catch (CMException e) {
+			System.out.println(e.getStackTrace());
+		}
+
+		// Create the dummy master password provider
+		masterPasswordProvider = new DummyMasterPasswordProvider();
+		masterPasswordProvider.setMasterPassword("uber");
+		List<MasterPasswordProvider> masterPasswordProviders = new ArrayList<MasterPasswordProvider>();
+		masterPasswordProviders.add(masterPasswordProvider);
+		credentialManager.setMasterPasswordProviders(masterPasswordProviders);
+		
+		// Set an empty list for trust confirmation providers
+		credentialManager.setTrustConfirmationProviders(new ArrayList<TrustConfirmationProvider>());
+	}
+	
+	@After
+	// Clean up the credentialManagerDirectory we created for testing
+	public void cleanUp() throws NoSuchAlgorithmException, KeyManagementException, NoSuchProviderException, KeyStoreException, UnrecoverableKeyException, CertificateException, IOException{
+//		assertTrue(credentialManagerDirectory.exists());
+//		assertFalse(credentialManagerDirectory.listFiles().length == 0); // something was created there
+	
+		if (credentialManagerDirectory.exists()){
+			try {
+				FileUtils.deleteDirectory(credentialManagerDirectory);				
+				System.out.println("Deleting Credential Manager's directory: "
+						+ credentialManagerDirectory.getAbsolutePath());
+			} catch (IOException e) {
+				System.out.println(e.getStackTrace());
+			}	
+		}
+		
+		// Reset the SSLSocketFactory in JVM so we always have a clean start
+		SSLContext sc = null;
+		sc = SSLContext.getInstance("SSLv3");
+		
+		// Create a "default" JSSE X509KeyManager.
+		KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509",
+				"SunJSSE");
+		KeyStore ks = KeyStore.getInstance("JKS");
+		ks.load(null, null);
+		kmf.init(ks, "blah".toCharArray());
+		
+		// Create a "default" JSSE X509TrustManager.
+		TrustManagerFactory tmf = TrustManagerFactory.getInstance(
+				"SunX509", "SunJSSE");
+		KeyStore ts = KeyStore.getInstance("JKS");
+		ts.load(null, null);
+		tmf.init(ts);
+		
+		sc.init(kmf.getKeyManagers(), tmf.getTrustManagers(), new SecureRandom());
+		SSLContext.setDefault(sc);		
+		HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
+	}
+	
+	@Test
+	public void testTrustConfirmationProvidersTrustAlways() throws IOException, CMException {
+		// Initially trust provider list is empty, we only verify by what is in 
+		// Credential Manager's Truststore (and it does not contains the certificate for https://heater.cs.man.ac.uk:7443/)
+		
+		// Do not forget to initialise Taverna's/Credential Manager's SSLSocketFactory
+		credentialManager.initializeSSL();
+		
+		URL url = new URL("https://heater.cs.man.ac.uk:7443/");
+		HttpsURLConnection conn;
+		conn = (HttpsURLConnection) url.openConnection();
+		try{
+			// This should fail
+			conn.connect();
+			fail("Connection to https://heater.cs.man.ac.uk:7443/ should be untrusted at this point.");
+		}
+		catch(SSLHandshakeException sslex){
+			// expected to fail so all is good
+			System.out.println(sslex.getStackTrace());
+		}
+		finally{
+			conn.disconnect();
+		}
+		
+		// Add the trust confirmation provider that trusts everyone
+		List<TrustConfirmationProvider> trustProviders = new ArrayList<TrustConfirmationProvider>();
+		trustProviders.add(new TrustAlwaysTrustConfirmationProvider());
+		credentialManager.setTrustConfirmationProviders(trustProviders);
+		
+		HttpsURLConnection conn2 = (HttpsURLConnection) url.openConnection();
+		// This should work now
+		conn2.connect();
+		System.out.println("Status header: "+ conn2.getHeaderField(0));
+
+		assertEquals("HTTP/1.1 200 OK", conn2.getHeaderField(0));
+		conn2.disconnect();
+	}
+	
+	@Test
+	public void testTrustConfirmationProvidersTrustNever() throws IOException, CMException {
+		// Initially trust provider list is empty, we only verify by what is in 
+		// Credential Manager's Truststore (and it does not contains the certificate for https://heater.cs.man.ac.uk:7443/)
+		
+		// Do not forget to initialise Taverna's/Credential Manager's SSLSocketFactory
+		credentialManager.initializeSSL();
+		
+		URL url = new URL("https://heater.cs.man.ac.uk:7443/");
+		HttpsURLConnection conn;
+		conn = (HttpsURLConnection) url.openConnection();
+		try{
+			// This should fail
+			conn.connect();
+			fail("Connection to https://heater.cs.man.ac.uk:7443/ should be untrusted at this point.");
+		}
+		catch(SSLHandshakeException sslex){
+			// expected to fail so all is good
+		}
+		finally{
+			conn.disconnect();
+		}
+		
+		// Add the trust confirmation provider that trusts no one
+		List<TrustConfirmationProvider> trustProviders = new ArrayList<TrustConfirmationProvider>();
+		credentialManager.setTrustConfirmationProviders(trustProviders);
+		trustProviders = new ArrayList<TrustConfirmationProvider>();
+		trustProviders.add(new TrustNeverTrustConfimationProvider());
+		credentialManager.setTrustConfirmationProviders(trustProviders);
+		
+		HttpsURLConnection conn2 = (HttpsURLConnection) url.openConnection();
+		try{
+			// This should still fail as our trust providers are not trusting anyone
+			// and we have not added heater's certificate to Credential Manager's Truststore
+			conn2.connect();
+			fail("Connection to https://heater.cs.man.ac.uk:7443/ should be untrusted at this point.");
+		}
+		catch(SSLHandshakeException sslex){
+			// expected to fail so all is good
+		}
+		finally{
+			conn2.disconnect();
+		}
+	}
+	
+	@Test
+	public void testTrustConfirmationAddDeleteCertificateDirectly() throws CMException, IOException, CertificateException{
+		// Initially trust provider list is empty, we only verify by what is in 
+		// Credential Manager's Truststore (and it does not contains the certificate for https://heater.cs.man.ac.uk:7443/)
+		
+		// Do not forget to initialise Taverna's/Credential Manager's SSLSocketFactory
+		credentialManager.initializeSSL();
+		
+		URL url = new URL("https://heater.cs.man.ac.uk:7443/");
+		HttpsURLConnection conn;
+		conn = (HttpsURLConnection) url.openConnection();
+		try{
+			// This should fail
+			conn.connect();
+			fail("Connection to https://heater.cs.man.ac.uk:7443/ should be untrusted at this point.");
+		}
+		catch(SSLHandshakeException sslex){
+			// expected to fail so all is good
+		}
+		finally{
+			conn.disconnect();
+		}
+		
+		// Add heater's certificate directly to Credential Manager's Truststore
+		
+		// Load the test trusted certificate (belonging to heater.cs.man.ac.uk)
+		X509Certificate trustedCertficate;
+		URL trustedCertficateFileURL = getClass().getResource("/security/tomcat_heater_certificate.pem");
+		System.out.println("testTrustConfirmationAddDeleteCertificateDirectly: trusted certficate file URL " + trustedCertficateFileURL);
+		File trustedCertFile = new File(trustedCertficateFileURL.getPath());		
+		FileInputStream inStream = new FileInputStream(trustedCertFile);
+		//InputStream inStream = getClass().getClassLoader().getResourceAsStream("security/tomcat_heater_certificate.pem");
+		CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
+		trustedCertficate = (X509Certificate) certFactory.generateCertificate(inStream);
+		try{
+			inStream.close();
+		}
+		catch (Exception e) {
+			// Ignore
+		}
+		String alias = credentialManager.addTrustedCertificate(trustedCertficate);
+		
+		HttpsURLConnection conn2 = (HttpsURLConnection) url.openConnection();
+		// This should work now
+		conn2.connect();
+		//System.out.println(conn2.getHeaderField(0));
+
+		assertEquals("HTTP/1.1 200 OK", conn2.getHeaderField(0));
+		conn2.disconnect();
+		
+		// Now remove certificate and see if the "trust" changes
+		credentialManager.deleteTrustedCertificate(alias);
+		HttpsURLConnection conn3;
+		conn3 = (HttpsURLConnection) url.openConnection();
+		try{
+			// This should fail
+			conn3.connect();
+			fail("Connection to https://heater.cs.man.ac.uk:7443/ should be untrusted at this point.");
+		}
+		catch(SSLHandshakeException sslex){
+			// expected to fail so all is good
+		}
+		finally{
+			conn3.disconnect();
+		}
+	}
+}


[30/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/t2flow/iteration.t2flow
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/t2flow/iteration.t2flow b/taverna-platform-integration-tests/src/test/resources/t2flow/iteration.t2flow
new file mode 100644
index 0000000..bec4c2d
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/t2flow/iteration.t2flow
@@ -0,0 +1,474 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.2.0"><dataflow id="80c80b32-1faa-4c8e-9294-eb85d6aaa764" role="top"><name>Workflow13</name><inputPorts><port><name>in</name><depth>0</depth><granularDepth>0</granularDepth><annotations /></port></inputPorts><outputPorts><port><name>cross</name><annotations /></port><port><name>dot</name><annotations /></port><port><name>crossdot</name><annotations /></port><port><name>dotdot</name><annotations /></port><port><name>dotcross</name><annotations /></port></outputPorts><processors><processor><name>cross</name><inputPorts><port><name>in1</name><depth>0</depth></port><port><name>in2</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>beanshell-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.
 t2.activities.beanshell.BeanshellActivity</class><inputMap><map from="in2" to="in2" /><map from="in1" to="in1" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean xmlns="">
+  <script>out=in1 + in2;</script>
+  <dependencies />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in1</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in2</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>0</granularDepth>
+      <name>out</name>
+      <depth>0</depth>
+      <mimeTypes />
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in1" depth="0" /><port name="in2" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>ListGenerator1</name><inputPorts><port><name>in</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>1</depth><granularDepth>1</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>beanshell-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.beanshell.Beans
 hellActivity</class><inputMap><map from="in" to="in" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean xmlns="">
+  <script>out = new ArrayList();
+
+for (int i = 0; i &lt; 10; i++) {
+  out.add(in + ":" + i);
+}</script>
+  <dependencies />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>1</granularDepth>
+      <name>out</name>
+      <depth>1</depth>
+      <mimeTypes />
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>ListGenerator2</name><inputPorts><port><name>in</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>1</depth><granularDepth>1</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>beanshell-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.beanshell.BeanshellActivity</class><inputMap>
 <map from="in" to="in" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean xmlns="">
+  <script>out = new ArrayList();
+
+for (int i = 0; i &lt; 10; i++) {
+  out.add(in + ":" + i);
+}</script>
+  <dependencies />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>1</granularDepth>
+      <name>out</name>
+      <depth>1</depth>
+      <mimeTypes />
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>dot</name><inputPorts><port><name>in2</name><depth>0</depth></port><port><name>in1</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>beanshell-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.beanshell.
 BeanshellActivity</class><inputMap><map from="in2" to="in2" /><map from="in1" to="in1" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean xmlns="">
+  <script>out=in1 + in2;</script>
+  <dependencies />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in1</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in2</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>0</granularDepth>
+      <name>out</name>
+      <depth>0</depth>
+      <mimeTypes />
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><dot><port name="in2" depth="0" /><port name="in1" depth="0" /></dot></strategy></iteration></iterationStrategyStack></processor><processor><name>crossdot</name><inputPorts><port><name>in1</name><depth>0</depth></port><port><name>in2</name><depth>0</depth></port><port><name>in3</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>beanshell-activity</artifact>
 <version>1.2</version></raven><class>net.sf.taverna.t2.activities.beanshell.BeanshellActivity</class><inputMap><map from="in2" to="in2" /><map from="in1" to="in1" /><map from="in3" to="in3" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean xmlns="">
+  <script>out = in1 + in2 + in3;</script>
+  <dependencies />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in1</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in2</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in3</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>0</granularDepth>
+      <name>out</name>
+      <depth>0</depth>
+      <mimeTypes />
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in1" depth="0" /><port name="in2" depth="0" /><dot><port name="in3" depth="0" /></dot></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>dotcross</name><inputPorts><port><name>in1</name><depth>0</depth></port><port><name>in2</name><depth>0</depth></port><port><name>in3</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</g
 roup><artifact>beanshell-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.beanshell.BeanshellActivity</class><inputMap><map from="in2" to="in2" /><map from="in1" to="in1" /><map from="in3" to="in3" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean xmlns="">
+  <script>out = in1 + in2 + in3;</script>
+  <dependencies />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in1</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in2</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in3</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>0</granularDepth>
+      <name>out</name>
+      <depth>0</depth>
+      <mimeTypes />
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in3" depth="0" /><dot><port name="in2" depth="0" /><port name="in1" depth="0" /></dot></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>dotdot</name><inputPorts><port><name>in1</name><depth>0</depth></port><port><name>in2</name><depth>0</depth></port><port><name>in3</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</gro
 up><artifact>beanshell-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.beanshell.BeanshellActivity</class><inputMap><map from="in2" to="in2" /><map from="in1" to="in1" /><map from="in3" to="in3" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean xmlns="">
+  <script>out = in1 + in2 + in3;</script>
+  <dependencies />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in1</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in2</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in3</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>0</granularDepth>
+      <name>out</name>
+      <depth>0</depth>
+      <mimeTypes />
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><dot><port name="in1" depth="0" /><port name="in2" depth="0" /><dot><port name="in3" depth="0" /></dot></dot></strategy></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>cross</processor><port>in1</port></sink><source type="processor"><processor>ListGenerator1</processor><port>out</port></source></datalink><datalink><sink type="processor"><processor>cross</processor><port>in2</port></sink><source type="processor"><processor>ListGenerator2</processor><port>out</port>
 </source></datalink><datalink><sink type="processor"><processor>ListGenerator1</processor><port>in</port></sink><source type="dataflow"><port>in</port></source></datalink><datalink><sink type="processor"><processor>ListGenerator2</processor><port>in</port></sink><source type="dataflow"><port>in</port></source></datalink><datalink><sink type="processor"><processor>dot</processor><port>in2</port></sink><source type="processor"><processor>ListGenerator2</processor><port>out</port></source></datalink><datalink><sink type="processor"><processor>dot</processor><port>in1</port></sink><source type="processor"><processor>ListGenerator1</processor><port>out</port></source></datalink><datalink><sink type="processor"><processor>crossdot</processor><port>in1</port></sink><source type="processor"><processor>ListGenerator1</processor><port>out</port></source></datalink><datalink><sink type="processor"><processor>crossdot</processor><port>in2</port></sink><source type="processor"><processor>ListGen
 erator2</processor><port>out</port></source></datalink><datalink><sink type="processor"><processor>crossdot</processor><port>in3</port></sink><source type="dataflow"><port>in</port></source></datalink><datalink><sink type="processor"><processor>dotcross</processor><port>in1</port></sink><source type="processor"><processor>ListGenerator1</processor><port>out</port></source></datalink><datalink><sink type="processor"><processor>dotcross</processor><port>in2</port></sink><source type="processor"><processor>ListGenerator2</processor><port>out</port></source></datalink><datalink><sink type="processor"><processor>dotcross</processor><port>in3</port></sink><source type="dataflow"><port>in</port></source></datalink><datalink><sink type="processor"><processor>dotdot</processor><port>in1</port></sink><source type="processor"><processor>ListGenerator1</processor><port>out</port></source></datalink><datalink><sink type="processor"><processor>dotdot</processor><port>in2</port></sink><source type
 ="processor"><processor>ListGenerator2</processor><port>out</port></source></datalink><datalink><sink type="processor"><processor>dotdot</processor><port>in3</port></sink><source type="processor"><processor>ListGenerator2</processor><port>out</port></source></datalink><datalink><sink type="dataflow"><port>cross</port></sink><source type="processor"><processor>cross</processor><port>out</port></source></datalink><datalink><sink type="dataflow"><port>dot</port></sink><source type="processor"><processor>dot</processor><port>out</port></source></datalink><datalink><sink type="dataflow"><port>crossdot</port></sink><source type="processor"><processor>crossdot</processor><port>out</port></source></datalink><datalink><sink type="dataflow"><port>dotdot</port></sink><source type="processor"><processor>dotdot</processor><port>out</port></source></datalink><datalink><sink type="dataflow"><port>dotcross</port></sink><source type="processor"><processor>dotcross</processor><port>out</port></source
 ></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>ad638364-a6e0-4852-abca-9f609c9553d2</identification>
+      </annotationBean>
+      <date>2010-08-19 13:43:43.797 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>3fb7f0a7-26f8-43e1-a122-87a25889f57d</identification>
+      </annotationBean>
+      <date>2011-02-22 08:25:53.793 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>13c70169-dfaa-4ea6-b6ab-3551dae7fa84</identification>
+      </annotationBean>
+      <date>2010-08-19 12:28:57.881 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>af1f698b-820d-4b35-a92e-9091c90b493e</identification>
+      </annotationBean>
+      <date>2011-02-22 09:30:17.881 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>be50375c-4f68-44aa-8604-9a80d8d97570</identification>
+      </annotationBean>
+      <date>2011-02-22 09:03:28.97 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>eb6a550d-f34e-4de9-b0fc-1b3df8ab36c4</identification>
+      </annotationBean>
+      <date>2010-08-31 14:32:44.634 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>ac70d4c0-5db9-48b1-ba32-8e11fff8ae59</identification>
+      </annotationBean>
+      <date>2011-02-22 08:31:32.90 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>78cb1427-d57f-42c2-a385-1d20c1580f3b</identification>
+      </annotationBean>
+      <date>2010-08-31 14:36:00.297 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>3b7c0b9c-572d-466b-af6d-0fb40699e8a5</identification>
+      </annotationBean>
+      <date>2010-08-31 12:50:40.306 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>7a22acbb-2f0f-41dd-a526-d2a9b4e267c5</identification>
+      </annotationBean>
+      <date>2011-02-22 08:59:59.964 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>80c80b32-1faa-4c8e-9294-eb85d6aaa764</identification>
+      </annotationBean>
+      <date>2011-02-22 09:40:37.744 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>bc9c64da-9143-4811-a22e-657c92fcfe94</identification>
+      </annotationBean>
+      <date>2011-02-22 09:23:49.109 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>c072030e-b367-4885-a770-7d892672d979</identification>
+      </annotationBean>
+      <date>2011-02-22 09:31:03.727 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>7ef10e93-7376-41a9-9255-552149094142</identification>
+      </annotationBean>
+      <date>2010-08-31 13:06:57.536 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/t2flow/localworker.t2flow
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/t2flow/localworker.t2flow b/taverna-platform-integration-tests/src/test/resources/t2flow/localworker.t2flow
new file mode 100644
index 0000000..b3b2053
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/t2flow/localworker.t2flow
@@ -0,0 +1,67 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.2.0"><dataflow id="5eebce20-72f5-4ac7-a4bf-8086d59d0c9e" role="top"><name>Workflow5</name><inputPorts><port><name>in</name><depth>0</depth><granularDepth>0</granularDepth><annotations /></port></inputPorts><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>Concatenate_two_strings</name><inputPorts><port><name>string2</name><depth>0</depth></port><port><name>string1</name><depth>0</depth></port></inputPorts><outputPorts><port><name>output</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivity</class><inputMap><map from="string2" to="string2" /><map from="string1" to="string1" /></inputMap><outputMap><map f
 rom="output" to="output" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <localworkerName>org.embl.ebi.escience.scuflworkers.java.StringConcat</localworkerName>
+  <script>output = string1 + string2;</script>
+  <dependencies />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>string1</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>string2</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>0</granularDepth>
+      <name>output</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="string2" depth="0" /><port name="string1" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>string1_value</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /
 ><outputMap><map from="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>Hello </value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>Concatenate_two_strings</processor><port>string2</port></sink><source type="dataflow"><port>in</port></source></datalink><datalink><sink type="processor"><processor>Concatenate_two_strings</processor><port>string1</port></sink><source type="processor"><processor>string1_value</processor><port>value</port></source></datalink><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>C
 oncatenate_two_strings</processor><port>output</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>5eebce20-72f5-4ac7-a4bf-8086d59d0c9e</identification>
+      </annotationBean>
+      <date>2011-02-21 13:44:43.621 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/t2flow/rest.t2flow
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/t2flow/rest.t2flow b/taverna-platform-integration-tests/src/test/resources/t2flow/rest.t2flow
new file mode 100644
index 0000000..f3f90b8
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/t2flow/rest.t2flow
@@ -0,0 +1,154 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3.0"><dataflow id="8e36176a-2975-498b-93f7-f2beba774532" role="top"><name>Workflow11</name><inputPorts /><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>REST_Service</name><inputPorts><port><name>id</name><depth>0</depth></port></inputPorts><outputPorts><port><name>responseBody</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>rest-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.rest.RESTActivity</class><inputMap><map from="id" to="id" /></inputMap><outputMap><map from="responseBody" to="responseBody" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.rest.RESTActivityConfigurationBean xmlns="">
+  <httpMethod>GET</httpMethod>
+  <urlSignature>http://www.uniprot.org/uniprot/{id}.xml</urlSignature>
+  <acceptsHeaderValue>text/plain</acceptsHeaderValue>
+  <contentTypeForUpdates>application/xml</contentTypeForUpdates>
+  <outgoingDataFormat>String</outgoingDataFormat>
+  <sendHTTPExpectRequestHeader>false</sendHTTPExpectRequestHeader>
+  <showRedirectionOutputPort>false</showRedirectionOutputPort>
+  <escapeParameters>true</escapeParameters>
+  <otherHTTPHeaders />
+  <activityInputs>
+    <entry>
+      <string>id</string>
+      <java-class>java.lang.String</java-class>
+    </entry>
+  </activityInputs>
+</net.sf.taverna.t2.activities.rest.RESTActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="id" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>id_value</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" to="value" />
 </outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>P12345</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>REST_Service</processor><port>id</port></sink><source type="processor"><processor>id_value</processor><port>value</port></source></datalink><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>REST_Service</processor><port>responseBody</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xm
 lns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>30c58a3d-4037-4b92-b7d6-3aea761bdada</identification>
+      </annotationBean>
+      <date>2011-11-02 08:52:32.796 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>d090ff3c-c84d-461f-9027-ccd07fe0a352</identification>
+      </annotationBean>
+      <date>2011-11-02 10:09:35.558 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>1e2069a6-54c3-4e09-b639-c9bb27356eb9</identification>
+      </annotationBean>
+      <date>2011-11-02 09:59:38.235 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>f88604da-4047-4ab9-bd19-23cbbb8be88b</identification>
+      </annotationBean>
+      <date>2011-11-02 10:12:00.757 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>8e36176a-2975-498b-93f7-f2beba774532</identification>
+      </annotationBean>
+      <date>2012-02-10 15:56:15.960 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>b3887d66-e945-444d-820a-ddb5c1d6cecb</identification>
+      </annotationBean>
+      <date>2011-11-02 10:00:26.717 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>bbf68124-dbeb-482b-80c6-e461d264a98b</identification>
+      </annotationBean>
+      <date>2011-11-02 10:12:59.372 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>c2802c60-cc0e-4bc0-b401-473476811e46</identification>
+      </annotationBean>
+      <date>2011-11-02 10:02:16.255 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>d73137e0-8cfb-4536-849e-6d30b1b1f4dc</identification>
+      </annotationBean>
+      <date>2011-11-02 08:49:30.655 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>3f67a647-2d0e-4d7e-9937-5bde3d562fde</identification>
+      </annotationBean>
+      <date>2011-11-02 10:10:29.316 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>f76689f8-2629-4168-b0a6-e70c88acaca9</identification>
+      </annotationBean>
+      <date>2012-02-10 15:49:11.156 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/t2flow/secure-basic-authentication-https.t2flow
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/t2flow/secure-basic-authentication-https.t2flow b/taverna-platform-integration-tests/src/test/resources/t2flow/secure-basic-authentication-https.t2flow
new file mode 100644
index 0000000..0cbff10
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/t2flow/secure-basic-authentication-https.t2flow
@@ -0,0 +1,74 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3-SNAPSHOT-20110621T1150"><dataflow id="12203b36-f878-45f7-a16e-863e1bbc81b8" role="top"><name>Workflow18</name><inputPorts /><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>Service_protected_with_Basic_AuthN_and_HTTPS</name><inputPorts /><outputPorts><port><name>responseBody</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>rest-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.rest.RESTActivity</class><inputMap /><outputMap><map from="responseBody" to="responseBody" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.rest.RESTActivityConfigurationBean xmlns="">
+  <httpMethod>GET</httpMethod>
+  <urlSignature>https://heater.cs.man.ac.uk:7443/examples-basic-authentication/taverna-test-page.html</urlSignature>
+  <acceptsHeaderValue>text/plain</acceptsHeaderValue>
+  <contentTypeForUpdates>application/xml</contentTypeForUpdates>
+  <outgoingDataFormat>String</outgoingDataFormat>
+  <sendHTTPExpectRequestHeader>false</sendHTTPExpectRequestHeader>
+  <showRedirectionOutputPort>false</showRedirectionOutputPort>
+  <escapeParameters>true</escapeParameters>
+  <otherHTTPHeaders />
+  <activityInputs />
+</net.sf.taverna.t2.activities.rest.RESTActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>Service_protected_with_Basic_AuthN_and_HTTPS</processor><port>responseBody</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>adb25995-c890-40c7-b091-2c2512024864</identification>
+      </annotationBean>
+      <date>2010-11-29 10:35:54.270 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>12203b36-f878-45f7-a16e-863e1bbc81b8</identification>
+      </annotationBean>
+      <date>2010-11-29 15:35:51.711 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>837b1710-ff29-4eef-85a0-51fc76139364</identification>
+      </annotationBean>
+      <date>2010-11-22 14:15:20.380 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>b7887959-6d6c-4466-8d15-16b4e20051db</identification>
+      </annotationBean>
+      <date>2010-11-22 14:16:43.484 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>388333c0-fd34-4571-ab0c-f67c10c2ed64</identification>
+      </annotationBean>
+      <date>2010-11-22 14:21:12.760 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/t2flow/secure-basic-authentication.t2flow
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/t2flow/secure-basic-authentication.t2flow b/taverna-platform-integration-tests/src/test/resources/t2flow/secure-basic-authentication.t2flow
new file mode 100644
index 0000000..998b69a
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/t2flow/secure-basic-authentication.t2flow
@@ -0,0 +1,74 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3-SNAPSHOT-20110621T1150"><dataflow id="6eca35ba-d7d4-43d9-8593-93eba828cc46" role="top"><name>Workflow18</name><inputPorts /><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>Service_protected_with_Basic_AuthN</name><inputPorts /><outputPorts><port><name>responseBody</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>rest-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.rest.RESTActivity</class><inputMap /><outputMap><map from="responseBody" to="responseBody" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.rest.RESTActivityConfigurationBean xmlns="">
+  <httpMethod>GET</httpMethod>
+  <urlSignature>http://heater.cs.man.ac.uk:7070/examples-basic-authentication/taverna-test-page.html</urlSignature>
+  <acceptsHeaderValue>text/plain</acceptsHeaderValue>
+  <contentTypeForUpdates>application/xml</contentTypeForUpdates>
+  <outgoingDataFormat>String</outgoingDataFormat>
+  <sendHTTPExpectRequestHeader>false</sendHTTPExpectRequestHeader>
+  <showRedirectionOutputPort>false</showRedirectionOutputPort>
+  <escapeParameters>true</escapeParameters>
+  <otherHTTPHeaders />
+  <activityInputs />
+</net.sf.taverna.t2.activities.rest.RESTActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>Service_protected_with_Basic_AuthN</processor><port>responseBody</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>837b1710-ff29-4eef-85a0-51fc76139364</identification>
+      </annotationBean>
+      <date>2010-11-22 14:15:20.380 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>6eca35ba-d7d4-43d9-8593-93eba828cc46</identification>
+      </annotationBean>
+      <date>2010-11-29 10:41:02.602 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>adb25995-c890-40c7-b091-2c2512024864</identification>
+      </annotationBean>
+      <date>2010-11-29 10:35:54.270 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>b7887959-6d6c-4466-8d15-16b4e20051db</identification>
+      </annotationBean>
+      <date>2010-11-22 14:16:43.484 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>388333c0-fd34-4571-ab0c-f67c10c2ed64</identification>
+      </annotationBean>
+      <date>2010-11-22 14:21:12.760 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file


[41/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecution.java
----------------------------------------------------------------------
diff --git a/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecution.java b/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecution.java
new file mode 100644
index 0000000..cf94d39
--- /dev/null
+++ b/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecution.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (C) 2011 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.impl.remote;
+
+import org.purl.wf4ever.robundle.Bundle;
+
+import uk.org.taverna.platform.execution.api.AbstractExecution;
+import uk.org.taverna.platform.report.ActivityReport;
+import uk.org.taverna.platform.report.ProcessorReport;
+import uk.org.taverna.platform.report.WorkflowReport;
+import uk.org.taverna.scufl2.api.activity.Activity;
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+import uk.org.taverna.scufl2.api.core.Processor;
+import uk.org.taverna.scufl2.api.core.Workflow;
+import uk.org.taverna.scufl2.api.profiles.Profile;
+
+/**
+ * An {@link uk.org.taverna.platform.execution.api.Execution Execution} for executing a Taverna workflow on a Taverna Server.
+ *
+ * @author David Withers
+ */
+public class RemoteExecution extends AbstractExecution {
+
+	public RemoteExecution(WorkflowBundle workflowBundle, Workflow workflow, Profile profile,
+			Bundle inputs) {
+		super(workflowBundle, workflow, profile, inputs);
+		// TODO Auto-generated constructor stub
+	}
+
+	@Override
+	protected WorkflowReport createWorkflowReport(Workflow workflow) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	protected ProcessorReport createProcessorReport(Processor processor) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	protected ActivityReport createActivityReport(Activity activity) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void start() {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void pause() {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void resume() {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void cancel() {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void delete() {
+		// TODO Auto-generated method stub
+
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecutionService.java
----------------------------------------------------------------------
diff --git a/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecutionService.java b/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecutionService.java
new file mode 100644
index 0000000..6ca8db7
--- /dev/null
+++ b/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecutionService.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (C) 2011 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.impl.remote;
+
+import java.util.Collections;
+import java.util.Set;
+
+import org.purl.wf4ever.robundle.Bundle;
+
+import uk.org.taverna.platform.execution.api.AbstractExecutionService;
+import uk.org.taverna.platform.execution.api.Execution;
+import uk.org.taverna.platform.execution.api.ExecutionEnvironment;
+import uk.org.taverna.platform.execution.api.InvalidWorkflowException;
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+import uk.org.taverna.scufl2.api.core.Workflow;
+import uk.org.taverna.scufl2.api.profiles.Profile;
+
+/**
+ * Service for executing Taverna workflows on a Taverna Server.
+ *
+ * @author David Withers
+ */
+public class RemoteExecutionService extends AbstractExecutionService {
+
+	public RemoteExecutionService() {
+		super(RemoteExecutionService.class.getName(), "Taverna Remote Execution Service",
+				"Execution Service for executing Taverna workflows on a Taverna Server");
+	}
+
+	@Override
+	protected Execution createExecutionImpl(WorkflowBundle workflowBundle, Workflow workflow,
+			Profile profile, Bundle inputs)
+			throws InvalidWorkflowException {
+		return new RemoteExecution(workflowBundle, workflow, profile, inputs);
+	}
+
+	@Override
+	public Set<ExecutionEnvironment> getExecutionEnvironments() {
+		return Collections.<ExecutionEnvironment>emptySet();
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-remote/src/main/resources/META-INF/spring/execution-remote-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-execution-remote/src/main/resources/META-INF/spring/execution-remote-context-osgi.xml b/taverna-execution-remote/src/main/resources/META-INF/spring/execution-remote-context-osgi.xml
new file mode 100644
index 0000000..2bce13d
--- /dev/null
+++ b/taverna-execution-remote/src/main/resources/META-INF/spring/execution-remote-context-osgi.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xmlns:beans="http://www.springframework.org/schema/beans"
+             xsi:schemaLocation="http://www.springframework.org/schema/beans 
+                                 http://www.springframework.org/schema/beans/spring-beans.xsd
+                                 http://www.springframework.org/schema/osgi 
+                                 http://www.springframework.org/schema/osgi/spring-osgi.xsd">
+
+    <service ref="remoteExecution" interface="uk.org.taverna.platform.execution.api.ExecutionService" />
+      
+</beans:beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-remote/src/main/resources/META-INF/spring/execution-remote-context.xml
----------------------------------------------------------------------
diff --git a/taverna-execution-remote/src/main/resources/META-INF/spring/execution-remote-context.xml b/taverna-execution-remote/src/main/resources/META-INF/spring/execution-remote-context.xml
new file mode 100644
index 0000000..70f9f9d
--- /dev/null
+++ b/taverna-execution-remote/src/main/resources/META-INF/spring/execution-remote-context.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans 
+                           http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+	<bean id="remoteExecution" class="uk.org.taverna.platform.execution.impl.remote.RemoteExecutionService" />
+
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/pom.xml b/taverna-integration-tests/pom.xml
new file mode 100644
index 0000000..c1cd2be
--- /dev/null
+++ b/taverna-integration-tests/pom.xml
@@ -0,0 +1,92 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.taverna.engine</groupId>
+		<artifactId>taverna-engine</artifactId>
+		<version>3.1.0-incubating-SNAPSHOT</version>
+	</parent>
+	<artifactId>taverna-integration-tests</artifactId>
+	<name>Apache Taverna Integration Tests</name>
+	<dependencies>
+		<dependency>
+			<groupId>org.apache.taverna.engine</groupId>
+			<artifactId>taverna-engine-product</artifactId>
+			<version>0.0.1-SNAPSHOT</version>
+			<scope>test</scope>
+			<exclusions>
+				<exclusion>
+					<groupId>org.apache.xalan</groupId>
+					<artifactId>com.springsource.org.apache.xalan</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>org.apache.xerces</groupId>
+					<artifactId>com.springsource.org.apache.xerces</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.language</groupId>
+			<artifactId>taverna-scufl2-api</artifactId>
+			<version>${taverna.language.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.language</groupId>
+			<artifactId>taverna-databundle</artifactId>
+			<version>${taverna.language.version}</version>
+			<exclusions>
+				<exclusion>
+					<groupId>log4j</groupId>
+					<artifactId>log4j</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-execution-api</artifactId>
+			<version>${project.parent.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-report-api</artifactId>
+			<version>${project.parent.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-run-api</artifactId>
+			<version>${project.parent.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>commons-io</groupId>
+			<artifactId>commons-io</artifactId>
+			<version>2.4</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse</groupId>
+			<artifactId>org.eclipse.osgi</artifactId>
+			<version>${osgi.equinox.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.osgi</groupId>
+			<artifactId>org.osgi.core</artifactId>
+			<version>${osgi.core.version}</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.osgi</groupId>
+			<artifactId>org.osgi.compendium</artifactId>
+			<version>${osgi.core.version}</version>
+			<scope>provided</scope>
+		</dependency>
+	</dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/java/uk/org/taverna/platform/ActivityIT.java
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/java/uk/org/taverna/platform/ActivityIT.java b/taverna-integration-tests/src/test/java/uk/org/taverna/platform/ActivityIT.java
new file mode 100644
index 0000000..5574ee0
--- /dev/null
+++ b/taverna-integration-tests/src/test/java/uk/org/taverna/platform/ActivityIT.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform;
+
+import java.io.File;
+import java.net.URI;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.osgi.framework.BundleContext;
+
+import uk.org.taverna.osgi.starter.TavernaStarter;
+import uk.org.taverna.platform.execution.api.ExecutionEnvironment;
+import uk.org.taverna.platform.run.api.RunService;
+
+public class ActivityIT extends PlatformIT {
+
+	private static TavernaStarter tavernaStarter;
+	private static BundleContext bundleContext;
+	private static RunService runService;
+
+	@BeforeClass
+	public static void setup() throws Exception {
+		tavernaStarter = new TavernaStarter(new File("/tmp"));
+		tavernaStarter.start();
+		runService = tavernaStarter.getRunService();
+	}
+
+	@AfterClass
+	public static void shutdown() throws Exception {
+		tavernaStarter.stop();
+	}
+
+	@Test
+	public void testGetActivityURIs() {
+		System.out.println("================= Available Activities ===================");
+		for (ExecutionEnvironment executionEnvironment : runService.getExecutionEnvironments()) {
+			for (URI uri : executionEnvironment.getActivityTypes()) {
+				System.out.println(uri);
+			}
+		}
+		System.out.println("==========================================================");
+		System.out.println("");
+	}
+
+	public void testCreateActivity() throws Exception {
+//		for (URI uri : activityService.getActivityTypes()) {
+//			System.out.println("Creating activity " + uri);
+//			Activity<?> activity = activityService.createActivity(uri, null);
+//		}
+	}
+
+	@Test
+	public void testGetActivityConfigurationDefinition() throws Exception {
+		System.out.println("============ Activity Configuration Definitions ==========");
+		for (ExecutionEnvironment executionEnvironment : runService.getExecutionEnvironments()) {
+			for (URI uri : executionEnvironment.getActivityTypes()) {
+				System.out.println(executionEnvironment.getActivityConfigurationSchema(uri));
+			}
+		}
+		System.out.println("==========================================================");
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java b/taverna-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java
new file mode 100644
index 0000000..24bcbdb
--- /dev/null
+++ b/taverna-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URL;
+import java.nio.file.Path;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.junit.Ignore;
+
+import uk.org.taverna.databundle.DataBundles;
+import uk.org.taverna.databundle.ErrorDocument;
+import uk.org.taverna.platform.report.State;
+import uk.org.taverna.platform.report.WorkflowReport;
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+import uk.org.taverna.scufl2.api.io.WorkflowBundleIO;
+
+@Ignore
+public class PlatformIT {
+
+	public WorkflowBundle loadWorkflow(String t2FlowFile, WorkflowBundleIO workflowBundleIO)
+			throws Exception {
+		URL wfResource = getClass().getResource(t2FlowFile);
+		assertNotNull(wfResource);
+		return workflowBundleIO.readBundle(wfResource.openStream(), null);
+	}
+
+	public File loadFile(String fileName) throws IOException, FileNotFoundException {
+		File file = File.createTempFile("platform-test", null);
+		file.deleteOnExit();
+		FileUtils.copyURLToFile(getClass().getResource(fileName), file);
+		return file;
+	}
+
+	public void printErrors(Path error) {
+		try {
+			ErrorDocument errorDocument = DataBundles.getError(error);
+			String message = errorDocument.getMessage();
+			if (message != null) {
+				System.out.println(message);
+			}
+			String trace = errorDocument.getTrace();
+			if (trace != null) {
+				System.out.println(trace);
+			}
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+
+	public boolean checkResult(Path result, String expectedResult) {
+		if (DataBundles.isError(result)) {
+			printErrors(result);
+			return false;
+		} else {
+			String resultValue;
+			if (DataBundles.isValue(result)) {
+				try {
+					resultValue = DataBundles.getStringValue(result);
+				} catch (IOException e) {
+					e.printStackTrace();
+					return false;
+				}
+			} else if (DataBundles.isReference(result)) {
+				try {
+					URI reference = DataBundles.getReference(result);
+					resultValue = IOUtils.toString(reference);
+				} catch (IOException e) {
+					e.printStackTrace();
+					return false;
+				}
+			} else {
+				System.out.println("Expected a value or reference");
+				return false;
+			}
+			if (resultValue.startsWith(expectedResult)) {
+				return true;
+			} else {
+				System.out.println("Expected: " + expectedResult + ", Actual: " + resultValue);
+				return false;
+			}
+		}
+	}
+
+	public boolean waitForState(WorkflowReport report, State state) throws InterruptedException {
+		return waitForState(report, state, true);
+	}
+
+	public boolean waitForState(WorkflowReport report, State state, boolean printReport)
+			throws InterruptedException {
+		int wait = 0;
+		while (!report.getState().equals(state) && wait++ < 30) {
+			if (printReport) {
+				System.out.println(report);
+			}
+			Thread.sleep(500);
+		}
+		if (printReport) {
+			System.out.println(report);
+		}
+		return report.getState().equals(state);
+	}
+
+	public void waitForResults(Path outputs, WorkflowReport report, String... ports)
+			throws InterruptedException {
+		int wait = 0;
+		while (!resultsReady(outputs, ports) && wait++ < 20) {
+			System.out.println(report);
+			Thread.sleep(500);
+		}
+	}
+
+	private boolean resultsReady(Path outputs, String... ports) {
+		for (String port : ports) {
+			try {
+				if (DataBundles.isMissing(DataBundles.getPort(outputs, port))) {
+					return false;
+				}
+			} catch (IOException e) {
+				return false;
+			}
+		}
+		return true;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/java/uk/org/taverna/platform/RunIT.java
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/java/uk/org/taverna/platform/RunIT.java b/taverna-integration-tests/src/test/java/uk/org/taverna/platform/RunIT.java
new file mode 100644
index 0000000..72cbe40
--- /dev/null
+++ b/taverna-integration-tests/src/test/java/uk/org/taverna/platform/RunIT.java
@@ -0,0 +1,954 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeTrue;
+
+import java.io.File;
+import java.net.URI;
+import java.net.URL;
+import java.nio.file.Path;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+import java.util.List;
+import java.util.Set;
+
+import net.sf.taverna.t2.security.credentialmanager.CredentialManager;
+import net.sf.taverna.t2.security.credentialmanager.MasterPasswordProvider;
+import net.sf.taverna.t2.security.credentialmanager.UsernamePassword;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.osgi.framework.BundleContext;
+import org.purl.wf4ever.robundle.Bundle;
+
+import uk.org.taverna.databundle.DataBundles;
+import uk.org.taverna.osgi.starter.TavernaStarter;
+import uk.org.taverna.platform.execution.api.ExecutionEnvironment;
+import uk.org.taverna.platform.report.State;
+import uk.org.taverna.platform.report.WorkflowReport;
+import uk.org.taverna.platform.run.api.RunProfile;
+import uk.org.taverna.platform.run.api.RunService;
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+import uk.org.taverna.scufl2.api.io.WorkflowBundleIO;
+
+public class RunIT extends PlatformIT {
+
+	private static TavernaStarter tavernaStarter;
+	private static BundleContext bundleContext;
+	private static WorkflowBundleIO workflowBundleIO;
+	private static CredentialManager credentialManager;
+	private static RunService runService;
+
+	public WorkflowBundle loadWorkflow(String t2FlowFile) throws Exception {
+		return super.loadWorkflow(t2FlowFile, workflowBundleIO);
+	}
+
+	@BeforeClass
+	public static void setup() throws Exception {
+		tavernaStarter = new TavernaStarter(new File("/tmp"));
+		tavernaStarter.start();
+		bundleContext = tavernaStarter.getContext();
+		runService = tavernaStarter.getRunService();
+		credentialManager = tavernaStarter.getCredentialManager();
+		workflowBundleIO = tavernaStarter.getWorkflowBundleIO();
+
+		bundleContext.registerService(
+				"net.sf.taverna.t2.security.credentialmanager.MasterPasswordProvider",
+				new MasterPasswordProvider() {
+					public String getMasterPassword(boolean firstTime) {
+						return "test";
+					}
+
+					public void setMasterPassword(String password) {
+					}
+
+					public int getProviderPriority() {
+						return 0;
+					}
+				}, null);
+
+	}
+
+	@AfterClass
+	public static void shutdown() throws Exception {
+		tavernaStarter.stop();
+	}
+
+	@Test
+	public void testRun() throws Exception {
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/in-out.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			Bundle inputBundle = DataBundles.createBundle();
+			Path inputs = DataBundles.getInputs(inputBundle);
+			Path port = DataBundles.getPort(inputs, "in");
+			DataBundles.setStringValue(port, "test-input");
+
+			String runId = runService.createRun(new RunProfile(executionEnvironment,
+					workflowBundle, inputBundle));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(waitForState(report, State.COMPLETED));
+
+			Bundle outputBundle = runService.getDataBundle(runId);
+			assertNotNull(outputBundle);
+			Path outputs = DataBundles.getOutputs(outputBundle);
+
+			assertTrue(checkResult(DataBundles.getPort(outputs, "out"), "test-input"));
+		}
+	}
+
+	@Test
+	public void testRunApiConsumer() throws Exception {
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/apiconsumer.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			Bundle inputBundle = DataBundles.createBundle();
+			Path inputs = DataBundles.getInputs(inputBundle);
+			Path port = DataBundles.getPort(inputs, "in");
+			DataBundles.setStringValue(port, "test-input");
+
+			String runId = runService.createRun(new RunProfile(executionEnvironment,
+					workflowBundle, inputBundle));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(waitForState(report, State.COMPLETED));
+
+			Bundle outputBundle = runService.getDataBundle(runId);
+			assertNotNull(outputBundle);
+			Path outputs = DataBundles.getOutputs(outputBundle);
+
+			assertTrue(checkResult(DataBundles.getPort(outputs, "out"), "TEST-INPUT"));
+		}
+	}
+
+	@Test
+	public void testRunBeanshell() throws Exception {
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/beanshell.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			Bundle inputBundle = DataBundles.createBundle();
+			Path inputs = DataBundles.getInputs(inputBundle);
+			Path port = DataBundles.getPort(inputs, "in");
+			DataBundles.setStringValue(port, "test-input");
+
+			String runId = runService.createRun(new RunProfile(executionEnvironment,
+					workflowBundle, inputBundle));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(waitForState(report, State.COMPLETED));
+
+			Bundle outputBundle = runService.getDataBundle(runId);
+			assertNotNull(outputBundle);
+			Path outputs = DataBundles.getOutputs(outputBundle);
+
+			Path outPort = DataBundles.getPort(outputs, "out");
+			assertTrue(DataBundles.isList(outPort));
+			List<Path> result = DataBundles.getList(outPort);
+			assertEquals(1000, result.size());
+			assertEquals("test-input:0", DataBundles.getStringValue(result.get(0)));
+		}
+	}
+
+	@Test
+	public void testRunBiomart() throws Exception {
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/biomart.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle, DataBundles.createBundle()));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(waitForState(report, State.COMPLETED));
+
+			Bundle outputBundle = runService.getDataBundle(runId);
+			assertNotNull(outputBundle);
+			Path outputs = DataBundles.getOutputs(outputBundle);
+
+			Path outPort = DataBundles.getPort(outputs, "out");
+			assertTrue(DataBundles.isList(outPort));
+			List<Path> result = DataBundles.getList(outPort);
+			assertEquals(6, result.size());
+			assertEquals("ENSBTAG00000018278", DataBundles.getStringValue(result.get(0)));
+		}
+	}
+
+	@Test
+	@Ignore
+	public void testRunBiomoby() throws Exception {
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/biomoby.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assumeTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle, DataBundles.createBundle()));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(waitForState(report, State.COMPLETED));
+
+			Bundle outputBundle = runService.getDataBundle(runId);
+			assertNotNull(outputBundle);
+			Path outputs = DataBundles.getOutputs(outputBundle);
+
+			Path outPort = DataBundles.getPort(outputs, "out");
+			assertTrue(DataBundles.isList(outPort));
+			List<Path> result = DataBundles.getList(outPort);
+			assertEquals(5, result.size());
+			assertEquals("ENSBTAG00000018854", DataBundles.getStringValue(result.get(0)));
+		}
+	}
+
+	@Test
+	public void testRunDataflow() throws Exception {
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/dataflow.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			Bundle inputBundle = DataBundles.createBundle();
+			Path inputs = DataBundles.getInputs(inputBundle);
+			Path port = DataBundles.getPort(inputs, "in");
+			DataBundles.setStringValue(port, "test-input");
+
+			String runId = runService.createRun(new RunProfile(executionEnvironment,
+					workflowBundle, inputBundle));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(waitForState(report, State.COMPLETED));
+
+			Bundle outputBundle = runService.getDataBundle(runId);
+			assertNotNull(outputBundle);
+			Path outputs = DataBundles.getOutputs(outputBundle);
+
+			assertTrue(checkResult(DataBundles.getPort(outputs, "out"), "nested dataflow : test-input"));
+		}
+	}
+
+	@Test
+	public void testRunLocalworker() throws Exception {
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/localworker.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			Bundle inputBundle = DataBundles.createBundle();
+			Path inputs = DataBundles.getInputs(inputBundle);
+			Path port = DataBundles.getPort(inputs, "in");
+			DataBundles.setStringValue(port, "Tom");
+
+			String runId = runService.createRun(new RunProfile(executionEnvironment,
+					workflowBundle, inputBundle));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(waitForState(report, State.COMPLETED));
+
+			Bundle outputBundle = runService.getDataBundle(runId);
+			assertNotNull(outputBundle);
+			Path outputs = DataBundles.getOutputs(outputBundle);
+
+			assertTrue(checkResult(DataBundles.getPort(outputs, "out"), "Hello Tom"));
+		}
+	}
+
+	@Test
+	public void testRunRest() throws Exception {
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/rest.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle, DataBundles.createBundle()));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(waitForState(report, State.COMPLETED));
+
+			Bundle outputBundle = runService.getDataBundle(runId);
+			assertNotNull(outputBundle);
+			Path outputs = DataBundles.getOutputs(outputBundle);
+
+			String outString = DataBundles.getStringValue(DataBundles.getPort(outputs, "out"));
+			assertTrue(outString.contains("<name>AATM_RABIT</name>"));
+		}
+	}
+
+	@Test
+	public void testRunRestSecureBasic() throws Exception {
+		credentialManager.addUsernameAndPasswordForService(new UsernamePassword("testuser",
+				"testpasswd"), URI
+				.create("http://heater.cs.man.ac.uk:7070/#Example+HTTP+BASIC+Authentication"));
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/secure-basic-authentication.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle, DataBundles.createBundle()));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(waitForState(report, State.COMPLETED));
+
+			Bundle outputBundle = runService.getDataBundle(runId);
+			assertNotNull(outputBundle);
+			Path outputs = DataBundles.getOutputs(outputBundle);
+
+			assertTrue(checkResult(
+					DataBundles.getPort(outputs, "out"),
+					"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n"
+							+ "<HTML><HEAD><TITLE>Apache Tomcat Examples</TITLE>\n"
+							+ "<META http-equiv=Content-Type content=\"text/html\">\n"
+							+ "</HEAD>\n"
+							+ "<BODY>\n"
+							+ "<P>\n"
+							+ "<H3>Secure Apache Tomcat Examples</H3>\n"
+							+ "<P>Congratulations! If you see this page that means that you have authenticated yourself successfully using HTTP Basic Authentication.</P>\n"
+							+ "</BODY></HTML>"));
+		}
+	}
+
+	@Test
+	public void testRunRestSecureBasicHttps() throws Exception {
+		credentialManager.addUsernameAndPasswordForService(new UsernamePassword("testuser",
+				"testpasswd"), URI
+				.create("https://heater.cs.man.ac.uk:7443/#Example+HTTP+BASIC+Authentication"));
+
+		URL trustedCertficateFileURL = getClass().getResource(
+				"/security/tomcat_heater_certificate.pem");
+		CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
+		X509Certificate trustedCertficate = (X509Certificate) certFactory
+				.generateCertificate(trustedCertficateFileURL.openStream());
+		credentialManager.addTrustedCertificate(trustedCertficate);
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/secure-basic-authentication-https.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle, DataBundles.createBundle()));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(waitForState(report, State.COMPLETED));
+
+			Bundle outputBundle = runService.getDataBundle(runId);
+			assertNotNull(outputBundle);
+			Path outputs = DataBundles.getOutputs(outputBundle);
+
+			assertTrue(checkResult(
+					DataBundles.getPort(outputs, "out"),
+					"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n"
+							+ "<HTML><HEAD><TITLE>Apache Tomcat Examples</TITLE>\n"
+							+ "<META http-equiv=Content-Type content=\"text/html\">\n"
+							+ "</HEAD>\n"
+							+ "<BODY>\n"
+							+ "<P>\n"
+							+ "<H3>Secure Apache Tomcat Examples</H3>\n"
+							+ "<P>Congratulations! If you see this page that means that you have authenticated yourself successfully using HTTP Basic Authentication.</P>\n"
+							+ "</BODY></HTML>"));
+		}
+	}
+
+	@Test
+	public void testRunRestSecureDigest() throws Exception {
+		credentialManager.addUsernameAndPasswordForService(new UsernamePassword("testuser",
+				"testpasswd"), URI
+				.create("http://heater.cs.man.ac.uk:7070/#Example+HTTP+BASIC+Authentication"));
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/secure-digest-authentication.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle, DataBundles.createBundle()));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(waitForState(report, State.COMPLETED));
+
+			Bundle outputBundle = runService.getDataBundle(runId);
+			assertNotNull(outputBundle);
+			Path outputs = DataBundles.getOutputs(outputBundle);
+
+			assertTrue(checkResult(
+					DataBundles.getPort(outputs, "out"),
+					"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n"
+							+ "<HTML><HEAD><TITLE>Apache Tomcat Examples</TITLE>\n"
+							+ "<META http-equiv=Content-Type content=\"text/html\">\n"
+							+ "</HEAD>\n"
+							+ "<BODY>\n"
+							+ "<P>\n"
+							+ "<H3>Secure Apache Tomcat Examples</H3>\n"
+							+ "<P>Congratulations! If you see this page that means that you have authenticated yourself successfully using HTTP Digest Authentication.</P>\n"
+							+ "</BODY></HTML>"));
+		}
+	}
+
+	@Test
+	public void testRunRestSecureDigestHttps() throws Exception {
+		credentialManager.addUsernameAndPasswordForService(new UsernamePassword("testuser",
+				"testpasswd"), URI
+				.create("http://heater.cs.man.ac.uk:7443/#Example+HTTP+BASIC+Authentication"));
+
+		URL trustedCertficateFileURL = getClass().getResource(
+				"/security/tomcat_heater_certificate.pem");
+		CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
+		X509Certificate trustedCertficate = (X509Certificate) certFactory
+				.generateCertificate(trustedCertficateFileURL.openStream());
+		credentialManager.addTrustedCertificate(trustedCertficate);
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/secure-digest-authentication-https.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle, DataBundles.createBundle()));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(waitForState(report, State.COMPLETED));
+
+			Bundle outputBundle = runService.getDataBundle(runId);
+			assertNotNull(outputBundle);
+			Path outputs = DataBundles.getOutputs(outputBundle);
+
+			assertTrue(checkResult(
+					DataBundles.getPort(outputs, "out"),
+					"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n"
+							+ "<HTML><HEAD><TITLE>Apache Tomcat Examples</TITLE>\n"
+							+ "<META http-equiv=Content-Type content=\"text/html\">\n"
+							+ "</HEAD>\n"
+							+ "<BODY>\n"
+							+ "<P>\n"
+							+ "<H3>Secure Apache Tomcat Examples</H3>\n"
+							+ "<P>Congratulations! If you see this page that means that you have authenticated yourself successfully using HTTP Digest Authentication.</P>\n"
+							+ "</BODY></HTML>"));
+		}
+	}
+
+	@Test
+	public void testRunSpreadsheetImport() throws Exception {
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/spreadsheetimport.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle, DataBundles.createBundle()));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(waitForState(report, State.COMPLETED));
+
+			Bundle outputBundle = runService.getDataBundle(runId);
+			assertNotNull(outputBundle);
+			Path outputs = DataBundles.getOutputs(outputBundle);
+
+			Path outPort = DataBundles.getPort(outputs, "out");
+			assertTrue(DataBundles.isList(outPort));
+			List<Path> result = DataBundles.getList(outPort);
+			assertEquals(35, result.size());
+			assertEquals("1971.0", DataBundles.getStringValue(result.get(1)));
+			assertEquals("2004.0", DataBundles.getStringValue(result.get(34)));
+		}
+	}
+
+	@Test
+	public void testRunSoaplab() throws Exception {
+		// TODO find new soaplab service for testing
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/soaplab.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle, DataBundles.createBundle()));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(waitForState(report, State.COMPLETED));
+
+			Bundle outputBundle = runService.getDataBundle(runId);
+			assertNotNull(outputBundle);
+			Path outputs = DataBundles.getOutputs(outputBundle);
+
+			assertTrue(checkResult(DataBundles.getPort(outputs, "sequence"),
+					"ID   X52524; SV 1; linear; genomic DNA; STD; INV; 4507 BP."));
+		}
+	}
+
+	@Test
+	public void testRunStringConstant() throws Exception {
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/stringconstant.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle, DataBundles.createBundle()));
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			runService.start(runId);
+			assertTrue(waitForState(report, State.COMPLETED));
+
+			Bundle outputBundle = runService.getDataBundle(runId);
+			assertNotNull(outputBundle);
+			Path outputs = DataBundles.getOutputs(outputBundle);
+
+			assertTrue(checkResult(DataBundles.getPort(outputs, "out"), "Test Value"));
+		}
+	}
+
+	@Test
+	public void testRunTool() throws Exception {
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/tool.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle, DataBundles.createBundle()));
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			runService.start(runId);
+			assertTrue(waitForState(report, State.COMPLETED));
+
+			Bundle outputBundle = runService.getDataBundle(runId);
+			assertNotNull(outputBundle);
+			Path outputs = DataBundles.getOutputs(outputBundle);
+
+			assertTrue(checkResult(DataBundles.getPort(outputs, "out"), "HelloWorld"));
+		}
+	}
+
+	@Test
+	public void testRunIteration() throws Exception {
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/iteration.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			Bundle inputBundle = DataBundles.createBundle();
+			Path inputs = DataBundles.getInputs(inputBundle);
+			Path port = DataBundles.getPort(inputs, "in");
+			DataBundles.setStringValue(port, "test");
+
+			String runId = runService.createRun(new RunProfile(executionEnvironment,
+					workflowBundle, inputBundle));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(waitForState(report, State.COMPLETED));
+
+			Bundle outputBundle = runService.getDataBundle(runId);
+			assertNotNull(outputBundle);
+			Path outputs = DataBundles.getOutputs(outputBundle);
+
+			Path crossPort = DataBundles.getPort(outputs, "cross");
+			assertTrue(DataBundles.isList(crossPort));
+			List<Path> crossResult = DataBundles.getList(crossPort);
+			assertEquals(10, crossResult.size());
+			assertEquals(10, DataBundles.getList(crossResult.get(0)).size());
+			assertEquals(10, DataBundles.getList(crossResult.get(5)).size());
+			assertEquals("test:0test:0", DataBundles.getStringValue(DataBundles.getListItem(DataBundles.getListItem(crossPort, 0), 0)));
+			assertEquals("test:0test:1", DataBundles.getStringValue(DataBundles.getListItem(DataBundles.getListItem(crossPort, 0), 1)));
+			assertEquals("test:4test:2", DataBundles.getStringValue(DataBundles.getListItem(DataBundles.getListItem(crossPort, 4), 2)));
+			assertEquals("test:7test:6", DataBundles.getStringValue(DataBundles.getListItem(DataBundles.getListItem(crossPort, 7), 6)));
+
+			Path dotPort = DataBundles.getPort(outputs, "dot");
+			assertTrue(DataBundles.isList(dotPort));
+			List<Path> dotResult = DataBundles.getList(dotPort);
+			assertEquals(10, dotResult.size());
+			assertEquals("test:0test:0", DataBundles.getStringValue(DataBundles.getListItem(dotPort, 0)));
+			assertEquals("test:5test:5", DataBundles.getStringValue(DataBundles.getListItem(dotPort, 5)));
+
+			Path crossdotPort = DataBundles.getPort(outputs, "crossdot");
+			assertTrue(DataBundles.isList(crossdotPort));
+			List<Path> crossdotResult = DataBundles.getList(crossdotPort);
+			assertEquals(10, crossdotResult.size());
+			assertEquals(10, DataBundles.getList(crossdotResult.get(0)).size());
+			assertEquals(10, DataBundles.getList(crossdotResult.get(5)).size());
+			assertEquals("test:0test:0test", DataBundles.getStringValue(DataBundles.getListItem(DataBundles.getListItem(crossdotPort, 0), 0)));
+			assertEquals("test:0test:1test", DataBundles.getStringValue(DataBundles.getListItem(DataBundles.getListItem(crossdotPort, 0), 1)));
+			assertEquals("test:4test:2test", DataBundles.getStringValue(DataBundles.getListItem(DataBundles.getListItem(crossdotPort, 4), 2)));
+			assertEquals("test:7test:6test", DataBundles.getStringValue(DataBundles.getListItem(DataBundles.getListItem(crossdotPort, 7), 6)));
+
+			Path dotcrossPort = DataBundles.getPort(outputs, "dotcross");
+			assertTrue(DataBundles.isList(dotcrossPort));
+			List<Path> dotcrossResult = DataBundles.getList(crossdotPort);
+			assertEquals(10, dotcrossResult.size());
+			assertEquals("test:0test:0test", DataBundles.getStringValue(DataBundles.getListItem(dotcrossPort, 0)));
+			assertEquals("test:5test:5test", DataBundles.getStringValue(DataBundles.getListItem(dotcrossPort, 5)));
+
+			Path dotdotPort = DataBundles.getPort(outputs, "dotdot");
+			assertTrue(DataBundles.isList(dotdotPort));
+			List<Path> dotdotResult = DataBundles.getList(crossdotPort);
+			assertEquals(10, dotdotResult.size());
+			assertEquals("test:0test:0test:0", DataBundles.getStringValue(DataBundles.getListItem(dotdotPort, 0)));
+			assertEquals("test:5test:5test:5", DataBundles.getStringValue(DataBundles.getListItem(dotdotPort, 5)));
+		}
+	}
+
+	@Test
+	public void testRunWSDL() throws Exception {
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/wsdl.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle, DataBundles.createBundle()));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(waitForState(report, State.COMPLETED));
+
+			Bundle outputBundle = runService.getDataBundle(runId);
+			assertNotNull(outputBundle);
+			Path outputs = DataBundles.getOutputs(outputBundle);
+
+			// assertTrue(checkResult(results.get("out"),
+			// "Apache Axis version: 1.4\nBuilt on Apr 22, 2006 (06:55:48 PDT)"));
+			assertTrue(checkResult(DataBundles.getPort(outputs, "out"),
+					"Apache Axis version: 1.2\nBuilt on May 03, 2005 (02:20:24 EDT)"));
+		}
+	}
+
+	@Test
+	public void testRunWSDLSecure() throws Exception {
+		credentialManager
+				.addUsernameAndPasswordForService(
+						new UsernamePassword("testuser", "testpasswd"),
+						URI.create("http://heater.cs.man.ac.uk:7070/axis/services/HelloService-PlaintextPassword?wsdl"));
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/wsdl-secure.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle, DataBundles.createBundle()));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(waitForState(report, State.COMPLETED));
+
+			Bundle outputBundle = runService.getDataBundle(runId);
+			assertNotNull(outputBundle);
+			Path outputs = DataBundles.getOutputs(outputBundle);
+
+			assertTrue(checkResult(DataBundles.getPort(outputs, "out"), "Hello Alan!"));
+		}
+	}
+
+	@Test
+	public void testRunWSDLSecureFull() throws Exception {
+		credentialManager
+				.addUsernameAndPasswordForService(
+						new UsernamePassword("testuser", "testpasswd"),
+						URI.create("http://heater.cs.man.ac.uk:7070/axis/services/HelloService-PlaintextPassword?wsdl"));
+		credentialManager
+				.addUsernameAndPasswordForService(
+						new UsernamePassword("testuser", "testpasswd"),
+						URI.create("http://heater.cs.man.ac.uk:7070/axis/services/HelloService-DigestPassword?wsdl"));
+		credentialManager
+				.addUsernameAndPasswordForService(
+						new UsernamePassword("testuser", "testpasswd"),
+						URI.create("http://heater.cs.man.ac.uk:7070/axis/services/HelloService-DigestPassword-Timestamp?wsdl"));
+		credentialManager
+				.addUsernameAndPasswordForService(
+						new UsernamePassword("testuser", "testpasswd"),
+						URI.create("http://heater.cs.man.ac.uk:7070/axis/services/HelloService-PlaintextPassword-Timestamp?wsdl"));
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/secure-ws.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle, DataBundles.createBundle()));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(waitForState(report, State.COMPLETED));
+
+			Bundle outputBundle = runService.getDataBundle(runId);
+			assertNotNull(outputBundle);
+			Path outputs = DataBundles.getOutputs(outputBundle);
+
+			assertTrue(checkResult(DataBundles.getPort(outputs, "out_plaintext"), "Hello Alan!"));
+			assertTrue(checkResult(DataBundles.getPort(outputs, "out_digest"), "Hello Stian!"));
+			assertTrue(checkResult(DataBundles.getPort(outputs, "out_digest_timestamp"), "Hello David!"));
+			assertTrue(checkResult(DataBundles.getPort(outputs, "out_plaintext_timestamp"), "Hello Alex!"));
+		}
+	}
+
+	@Test
+	public void testRunWSDLSecureSsh() throws Exception {
+		credentialManager
+				.addUsernameAndPasswordForService(
+						new UsernamePassword("testuser", "testpasswd"),
+						URI.create("https://heater.cs.man.ac.uk:7443/axis/services/HelloService-PlaintextPassword?wsdl"));
+		credentialManager
+				.addUsernameAndPasswordForService(
+						new UsernamePassword("testuser", "testpasswd"),
+						URI.create("https://heater.cs.man.ac.uk:7443/axis/services/HelloService-DigestPassword?wsdl"));
+		credentialManager
+				.addUsernameAndPasswordForService(
+						new UsernamePassword("testuser", "testpasswd"),
+						URI.create("https://heater.cs.man.ac.uk:7443/axis/services/HelloService-DigestPassword-Timestamp?wsdl"));
+		credentialManager
+				.addUsernameAndPasswordForService(
+						new UsernamePassword("testuser", "testpasswd"),
+						URI.create("https://heater.cs.man.ac.uk:7443/axis/services/HelloService-PlaintextPassword-Timestamp?wsdl"));
+
+		URL trustedCertficateFileURL = getClass().getResource(
+				"/security/tomcat_heater_certificate.pem");
+		CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
+		X509Certificate trustedCertficate = (X509Certificate) certFactory
+				.generateCertificate(trustedCertficateFileURL.openStream());
+		credentialManager.addTrustedCertificate(trustedCertficate);
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/secure-ws-https.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle, DataBundles.createBundle()));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(waitForState(report, State.COMPLETED));
+
+			Bundle outputBundle = runService.getDataBundle(runId);
+			assertNotNull(outputBundle);
+			Path outputs = DataBundles.getOutputs(outputBundle);
+
+			assertTrue(checkResult(DataBundles.getPort(outputs, "out_plaintext"), "Hello Alan!"));
+			assertTrue(checkResult(DataBundles.getPort(outputs, "out_digest"), "Hello Stian!"));
+			assertTrue(checkResult(DataBundles.getPort(outputs, "out_digest_timestamp"), "Hello David!"));
+			assertTrue(checkResult(DataBundles.getPort(outputs, "out_plaintext_timestamp"), "Hello Alex!"));
+		}
+	}
+
+	@Test
+	public void testRunXMLSplitter() throws Exception {
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/xmlSplitter.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			Bundle inputBundle = DataBundles.createBundle();
+			Path inputs = DataBundles.getInputs(inputBundle);
+			DataBundles.setStringValue(DataBundles.getPort(inputs, "firstName"), "John");
+			DataBundles.setStringValue(DataBundles.getPort(inputs, "lastName"), "Smith");
+			DataBundles.setStringValue(DataBundles.getPort(inputs, "age"), "21");
+
+			String runId = runService.createRun(new RunProfile(executionEnvironment,
+					workflowBundle, inputBundle));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(waitForState(report, State.COMPLETED));
+
+			Bundle outputBundle = runService.getDataBundle(runId);
+			assertNotNull(outputBundle);
+			Path outputs = DataBundles.getOutputs(outputBundle);
+
+			assertTrue(checkResult(DataBundles.getPort(outputs, "out"),
+					"John Smith (21) of 40, Oxford Road. Manchester."));
+		}
+	}
+
+	@Test
+	public void testRunXPath() throws Exception {
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/xpath.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle, DataBundles.createBundle()));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(waitForState(report, State.COMPLETED));
+
+			Bundle outputBundle = runService.getDataBundle(runId);
+			assertNotNull(outputBundle);
+			Path outputs = DataBundles.getOutputs(outputBundle);
+
+			assertTrue(checkResult(DataBundles.getPort(outputs, "out"), "<test-element>test</test-element>"));
+		}
+	}
+
+	@Test
+	public void testRunFromFile() throws Exception {
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/in-out.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			Bundle inputBundle = DataBundles.createBundle();
+			Path inputs = DataBundles.getInputs(inputBundle);
+			File file = loadFile("/t2flow/input.txt");
+			DataBundles.setReference(DataBundles.getPort(inputs, "in"), file.toURI());
+			assertTrue(DataBundles.isReference(DataBundles.getPort(inputs, "in")));
+			assertFalse(DataBundles.isValue(DataBundles.getPort(inputs, "in")));
+
+			String runId = runService.createRun(new RunProfile(executionEnvironment,
+					workflowBundle, inputBundle));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(waitForState(report, State.COMPLETED));
+
+			Bundle outputBundle = runService.getDataBundle(runId);
+			assertNotNull(outputBundle);
+			Path outputs = DataBundles.getOutputs(outputBundle);
+
+			assertTrue(checkResult(DataBundles.getPort(outputs, "out"), "test input value"));
+		}
+	}
+
+}


[25/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/dcterms_od.owl
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/dcterms_od.owl b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/dcterms_od.owl
new file mode 100644
index 0000000..8b9df5c
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/dcterms_od.owl
@@ -0,0 +1,584 @@
+<?xml version="1.0" encoding="utf-8"?>
+<rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcam="http://purl.org/dc/dcam/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xml:base="http://triplr.org/rdf/bloody-byte.net/rdf/dc_owl2dl/dcterms_od.ttl">
+<owl:Ontology rdf:about="http://purl.org/wf4ever/dcterms_od">
+    <owl:imports rdf:resource="http://purl.org/wf4ever/dcam"/>
+    <rdfs:label xml:lang="en">DCMI metadata terms</rdfs:label>
+    <rdfs:comment xml:lang="en">OWL 2 DL ontology for Dublin Core metadata terms from the http://purl.org/dc/terms/ namespace; this version uses object and datatype properties instead of annotation properties where possible. Note that, because of this, when using this ontology you are restricted to using literals and non-literals in certain cases and especially you cannot use DCMI's DCSV.</rdfs:comment>
+  </owl:Ontology>
+  <owl:AnnotationProperty rdf:about="http://purl.org/dc/terms/abstract">
+    <skos:definition xml:lang="en-US">A summary of the resource.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/description"/>
+    <rdfs:label xml:lang="en-US">Abstract</rdfs:label>
+  </owl:AnnotationProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/accessRights">
+    <skos:definition xml:lang="en-US">Information about who can access the resource or an indication of its security status.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/rights"/>
+    <rdfs:label xml:lang="en-US">Access Rights</rdfs:label>
+    <rdfs:range rdf:resource="http://purl.org/dc/terms/RightsStatement"/>
+    <rdfs:comment xml:lang="en-US">Access Rights may include information regarding access or restrictions based on privacy, security, or other policies.</rdfs:comment>
+  </owl:ObjectProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/accrualMethod">
+    <skos:definition xml:lang="en-US">The method by which items are added to a collection.</skos:definition>
+    <rdfs:domain rdf:resource="http://purl.org/dc/terms/Collection"/>
+    <rdfs:label xml:lang="en-US">Accrual Method</rdfs:label>
+    <rdfs:range rdf:resource="http://purl.org/dc/terms/MethodOfAccrual"/>
+  </owl:ObjectProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/accrualPeriodicity">
+    <skos:definition xml:lang="en-US">The frequency with which items are added to a collection.</skos:definition>
+    <rdfs:domain rdf:resource="http://purl.org/dc/terms/Collection"/>
+    <rdfs:label xml:lang="en-US">Accrual Periodicity</rdfs:label>
+    <rdfs:range rdf:resource="http://purl.org/dc/terms/Frequency"/>
+  </owl:ObjectProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/accrualPolicy">
+    <skos:definition xml:lang="en-US">The policy governing the addition of items to a collection.</skos:definition>
+    <rdfs:domain rdf:resource="http://purl.org/dc/terms/Collection"/>
+    <rdfs:label xml:lang="en-US">Accrual Policy</rdfs:label>
+    <rdfs:range rdf:resource="http://purl.org/dc/terms/Policy"/>
+  </owl:ObjectProperty>
+  <owl:AnnotationProperty rdf:about="http://purl.org/dc/terms/alternative">
+    <skos:definition xml:lang="en-US">An alternative name for the resource.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/title"/>
+    <rdfs:label xml:lang="en-US">Alternative Title</rdfs:label>
+    <skos:note xml:lang="en-US">In current practice, this term is used primarily with literal values; however, there are important uses with non-literal values as well. As of December 2007, the DCMI Usage Board is leaving this range unspecified pending an investigation of options.</skos:note>
+    <rdfs:comment xml:lang="en-US">The distinction between titles and alternative titles is application-specific.</rdfs:comment>
+  </owl:AnnotationProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/audience">
+    <skos:definition xml:lang="en-US">A class of entity for whom the resource is intended or useful.</skos:definition>
+    <rdfs:label xml:lang="en-US">Audience</rdfs:label>
+    <rdfs:range rdf:resource="http://purl.org/dc/terms/AgentClass"/>
+  </owl:ObjectProperty>
+  <owl:DatatypeProperty rdf:about="http://purl.org/dc/terms/available">
+    <skos:definition xml:lang="en-US">Date (often a range) that the resource became or will become available.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/date"/>
+    <rdfs:label xml:lang="en-US">Date Available</rdfs:label>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+  </owl:DatatypeProperty>
+  <owl:DatatypeProperty rdf:about="http://purl.org/dc/terms/bibliographicCitation">
+    <skos:definition xml:lang="en-US">A bibliographic reference for the resource.</skos:definition>
+    <rdfs:domain rdf:resource="http://purl.org/dc/terms/BibliographicResource"/>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/identifier"/>
+    <rdfs:label xml:lang="en-US">Bibliographic Citation</rdfs:label>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+    <rdfs:comment xml:lang="en-US">Recommended practice is to include sufficient bibliographic detail to identify the resource as unambiguously as possible.</rdfs:comment>
+  </owl:DatatypeProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/conformsTo">
+    <skos:definition xml:lang="en-US">An established standard to which the described resource conforms.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/relation"/>
+    <rdfs:label xml:lang="en-US">Conforms To</rdfs:label>
+    <rdfs:range rdf:resource="http://purl.org/dc/terms/Standard"/>
+  </owl:ObjectProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/contributor">
+    <skos:definition xml:lang="en-US">An entity responsible for making contributions to the resource.</skos:definition>
+    <rdfs:label xml:lang="en-US">Contributor</rdfs:label>
+    <rdfs:range rdf:resource="http://purl.org/dc/terms/Agent"/>
+    <rdfs:comment xml:lang="en-US">Examples of a Contributor include a person, an organization, or a service. Typically, the name of a Contributor should be used to indicate the entity.</rdfs:comment>
+  </owl:ObjectProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/coverage">
+    <skos:definition xml:lang="en-US">The spatial or temporal topic of the resource, the spatial applicability of the resource, or the jurisdiction under which the resource is relevant.</skos:definition>
+    <dcterms:bibliographicCitation>[TGN] http://www.getty.edu/research/tools/vocabulary/tgn/index.html</dcterms:bibliographicCitation>
+    <rdfs:seeAlso rdf:resource="http://www.getty.edu/research/tools/vocabulary/tgn/index.html"/>
+    <rdfs:label xml:lang="en-US">Coverage</rdfs:label>
+    <rdfs:range rdf:resource="http://purl.org/dc/terms/LocationPeriodOrJurisdiction"/>
+    <skos:note xml:lang="en">In this ontology this property has been defined as an object property, meaning when using this ontology you cannot encode its value as a literal (e.g. by using DCMI's DCSV) but only as a related description.</skos:note>
+    <rdfs:comment xml:lang="en-US">Spatial topic and spatial applicability may be a named place or a location specified by its geographic coordinates. Temporal topic may be a named period, date, or date range. A jurisdiction may be a named administrative entity or a geographic place to which the resource applies. Recommended best practice is to use a controlled vocabulary such as the Thesaurus of Geographic Names [TGN]. Where appropriate, named places or time periods can be used in preference to numeric identifiers such as sets of coordinates or date ranges.</rdfs:comment>
+  </owl:ObjectProperty>
+  <owl:DatatypeProperty rdf:about="http://purl.org/dc/terms/created">
+    <skos:definition xml:lang="en-US">Date of creation of the resource.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/date"/>
+    <rdfs:label xml:lang="en-US">Date Created</rdfs:label>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+  </owl:DatatypeProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/creator">
+    <skos:definition xml:lang="en-US">An entity primarily responsible for making the resource.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/contributor"/>
+    <rdfs:label xml:lang="en-US">Creator</rdfs:label>
+    <rdfs:range rdf:resource="http://purl.org/dc/terms/Agent"/>
+    <rdfs:comment xml:lang="en-US">Examples of a Creator include a person, an organization, or a service. Typically, the name of a Creator should be used to indicate the entity.</rdfs:comment>
+  </owl:ObjectProperty>
+  <owl:DatatypeProperty rdf:about="http://purl.org/dc/terms/date">
+    <skos:definition xml:lang="en-US">A point or period of time associated with an event in the lifecycle of the resource.</skos:definition>
+    <dcterms:bibliographicCitation>[W3CDTF] http://www.w3.org/TR/NOTE-datetime</dcterms:bibliographicCitation>
+    <rdfs:seeAlso rdf:resource="http://www.w3.org/TR/NOTE-datetime"/>
+    <rdfs:label xml:lang="en-US">Date</rdfs:label>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+    <rdfs:comment xml:lang="en-US">Date may be used to express temporal information at any level of granularity. Recommended best practice is to use an encoding scheme, such as the W3CDTF profile of ISO 8601 [W3CDTF].</rdfs:comment>
+  </owl:DatatypeProperty>
+  <owl:DatatypeProperty rdf:about="http://purl.org/dc/terms/dateAccepted">
+    <skos:definition xml:lang="en-US">Date of acceptance of the resource.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/date"/>
+    <rdfs:label xml:lang="en-US">Date Accepted</rdfs:label>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+    <rdfs:comment xml:lang="en-US">Examples of resources to which a Date Accepted may be relevant are a thesis (accepted by a university department) or an article (accepted by a journal).</rdfs:comment>
+  </owl:DatatypeProperty>
+  <owl:DatatypeProperty rdf:about="http://purl.org/dc/terms/dateCopyrighted">
+    <skos:definition xml:lang="en-US">Date of copyright.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/date"/>
+    <rdfs:label xml:lang="en-US">Date Copyrighted</rdfs:label>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+  </owl:DatatypeProperty>
+  <owl:DatatypeProperty rdf:about="http://purl.org/dc/terms/dateSubmitted">
+    <skos:definition xml:lang="en-US">Date of submission of the resource.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/date"/>
+    <rdfs:label xml:lang="en-US">Date Submitted</rdfs:label>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+    <rdfs:comment xml:lang="en-US">Examples of resources to which a Date Submitted may be relevant are a thesis (submitted to a university department) or an article (submitted to a journal).</rdfs:comment>
+  </owl:DatatypeProperty>
+  <owl:AnnotationProperty rdf:about="http://purl.org/dc/terms/description">
+    <skos:definition xml:lang="en-US">An account of the resource.</skos:definition>
+    <rdfs:label xml:lang="en-US">Description</rdfs:label>
+    <rdfs:comment xml:lang="en-US">Description may include but is not limited to: an abstract, a table of contents, a graphical representation, or a free-text account of the resource.</rdfs:comment>
+  </owl:AnnotationProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/educationLevel">
+    <skos:definition xml:lang="en-US">A class of entity, defined in terms of progression through an educational or training context, for which the described resource is intended.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/audience"/>
+    <rdfs:label xml:lang="en-US">Audience Education Level</rdfs:label>
+    <rdfs:range rdf:resource="http://purl.org/dc/terms/AgentClass"/>
+  </owl:ObjectProperty>
+  <owl:AnnotationProperty rdf:about="http://purl.org/dc/terms/extent">
+    <skos:definition xml:lang="en-US">The size or duration of the resource.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/format"/>
+    <rdfs:label xml:lang="en-US">Extent</rdfs:label>
+    <rdfs:range rdf:resource="http://purl.org/dc/terms/SizeOrDuration"/>
+    <skos:note xml:lang="en">In this ontology this property has been defined as an object property, meaning when using this ontology you cannot encode its value as a literal (e.g. by using DCMI's DCSV) but only as a related description.</skos:note>
+  </owl:AnnotationProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/format">
+    <skos:definition xml:lang="en-US">The file format, physical medium, or dimensions of the resource.</skos:definition>
+    <dcterms:bibliographicCitation>[MIME] http://www.iana.org/assignments/media-types/</dcterms:bibliographicCitation>
+    <rdfs:seeAlso rdf:resource="http://www.iana.org/assignments/media-types/"/>
+    <rdfs:label xml:lang="en-US">Format</rdfs:label>
+    <rdfs:range rdf:resource="http://purl.org/dc/terms/MediaTypeOrExtent"/>
+    <skos:note xml:lang="en">In this ontology this property has been defined as an object property, meaning when using this ontology you cannot encode its value as a literal (e.g. by using DCMI's DCSV) but only as a related description.</skos:note>
+    <rdfs:comment xml:lang="en-US">Examples of dimensions include size and duration. Recommended best practice is to use a controlled vocabulary such as the list of Internet Media Types [MIME].</rdfs:comment>
+  </owl:ObjectProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/hasFormat">
+    <skos:definition xml:lang="en-US">A related resource that is substantially the same as the pre-existing described resource, but in another format.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/relation"/>
+    <rdfs:label xml:lang="en-US">Has Format</rdfs:label>
+  </owl:ObjectProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/hasPart">
+    <skos:definition xml:lang="en-US">A related resource that is included either physically or logically in the described resource.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/relation"/>
+    <rdfs:label xml:lang="en-US">Has Part</rdfs:label>
+  </owl:ObjectProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/hasVersion">
+    <skos:definition xml:lang="en-US">A related resource that is a version, edition, or adaptation of the described resource.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/relation"/>
+    <rdfs:label xml:lang="en-US">Has Version</rdfs:label>
+  </owl:ObjectProperty>
+  <owl:DatatypeProperty rdf:about="http://purl.org/dc/terms/identifier">
+    <skos:definition xml:lang="en-US">An unambiguous reference to the resource within a given context.</skos:definition>
+    <rdfs:label xml:lang="en-US">Identifier</rdfs:label>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+    <rdfs:comment xml:lang="en-US">Recommended best practice is to identify the resource by means of a string conforming to a formal identification system.</rdfs:comment>
+  </owl:DatatypeProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/instructionalMethod">
+    <skos:definition xml:lang="en-US">A process, used to engender knowledge, attitudes and skills, that the described resource is designed to support.</skos:definition>
+    <rdfs:label xml:lang="en-US">Instructional Method</rdfs:label>
+    <rdfs:range rdf:resource="http://purl.org/dc/terms/MethodOfInstruction"/>
+    <rdfs:comment xml:lang="en-US">Instructional Method will typically include ways of presenting instructional materials or conducting instructional activities, patterns of learner-to-learner and learner-to-instructor interactions, and mechanisms by which group and individual levels of learning are measured. Instructional methods include all aspects of the instruction and learning processes from planning and implementation through evaluation and feedback.</rdfs:comment>
+  </owl:ObjectProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/isFormatOf">
+    <skos:definition xml:lang="en-US">A related resource that is substantially the same as the described resource, but in another format.</skos:definition>
+    <owl:inverseOf rdf:resource="http://purl.org/dc/terms/hasFormat"/>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/relation"/>
+    <rdfs:label xml:lang="en-US">Is Format Of</rdfs:label>
+  </owl:ObjectProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/isPartOf">
+    <skos:definition xml:lang="en-US">A related resource in which the described resource is physically or logically included.</skos:definition>
+    <owl:inverseOf rdf:resource="http://purl.org/dc/terms/hasPart"/>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/relation"/>
+    <rdfs:label xml:lang="en-US">Is Part Of</rdfs:label>
+  </owl:ObjectProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/isReferencedBy">
+    <skos:definition xml:lang="en-US">A related resource that references, cites, or otherwise points to the described resource.</skos:definition>
+    <owl:inverseOf rdf:resource="http://purl.org/dc/terms/creator"/>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/relation"/>
+    <rdfs:label xml:lang="en-US">Is Referenced By</rdfs:label>
+  </owl:ObjectProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/isReplacedBy">
+    <skos:definition xml:lang="en-US">A related resource that supplants, displaces, or supersedes the described resource.</skos:definition>
+    <owl:inverseOf rdf:resource="http://purl.org/dc/terms/replaces"/>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/relation"/>
+    <rdfs:label xml:lang="en-US">Is Replaced By</rdfs:label>
+  </owl:ObjectProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/creator"/>
+  <rdf:Description rdf:about="http://purl.org/dc/terms/creator">
+    <rdfs:label xml:lang="en-US">Is Required By</rdfs:label>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://purl.org/dc/terms/creator">
+    <skos:definition xml:lang="en-US">A related resource that requires the described resource to support its function, delivery, or coherence.</skos:definition>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://purl.org/dc/terms/creator">
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/relation"/>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://purl.org/dc/terms/creator">
+    <owl:inverseOf rdf:resource="http://purl.org/dc/terms/requires"/>
+  </rdf:Description>
+  <owl:DatatypeProperty rdf:about="http://purl.org/dc/terms/issued">
+    <skos:definition xml:lang="en-US">Date of formal issuance (e.g., publication) of the resource.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/date"/>
+    <rdfs:label xml:lang="en-US">Date Issued</rdfs:label>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+  </owl:DatatypeProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/isVersionOf">
+    <skos:definition xml:lang="en-US">A related resource of which the described resource is a version, edition, or adaptation.</skos:definition>
+    <owl:inverseOf rdf:resource="http://purl.org/dc/terms/hasVersion"/>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/relation"/>
+    <rdfs:label xml:lang="en-US">Is Version Of</rdfs:label>
+    <rdfs:comment xml:lang="en-US">Changes in version imply substantive changes in content rather than differences in format.</rdfs:comment>
+  </owl:ObjectProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/language">
+    <skos:definition xml:lang="en-US">A language of the resource.</skos:definition>
+    <dcterms:bibliographicCitation>[RFC4646] http://www.ietf.org/rfc/rfc4646.txt</dcterms:bibliographicCitation>
+    <rdfs:seeAlso rdf:resource="http://www.ietf.org/rfc/rfc4646.txt"/>
+    <rdfs:label xml:lang="en-US">Language</rdfs:label>
+    <rdfs:range rdf:resource="http://purl.org/dc/terms/LinguisticSystem"/>
+    <skos:note xml:lang="en">In this ontology this property has been defined as an object property, meaning when using this ontology you cannot encode its value as a literal (e.g. as a language code or tag) but only as a non-literal value.</skos:note>
+    <rdfs:comment xml:lang="en-US">Recommended best practice is to use a controlled vocabulary such as RFC 4646 [RFC4646].</rdfs:comment>
+  </owl:ObjectProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/license">
+    <skos:definition xml:lang="en-US">A legal document giving official permission to do something with the resource.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/rights"/>
+    <rdfs:label xml:lang="en-US">License</rdfs:label>
+    <rdfs:range rdf:resource="http://purl.org/dc/terms/LicenseDocument"/>
+  </owl:ObjectProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/mediator">
+    <skos:definition xml:lang="en-US">An entity that mediates access to the resource and for whom the resource is intended or useful.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/audience"/>
+    <rdfs:label xml:lang="en-US">Mediator</rdfs:label>
+    <rdfs:range rdf:resource="http://purl.org/dc/terms/AgentClass"/>
+    <rdfs:comment xml:lang="en-US">In an educational context, a mediator might be a parent, teacher, teaching assistant, or care-giver.</rdfs:comment>
+  </owl:ObjectProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/medium">
+    <skos:definition xml:lang="en-US">The material or physical carrier of the resource.</skos:definition>
+    <rdfs:domain rdf:resource="http://purl.org/dc/terms/PhysicalResource"/>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/format"/>
+    <rdfs:label xml:lang="en-US">Medium</rdfs:label>
+    <rdfs:range rdf:resource="http://purl.org/dc/terms/PhysicalMedium"/>
+    <skos:note xml:lang="en">In this ontology this property has been defined as an object property, meaning when using this ontology you cannot encode its value as a literal but only as a related description.</skos:note>
+  </owl:ObjectProperty>
+  <owl:DatatypeProperty rdf:about="http://purl.org/dc/terms/modified">
+    <skos:definition xml:lang="en-US">Date on which the resource was changed.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/date"/>
+    <rdfs:label xml:lang="en-US">Date Modified</rdfs:label>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+  </owl:DatatypeProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/provenance">
+    <skos:definition xml:lang="en-US">A statement of any changes in ownership and custody of the resource since its creation that are significant for its authenticity, integrity, and interpretation.</skos:definition>
+    <rdfs:label xml:lang="en-US">Provenance</rdfs:label>
+    <rdfs:range rdf:resource="http://purl.org/dc/terms/ProvenanceStatement"/>
+    <rdfs:comment xml:lang="en-US">The statement may include a description of any changes successive custodians made to the resource.</rdfs:comment>
+  </owl:ObjectProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/publisher">
+    <skos:definition xml:lang="en-US">An entity responsible for making the resource available.</skos:definition>
+    <rdfs:label xml:lang="en-US">Publisher</rdfs:label>
+    <rdfs:range rdf:resource="http://purl.org/dc/terms/Agent"/>
+    <rdfs:comment xml:lang="en-US">Examples of a Publisher include a person, an organization, or a service. Typically, the name of a Publisher should be used to indicate the entity.</rdfs:comment>
+  </owl:ObjectProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/creator"/>
+  <rdf:Description rdf:about="http://purl.org/dc/terms/creator">
+    <rdfs:label xml:lang="en-US">References</rdfs:label>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://purl.org/dc/terms/creator">
+    <skos:definition xml:lang="en-US">A related resource that is referenced, cited, or otherwise pointed to by the described resource.</skos:definition>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://purl.org/dc/terms/creator">
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/relation"/>
+  </rdf:Description>
+  <owl:SymmetricProperty rdf:about="http://purl.org/dc/terms/relation">
+    <skos:definition xml:lang="en-US">A related resource.</skos:definition>
+    <rdfs:label xml:lang="en-US">Relation</rdfs:label>
+    <rdfs:comment xml:lang="en-US">Recommended best practice is to identify the related resource by means of a string conforming to a formal identification system.</rdfs:comment>
+  </owl:SymmetricProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/replaces">
+    <skos:definition xml:lang="en-US">A related resource that is supplanted, displaced, or superseded by the described resource.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/relation"/>
+    <rdfs:label xml:lang="en-US">Replaces</rdfs:label>
+  </owl:ObjectProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/requires">
+    <skos:definition xml:lang="en-US">A related resource that is required by the described resource to support its function, delivery, or coherence.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/relation"/>
+    <rdfs:label xml:lang="en-US">Requires</rdfs:label>
+  </owl:ObjectProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/rights">
+    <skos:definition xml:lang="en-US">Information about rights held in and over the resource.</skos:definition>
+    <rdfs:label xml:lang="en-US">Rights</rdfs:label>
+    <rdfs:range rdf:resource="http://purl.org/dc/terms/RightsStatement"/>
+    <rdfs:comment xml:lang="en-US">Typically, rights information includes a statement about various property rights associated with the resource, including intellectual property rights.</rdfs:comment>
+  </owl:ObjectProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/rightsHolder">
+    <skos:definition xml:lang="en-US">A person or organization owning or managing rights over the resource.</skos:definition>
+    <rdfs:label xml:lang="en-US">Rights Holder</rdfs:label>
+    <rdfs:range rdf:resource="http://purl.org/dc/terms/Agent"/>
+  </owl:ObjectProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/source">
+    <skos:definition xml:lang="en-US">A related resource from which the described resource is derived.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/relation"/>
+    <rdfs:label xml:lang="en-US">Source</rdfs:label>
+    <rdfs:comment xml:lang="en-US">The described resource may be derived from the related resource in whole or in part. Recommended best practice is to identify the related resource by means of a string conforming to a formal identification system.</rdfs:comment>
+  </owl:ObjectProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/spatial">
+    <skos:definition xml:lang="en-US">Spatial characteristics of the resource.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/coverage"/>
+    <rdfs:label xml:lang="en-US">Spatial Coverage</rdfs:label>
+    <rdfs:range rdf:resource="http://purl.org/dc/terms/Location"/>
+    <skos:note xml:lang="en">In this ontology this property has been defined as an object property, meaning when using this ontology you cannot encode its value as a literal (e.g. by using DCMI's DCSV) but only as a related description.</skos:note>
+  </owl:ObjectProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/subject">
+    <skos:definition xml:lang="en-US">The topic of the resource.</skos:definition>
+    <rdfs:label xml:lang="en-US">Subject</rdfs:label>
+    <rdfs:comment xml:lang="en-US">Typically, the subject will be represented using keywords, key phrases, or classification codes. Recommended best practice is to use a controlled vocabulary. To describe the spatial or temporal topic of the resource, use the Coverage element.</rdfs:comment>
+  </owl:ObjectProperty>
+  <owl:AnnotationProperty rdf:about="http://purl.org/dc/terms/tableOfContents">
+    <skos:definition xml:lang="en-US">A list of subunits of the resource.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/description"/>
+    <rdfs:label xml:lang="en-US">Table Of Contents</rdfs:label>
+  </owl:AnnotationProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/temporal">
+    <skos:definition xml:lang="en-US">Temporal characteristics of the resource.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/coverage"/>
+    <rdfs:label xml:lang="en-US">Temporal Coverage</rdfs:label>
+    <rdfs:range rdf:resource="http://purl.org/dc/terms/PeriodOfTime"/>
+    <skos:note xml:lang="en">In this ontology this property has been defined as an object property, meaning when using this ontology you cannot encode its value as a literal (e.g. by using DCMI's DCSV) but only as a related description.</skos:note>
+  </owl:ObjectProperty>
+  <owl:AnnotationProperty rdf:about="http://purl.org/dc/terms/title">
+    <skos:definition xml:lang="en-US">A name given to the resource.</skos:definition>
+    <rdfs:label xml:lang="en-US">Title</rdfs:label>
+    <skos:note xml:lang="en-US">In current practice, this term is used primarily with literal values; however, there are important uses with non-literal values as well. As of December 2007, the DCMI Usage Board is leaving this range unspecified pending an investigation of options.</skos:note>
+  </owl:AnnotationProperty>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/terms/type">
+    <skos:definition xml:lang="en-US">The nature or genre of the resource.</skos:definition>
+    <dcterms:bibliographicCitation>[DCMITYPE] http://dublincore.org/documents/dcmi-type-vocabulary/</dcterms:bibliographicCitation>
+    <rdfs:seeAlso rdf:resource="http://dublincore.org/documents/dcmi-type-vocabulary/"/>
+    <rdfs:label xml:lang="en-US">Type</rdfs:label>
+    <rdfs:range rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
+    <rdfs:comment xml:lang="en-US">Recommended best practice is to use a controlled vocabulary such as the DCMI Type Vocabulary [DCMITYPE]. To describe the file format, physical medium, or dimensions of the resource, use the Format element.</rdfs:comment>
+  </owl:ObjectProperty>
+  <owl:DatatypeProperty rdf:about="http://purl.org/dc/terms/valid">
+    <skos:definition xml:lang="en-US">Date (often a range) of validity of a resource.</skos:definition>
+    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/date"/>
+    <rdfs:label xml:lang="en-US">Date Valid</rdfs:label>
+    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+  </owl:DatatypeProperty>
+  <dcam:VocabularyEncodingScheme rdf:about="http://purl.org/dc/terms/DCMIType">
+    <rdfs:isDefinedBy rdf:resource="http://dublincore.org/documents/dcmi-type-vocabulary/"/>
+    <skos:definition xml:lang="en-US">The set of classes specified by the DCMI Type Vocabulary, used to categorize the nature or genre of the resource.</skos:definition>
+    <rdfs:label xml:lang="en-US">DCMI Type Vocabulary</rdfs:label>
+  </dcam:VocabularyEncodingScheme>
+  <dcam:VocabularyEncodingScheme rdf:about="http://purl.org/dc/terms/DDC">
+    <rdfs:isDefinedBy rdf:resource="http://www.oclc.org/dewey/"/>
+    <skos:definition xml:lang="en-US">The set of conceptual resources specified by the Dewey Decimal Classification.</skos:definition>
+    <rdfs:label xml:lang="en-US">DDC</rdfs:label>
+  </dcam:VocabularyEncodingScheme>
+  <dcam:VocabularyEncodingScheme rdf:about="http://purl.org/dc/terms/IMT">
+    <rdfs:isDefinedBy rdf:resource="http://www.iana.org/assignments/media-types/"/>
+    <skos:definition xml:lang="en-US">The set of media types specified by the Internet Assigned Numbers Authority.</skos:definition>
+    <rdfs:label xml:lang="en-US">IMT</rdfs:label>
+  </dcam:VocabularyEncodingScheme>
+  <dcam:VocabularyEncodingScheme rdf:about="http://purl.org/dc/terms/LCC">
+    <rdfs:isDefinedBy rdf:resource="http://lcweb.loc.gov/catdir/cpso/lcco/lcco.html"/>
+    <skos:definition xml:lang="en-US">The set of conceptual resources specified by the Library of Congress Classification.</skos:definition>
+    <rdfs:label xml:lang="en-US">LCC</rdfs:label>
+  </dcam:VocabularyEncodingScheme>
+  <dcam:VocabularyEncodingScheme rdf:about="http://purl.org/dc/terms/LCSH">
+    <skos:definition xml:lang="en-US">The set of labeled concepts specified by the Library of Congress Subject Headings.</skos:definition>
+    <rdfs:label xml:lang="en-US">LCSH</rdfs:label>
+  </dcam:VocabularyEncodingScheme>
+  <dcam:VocabularyEncodingScheme rdf:about="http://purl.org/dc/terms/MESH">
+    <rdfs:isDefinedBy rdf:resource="http://www.nlm.nih.gov/mesh/meshhome.html"/>
+    <skos:definition xml:lang="en-US">The set of labeled concepts specified by the Medical Subject Headings.</skos:definition>
+    <rdfs:label xml:lang="en-US">MeSH</rdfs:label>
+  </dcam:VocabularyEncodingScheme>
+  <dcam:VocabularyEncodingScheme rdf:about="http://purl.org/dc/terms/creator"/>
+  <rdf:Description rdf:about="http://purl.org/dc/terms/creator">
+    <rdfs:label xml:lang="en-US">NLM</rdfs:label>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://purl.org/dc/terms/creator">
+    <skos:definition xml:lang="en-US">The set of conceptual resources specified by the National Library of Medicine Classification.</skos:definition>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://purl.org/dc/terms/creator">
+    <rdfs:isDefinedBy rdf:resource="http://wwwcf.nlm.nih.gov/class/"/>
+  </rdf:Description>
+  <dcam:VocabularyEncodingScheme rdf:about="http://purl.org/dc/terms/TGN">
+    <rdfs:isDefinedBy rdf:resource="http://www.getty.edu/research/tools/vocabulary/tgn/index.html"/>
+    <skos:definition xml:lang="en-US">The set of places specified by the Getty Thesaurus of Geographic Names.</skos:definition>
+    <rdfs:label xml:lang="en-US">TGN</rdfs:label>
+  </dcam:VocabularyEncodingScheme>
+  <dcam:VocabularyEncodingScheme rdf:about="http://purl.org/dc/terms/UDC">
+    <rdfs:isDefinedBy rdf:resource="http://www.udcc.org/"/>
+    <skos:definition xml:lang="en-US">The set of conceptual resources specified by the Universal Decimal Classification.</skos:definition>
+    <rdfs:label xml:lang="en-US">UDC</rdfs:label>
+  </dcam:VocabularyEncodingScheme>
+  <rdfs:Datatype rdf:about="http://purl.org/dc/terms/Box">
+    <rdfs:isDefinedBy rdf:resource="http://purl.org/dc/terms/creator"/>
+    <skos:definition xml:lang="en-US">The set of regions in space defined by their geographic coordinates according to the DCMI Box Encoding Scheme.</skos:definition>
+    <rdfs:label xml:lang="en-US">DCMI Box</rdfs:label>
+  </rdfs:Datatype>
+  <rdfs:Datatype rdf:about="http://purl.org/dc/terms/ISO3166">
+    <rdfs:isDefinedBy rdf:resource="http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html"/>
+    <skos:definition xml:lang="en-US">The set of codes listed in ISO 3166-1 for the representation of names of countries.</skos:definition>
+    <rdfs:label xml:lang="en-US">ISO 3166</rdfs:label>
+  </rdfs:Datatype>
+  <rdfs:Datatype rdf:about="http://purl.org/dc/terms/ISO639-2">
+    <rdfs:isDefinedBy rdf:resource="http://lcweb.loc.gov/standards/iso639-2/langhome.html"/>
+    <skos:definition xml:lang="en-US">The three-letter alphabetic codes listed in ISO639-2 for the representation of names of languages.</skos:definition>
+    <rdfs:label xml:lang="en-US">ISO 639-2</rdfs:label>
+  </rdfs:Datatype>
+  <rdfs:Datatype rdf:about="http://purl.org/dc/terms/ISO639-3">
+    <rdfs:isDefinedBy rdf:resource="http://www.sil.org/iso639-3/"/>
+    <skos:definition xml:lang="en-US">The set of three-letter codes listed in ISO 639-3 for the representation of names of languages.</skos:definition>
+    <rdfs:label xml:lang="en-US">ISO 639-3</rdfs:label>
+  </rdfs:Datatype>
+  <rdfs:Datatype rdf:about="http://purl.org/dc/terms/Period">
+    <rdfs:isDefinedBy rdf:resource="http://dublincore.org/documents/dcmi-period/"/>
+    <skos:definition xml:lang="en-US">The set of time intervals defined by their limits according to the DCMI Period Encoding Scheme.</skos:definition>
+    <rdfs:label xml:lang="en-US">DCMI Period</rdfs:label>
+  </rdfs:Datatype>
+  <rdfs:Datatype rdf:about="http://purl.org/dc/terms/Point">
+    <rdfs:isDefinedBy rdf:resource="http://dublincore.org/documents/dcmi-point/"/>
+    <skos:definition xml:lang="en-US">The set of points in space defined by their geographic coordinates according to the DCMI Point Encoding Scheme.</skos:definition>
+    <rdfs:label xml:lang="en-US">DCMI Point</rdfs:label>
+  </rdfs:Datatype>
+  <rdfs:Datatype rdf:about="http://purl.org/dc/terms/creator"/>
+  <rdf:Description rdf:about="http://purl.org/dc/terms/creator">
+    <rdfs:label xml:lang="en-US">RFC 1766</rdfs:label>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://purl.org/dc/terms/creator">
+    <skos:definition xml:lang="en-US">The set of tags, constructed according to RFC 1766, for the identification of languages.</skos:definition>
+  </rdf:Description>
+  <rdf:Description rdf:about="http://purl.org/dc/terms/creator">
+    <rdfs:isDefinedBy rdf:resource="http://www.ietf.org/rfc/rfc1766.txt"/>
+  </rdf:Description>
+  <rdfs:Datatype rdf:about="http://purl.org/dc/terms/RFC3066">
+    <rdfs:isDefinedBy rdf:resource="http://www.ietf.org/rfc/rfc3066.txt"/>
+    <skos:definition xml:lang="en-US">The set of tags constructed according to RFC 3066 for the identification of languages.</skos:definition>
+    <rdfs:label xml:lang="en-US">RFC 3066</rdfs:label>
+    <rdfs:comment xml:lang="en-US">RFC 3066 has been obsoleted by RFC 4646.</rdfs:comment>
+  </rdfs:Datatype>
+  <rdfs:Datatype rdf:about="http://purl.org/dc/terms/RFC4646">
+    <rdfs:isDefinedBy rdf:resource="http://www.ietf.org/rfc/rfc4646.txt"/>
+    <skos:definition xml:lang="en-US">The set of tags constructed according to RFC 4646 for the identification of languages.</skos:definition>
+    <rdfs:label xml:lang="en-US">RFC 4646</rdfs:label>
+    <rdfs:comment xml:lang="en-US">RFC 4646 obsoletes RFC 3066.</rdfs:comment>
+  </rdfs:Datatype>
+  <rdfs:Datatype rdf:about="http://purl.org/dc/terms/URI">
+    <rdfs:isDefinedBy rdf:resource="http://www.ietf.org/rfc/rfc3986.txt"/>
+    <skos:definition xml:lang="en-US">The set of identifiers constructed according to the generic syntax for Uniform Resource Identifiers as specified by the Internet Engineering Task Force.</skos:definition>
+    <rdfs:label xml:lang="en-US">URI</rdfs:label>
+  </rdfs:Datatype>
+  <rdfs:Datatype rdf:about="http://purl.org/dc/terms/W3CDTF">
+    <rdfs:isDefinedBy rdf:resource="http://www.w3.org/TR/NOTE-datetime"/>
+    <skos:definition xml:lang="en-US">The set of dates and times constructed according to the W3C Date and Time Formats Specification.</skos:definition>
+    <rdfs:label xml:lang="en-US">W3C-DTF</rdfs:label>
+  </rdfs:Datatype>
+  <owl:Class rdf:about="http://purl.org/dc/terms/Agent">
+    <skos:definition xml:lang="en-US">A resource that acts or has the power to act.</skos:definition>
+    <rdf:type rdf:resource="http://purl.org/dc/terms/AgentClass"/>
+    <rdfs:label xml:lang="en-US">Agent</rdfs:label>
+    <rdfs:comment xml:lang="en-US">Examples of Agent include person, organization, and software agent.</rdfs:comment>
+  </owl:Class>
+  <owl:Class rdf:about="http://purl.org/dc/terms/AgentClass">
+    <skos:definition xml:lang="en-US">A group of agents.</skos:definition>
+    <rdfs:subClassOf rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
+    <rdfs:label xml:lang="en-US">Agent Class</rdfs:label>
+    <rdfs:comment xml:lang="en-US">Examples of Agent Class include groups seen as classes, such as students, women, charities, lecturers.</rdfs:comment>
+  </owl:Class>
+  <owl:Class rdf:about="http://purl.org/dc/terms/BibliographicResource">
+    <skos:definition xml:lang="en-US">A book, article, or other documentary resource.</skos:definition>
+    <rdfs:label xml:lang="en-US">Bibliographic Resource</rdfs:label>
+  </owl:Class>
+  <owl:Class rdf:about="http://purl.org/dc/terms/FileFormat">
+    <skos:definition xml:lang="en-US">A digital resource format.</skos:definition>
+    <rdfs:subClassOf rdf:resource="http://purl.org/dc/terms/MediaType"/>
+    <rdfs:label xml:lang="en-US">File Format</rdfs:label>
+    <rdfs:comment xml:lang="en-US">Examples include the formats defined by the list of Internet Media Types.</rdfs:comment>
+  </owl:Class>
+  <owl:Class rdf:about="http://purl.org/dc/terms/Frequency">
+    <skos:definition xml:lang="en-US">A rate at which something recurs.</skos:definition>
+    <rdfs:label xml:lang="en-US">Frequency</rdfs:label>
+  </owl:Class>
+  <owl:Class rdf:about="http://purl.org/dc/terms/Jurisdiction">
+    <skos:definition xml:lang="en-US">The extent or range of judicial, law enforcement, or other authority.</skos:definition>
+    <rdfs:subClassOf rdf:resource="http://purl.org/dc/terms/LocationPeriodOrJurisdiction"/>
+    <rdfs:label xml:lang="en-US">Jurisdiction</rdfs:label>
+  </owl:Class>
+  <owl:Class rdf:about="http://purl.org/dc/terms/LicenseDocument">
+    <skos:definition xml:lang="en-US">A legal document giving official permission to do something with a Resource.</skos:definition>
+    <rdfs:subClassOf rdf:resource="http://purl.org/dc/terms/RightsStatement"/>
+    <rdfs:label xml:lang="en-US">License Document</rdfs:label>
+  </owl:Class>
+  <owl:Class rdf:about="http://purl.org/dc/terms/LinguisticSystem">
+    <skos:definition xml:lang="en-US">A system of signs, symbols, sounds, gestures, or rules used in communication.</skos:definition>
+    <rdfs:label xml:lang="en-US">Linguistic System</rdfs:label>
+    <rdfs:comment xml:lang="en-US">Examples include written, spoken, sign, and computer languages.</rdfs:comment>
+  </owl:Class>
+  <owl:Class rdf:about="http://purl.org/dc/terms/Location">
+    <skos:definition xml:lang="en-US">A spatial region or named place.</skos:definition>
+    <rdfs:subClassOf rdf:resource="http://purl.org/dc/terms/LocationPeriodOrJurisdiction"/>
+    <rdfs:label xml:lang="en-US">Location</rdfs:label>
+  </owl:Class>
+  <owl:Class rdf:about="http://purl.org/dc/terms/LocationPeriodOrJurisdiction">
+    <skos:definition xml:lang="en-US">A location, period of time, or jurisdiction.</skos:definition>
+    <rdfs:label xml:lang="en-US">Location, Period, or Jurisdiction</rdfs:label>
+  </owl:Class>
+  <owl:Class rdf:about="http://purl.org/dc/terms/MediaType">
+    <skos:definition xml:lang="en-US">A file format or physical medium.</skos:definition>
+    <rdfs:subClassOf rdf:resource="http://purl.org/dc/terms/MediaTypeOrExtent"/>
+    <rdfs:label xml:lang="en-US">Media Type</rdfs:label>
+  </owl:Class>
+  <owl:Class rdf:about="http://purl.org/dc/terms/MediaTypeOrExtent">
+    <skos:definition xml:lang="en-US">A media type or extent.</skos:definition>
+    <rdfs:label xml:lang="en-US">Media Type or Extent</rdfs:label>
+  </owl:Class>
+  <owl:Class rdf:about="http://purl.org/dc/terms/MethodOfAccrual">
+    <skos:definition xml:lang="en-US">A method by which resources are added to a collection.</skos:definition>
+    <rdfs:label xml:lang="en-US">Method of Accrual</rdfs:label>
+  </owl:Class>
+  <owl:Class rdf:about="http://purl.org/dc/terms/MethodOfInstruction">
+    <skos:definition xml:lang="en-US">A process that is used to engender knowledge, attitudes, and skills.</skos:definition>
+    <rdfs:label xml:lang="en-US">Method of Instruction</rdfs:label>
+  </owl:Class>
+  <owl:Class rdf:about="http://purl.org/dc/terms/PeriodOfTime">
+    <skos:definition xml:lang="en-US">An interval of time that is named or defined by its start and end dates.</skos:definition>
+    <rdfs:subClassOf rdf:resource="http://purl.org/dc/terms/LocationPeriodOrJurisdiction"/>
+    <rdfs:label xml:lang="en-US">Period of Time</rdfs:label>
+  </owl:Class>
+  <owl:Class rdf:about="http://purl.org/dc/terms/PhysicalMedium">
+    <skos:definition xml:lang="en-US">A physical material or carrier.</skos:definition>
+    <rdfs:subClassOf rdf:resource="http://purl.org/dc/terms/MediaType"/>
+    <rdfs:label xml:lang="en-US">Physical Medium</rdfs:label>
+    <rdfs:comment xml:lang="en-US">Examples include paper, canvas, or DVD.</rdfs:comment>
+  </owl:Class>
+  <owl:Class rdf:about="http://purl.org/dc/terms/PhysicalResource">
+    <skos:definition xml:lang="en-US">A material thing.</skos:definition>
+    <rdfs:label xml:lang="en-US">Physical Resource</rdfs:label>
+  </owl:Class>
+  <owl:Class rdf:about="http://purl.org/dc/terms/Policy">
+    <skos:definition xml:lang="en-US">A plan or course of action by an authority, intended to influence and determine decisions, actions, and other matters.</skos:definition>
+    <rdfs:label xml:lang="en-US">Policy</rdfs:label>
+  </owl:Class>
+  <owl:Class rdf:about="http://purl.org/dc/terms/ProvenanceStatement">
+    <skos:definition xml:lang="en-US">A statement of any changes in ownership and custody of a resource since its creation that are significant for its authenticity, integrity, and interpretation.</skos:definition>
+    <rdfs:label xml:lang="en-US">Provenance Statement</rdfs:label>
+  </owl:Class>
+  <owl:Class rdf:about="http://purl.org/dc/terms/RightsStatement">
+    <skos:definition xml:lang="en-US">A statement about the intellectual property rights (IPR) held in or over a Resource, a legal document giving official permission to do something with a resource, or a statement about access rights.</skos:definition>
+    <rdfs:label xml:lang="en-US">Rights Statement</rdfs:label>
+  </owl:Class>
+  <owl:Class rdf:about="http://purl.org/dc/terms/SizeOrDuration">
+    <skos:definition xml:lang="en-US">A dimension or extent, or a time taken to play or execute.</skos:definition>
+    <rdfs:subClassOf rdf:resource="http://purl.org/dc/terms/MediaTypeOrExtent"/>
+    <rdfs:label xml:lang="en-US">Size or Duration</rdfs:label>
+    <rdfs:comment xml:lang="en-US">Examples include a number of pages, a specification of length, width, and breadth, or a period in hours, minutes, and seconds.</rdfs:comment>
+  </owl:Class>
+  <owl:Class rdf:about="http://purl.org/dc/terms/Standard">
+    <skos:definition xml:lang="en-US">A basis for comparison; a reference point against which other things can be evaluated.</skos:definition>
+    <rdfs:label xml:lang="en-US">Standard</rdfs:label>
+  </owl:Class>
+</rdf:RDF>
+<!--
+Made by Triplr http://triplr.org by Dave Beckett, http://purl.org/net/dajobe/
+from http://bloody-byte.net/rdf/dc_owl2dl/dcterms_od.ttl in format turtle to rdfxml-abbrev
+using Redland 1.0.7 and Raptor 1.4.18 from http://librdf.org/
+This document is http://triplr.org/rdf/bloody-byte.net/rdf/dc_owl2dl/dcterms_od.ttl
+-->


[10/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/uml/database-schema.uml
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/uml/database-schema.uml b/taverna-provenanceconnector/src/main/uml/database-schema.uml
new file mode 100644
index 0000000..7cceeab
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/uml/database-schema.uml
@@ -0,0 +1,309 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Package xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML" xmi:id="_sneugE7WEd-4z_lD9gn2Tw" name="database-schema">
+  <elementImport xmi:id="_sr1DAE7WEd-4z_lD9gn2Tw">
+    <importedElement xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+  </elementImport>
+  <elementImport xmi:id="_sr6ikE7WEd-4z_lD9gn2Tw">
+    <importedElement xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+  </elementImport>
+  <elementImport xmi:id="_sr7JoE7WEd-4z_lD9gn2Tw">
+    <importedElement xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#UnlimitedNatural"/>
+  </elementImport>
+  <elementImport xmi:id="_sr7JoU7WEd-4z_lD9gn2Tw">
+    <importedElement xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+  </elementImport>
+  <packagedElement xmi:type="uml:Class" xmi:id="_v8DdoE7WEd-4z_lD9gn2Tw" name="WorkflowRun">
+    <ownedAttribute xmi:id="_EGXv8E7ZEd-4z_lD9gn2Tw" name="&lt;PK> workflowRunId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_GHJU4E7ZEd-4z_lD9gn2Tw" name="workflowId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_HPA74E7ZEd-4z_lD9gn2Tw" name="runStarted" aggregation="composite"/>
+    <ownedAttribute xmi:id="_JEjboFESEd-nO4bXYmJbIQ" name="&lt;PK> nestedProcessorEnactmentId" aggregation="composite"/>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Class" xmi:id="_yEqv8E7WEd-4z_lD9gn2Tw" name="Workflow">
+    <ownedAttribute xmi:id="_FPXDME7XEd-4z_lD9gn2Tw" name="&lt;PK> workflowId" aggregation="composite">
+      <defaultValue xmi:type="uml:LiteralString" xmi:id="_4vFHkE7YEd-4z_lD9gn2Tw" value=""/>
+    </ownedAttribute>
+    <ownedAttribute xmi:id="_M4h0AE7XEd-4z_lD9gn2Tw" name="dataflow" aggregation="composite"/>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Association" xmi:id="_KN69AE7ZEd-4z_lD9gn2Tw" memberEnd="_KN7kEE7ZEd-4z_lD9gn2Tw _KN8yMU7ZEd-4z_lD9gn2Tw">
+    <ownedEnd xmi:id="_KN7kEE7ZEd-4z_lD9gn2Tw" name="workflowId" type="_v8DdoE7WEd-4z_lD9gn2Tw" association="_KN69AE7ZEd-4z_lD9gn2Tw">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_KN8yME7ZEd-4z_lD9gn2Tw" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_KN8LIE7ZEd-4z_lD9gn2Tw" value="1"/>
+    </ownedEnd>
+    <ownedEnd xmi:id="_KN8yMU7ZEd-4z_lD9gn2Tw" name="dst" type="_yEqv8E7WEd-4z_lD9gn2Tw" association="_KN69AE7ZEd-4z_lD9gn2Tw">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_KN9ZQU7ZEd-4z_lD9gn2Tw" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_KN9ZQE7ZEd-4z_lD9gn2Tw" value="1"/>
+    </ownedEnd>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Class" xmi:id="_OKWWUE7ZEd-4z_lD9gn2Tw" name="Processor">
+    <ownedAttribute xmi:id="_RdvZsE7ZEd-4z_lD9gn2Tw" name="&lt;PK> processorId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_WVP7ME7ZEd-4z_lD9gn2Tw" name="processorName" aggregation="composite"/>
+    <ownedAttribute xmi:id="_XbvpME7ZEd-4z_lD9gn2Tw" name="workflowId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_YjvzEE7ZEd-4z_lD9gn2Tw" name="firstActivityClass" aggregation="composite"/>
+    <ownedAttribute xmi:id="_ZYtFIE7ZEd-4z_lD9gn2Tw" name="isTopLevel" aggregation="composite"/>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Association" xmi:id="_aUdiwE7ZEd-4z_lD9gn2Tw" name="workflowId" memberEnd="_aUeJ0E7ZEd-4z_lD9gn2Tw _aUfX8E7ZEd-4z_lD9gn2Tw">
+    <ownedEnd xmi:id="_aUeJ0E7ZEd-4z_lD9gn2Tw" name="workflowId" type="_OKWWUE7ZEd-4z_lD9gn2Tw" association="_aUdiwE7ZEd-4z_lD9gn2Tw">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_aUew4U7ZEd-4z_lD9gn2Tw" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_aUew4E7ZEd-4z_lD9gn2Tw" value="1"/>
+    </ownedEnd>
+    <ownedEnd xmi:id="_aUfX8E7ZEd-4z_lD9gn2Tw" name="dst" type="_yEqv8E7WEd-4z_lD9gn2Tw" association="_aUdiwE7ZEd-4z_lD9gn2Tw">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_aUf_AU7ZEd-4z_lD9gn2Tw" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_aUf_AE7ZEd-4z_lD9gn2Tw" value="1"/>
+    </ownedEnd>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Class" xmi:id="_JrqIAE7aEd-4z_lD9gn2Tw" name="Port" clientDependency="_VoSR4FEmEd-nO4bXYmJbIQ">
+    <ownedAttribute xmi:id="_WtxukFELEd-nO4bXYmJbIQ" name="&lt;PK> portId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_ZN-acFELEd-nO4bXYmJbIQ" name="portName" aggregation="composite"/>
+    <ownedAttribute xmi:id="_Z4GVgFELEd-nO4bXYmJbIQ" name="processorId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_cb-ngFELEd-nO4bXYmJbIQ" name="workflowId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_eQtUgFELEd-nO4bXYmJbIQ" name="depth" aggregation="composite"/>
+    <ownedAttribute xmi:id="_fij98FELEd-nO4bXYmJbIQ" name="resolvedDepth" aggregation="composite"/>
+    <ownedAttribute xmi:id="_g184cFELEd-nO4bXYmJbIQ" name="iterationStrategyOrder" aggregation="composite"/>
+    <ownedAttribute xmi:id="_hYIYcFELEd-nO4bXYmJbIQ" name="anlSet" aggregation="composite"/>
+    <ownedAttribute xmi:id="_L2VjkFEOEd-nO4bXYmJbIQ" name="isInputPort" aggregation="composite"/>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Association" xmi:id="__5-xMFELEd-nO4bXYmJbIQ" name="" memberEnd="__6BNcFELEd-nO4bXYmJbIQ __6DCoVELEd-nO4bXYmJbIQ">
+    <ownedEnd xmi:id="__6BNcFELEd-nO4bXYmJbIQ" name="src" type="_OKWWUE7ZEd-4z_lD9gn2Tw" association="__5-xMFELEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="__6DCoFELEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="__6CbkFELEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+    <ownedEnd xmi:id="__6DCoVELEd-nO4bXYmJbIQ" name="processorId" type="_JrqIAE7aEd-4z_lD9gn2Tw" association="__5-xMFELEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="__6DpsVELEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="__6DpsFELEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Class" xmi:id="_BFzOoFENEd-nO4bXYmJbIQ" name="Datalink">
+    <ownedAttribute xmi:id="_DiWJkFENEd-nO4bXYmJbIQ" name="&lt;PK> sourcePortId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_F_kZ8FENEd-nO4bXYmJbIQ" name="&lt;PK> destinationPortId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_OnfckFEOEd-nO4bXYmJbIQ" name="sourcePortName" aggregation="composite"/>
+    <ownedAttribute xmi:id="_P1ObAFEOEd-nO4bXYmJbIQ" name="sourceProcessorName" aggregation="composite"/>
+    <ownedAttribute xmi:id="_RbdZAFEOEd-nO4bXYmJbIQ" name="destinationPortName" aggregation="composite"/>
+    <ownedAttribute xmi:id="_Ssx28FEOEd-nO4bXYmJbIQ" name="destinationProcessorName" aggregation="composite"/>
+    <ownedAttribute xmi:id="_YeNqEFEOEd-nO4bXYmJbIQ" name="workflowId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_QohIAFHxEd-nO4bXYmJbIQ" name="&lt;PK> mergePosition" aggregation="composite"/>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Association" xmi:id="_PsnuEFENEd-nO4bXYmJbIQ" memberEnd="_PsoVIFENEd-nO4bXYmJbIQ _Pso8MVENEd-nO4bXYmJbIQ">
+    <ownedEnd xmi:id="_PsoVIFENEd-nO4bXYmJbIQ" name="sourcePortId" type="_BFzOoFENEd-nO4bXYmJbIQ" association="_PsnuEFENEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_Pso8MFENEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_PsoVIVENEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+    <ownedEnd xmi:id="_Pso8MVENEd-nO4bXYmJbIQ" name="dst" type="_JrqIAE7aEd-4z_lD9gn2Tw" association="_PsnuEFENEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_PspjQVENEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_PspjQFENEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Association" xmi:id="_RgRdAFENEd-nO4bXYmJbIQ" memberEnd="_RgSEEFENEd-nO4bXYmJbIQ _RgTSMVENEd-nO4bXYmJbIQ">
+    <ownedEnd xmi:id="_RgSEEFENEd-nO4bXYmJbIQ" name="src" type="_JrqIAE7aEd-4z_lD9gn2Tw" association="_RgRdAFENEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_RgTSMFENEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_RgSrIFENEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+    <ownedEnd xmi:id="_RgTSMVENEd-nO4bXYmJbIQ" name="destinationPortId" type="_BFzOoFENEd-nO4bXYmJbIQ" association="_RgRdAFENEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_RgT5QVENEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_RgT5QFENEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Class" xmi:id="_VA7gUFENEd-nO4bXYmJbIQ" name="PortValue" clientDependency="_UV0kcFEmEd-nO4bXYmJbIQ">
+    <ownedAttribute xmi:id="_Yz_iQFENEd-nO4bXYmJbIQ" name="&lt;PK> portId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_baKTQFENEd-nO4bXYmJbIQ" name="workflowRunId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_rZgr4FENEd-nO4bXYmJbIQ" name="&lt;PK> iteration" aggregation="composite"/>
+    <ownedAttribute xmi:id="_yNKJ8FENEd-nO4bXYmJbIQ" name="valueT2Reference" aggregation="composite"/>
+    <ownedAttribute xmi:id="_YQGDoFEQEd-nO4bXYmJbIQ" name="portName" aggregation="composite"/>
+    <ownedAttribute xmi:id="_ZiuJIFEQEd-nO4bXYmJbIQ" name="workflowId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_a1RWIFEQEd-nO4bXYmJbIQ" name="collectionValueRef" aggregation="composite"/>
+    <ownedAttribute xmi:id="_f2J2EFEQEd-nO4bXYmJbIQ" name="collectionPosition" aggregation="composite"/>
+    <ownedAttribute xmi:id="_kEh7AFEQEd-nO4bXYmJbIQ" name="valueType" aggregation="composite"/>
+    <ownedAttribute xmi:id="_bUoJoFEmEd-nO4bXYmJbIQ" name="processorId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_OCA-4FE4Ed-nO4bXYmJbIQ" name="&lt;PK> processorEnactmentId" aggregation="composite"/>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Association" xmi:id="_nKV8wFENEd-nO4bXYmJbIQ" memberEnd="_nKWj0FENEd-nO4bXYmJbIQ _nKXx8VENEd-nO4bXYmJbIQ">
+    <ownedEnd xmi:id="_nKWj0FENEd-nO4bXYmJbIQ" name="workflowRunId" type="_VA7gUFENEd-nO4bXYmJbIQ" association="_nKV8wFENEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_nKXx8FENEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_nKXK4FENEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+    <ownedEnd xmi:id="_nKXx8VENEd-nO4bXYmJbIQ" name="dst" type="_v8DdoE7WEd-4z_lD9gn2Tw" association="_nKV8wFENEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_nKYZAVENEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_nKYZAFENEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Class" xmi:id="_9CkNQFENEd-nO4bXYmJbIQ" name="PortCollection">
+    <ownedAttribute xmi:id="__sA7wFENEd-nO4bXYmJbIQ" name="&lt;PK> portId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_AXQ4MFEOEd-nO4bXYmJbIQ" name="workflowRunId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_BhWFsFEOEd-nO4bXYmJbIQ" name="&lt;PK> iteration" isOrdered="true" aggregation="composite"/>
+    <ownedAttribute xmi:id="_B7qqMFEOEd-nO4bXYmJbIQ" name="collectionT2Reference" aggregation="composite"/>
+    <ownedAttribute xmi:id="_Yi3zsFEmEd-nO4bXYmJbIQ" name="processorId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_dDQOoFEmEd-nO4bXYmJbIQ" name="portName" aggregation="composite"/>
+    <ownedAttribute xmi:id="_j0l_kFEmEd-nO4bXYmJbIQ" name="parentCollectionT2Reference" aggregation="composite"/>
+    <ownedAttribute xmi:id="_cYxCAFE4Ed-nO4bXYmJbIQ" name="&lt;PK> processorEnactmentId" aggregation="composite"/>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Association" xmi:id="_ZzvSkFEOEd-nO4bXYmJbIQ" memberEnd="_ZzvSkVEOEd-nO4bXYmJbIQ _ZzwgsVEOEd-nO4bXYmJbIQ">
+    <ownedEnd xmi:id="_ZzvSkVEOEd-nO4bXYmJbIQ" name="workflowId" type="_BFzOoFENEd-nO4bXYmJbIQ" association="_ZzvSkFEOEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_ZzwgsFEOEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_Zzv5oFEOEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+    <ownedEnd xmi:id="_ZzwgsVEOEd-nO4bXYmJbIQ" name="dst" type="_yEqv8E7WEd-4z_lD9gn2Tw" association="_ZzvSkFEOEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_ZzxHwVEOEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_ZzxHwFEOEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Class" xmi:id="_mzS5QFEOEd-nO4bXYmJbIQ" name="NestedWorkflow">
+    <ownedAttribute xmi:id="_o6U3MFEOEd-nO4bXYmJbIQ" name="&lt;PK> workflowId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_pvfkoFEOEd-nO4bXYmJbIQ" name="parentWorkflowId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_qllfIFEOEd-nO4bXYmJbIQ" name="&lt;PK> processorId" aggregation="composite"/>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Association" xmi:id="_u7KYQFEOEd-nO4bXYmJbIQ" memberEnd="_u7K_UFEOEd-nO4bXYmJbIQ _u7MNcFEOEd-nO4bXYmJbIQ">
+    <ownedEnd xmi:id="_u7K_UFEOEd-nO4bXYmJbIQ" name="processorId" type="_mzS5QFEOEd-nO4bXYmJbIQ" association="_u7KYQFEOEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_u7LmYVEOEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_u7LmYFEOEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+    <ownedEnd xmi:id="_u7MNcFEOEd-nO4bXYmJbIQ" name="dst" type="_OKWWUE7ZEd-4z_lD9gn2Tw" association="_u7KYQFEOEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_u7M0gVEOEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_u7M0gFEOEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Association" xmi:id="_vWUqQFEOEd-nO4bXYmJbIQ" memberEnd="_vWUqQVEOEd-nO4bXYmJbIQ _vWVRUlEOEd-nO4bXYmJbIQ">
+    <ownedEnd xmi:id="_vWUqQVEOEd-nO4bXYmJbIQ" name="workflowId" type="_mzS5QFEOEd-nO4bXYmJbIQ" association="_vWUqQFEOEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_vWVRUVEOEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_vWVRUFEOEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+    <ownedEnd xmi:id="_vWVRUlEOEd-nO4bXYmJbIQ" name="dst" type="_yEqv8E7WEd-4z_lD9gn2Tw" association="_vWUqQFEOEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_vWV4YVEOEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_vWV4YFEOEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Association" xmi:id="_-kyYgFEOEd-nO4bXYmJbIQ" memberEnd="_-ky_kFEOEd-nO4bXYmJbIQ _-k0NsVEOEd-nO4bXYmJbIQ">
+    <ownedEnd xmi:id="_-ky_kFEOEd-nO4bXYmJbIQ" name="parentWorkflowId" type="_mzS5QFEOEd-nO4bXYmJbIQ" association="_-kyYgFEOEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_-k0NsFEOEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_-kzmoFEOEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+    <ownedEnd xmi:id="_-k0NsVEOEd-nO4bXYmJbIQ" name="dst" type="_yEqv8E7WEd-4z_lD9gn2Tw" association="_-kyYgFEOEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_-k00wVEOEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_-k00wFEOEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Association" xmi:id="_CSqYcFEPEd-nO4bXYmJbIQ" memberEnd="_CSq_gFEPEd-nO4bXYmJbIQ _CSsNoFEPEd-nO4bXYmJbIQ">
+    <ownedEnd xmi:id="_CSq_gFEPEd-nO4bXYmJbIQ" name="portId" type="_9CkNQFENEd-nO4bXYmJbIQ" association="_CSqYcFEPEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_CSrmkVEPEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_CSrmkFEPEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+    <ownedEnd xmi:id="_CSsNoFEPEd-nO4bXYmJbIQ" name="dst" type="_JrqIAE7aEd-4z_lD9gn2Tw" association="_CSqYcFEPEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_CSs0sVEPEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_CSs0sFEPEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Association" xmi:id="_G9lPcFEPEd-nO4bXYmJbIQ" memberEnd="_G9l2gFEPEd-nO4bXYmJbIQ _G9mdkVEPEd-nO4bXYmJbIQ">
+    <ownedEnd xmi:id="_G9l2gFEPEd-nO4bXYmJbIQ" name="workflowRunId" type="_9CkNQFENEd-nO4bXYmJbIQ" association="_G9lPcFEPEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_G9mdkFEPEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_G9l2gVEPEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+    <ownedEnd xmi:id="_G9mdkVEPEd-nO4bXYmJbIQ" name="dst" type="_v8DdoE7WEd-4z_lD9gn2Tw" association="_G9lPcFEPEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_G9mdk1EPEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_G9mdklEPEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Association" xmi:id="_vXCKAFEQEd-nO4bXYmJbIQ" memberEnd="_vXCKAVEQEd-nO4bXYmJbIQ _vXDYIVEQEd-nO4bXYmJbIQ">
+    <ownedEnd xmi:id="_vXCKAVEQEd-nO4bXYmJbIQ" name="collectionT2Reference" type="_VA7gUFENEd-nO4bXYmJbIQ" association="_vXCKAFEQEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_vXDYIFEQEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_vXCxEFEQEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+    <ownedEnd xmi:id="_vXDYIVEQEd-nO4bXYmJbIQ" name="dst" type="_9CkNQFENEd-nO4bXYmJbIQ" association="_vXCKAFEQEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_vXD_MVEQEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_vXD_MFEQEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Association" xmi:id="_vzp_IFEREd-nO4bXYmJbIQ" memberEnd="_vzqmMFEREd-nO4bXYmJbIQ _vzrNQVEREd-nO4bXYmJbIQ">
+    <ownedEnd xmi:id="_vzqmMFEREd-nO4bXYmJbIQ" name="portId" type="_VA7gUFENEd-nO4bXYmJbIQ" association="_vzp_IFEREd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_vzrNQFEREd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_vzqmMVEREd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+    <ownedEnd xmi:id="_vzrNQVEREd-nO4bXYmJbIQ" name="dst" type="_JrqIAE7aEd-4z_lD9gn2Tw" association="_vzp_IFEREd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_vzsbYFEREd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_vzr0UFEREd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Association" xmi:id="_B4RTwFEVEd-nO4bXYmJbIQ" memberEnd="_B4R60FEVEd-nO4bXYmJbIQ _B4TI8FEVEd-nO4bXYmJbIQ">
+    <ownedEnd xmi:id="_B4R60FEVEd-nO4bXYmJbIQ" name="nestedWorkflowProcessorId" type="_v8DdoE7WEd-4z_lD9gn2Tw" association="_B4RTwFEVEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_B4Sh4VEVEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_B4Sh4FEVEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+    <ownedEnd xmi:id="_B4TI8FEVEd-nO4bXYmJbIQ" name="dst" type="_OKWWUE7ZEd-4z_lD9gn2Tw" association="_B4RTwFEVEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_B4TwAFEVEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_B4TI8VEVEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Dependency" xmi:id="_UV0kcFEmEd-nO4bXYmJbIQ" supplier="_yEqv8E7WEd-4z_lD9gn2Tw" client="_VA7gUFENEd-nO4bXYmJbIQ"/>
+  <packagedElement xmi:type="uml:Dependency" xmi:id="_VoSR4FEmEd-nO4bXYmJbIQ" supplier="_yEqv8E7WEd-4z_lD9gn2Tw" client="_JrqIAE7aEd-4z_lD9gn2Tw"/>
+  <packagedElement xmi:type="uml:Association" xmi:id="_LGTbsFE4Ed-nO4bXYmJbIQ" memberEnd="_LGUp0FE4Ed-nO4bXYmJbIQ _LGVQ4FE4Ed-nO4bXYmJbIQ">
+    <ownedEnd xmi:id="_LGUp0FE4Ed-nO4bXYmJbIQ" name="processorEnactmentId" type="_VA7gUFENEd-nO4bXYmJbIQ" association="_LGTbsFE4Ed-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_LGUp0lE4Ed-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_LGUp0VE4Ed-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+    <ownedEnd xmi:id="_LGVQ4FE4Ed-nO4bXYmJbIQ" name="dst" type="_eoBMAFExEd-nO4bXYmJbIQ" association="_LGTbsFE4Ed-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_LGVQ4lE4Ed-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_LGVQ4VE4Ed-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Association" xmi:id="_9zNacFHmEd-nO4bXYmJbIQ" memberEnd="_9zOBgFHmEd-nO4bXYmJbIQ _9zOokVHmEd-nO4bXYmJbIQ">
+    <ownedEnd xmi:id="_9zOBgFHmEd-nO4bXYmJbIQ" name="processEnactmentId" type="_9CkNQFENEd-nO4bXYmJbIQ" association="_9zNacFHmEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_9zOokFHmEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_9zOBgVHmEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+    <ownedEnd xmi:id="_9zOokVHmEd-nO4bXYmJbIQ" name="dst" type="_eoBMAFExEd-nO4bXYmJbIQ" association="_9zNacFHmEd-nO4bXYmJbIQ">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_9zPPoVHmEd-nO4bXYmJbIQ" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_9zPPoFHmEd-nO4bXYmJbIQ" value="1"/>
+    </ownedEnd>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Class" xmi:id="_eoBMAFExEd-nO4bXYmJbIQ" name="ProcessorEnactment">
+    <ownedAttribute xmi:id="_4fjKsFExEd-nO4bXYmJbIQ" name="&lt;PK> processEnactmentId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_63SeIFExEd-nO4bXYmJbIQ" name="workflowRunId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_8whQoFExEd-nO4bXYmJbIQ" name="processId" aggregation="composite"/>
+    <ownedAttribute xmi:id="__Ek98FExEd-nO4bXYmJbIQ" name="processIdentifier" aggregation="composite"/>
+    <ownedAttribute xmi:id="_FqBn8FEyEd-nO4bXYmJbIQ" name="iteration" aggregation="composite"/>
+    <ownedAttribute xmi:id="_HLwgcFEyEd-nO4bXYmJbIQ" name="parentProcessEnactmentId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_Ji5W8FEyEd-nO4bXYmJbIQ" name="enactmentStarted" aggregation="composite"/>
+    <ownedAttribute xmi:id="_Li-_YFEyEd-nO4bXYmJbIQ" name="enactmentEnded" aggregation="composite"/>
+    <ownedAttribute xmi:id="_NE76UFEyEd-nO4bXYmJbIQ" name="initialInputs" aggregation="composite"/>
+    <ownedAttribute xmi:id="_OC0e4FEyEd-nO4bXYmJbIQ" name="finalOutputs" aggregation="composite"/>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Association" xmi:id="_VY1LQFQ0Ed-2MdC0gorhYw" memberEnd="_VY3AcFQ0Ed-2MdC0gorhYw _VY4OkVQ0Ed-2MdC0gorhYw">
+    <ownedEnd xmi:id="_VY3AcFQ0Ed-2MdC0gorhYw" name="src" type="_eoBMAFExEd-nO4bXYmJbIQ" association="_VY1LQFQ0Ed-2MdC0gorhYw">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_VY4OkFQ0Ed-2MdC0gorhYw" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_VY3ngFQ0Ed-2MdC0gorhYw" value="1"/>
+    </ownedEnd>
+    <ownedEnd xmi:id="_VY4OkVQ0Ed-2MdC0gorhYw" name="nestedProcessorEnactmentId" type="_v8DdoE7WEd-4z_lD9gn2Tw" association="_VY1LQFQ0Ed-2MdC0gorhYw">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_VY41oVQ0Ed-2MdC0gorhYw" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_VY41oFQ0Ed-2MdC0gorhYw" value="1"/>
+    </ownedEnd>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Association" xmi:id="_clJA8FQ0Ed-2MdC0gorhYw" memberEnd="_clJA8VQ0Ed-2MdC0gorhYw _clKPEVQ0Ed-2MdC0gorhYw">
+    <ownedEnd xmi:id="_clJA8VQ0Ed-2MdC0gorhYw" name="workflowRunId" type="_eoBMAFExEd-nO4bXYmJbIQ" association="_clJA8FQ0Ed-2MdC0gorhYw">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_clKPEFQ0Ed-2MdC0gorhYw" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_clJoAFQ0Ed-2MdC0gorhYw" value="1"/>
+    </ownedEnd>
+    <ownedEnd xmi:id="_clKPEVQ0Ed-2MdC0gorhYw" name="dst" type="_v8DdoE7WEd-4z_lD9gn2Tw" association="_clJA8FQ0Ed-2MdC0gorhYw">
+      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_clK2IVQ0Ed-2MdC0gorhYw" value="1"/>
+      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_clK2IFQ0Ed-2MdC0gorhYw" value="1"/>
+    </ownedEnd>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Class" xmi:id="_XUGAgFEzEd-nO4bXYmJbIQ" name="DataBinding">
+    <ownedAttribute xmi:id="_s92-QFEzEd-nO4bXYmJbIQ" name="&lt;PK> dataBindingId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_uNk5sFEzEd-nO4bXYmJbIQ" name="&lt;PK> portId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_viznQFEzEd-nO4bXYmJbIQ" name="t2Reference" aggregation="composite"/>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Class" xmi:id="_9Oi-gFEzEd-nO4bXYmJbIQ" name="Activity">
+    <ownedAttribute xmi:id="_-NQpgFEzEd-nO4bXYmJbIQ" name="&lt;PK> activityId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_-_rk8FEzEd-nO4bXYmJbIQ" name="activityDefinition" aggregation="composite"/>
+  </packagedElement>
+  <packagedElement xmi:type="uml:Class" xmi:id="_fiAIAFExEd-nO4bXYmJbIQ" name="ServiceInvocation">
+    <ownedAttribute xmi:id="_IflqYFEzEd-nO4bXYmJbIQ" name="&lt;PK> processorEnactmentId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_LAAYsFEzEd-nO4bXYmJbIQ" name="&lt;PK> invocationNumber" aggregation="composite"/>
+    <ownedAttribute xmi:id="_NTjvsFEzEd-nO4bXYmJbIQ" name="invocationStarted" aggregation="composite"/>
+    <ownedAttribute xmi:id="_OzX8oFEzEd-nO4bXYmJbIQ" name="invocationEnded" aggregation="composite"/>
+    <ownedAttribute xmi:id="_QBf8oFEzEd-nO4bXYmJbIQ" name="inputs" aggregation="composite"/>
+    <ownedAttribute xmi:id="_QqKfIFEzEd-nO4bXYmJbIQ" name="outputs" aggregation="composite"/>
+    <ownedAttribute xmi:id="_ReuvoFEzEd-nO4bXYmJbIQ" name="failureT2Reference" aggregation="composite"/>
+    <ownedAttribute xmi:id="_S-tUoFEzEd-nO4bXYmJbIQ" name="activityId" aggregation="composite"/>
+    <ownedAttribute xmi:id="_udhIQFE1Ed-nO4bXYmJbIQ" name="initiatingDispatchLayer" aggregation="composite"/>
+    <ownedAttribute xmi:id="_hCNc4FE5Ed-nO4bXYmJbIQ" name="finalDispatchLayer" aggregation="composite"/>
+  </packagedElement>
+</uml:Package>
+


[45/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/PossibleURILookupsTest.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/PossibleURILookupsTest.java b/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/PossibleURILookupsTest.java
new file mode 100644
index 0000000..1cf20ff
--- /dev/null
+++ b/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/PossibleURILookupsTest.java
@@ -0,0 +1,254 @@
+/*******************************************************************************
+ * Copyright (C) 2008-2010 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.security.credentialmanager.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Random;
+
+import net.sf.taverna.t2.security.credentialmanager.CMException;
+import net.sf.taverna.t2.security.credentialmanager.JavaTruststorePasswordProvider;
+import net.sf.taverna.t2.security.credentialmanager.MasterPasswordProvider;
+import net.sf.taverna.t2.security.credentialmanager.ServiceUsernameAndPasswordProvider;
+import net.sf.taverna.t2.security.credentialmanager.TrustConfirmationProvider;
+
+import org.apache.commons.io.FileUtils;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * 
+ * @author Stian Soiland-Reyes
+ * @author Alex Nenadic
+ *
+ */
+public class PossibleURILookupsTest {
+	private static final String SIMPLE_URI = "http://www.taverna.org.uk/filename.html";
+	private static final String ROOT_URI = "http://www.taverna.org.uk/";
+	private static final String NAIVE_ROOT_URI = "http://www.taverna.org.uk";
+
+	private static final String NASTY_URI = "http://www.taverna.org.uk/path1/path2/path3/filename.html?query=1&query2=2";
+	
+	private static final String NASTY_URI_FRAGMENT = "http://www.taverna.org.uk/path1/path2/path3/filename.html?query=1&query2=2#frag1337";
+	
+	private static final String NASTY_URI_PARENT = "http://www.taverna.org.uk/path1/path2/path3/";
+
+	private static final String NASTY_DOT_DOT_URI = "http://www.taverna.org.uk/path1/path2/path3/path4/../fish.html";
+
+	private static CredentialManagerImpl credentialManager;
+	private static File credentialManagerDirectory;
+	private static DummyMasterPasswordProvider masterPasswordProvider;
+	private static HTTPAuthenticatorServiceUsernameAndPasswordProvider httpAuthProvider;
+
+	@BeforeClass
+	public static void setUp() throws CMException, IOException {
+		
+		try {
+			credentialManager = new CredentialManagerImpl();
+		} catch (CMException e) {
+			System.out.println(e.getStackTrace());
+		}
+		Random randomGenerator = new Random();
+		String credentialManagerDirectoryPath = System
+				.getProperty("java.io.tmpdir")
+				+ System.getProperty("file.separator")
+				+ "taverna-security-"
+				+ randomGenerator.nextInt(1000000);
+		System.out.println("Credential Manager's directory path: "
+				+ credentialManagerDirectoryPath);
+		credentialManagerDirectory = new File(credentialManagerDirectoryPath);
+		try {
+			credentialManager
+					.setConfigurationDirectoryPath(credentialManagerDirectory);
+		} catch (CMException e) {
+			System.out.println(e.getStackTrace());
+		}
+
+		// Create the dummy master password provider
+		masterPasswordProvider = new DummyMasterPasswordProvider();
+		/* Short password to avoid issues with key sizes and Java strong crypto policy*/
+		masterPasswordProvider.setMasterPassword("uber");
+		List<MasterPasswordProvider> masterPasswordProviders = new ArrayList<MasterPasswordProvider>();
+		masterPasswordProviders.add(masterPasswordProvider);
+		credentialManager.setMasterPasswordProviders(masterPasswordProviders);
+		
+		// Put our HTTP authenticator in the list of service username and password providers
+		httpAuthProvider = new HTTPAuthenticatorServiceUsernameAndPasswordProvider();
+		ArrayList<ServiceUsernameAndPasswordProvider> serviceUsernameAndPasswordProviders = new ArrayList<ServiceUsernameAndPasswordProvider>();
+		serviceUsernameAndPasswordProviders.add(httpAuthProvider);
+		credentialManager.setServiceUsernameAndPasswordProviders(serviceUsernameAndPasswordProviders);
+
+		// These can be empty
+		credentialManager.setJavaTruststorePasswordProviders(new ArrayList<JavaTruststorePasswordProvider>());
+		credentialManager.setTrustConfirmationProviders(new ArrayList<TrustConfirmationProvider>());
+	}
+	
+	@AfterClass
+	// Clean up the credentialManagerDirectory we created for testing
+	public static void cleanUp(){
+	
+		if (credentialManagerDirectory.exists()){
+			try {
+				FileUtils.deleteDirectory(credentialManagerDirectory);				
+				System.out.println("Deleting Credential Manager's directory: "
+						+ credentialManagerDirectory.getAbsolutePath());
+			} catch (IOException e) {
+				System.out.println(e.getStackTrace());
+			}	
+		}
+	}
+	
+	@Test
+	public void possibleLookupsNoRecursion() throws Exception {
+		URI uri = URI.create(NASTY_URI);
+		LinkedHashSet<URI> lookups = credentialManager.getPossibleServiceURIsToLookup(uri,
+				false);
+		assertTrue("Did not contain " + uri, lookups.remove(uri));
+		assertTrue("Unexpected lookups:" + lookups, lookups.isEmpty());
+	}
+
+	@Test
+	public void possibleLookupsDotDot() throws Exception {
+		URI uri = URI.create(NASTY_DOT_DOT_URI);
+		List<URI> expected = Arrays
+				.asList(
+						URI.create("http://www.taverna.org.uk/path1/path2/path3/fish.html"),
+						URI.create("http://www.taverna.org.uk/path1/path2/path3/"),
+						URI.create("http://www.taverna.org.uk/path1/path2/"),
+						URI.create("http://www.taverna.org.uk/path1/"), 
+						URI.create("http://www.taverna.org.uk/"));
+
+		ArrayList<URI> lookups = new ArrayList<URI>(credentialManager
+				.getPossibleServiceURIsToLookup(uri, true));
+
+		assertEquals("Did not match expected URIs", expected, lookups);
+	}
+
+	@Test
+	public void possibleLookups() throws Exception {
+		URI uri = URI.create(NASTY_URI);
+		List<URI> expected = Arrays
+				.asList(
+						URI.create("http://www.taverna.org.uk/path1/path2/path3/filename.html?query=1&query2=2"),
+						URI.create("http://www.taverna.org.uk/path1/path2/path3/filename.html"),
+						URI.create("http://www.taverna.org.uk/path1/path2/path3/"),
+						URI.create("http://www.taverna.org.uk/path1/path2/"),
+						URI.create("http://www.taverna.org.uk/path1/"), URI
+								.create("http://www.taverna.org.uk/"));
+
+		ArrayList<URI> lookups = new ArrayList<URI>(credentialManager
+				.getPossibleServiceURIsToLookup(uri, true));
+
+		assertEquals("Did not match expected URIs", expected, lookups);
+	}
+	
+
+	@Test
+	public void possibleLookupsWithFragment() throws Exception {
+		URI uri = URI.create(NASTY_URI_FRAGMENT);
+		List<URI> expected = Arrays
+				.asList(
+						URI.create("http://www.taverna.org.uk/path1/path2/path3/filename.html?query=1&query2=2#frag1337"),
+						URI.create("http://www.taverna.org.uk/path1/path2/path3/filename.html#frag1337"),
+						URI.create("http://www.taverna.org.uk/path1/path2/path3/#frag1337"),
+						URI.create("http://www.taverna.org.uk/path1/path2/#frag1337"),
+						URI.create("http://www.taverna.org.uk/path1/#frag1337"), URI
+								.create("http://www.taverna.org.uk/#frag1337"),
+				// And then again without fragment
+						URI.create("http://www.taverna.org.uk/path1/path2/path3/filename.html?query=1&query2=2"),
+						URI.create("http://www.taverna.org.uk/path1/path2/path3/filename.html"),
+						URI.create("http://www.taverna.org.uk/path1/path2/path3/"),
+						URI.create("http://www.taverna.org.uk/path1/path2/"),
+						URI.create("http://www.taverna.org.uk/path1/"), URI
+								.create("http://www.taverna.org.uk/")
+				
+				);
+
+		ArrayList<URI> lookups = new ArrayList<URI>(credentialManager
+				.getPossibleServiceURIsToLookup(uri, true));
+
+		assertEquals("Did not match expected URIs", expected, lookups);
+	}
+
+	@Test
+	public void possibleLookupDirectory() throws Exception {
+		URI uri = URI.create(NASTY_URI_PARENT);
+		List<URI> expected = Arrays.asList(URI
+				.create("http://www.taverna.org.uk/path1/path2/path3/"), URI
+				.create("http://www.taverna.org.uk/path1/path2/"), URI
+				.create("http://www.taverna.org.uk/path1/"), URI
+				.create("http://www.taverna.org.uk/"));
+
+		ArrayList<URI> lookups = new ArrayList<URI>(credentialManager
+				.getPossibleServiceURIsToLookup(uri, true));
+
+		assertEquals("Did not match expected URIs", expected, lookups);
+	}
+
+	@Test
+	public void possibleLookupSimple() throws Exception {
+		URI uri = URI.create(SIMPLE_URI);
+		List<URI> expected = Arrays.asList(URI
+				.create("http://www.taverna.org.uk/filename.html"), URI
+				.create("http://www.taverna.org.uk/"));
+
+		ArrayList<URI> lookups = new ArrayList<URI>(credentialManager
+				.getPossibleServiceURIsToLookup(uri, true));
+
+		assertEquals("Did not match expected URIs", expected, lookups);
+	}
+
+	@Test
+	public void possibleLookupRoot() throws Exception {
+		URI uri = URI.create(ROOT_URI);
+		List<URI> expected = Arrays.asList(URI
+				.create("http://www.taverna.org.uk/"));
+
+		ArrayList<URI> lookups = new ArrayList<URI>(credentialManager
+				.getPossibleServiceURIsToLookup(uri, true));
+
+		assertEquals("Did not match expected URIs", expected, lookups);
+	}
+
+	@Test
+	public void possibleLookupNaiveRoot() throws Exception {
+		URI uri = URI.create(NAIVE_ROOT_URI);
+		List<URI> expected = Arrays.asList(URI
+				.create("http://www.taverna.org.uk"), URI
+				.create("http://www.taverna.org.uk/"));
+
+		ArrayList<URI> lookups = new ArrayList<URI>(credentialManager
+				.getPossibleServiceURIsToLookup(uri, true));
+
+		assertEquals("Did not match expected URIs", expected, lookups);
+	}
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/TrustAlwaysTrustConfirmationProvider.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/TrustAlwaysTrustConfirmationProvider.java b/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/TrustAlwaysTrustConfirmationProvider.java
new file mode 100644
index 0000000..bae9e54
--- /dev/null
+++ b/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/TrustAlwaysTrustConfirmationProvider.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (C) 2008-2010 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.security.credentialmanager.impl;
+
+import java.security.cert.X509Certificate;
+
+import net.sf.taverna.t2.security.credentialmanager.TrustConfirmationProvider;
+
+public class TrustAlwaysTrustConfirmationProvider implements TrustConfirmationProvider{
+
+	@Override
+	public Boolean shouldTrustCertificate(X509Certificate[] chain) {
+		
+		// Always trust
+		return Boolean.TRUE;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/TrustNeverTrustConfimationProvider.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/TrustNeverTrustConfimationProvider.java b/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/TrustNeverTrustConfimationProvider.java
new file mode 100644
index 0000000..f7e0aee
--- /dev/null
+++ b/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/TrustNeverTrustConfimationProvider.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (C) 2008-2010 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.security.credentialmanager.impl;
+
+import java.security.cert.X509Certificate;
+
+import net.sf.taverna.t2.security.credentialmanager.TrustConfirmationProvider;
+
+public class TrustNeverTrustConfimationProvider implements TrustConfirmationProvider{
+
+	@Override
+	public Boolean shouldTrustCertificate(X509Certificate[] chain) {
+		
+		// Never trust
+		return Boolean.FALSE;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/test/resources/html/test.html
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/test/resources/html/test.html b/taverna-credential-manager-impl/src/test/resources/html/test.html
new file mode 100644
index 0000000..aca08e6
--- /dev/null
+++ b/taverna-credential-manager-impl/src/test/resources/html/test.html
@@ -0,0 +1,5 @@
+<html>
+	<body>
+		Hello!
+	</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/test/resources/security/google-trusted-certificate.pem
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/test/resources/security/google-trusted-certificate.pem b/taverna-credential-manager-impl/src/test/resources/security/google-trusted-certificate.pem
new file mode 100644
index 0000000..803d7db
--- /dev/null
+++ b/taverna-credential-manager-impl/src/test/resources/security/google-trusted-certificate.pem
@@ -0,0 +1,29 @@
+-----BEGIN CERTIFICATE-----
+MIIFCDCCBHGgAwIBAgIKYaLlHAADAAAtEDANBgkqhkiG9w0BAQUFADBGMQswCQYD
+VQQGEwJVUzETMBEGA1UEChMKR29vZ2xlIEluYzEiMCAGA1UEAxMZR29vZ2xlIElu
+dGVybmV0IEF1dGhvcml0eTAeFw0xMTA3MjcxMDExNTlaFw0xMjA3MjcxMDIxNTla
+MGYxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1N
+b3VudGFpbiBWaWV3MRMwEQYDVQQKEwpHb29nbGUgSW5jMRUwEwYDVQQDFAwqLmdv
+b2dsZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANCK/ZK6aQGxkbxJ
+BQavVU11O36JxAWwHSw1d5pNFS4FKUZSWAQrde2PEaGO3q/lezcK1Fef/ldZIu0M
+ZHYCdKoP5Axd8znIuJhbHw3xwnEi5V0gMINENEMcxdBsUCZiPTWFDI3v45bPYit3
+0wud8eBR94SAUfF27djcyGHq4VunAgMBAAGjggLbMIIC1zAdBgNVHQ4EFgQUflky
+CQk5VOPCyPDf6uPwmRDiB44wHwYDVR0jBBgwFoAUv8Aw6/VDET5nup6R+/xq2uNr
+EiQwWwYDVR0fBFQwUjBQoE6gTIZKaHR0cDovL3d3dy5nc3RhdGljLmNvbS9Hb29n
+bGVJbnRlcm5ldEF1dGhvcml0eS9Hb29nbGVJbnRlcm5ldEF1dGhvcml0eS5jcmww
+ZgYIKwYBBQUHAQEEWjBYMFYGCCsGAQUFBzAChkpodHRwOi8vd3d3LmdzdGF0aWMu
+Y29tL0dvb2dsZUludGVybmV0QXV0aG9yaXR5L0dvb2dsZUludGVybmV0QXV0aG9y
+aXR5LmNydDAhBgkrBgEEAYI3FAIEFB4SAFcAZQBiAFMAZQByAHYAZQByMIIBqwYD
+VR0RBIIBojCCAZ6CDCouZ29vZ2xlLmNvbYIKZ29vZ2xlLmNvbYILKi5hdGdnbC5j
+b22CDSoueW91dHViZS5jb22CC3lvdXR1YmUuY29tggsqLnl0aW1nLmNvbYIPKi5n
+b29nbGUuY29tLmJygg4qLmdvb2dsZS5jby5pboILKi5nb29nbGUuZXOCDiouZ29v
+Z2xlLmNvLnVrggsqLmdvb2dsZS5jYYILKi5nb29nbGUuZnKCCyouZ29vZ2xlLnB0
+ggsqLmdvb2dsZS5pdIILKi5nb29nbGUuZGWCCyouZ29vZ2xlLmNsggsqLmdvb2ds
+ZS5wbIILKi5nb29nbGUubmyCDyouZ29vZ2xlLmNvbS5hdYIOKi5nb29nbGUuY28u
+anCCCyouZ29vZ2xlLmh1gg8qLmdvb2dsZS5jb20ubXiCDyouZ29vZ2xlLmNvbS5h
+coIPKi5nb29nbGUuY29tLmNvgg8qLmdvb2dsZS5jb20udm6CDyouZ29vZ2xlLmNv
+bS50coINKi5hbmRyb2lkLmNvbYIUKi5nb29nbGVjb21tZXJjZS5jb20wDQYJKoZI
+hvcNAQEFBQADgYEAF9+a/uwn7VpDIF0jqn6oNRNwbBnfwxvr2Kilxe2BpBDEzq3a
+ELLK6eozpR8LAM7uLzGyIdTIBOvYH2HKjmLZ/fdaARoXnk7xSspOs/DRZ3inh2d/
+KwDcKoeS49p53dpUZ5805fUqY/v9yiEvhAwpaJrGRaS6YCsFTYFVE0+awYo=
+-----END CERTIFICATE-----

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/test/resources/security/t2keystore.ubr
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/test/resources/security/t2keystore.ubr b/taverna-credential-manager-impl/src/test/resources/security/t2keystore.ubr
new file mode 100644
index 0000000..474ad77
Binary files /dev/null and b/taverna-credential-manager-impl/src/test/resources/security/t2keystore.ubr differ

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/test/resources/security/t2truststore.ubr
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/test/resources/security/t2truststore.ubr b/taverna-credential-manager-impl/src/test/resources/security/t2truststore.ubr
new file mode 100644
index 0000000..15d38f2
Binary files /dev/null and b/taverna-credential-manager-impl/src/test/resources/security/t2truststore.ubr differ

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/test/resources/security/test-private-key-cert.p12
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/test/resources/security/test-private-key-cert.p12 b/taverna-credential-manager-impl/src/test/resources/security/test-private-key-cert.p12
new file mode 100644
index 0000000..6f298c5
Binary files /dev/null and b/taverna-credential-manager-impl/src/test/resources/security/test-private-key-cert.p12 differ

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/test/resources/security/tomcat_heater_certificate.pem
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/test/resources/security/tomcat_heater_certificate.pem b/taverna-credential-manager-impl/src/test/resources/security/tomcat_heater_certificate.pem
new file mode 100644
index 0000000..c729258
--- /dev/null
+++ b/taverna-credential-manager-impl/src/test/resources/security/tomcat_heater_certificate.pem
@@ -0,0 +1,20 @@
+-----BEGIN CERTIFICATE-----
+MIIDyDCCArCgAwIBAgIETlYTBzANBgkqhkiG9w0BAQUFADCBpTELMAkGA1UEBhMCVUsxGzAZBgNV
+BAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjETMBEGA1UEBxMKTWFuY2hlc3RlcjEhMB8GA1UEChMYVW5p
+dmVyc2l0eSBvZiBNYW5jaGVzdGVyMSMwIQYDVQQLExpTY2hvb2wgb2YgQ29tcHV0ZXIgU2NpZW5j
+ZTEcMBoGA1UEAxMTaGVhdGVyLmNzLm1hbi5hYy51azAeFw0xMTA4MjUwOTE2NTVaFw0yMTA4MjIw
+OTE2NTVaMIGlMQswCQYDVQQGEwJVSzEbMBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRMwEQYD
+VQQHEwpNYW5jaGVzdGVyMSEwHwYDVQQKExhVbml2ZXJzaXR5IG9mIE1hbmNoZXN0ZXIxIzAhBgNV
+BAsTGlNjaG9vbCBvZiBDb21wdXRlciBTY2llbmNlMRwwGgYDVQQDExNoZWF0ZXIuY3MubWFuLmFj
+LnVrMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1/TuezSNYFpD2NTtw5UGECCPwClV
+Om08Nca1aanOVxv5rcn4eUVbu6Btm/dqgiCeV8nCyu7nEPvWP+Kvktseikx3LZ08qKdDRLpNa68/
+WrjcbS6ICs2hphhqftHSpl0OPnWkQicbI7Z4uUdqmF6DsLDOLpRfiYhh9lZ0FM7PD3yt42GR5E2B
+j465IJQweZxLCsRKwuZlvOsWJxnx1MHVj7ZFBYl7HSBfEpvThyqKL5R7FOZW0zpG3+Y+S9HmfQYk
+BipXrrNS1+lsIwPU8jD31PBzVPBNxIeKYHxXCKLf+EBah/tAKSxIzUihxhh1pdNEPvUyy2zY9vyv
+1PfXd8Uk0wIDAQABMA0GCSqGSIb3DQEBBQUAA4IBAQAtiPDBRlmjhFd9DP1NvbyfMApdjLufMLvr
+mzze3W6A4XUZj+kXR/Z3KYj84pWOnhe+Benvw5bIf2JM+sqIiSUA+TB8losx+SeY5hZ3lqEFY1wZ
+1qy47hH3rY98RdSAXlAhvGCEL/CktvIEHgaSlCmrOvK76ySwRCTYA9DJTWeB81R7bP7le2ewSg5c
+MY/Hy3VBkMGbVnZQoHhkUd7TIsPqD1SvYQDCug49JFsKsyrfep3nANAQO7uR8FYrCYtXj66z9ziO
+m0gZm+h/Rq8StgMrNwmi+3mGAgRJ6JKj4vAWJfyUSaOjLLf9u3BvrxVtQKCMSDGx25dBFlZXHIhE
+rONf
+-----END CERTIFICATE-----

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-credential-manager/pom.xml b/taverna-credential-manager/pom.xml
new file mode 100644
index 0000000..e8b967a
--- /dev/null
+++ b/taverna-credential-manager/pom.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+    <groupId>org.apache.taverna.engine</groupId>
+    <artifactId>taverna-engine</artifactId>
+    <version>3.1.0-incubating-SNAPSHOT</version>
+	</parent>
+	<artifactId>taverna-credential-manager</artifactId>
+	<packaging>bundle</packaging>
+	<name>Apache Taverna Credential manager</name>
+	<dependencies>
+		<dependency>
+      <groupId>${project.parent.groupId}</groupId>
+	 		<artifactId>taverna-observer</artifactId>
+	 		<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.osgi</groupId>
+			<artifactId>taverna-app-configuration-api</artifactId>
+			<version>${taverna.osgi.version}</version>
+		</dependency>
+		<!-- <dependency>
+			<groupId>org.bouncycastle</groupId>
+			<artifactId>com.springsource.org.bouncycastle.jce</artifactId>
+			<version>1.39.0</version>
+		</dependency> -->
+		<dependency>
+			<groupId>org.bouncycastle</groupId>
+			<artifactId>bcprov-jdk16</artifactId>
+			<version>${bcprov.jdk16.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+      <version>${log4j.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+      <version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>commons-io</groupId>
+			<artifactId>commons-io</artifactId>
+      <version>${commons.io.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.mortbay.jetty</groupId>
+			<artifactId>jetty</artifactId>
+			<version>${jetty.version}</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/CMException.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/CMException.java b/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/CMException.java
new file mode 100644
index 0000000..a18e39b
--- /dev/null
+++ b/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/CMException.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.security.credentialmanager;
+
+/**
+ * Represents a (cryptographic or any other) exception thrown by Credential
+ * Manager.
+ * 
+ * @author Alexandra Nenadic
+ */
+public class CMException extends Exception {
+
+	private static final long serialVersionUID = 3885885604048806903L;
+
+	/**
+	 * Creates a new CMException.
+	 */
+	public CMException() {
+		super();
+	}
+
+	/**
+	 * Creates a new CMException with the specified message.
+	 */
+	public CMException(String message) {
+		super(message);
+	}
+
+	/**
+	 * Creates a new CMException with the specified message and cause.
+	 * 
+	 */
+	public CMException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+	/**
+	 * Creates a new CMException with the specified cause throwable.
+	 */
+	public CMException(Throwable cause) {
+		super(cause);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/CMNotInitialisedException.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/CMNotInitialisedException.java b/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/CMNotInitialisedException.java
new file mode 100644
index 0000000..aa978fc
--- /dev/null
+++ b/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/CMNotInitialisedException.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.security.credentialmanager;
+
+/**
+ * Represents an exception thrown by Credential Manager if an application tries
+ * to invoke certain methods on it before it has been initialised.
+ * 
+ * @author Alex Nenadic
+ */
+public class CMNotInitialisedException extends Exception {
+	private static final long serialVersionUID = 6041577726294822985L;
+
+	/**
+	 * Creates a new CMNotInitialisedException.
+	 */
+	public CMNotInitialisedException() {
+		super();
+	}
+
+	/**
+	 * Creates a new CMNotInitialisedException with the specified message.
+	 */
+	public CMNotInitialisedException(String message) {
+		super(message);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/CredentialManager.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/CredentialManager.java b/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/CredentialManager.java
new file mode 100644
index 0000000..808dd65
--- /dev/null
+++ b/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/CredentialManager.java
@@ -0,0 +1,415 @@
+/*******************************************************************************
+ * Copyright (C) 2008-2014 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.security.credentialmanager;
+
+import java.io.File;
+import java.net.Authenticator;
+import java.net.URI;
+import java.security.Key;
+import java.security.KeyStore;
+import java.security.cert.Certificate;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.net.ssl.SSLSocketFactory;
+
+import net.sf.taverna.t2.lang.observer.Observer;
+
+/**
+ * Provides a wrapper for Taverna's Keystore and Truststore and implements
+ * methods for managing user's credentials (passwords, private/proxy key pairs)
+ * and credentials of trusted services and CAs' (i.e. their public key
+ * certificates).
+ * <p>
+ * Keystore and Truststore are Bouncy Castle UBER-type keystores saved as files
+ * called "taverna-keystore.ubr" and "taverna-truststore.ubr" respectively. In
+ * the case of the Workbench, they are located in a directory called "security"
+ * inside the taverna.home directory. This location can be changed, e.g. in the
+ * case of the server and command line tool you may want to pass in the location
+ * of the Credential Manager's files.
+ * 
+ * @author Alex Nenadic
+ * @author Stian Soiland-Reyes
+ */
+public interface CredentialManager {
+
+	public static final String KEYSTORE_FILE_NAME = "taverna-keystore.ubr";
+	public static final String TRUSTSTORE_FILE_NAME = "taverna-truststore.ubr";
+
+	public static final String UTF_8 = "UTF-8";
+
+	public static final String PROPERTY_TRUSTSTORE = "javax.net.ssl.trustStore";
+	public static final String PROPERTY_TRUSTSTORE_PASSWORD = "javax.net.ssl.trustStorePassword";
+	public static final String PROPERTY_KEYSTORE = "javax.net.ssl.keyStore";
+	public static final String PROPERTY_KEYSTORE_PASSWORD = "javax.net.ssl.keyStorePassword";
+	public static final String PROPERTY_KEYSTORE_TYPE = "javax.net.ssl.keyStoreType";
+	public static final String PROPERTY_KEYSTORE_PROVIDER = "javax.net.ssl.keyStoreProvider";
+	public static final String PROPERTY_TRUSTSTORE_TYPE = "javax.net.ssl.trustStoreType";
+	public static final String PROPERTY_TRUSTSTORE_PROVIDER = "javax.net.ssl.trustStoreProvider";
+	
+	// Existence of the file with this name in the Credential Manager folder 
+	// indicates the we have deleted the revoked certificates from some of our services -
+	// BioCatalogue, BiodiversityCatalogue, heater.
+	public static final String CERTIFICATES_REVOKED_INDICATOR_FILE_NAME = "certificates_revoked";
+
+	/*
+	 * ASCII NUL character - for separating the username from the rest of the
+	 * string when saving it in the Keystore. Seems like a good separator as it
+	 * will highly unlikely feature in a username.
+	 */
+	public static final char USERNAME_AND_PASSWORD_SEPARATOR_CHARACTER = '\u0000';
+
+	/*
+	 * Constants denoting which of the two Credential Manager's keystores
+	 * (Keystore or Truststore) we are currently performing an operation on (in
+	 * cases when the same operation can be done on both).
+	 */
+	public static enum KeystoreType {
+		KEYSTORE, TRUSTSTORE
+	};
+
+	/*
+	 * Existence of this file in the Credential Manager folder indicates the
+	 * user has set the master password so do not use the default password
+	 */
+	public static final String USER_SET_MASTER_PASSWORD_INDICATOR_FILE_NAME = "user_set_master_password";
+
+	/*
+	 * Default password for Truststore - needed as the Truststore needs to be
+	 * populated before the Workbench starts up to initiate the SSLSocketFactory
+	 * and to avoid popping up a dialog to ask the user for it.
+	 */
+	// private static final String TRUSTSTORE_PASSWORD = "Tu/Ap%2_$dJt6*+Rca9v";
+
+	/**
+	 * Set the directory where Credential Manager's Keystore and Truststore
+	 * files will be read from. If this method is not used, the directory will
+	 * default to <TAVERNA_HOME>/security somewhere in user's home directory.
+	 * 
+	 * If you want to use this method to change the location of Credential
+	 * Manager's configuration directory then make sure you call it before any
+	 * other method on Credential Manager.
+	 * 
+	 * @param credentialManagerDirectory
+	 * @throws CMException
+	 */
+	void setConfigurationDirectoryPath(File credentialManagerDirectory)
+			throws CMException;
+
+	/**
+	 * Checks if the Keystore contains a username and password for the given
+	 * service URI.
+	 */
+	boolean hasUsernamePasswordForService(URI serviceURI) throws CMException;
+
+	/**
+	 * Get a username and password pair for the given service's URI, or null if
+	 * it does not exit.
+	 * <p>
+	 * If the username and password are not available in the Keystore, it will
+	 * invoke implementations of the {@link ServiceUsernameAndPasswordProvider}
+	 * interface asking the user (typically through the UI) or resolving
+	 * hard-coded credentials.
+	 * <p>
+	 * If the parameter <code>useURIPathRecursion</code> is true, then the
+	 * Credential Manager will also attempt to look for stored credentials for
+	 * each of the parent fragments of the URI.
+	 * 
+	 * @param serviceURI
+	 *            The URI of the service for which we are providing the username
+	 *            and password
+	 * 
+	 * @param useURIPathRecursion
+	 *            Whether to look for any username and passwords stored in the
+	 *            Keystore for the parent fragments of the service URI (for
+	 *            example, we are looking for the credentials for service
+	 *            http://somehost/some-fragment but we already have credentials
+	 *            stored for http://somehost which can be reused)
+	 * 
+	 * @param requestingMessage
+	 *            The message to be presented to the user when asking for the
+	 *            username and password, normally useful for UI providers that
+	 *            pop up dialogs, can be ignored otherwise
+	 * 
+	 * @return username and password pair for the given service
+	 * 
+	 * @throws CMException
+	 *             if anything goes wrong during Keystore lookup, etc.
+	 */
+	UsernamePassword getUsernameAndPasswordForService(URI serviceURI,
+			boolean useURIPathRecursion, String requestingMessage)
+			throws CMException;
+
+	/**
+	 * Insert a username and password pair for the given service URI in the
+	 * Keystore.
+	 * <p>
+	 * Effectively, this method inserts a new secret key entry in the Keystore,
+	 * where key contains <USERNAME>"\000"<PASSWORD> string, i.e. password is
+	 * prepended with the username and separated by a \000 character (which
+	 * hopefully will not appear in the username).
+	 * <p>
+	 * Username and password string is saved in the Keystore as byte array using
+	 * SecretKeySpec (which constructs a secret key from the given byte array
+	 * but does not check if the given bytes indeed specify a secret key of the
+	 * specified algorithm).
+	 * <p>
+	 * An alias used to identify the username and password entry is constructed
+	 * as "password#"<SERVICE_URL> using the service URL this username/password
+	 * pair is to be used for.
+	 * 
+	 * @param usernamePassword
+	 *            The {@link UsernamePassword} to store
+	 * @param serviceURI
+	 *            The (possibly normalized) URI to store the credentials under
+	 * @return TODO
+	 * @throws CMException
+	 *             If the credentials could not be stored
+	 * 
+	 * @return the alias under which this username and password entry was saved
+	 *         in the Keystore
+	 */
+	String addUsernameAndPasswordForService(UsernamePassword usernamePassword,
+			URI serviceURI) throws CMException;
+
+	/**
+	 * Delete a username and password pair for the given service URI from the
+	 * Keystore.
+	 */
+	void deleteUsernameAndPasswordForService(URI serviceURI) throws CMException;
+
+	/**
+	 * Checks if the Keystore contains the given key pair entry (private key and
+	 * its corresponding public key certificate chain).
+	 */
+	public boolean hasKeyPair(Key privateKey, Certificate[] certs)
+			throws CMException;
+
+	/**
+	 * Insert a new key entry containing private key and the corresponding
+	 * public key certificate chain in the Keystore.
+	 * 
+	 * An alias used to identify the keypair entry is constructed as:
+	 * "keypair#"<CERT_SUBJECT_COMMON_NAME>"#"<CERT_ISSUER_COMMON_NAME>"#"<
+	 * CERT_SERIAL_NUMBER>
+	 * 
+	 * @return the alias under which this key entry was saved in the Keystore
+	 */
+	String addKeyPair(Key privateKey, Certificate[] certs) throws CMException;
+
+	/**
+	 * Delete a key pair entry from the Keystore given its alias.
+	 */
+	void deleteKeyPair(String alias) throws CMException;
+
+	/**
+	 * Delete a key pair entry from the Keystore given its private and public
+	 * key parts.
+	 */
+	void deleteKeyPair(Key privateKey, Certificate[] certs) throws CMException;
+
+	/**
+	 * Create a Keystore alias that would be used for adding the given key pair
+	 * (private and public key) entry to the Keystore. The alias is cretaed as
+	 * "keypair#"<CERT_SUBJECT_COMMON_NAME>"#"<CERT_ISSUER_COMMON_NAME>"#"<
+	 * CERT_SERIAL_NUMBER>
+	 * 
+	 * @param privateKey
+	 *            private key
+	 * @param certs
+	 *            public key's certificate chain
+	 * @return
+	 */
+	String createKeyPairAlias(Key privateKey, Certificate certs[]);
+
+	/**
+	 * Export a key entry containing private key and public key certificate
+	 * chain from the Keystore to a PKCS #12 file.
+	 */
+	void exportKeyPair(String alias, File exportFile, String pkcs12Password)
+			throws CMException;
+
+	/**
+	 * Get certificate entry from the Keystore or Truststore. If the given alias
+	 * name identifies a trusted certificate entry, the certificate associated
+	 * with that entry is returned from the Truststore. If the given alias name
+	 * identifies a key pair entry, the first element of the certificate chain
+	 * of that entry is returned from the Keystore.
+	 */
+	Certificate getCertificate(KeystoreType ksType, String alias)
+			throws CMException;
+
+	/**
+	 * Get certificate chain for the key pair entry from the Keystore given its
+	 * alias.
+	 * <p>
+	 * This method works for the Keystore only as the Truststore does not
+	 * contain key pair entries, but trusted certificate entries only.
+	 */
+	Certificate[] getKeyPairsCertificateChain(String alias) throws CMException;
+
+	/**
+	 * Get the private key part of a key pair entry from the Keystore given its
+	 * alias.
+	 * <p>
+	 * This method works for the Keystore only as the Truststore does not
+	 * contain key pair entries, but trusted certificate entries only.
+	 */
+	Key getKeyPairsPrivateKey(String alias) throws CMException;
+
+	/**
+	 * Checks if the Truststore contains the given public key certificate.
+	 */
+	boolean hasTrustedCertificate(Certificate cert) throws CMException;
+
+	/**
+	 * Insert a trusted certificate entry in the Truststore with an alias
+	 * constructed as:
+	 * 
+	 * "trustedcert#<CERT_SUBJECT_COMMON_NAME>"#"<CERT_ISSUER_COMMON_NAME>"#
+	 * "<CERT_SERIAL_NUMBER>
+	 * 
+	 * @return the alias under which this trusted certificate entry was saved in
+	 *         the Keystore
+	 */
+	String addTrustedCertificate(X509Certificate cert) throws CMException;
+
+	/**
+	 * Delete a trusted certificate entry from the Truststore given its alias.
+	 */
+	void deleteTrustedCertificate(String alias) throws CMException;
+
+	/**
+	 * Delete a trusted certificate entry from the Truststore given the
+	 * certificate.
+	 */
+	void deleteTrustedCertificate(X509Certificate cert) throws CMException;
+
+	/**
+	 * Create a Truststore alias that would be used for adding the given trusted
+	 * X509 certificate to the Truststore. The alias is cretaed as
+	 * "trustedcert#"<CERT_SUBJECT_COMMON_NAME>"#"<CERT_ISSUER_COMMON_NAME>"#"<
+	 * CERT_SERIAL_NUMBER>
+	 * 
+	 * @param cert
+	 *            certificate to generate the alias for
+	 * @return the alias for the given certificate
+	 */
+	String createTrustedCertificateAlias(X509Certificate cert);
+
+	/**
+	 * Check if the given alias identifies a key entry in the Keystore.
+	 */
+	boolean isKeyEntry(String alias) throws CMException;
+
+	/**
+	 * Check if the Keystore/Truststore contains an entry with the given alias.
+	 */
+	boolean hasEntryWithAlias(KeystoreType ksType, String alias)
+			throws CMException;
+
+	/**
+	 * Get all the aliases from the Keystore/Truststore or null if there was
+	 * some error while accessing it.
+	 */
+	ArrayList<String> getAliases(KeystoreType ksType) throws CMException;
+
+	/**
+	 * Get service URIs associated with all username/password pairs currently in
+	 * the Keystore.
+	 * 
+	 * @see #hasUsernamePasswordForService(URI)
+	 */
+	List<URI> getServiceURIsForAllUsernameAndPasswordPairs() throws CMException;
+
+	/**
+	 * Load a PKCS12-type keystore from a file using the supplied password.
+	 */
+	KeyStore loadPKCS12Keystore(File pkcs12File, String pkcs12Password)
+			throws CMException;
+
+	/**
+	 * Add an observer of the changes to the Keystore or Truststore.
+	 */
+	void addObserver(Observer<KeystoreChangedEvent> observer);
+
+	/**
+	 * Get all current observers of changes to the Keystore or Truststore.
+	 */
+	List<Observer<KeystoreChangedEvent>> getObservers();
+
+	/**
+	 * Remove an observer of the changes to the Keystore or Truststore.
+	 */
+	void removeObserver(Observer<KeystoreChangedEvent> observer);
+
+	/**
+	 * Checks if Keystore's master password is the same as the one provided.
+	 * 
+	 * @param password
+	 * @return
+	 * @throws CMException
+	 */
+	boolean confirmMasterPassword(String password) throws CMException;
+
+	/**
+	 * Change the Keystore and the Truststore's master password to the one
+	 * provided. The Keystore and Truststore both use the same password.
+	 */
+	void changeMasterPassword(String newPassword) throws CMException;
+
+	/**
+	 * Reset the JVMs cache for authentication like HTTP Basic Auth.
+	 * <p>
+	 * Note that this method uses undocumented calls to
+	 * <code>sun.net.www.protocol.http.AuthCacheValue</code> which might not be
+	 * valid in virtual machines other than Sun Java 6. If these calls fail,
+	 * this method will log the error and return <code>false</code>.
+	 * 
+	 * @return <code>true</code> if the VMs cache could be reset, or
+	 *         <code>false</code> otherwise.
+	 */
+	boolean resetAuthCache();
+
+	/**
+	 * Set the default SSLContext to use Credential Manager's Keystore and
+	 * Truststore for managing SSL connections from Taverna and also set
+	 * HttpsURLConnection's default SSLSocketFactory to use the one from the
+	 * just configured SSLContext, i.e. backed by Credential Manager's Keystore
+	 * and Truststore.
+	 * 
+	 * @throws CMException
+	 */
+	void initializeSSL() throws CMException;
+
+	/**
+	 * Get Taverna's SSLSocketFactory backed by Credential Manager's Keystore
+	 * and Truststore.
+	 * 
+	 * @return
+	 * @throws CMException
+	 */
+	SSLSocketFactory getTavernaSSLSocketFactory() throws CMException;
+        
+        public Authenticator getAuthenticator();
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/DistinguishedNameParser.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/DistinguishedNameParser.java b/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/DistinguishedNameParser.java
new file mode 100644
index 0000000..eb1d171
--- /dev/null
+++ b/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/DistinguishedNameParser.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (C) 2014 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.security.credentialmanager;
+
+import java.io.File;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.security.cert.Certificate;
+import java.security.cert.X509Certificate;
+import uk.org.taverna.configuration.app.ApplicationConfiguration;
+
+/**
+ * Methods for parsing Distinguished Names and various associated utility methods.
+ * 
+ * @author Alex Nenadic
+ * @author Stian Soiland-Reyes
+ * @author Christian Brenninkmeijer
+ */
+public interface DistinguishedNameParser {
+
+    /**
+     * Parses a DN string and fills in fields with DN parts. 
+    */
+    public ParsedDistinguishedName parseDN(String DNstr);
+  
+    public String getMessageDigestAsFormattedString(byte[] certBinaryEncoding, String shA1);
+
+    /**
+     * Convert the certificate object into an X509Certificate object.
+     */
+    public X509Certificate convertCertificate(Certificate certificate) throws CMException;
+
+    public URI setUserInfoForURI(URI uri, String userinfo) throws URISyntaxException;
+
+    public URI setFragmentForURI(URI uri, String userinfo) throws URISyntaxException;
+
+    /**
+     * Get the configuration directory where the security stuff will be/is saved
+     * to.
+     */
+    public File getCredentialManagerDefaultDirectory(ApplicationConfiguration applicationConfiguration);
+
+ } 

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/JavaTruststorePasswordProvider.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/JavaTruststorePasswordProvider.java b/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/JavaTruststorePasswordProvider.java
new file mode 100644
index 0000000..7da73ca
--- /dev/null
+++ b/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/JavaTruststorePasswordProvider.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (C) 2008-2010 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.security.credentialmanager;
+
+/**
+ * Defines an interface for providing a password for Java's default truststore
+ * located in JAVA_HOME/lib/security/cacerts.
+ * <p>
+ * Used by Credential Manager when trying to copy the trusted certificates from the
+ * Java's default truststore into the Credential Manageger's own Truststore. It will
+ * first try the default Java passwords and then if they do not work - it will loop 
+ * through all the providers until one can provide the password. If none
+ * can, the certificates will not be copied. 
+ * <p>
+ * A typical implementation of this class would pop up a dialog 
+ * and ask the user for the password. Such providers should check
+ * {@link GraphicsEnvironment#isHeadless()} before returning to avoid 
+ * attempts to pop up dialogues on server/headless installations.
+ * <p>
+ * It is safe to return <code>null</code> if the provider does not have an
+ * opinion.
+ * 
+ * @see CredentialManagerOld
+ * @author Alex Nenadic
+ * @author Stian Soiland-Reyes
+ * 
+ */
+public interface JavaTruststorePasswordProvider {
+
+	/**
+	 * Get the Java truststore password.
+	 * <p>
+	 * This method will only be called if the provider returned
+	 * <code>true</code> from {@link #canProvideJavaTruststorePassword()}.
+	 * <p>
+	 * This method will be called when initialising the Credential Manager
+	 * for the first time, in the cases where the Java truststore password has
+	 * been changed from the VM default. The Credential Manager will need this
+	 * password to unlock the Java truststore and copy the trusted certificate
+	 * into the Credential Managers's own Truststore.
+	 * <p>
+	 * Generally only advanced users would change this password.
+	 * 
+	 * @return The Java truststore password, or <code>null</code> if not
+	 *         available (for instance if user action was cancelled).
+	 */
+	public String getJavaTruststorePassword();
+	
+	/**
+	 * Set the Java truststore password.
+	 * @param password to set
+	 */
+	public void setJavaTruststorePassword(String password);
+	
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/KeystoreChangedEvent.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/KeystoreChangedEvent.java b/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/KeystoreChangedEvent.java
new file mode 100644
index 0000000..de20a5a
--- /dev/null
+++ b/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/KeystoreChangedEvent.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.security.credentialmanager;
+
+import net.sf.taverna.t2.security.credentialmanager.CredentialManager.KeystoreType;
+
+/**
+ * An event given to {@link CredentialManagerOld} observers registered using
+ * {@link Observable#addObserver(net.sf.taverna.t2.lang.observer.Observer)} to
+ * let them know the Keystore or Truststore have been changed.
+ * 
+ * @author Alex Nenadic
+ */
+public class KeystoreChangedEvent {
+	// Whether the change is on the Keystore or the Truststore
+	public final KeystoreType keystoreType;
+
+	public KeystoreChangedEvent(KeystoreType keystoreType) {
+		this.keystoreType = keystoreType;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/MasterPasswordProvider.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/MasterPasswordProvider.java b/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/MasterPasswordProvider.java
new file mode 100644
index 0000000..83aaf7f
--- /dev/null
+++ b/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/MasterPasswordProvider.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (C) 2008-2010 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.security.credentialmanager;
+
+import java.util.Comparator;
+
+/**
+ * Defines an interface for providing a master password for the Credential
+ * Manager. This master password is used to encrypt/decrypt the Credential
+ * Manager's Keystore/Truststore.
+ * <p>
+ * A typical implementation of this class would pop up a dialog to ask the user
+ * for the master password. Such providers should check
+ * {@link GraphicsEnvironment#isHeadless()} before returning, to avoid attempts
+ * to pop up dialogues on server/headless installations.
+ * <p>
+ * Another example may be to read the master password from a file or from
+ * command line parameters.
+ * 
+ * @see CredentialManager
+ * @author Alex Nenadic
+ * @author Stian Soiland-Reyes
+ */
+public interface MasterPasswordProvider {
+
+	/**
+	 * Get the master password for the Credential Manager.
+	 * <p>
+	 * This method will only be called if the provider returned
+	 * <code>true</code> from {@link #canProvideMasterPassword()}.
+	 * <p>
+	 * If the parameter <code>firstTime</code> is <code>true</code>, this is a
+	 * request for <em>setting</em> the master password, as the Keystore and
+	 * Truststore have not been created yet.
+	 * 
+	 * @see #canProvideMasterPassword()
+	 * @param firstTime
+	 *            <code>true</code> if this is the first time the keystore is
+	 *            accessed, in which case the returned password will be used to
+	 *            encrypt the keystore. If <code>false</code>, the returned
+	 *            password will be used to decrypt (unlock) the keystore.
+	 * @return The master password, or <code>null</code> if not available (user
+	 *         cancelled, etc.)
+	 */
+	public String getMasterPassword(boolean firstTime);
+
+	/**
+	 * Set the master password.
+	 * 
+	 * @param password
+	 *            to set
+	 */
+	public void setMasterPassword(String password);
+
+	/**
+	 * Get the priority of this provider.
+	 * <p>
+	 * The providers with highest priority will be asked first, lower-priority
+	 * providers will be asked only if the higher ones either return
+	 * <code>false</code> on the canProvideMasterPassword() method, or return
+	 * <code>null</code> on the corresponding actual request.
+	 * <p>
+	 * It is undetermined who will be asked first if providers have the same
+	 * priority.
+	 * <p>
+	 * A typical priority for UI providers that pop up a dialog to as the user
+	 * could be <code>100</code>, allowing server-side providers to override
+	 * with priorities like <code>500</code>, or fall-back providers (say by
+	 * reading system properties) to have a priority of <code>10</code>.
+	 * 
+	 * @return The priority of this provider. Higher number means higher
+	 *         priority.
+	 */
+	public int getProviderPriority();
+
+	/**
+	 * Set the provider's priority that determines the order in which various
+	 * master password providers will be invoked.
+	 * 
+	 * @param priority
+	 *            provider's priority
+	 */
+	// public void setProviderPriority(int priority);
+
+	public class ProviderComparator implements
+			Comparator<MasterPasswordProvider> {
+		@Override
+		public int compare(MasterPasswordProvider provider1,
+				MasterPasswordProvider provider2) {
+			return provider1.getProviderPriority()
+					- provider2.getProviderPriority();
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/ParsedDistinguishedName.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/ParsedDistinguishedName.java b/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/ParsedDistinguishedName.java
new file mode 100644
index 0000000..f484493
--- /dev/null
+++ b/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/ParsedDistinguishedName.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (C) 2014 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.security.credentialmanager;
+
+
+/**
+ * A parsed Distinguished Name with getters for parts.
+ * 
+ * @author Alex Nenadic
+ * @author Stian Soiland-Reyes
+ * @author Christian Brenninkmeijer
+ */
+public interface ParsedDistinguishedName {
+    
+        /**
+         * 
+         * @return The common name
+         */
+	public String getCN();
+
+        /**
+         * 
+         * @return The Email address
+         */
+	public String getEmailAddress();
+
+        /**
+         * 
+         * @return The organizational unit name
+         */
+	public String getOU();
+        
+        /**
+         * 
+         * @return The organization name
+         */
+	public String getO();
+
+        /**
+         * 
+         * @return The locality name 
+         */
+	public String getL();
+
+        /**
+         * 
+         * @return The state or province name
+         */
+	public String getST();
+
+        /**
+         * 
+         * @return The country name 
+         */
+	public String getC();
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/ServiceUsernameAndPasswordProvider.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/ServiceUsernameAndPasswordProvider.java b/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/ServiceUsernameAndPasswordProvider.java
new file mode 100644
index 0000000..5a0835a
--- /dev/null
+++ b/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/ServiceUsernameAndPasswordProvider.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (C) 2008-2010 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.security.credentialmanager;
+
+import java.net.URI;
+
+/**
+ * Defines an interface for providing a username and password for a service to
+ * be invoked as part of a workflow run.
+ * <p>
+ * Used by Credential Manager when looking up the username and password for the
+ * service in its Keystore - if it cannot find anything it will loop through all
+ * providers until one can provide them. If none can, the service invocation
+ * will (most probably) fail.
+ * <p>
+ * A typical implementation of this class would pop up a dialog and ask the user
+ * for the password. Such providers should check
+ * {@link GraphicsEnvironment#isHeadless()} before returning to avoid attempts
+ * to pop up dialogues on server/headless installations.
+ * 
+ * @see CredentialManager
+ * @author Alex Nenadic
+ * @author Stian Soiland-Reyes
+ */
+public interface ServiceUsernameAndPasswordProvider {
+	/**
+	 * Get the username and password pair for the given service URI.
+	 * 
+	 * @param serviceURI
+	 *            The service we are looking username and password for
+	 * @param requestMessage
+	 *            The message to be presented to the user when asking for the
+	 *            username and password, normally useful for UI providers that
+	 *            pop up dialogs, can be ignored otherwise
+	 * @return the username and password pair for the given service URI, or
+	 *         <tt>null</tt> if the provider does not know for this URI.
+	 */
+	UsernamePassword getServiceUsernameAndPassword(URI serviceURI,
+			String requestMessage);
+
+	/**
+	 * Set the username and password pair for the given service URI.
+	 */
+	void setServiceUsernameAndPassword(URI serviceURI,
+			UsernamePassword usernamePassword);
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/TrustConfirmationProvider.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/TrustConfirmationProvider.java b/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/TrustConfirmationProvider.java
new file mode 100644
index 0000000..ca6af82
--- /dev/null
+++ b/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/TrustConfirmationProvider.java
@@ -0,0 +1,56 @@
+package net.sf.taverna.t2.security.credentialmanager;
+
+import java.security.cert.X509Certificate;
+
+/**
+ * Defines an interface for providing ways to confirm/decline trust in a given
+ * service (i.e. its public key certificate).
+ * <p>
+ * Used by Credential Manager when looking up the username and password for the
+ * service in its Keystore - if it cannot find anything it will loop through all
+ * providers until one can provide them. If none can, the service invocation
+ * will (most probably) fail.
+ * <p>
+ * A typical implementation of this class would pop up a dialog and ask the user
+ * for the password. Such providers should check
+ * {@link GraphicsEnvironment#isHeadless()} before returning to avoid attempts
+ * to pop up dialogues on server/headless installations.
+ * <p>
+ * It is safe to return <code>null</code> if the provider does not have an
+ * opinion.
+ * 
+ * @see CredentialManager
+ * @author Alex Nenadic
+ * @author Stian Soiland-Reyes
+ * 
+ */
+public interface TrustConfirmationProvider {
+	/**
+	 * If the given public key certificate should be trusted or not.
+	 * <p>
+	 * This method is called when a SSL connection is attempted to a service
+	 * which certificate could not be confirmed using the Credential Manager's
+	 * Truststore (i.e. it could not be found there).
+	 * <p>
+	 * A typical implementation of this class would pop up a dialog and ask the
+	 * user if they want to trust the service. Such providers should check
+	 * {@link GraphicsEnvironment#isHeadless()} before returning to avoid
+	 * attempts to pop up dialogues on server/headless installations.
+	 * <p>
+	 * The provider can return <code>null</code> if it does not have an opinion
+	 * whether the certificate should be trusted or not (in which case other
+	 * providers will be asked), or an instance of {@link TrustConfirmation}
+	 * confirming or denying if the certificate is to be trusted.
+	 * <p>
+	 * If the provider returns <code>true</code>, the Credential Manager will
+	 * also save the first certificate of the certificate chain (chain[0]) in
+	 * its Truststore so the user will not be asked next time.
+	 * 
+	 * @param chain
+	 *            X509 certificate chain to confirm whether it is trusted or not
+	 * @return <code>null</code> if the provider does not have an opinion,
+	 *         <code>true</code> if certificate is to be trusted and
+	 *         <code>false</code> if not.
+	 */
+	public Boolean shouldTrustCertificate(X509Certificate[] chain);
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/UsernamePassword.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/UsernamePassword.java b/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/UsernamePassword.java
new file mode 100644
index 0000000..a5ee1a7
--- /dev/null
+++ b/taverna-credential-manager/src/main/java/net/sf/taverna/t2/security/credentialmanager/UsernamePassword.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.security.credentialmanager;
+
+import java.util.Arrays;
+
+/**
+ * 
+ * @author Stian Soiland-Reyes
+ */
+public class UsernamePassword {
+	private char[] password;
+	private boolean shouldSave = false;
+	private String username;
+
+	@Override
+	public UsernamePassword clone() {
+		UsernamePassword up = new UsernamePassword();
+		up.setUsername(getUsername());
+		up.setPassword(getPassword().clone());
+		up.setShouldSave(isShouldSave());
+		return up;
+	}
+
+	public UsernamePassword() {
+	}
+
+	public UsernamePassword(String username, String password) {
+		this.username = username;
+		this.password = password.toCharArray();
+	}
+
+	public char[] getPassword() {
+		return password;
+	}
+
+	public String getPasswordAsString() {
+		return String.valueOf(password);
+	}
+
+	public String getUsername() {
+		return username;
+	}
+
+	public boolean isShouldSave() {
+		return shouldSave;
+	}
+
+	public void resetPassword() {
+		if (this.password == null)
+			return;
+		Arrays.fill(this.password, '\u0000');
+	}
+
+	public void setPassword(char[] password) {
+		resetPassword();
+		this.password = password;
+	}
+
+	public void setShouldSave(boolean shouldSave) {
+		this.shouldSave = shouldSave;
+	}
+
+	public void setUsername(String username) {
+		this.username = username;
+	}
+
+	@Override
+	protected void finalize() throws Throwable {
+		resetPassword();
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager/src/main/resources/META-INF/services/net.sf.taverna.t2.security.credentialmanager.CredentialProviderSPI
----------------------------------------------------------------------
diff --git a/taverna-credential-manager/src/main/resources/META-INF/services/net.sf.taverna.t2.security.credentialmanager.CredentialProviderSPI b/taverna-credential-manager/src/main/resources/META-INF/services/net.sf.taverna.t2.security.credentialmanager.CredentialProviderSPI
new file mode 100644
index 0000000..9ff33f1
--- /dev/null
+++ b/taverna-credential-manager/src/main/resources/META-INF/services/net.sf.taverna.t2.security.credentialmanager.CredentialProviderSPI
@@ -0,0 +1 @@
+net.sf.taverna.t2.security.credentialmanager.DefaultMasterPasswordProvider
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager/src/test/resources/html/test.html
----------------------------------------------------------------------
diff --git a/taverna-credential-manager/src/test/resources/html/test.html b/taverna-credential-manager/src/test/resources/html/test.html
new file mode 100644
index 0000000..5e45661
--- /dev/null
+++ b/taverna-credential-manager/src/test/resources/html/test.html
@@ -0,0 +1,5 @@
+<html>
+	<body>
+		Hello!
+	</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager/src/test/resources/realm.properties
----------------------------------------------------------------------
diff --git a/taverna-credential-manager/src/test/resources/realm.properties b/taverna-credential-manager/src/test/resources/realm.properties
new file mode 100644
index 0000000..2561568
--- /dev/null
+++ b/taverna-credential-manager/src/test/resources/realm.properties
@@ -0,0 +1 @@
+test: test, user

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-database-configuration-api/.project
----------------------------------------------------------------------
diff --git a/taverna-database-configuration-api/.project b/taverna-database-configuration-api/.project
new file mode 100644
index 0000000..dfcb96a
--- /dev/null
+++ b/taverna-database-configuration-api/.project
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>taverna-database-configuration-api</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.m2e.core.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.m2e.core.maven2Nature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-database-configuration-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-database-configuration-api/pom.xml b/taverna-database-configuration-api/pom.xml
new file mode 100644
index 0000000..01d000f
--- /dev/null
+++ b/taverna-database-configuration-api/pom.xml
@@ -0,0 +1,18 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+    <parent>
+			<groupId>org.apache.taverna.engine</groupId>
+			<artifactId>taverna-engine</artifactId>
+			<version>3.1.0-incubating-SNAPSHOT</version>
+    </parent>
+	<artifactId>taverna-database-configuration-api</artifactId>
+	<packaging>bundle</packaging>
+	<name>Apache Taverna Database Configuration API</name>
+	<dependencies>
+		<dependency>
+			<groupId>org.apache.taverna.osgi</groupId>
+			<artifactId>taverna-configuration-api</artifactId>
+			<version>${taverna.osgi.version}</version>
+		</dependency>
+	</dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-database-configuration-api/src/main/java/uk/org/taverna/configuration/database/DatabaseConfiguration.java
----------------------------------------------------------------------
diff --git a/taverna-database-configuration-api/src/main/java/uk/org/taverna/configuration/database/DatabaseConfiguration.java b/taverna-database-configuration-api/src/main/java/uk/org/taverna/configuration/database/DatabaseConfiguration.java
new file mode 100644
index 0000000..ba3ebd2
--- /dev/null
+++ b/taverna-database-configuration-api/src/main/java/uk/org/taverna/configuration/database/DatabaseConfiguration.java
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (C) 2012 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.configuration.database;
+
+import java.util.Map;
+
+import uk.org.taverna.configuration.Configurable;
+
+/**
+ *
+ *
+ * @author David Withers
+ */
+public interface DatabaseConfiguration extends Configurable {
+
+	public static final String IN_MEMORY = "in_memory";
+	public static final String ENABLE_PROVENANCE = "provenance";
+	public static final String CONNECTOR_TYPE = "connector";
+	public static final String PORT = "port";
+	public static final String CURRENT_PORT = "current_port";
+	public static final String REFERENCE_SERVICE_CONTEXT = "referenceService.context";
+	public static final String IN_MEMORY_CONTEXT = "inMemoryReferenceServiceContext.xml";
+	public static final String HIBERNATE_CONTEXT = "hibernateReferenceServiceContext.xml";
+	public static final String HIBERNATE_DIALECT = "dialect";
+	public static final String START_INTERNAL_DERBY = "start_derby";
+	public static final String POOL_MAX_ACTIVE = "pool_max_active";
+	public static final String POOL_MIN_IDLE = "pool_min_idle";
+	public static final String POOL_MAX_IDLE = "pool_max_idle";
+	public static final String DRIVER_CLASS_NAME = "driver";
+	public static final String JDBC_URI = "jdbcuri";
+	public static final String USERNAME = "username";
+	public static final String PASSWORD = "password";
+	public static final String EXPOSE_DATANATURE = "taverna.exposedatanature";
+	// FIXME: these should me just mysql & derby - but build & dependency issues
+	// is causing the provenance to expect these values:
+	public static final String CONNECTOR_MYSQL = "mysql";
+	public static final String CONNECTOR_DERBY = "derby";
+	public static final String JNDI_NAME = "jdbc/taverna";
+
+	public boolean isAutoSave();
+
+	public void enableAutoSave();
+
+	public void disableAutoSave();
+
+	public boolean isInMemory();
+
+	public void setInMemory(boolean value);
+
+	public boolean isExposeDatanature();
+
+	public void setExposeDatanature(boolean exposeDatanature);
+
+	public String getDatabaseContext();
+
+	public void setPort(int port);
+
+	public void setPort(String port);
+
+	public void setDriverClassName(String driverClassName);
+
+	public String getDriverClassName();
+
+	public boolean isProvenanceEnabled();
+
+	public void setProvenanceEnabled(boolean value);
+
+	public void setStartInternalDerbyServer(boolean value);
+
+	public boolean getStartInternalDerbyServer();
+
+	public int getPort();
+
+	public void setCurrentPort(int port);
+
+	public int getCurrentPort();
+
+	public int getPoolMaxActive();
+
+	public int getPoolMinIdle();
+
+	public int getPoolMaxIdle();
+
+	public String getCategory();
+
+	public Map<String, String> getDefaultPropertyMap();
+
+	public String getHibernateDialect();
+
+	public String getDisplayName();
+
+	public String getFilePrefix();
+
+	public String getUUID();
+
+	public String getConnectorType();
+
+	public String getJDBCUri();
+
+	public void setJDBCUri(String uri);
+
+	public String getUsername();
+
+	public String getPassword();
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-database-configuration-api/src/main/java/uk/org/taverna/configuration/database/DatabaseManager.java
----------------------------------------------------------------------
diff --git a/taverna-database-configuration-api/src/main/java/uk/org/taverna/configuration/database/DatabaseManager.java b/taverna-database-configuration-api/src/main/java/uk/org/taverna/configuration/database/DatabaseManager.java
new file mode 100644
index 0000000..c7e6641
--- /dev/null
+++ b/taverna-database-configuration-api/src/main/java/uk/org/taverna/configuration/database/DatabaseManager.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (C) 2012 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.configuration.database;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import javax.sql.DataSource;
+
+/**
+ *
+ *
+ * @author David Withers
+ */
+public interface DatabaseManager {
+
+	public Connection getConnection() throws SQLException;
+
+	public DataSource getDataSource();
+
+	public void startDerbyNetworkServer();
+
+	public void stopDerbyNetworkServer();
+
+	public boolean isRunning();
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-database-configuration-impl/.project
----------------------------------------------------------------------
diff --git a/taverna-database-configuration-impl/.project b/taverna-database-configuration-impl/.project
new file mode 100644
index 0000000..bac6198
--- /dev/null
+++ b/taverna-database-configuration-impl/.project
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>taverna-database-configuration-impl</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.m2e.core.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.m2e.core.maven2Nature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-database-configuration-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-database-configuration-impl/pom.xml b/taverna-database-configuration-impl/pom.xml
new file mode 100644
index 0000000..07bd9b7
--- /dev/null
+++ b/taverna-database-configuration-impl/pom.xml
@@ -0,0 +1,78 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.taverna.engine</groupId>
+		<artifactId>taverna-engine</artifactId>
+		<version>3.1.0-incubating-SNAPSHOT</version>
+	</parent>
+	<artifactId>taverna-database-configuration-impl</artifactId>
+	<packaging>bundle</packaging>
+	<name>Apache Taverna Database Configuration implementation</name>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-bundle-plugin</artifactId>
+				<extensions>true</extensions>
+				<configuration>
+					<instructions>
+						<Import-Package>
+							uk.org.taverna.configuration.database;provide:=true,
+							org.apache.derby.jdbc, *
+						</Import-Package>
+					</instructions>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+	<dependencies>
+		<dependency>
+			<groupId>${project.groupId}</groupId>
+			<artifactId>taverna-database-configuration-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.osgi</groupId>
+			<artifactId>taverna-app-configuration-api</artifactId>
+			<version>${taverna.osgi.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.osgi</groupId>
+			<artifactId>taverna-configuration-api</artifactId>
+			<version>${taverna.osgi.version}</version>
+		</dependency>
+
+		<dependency>
+ 			<groupId>org.apache.derby</groupId>
+			<artifactId>com.springsource.org.apache.derby</artifactId>
+ 			<version>${derby.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.apache.derby</groupId>
+			<artifactId>com.springsource.org.apache.derby.client</artifactId>
+ 			<version>${derbyclient.version}</version>
+ 		</dependency>
+ 		<dependency>
+ 			<groupId>org.apache.derby</groupId>
+			<artifactId>com.springsource.org.apache.derby.drda</artifactId>
+ 			<version>${derbynet.version}</version>
+ 		</dependency>
+    <dependency>
+      <groupId>commons-dbcp</groupId>
+      <artifactId>commons-dbcp</artifactId>
+      <version>${commons.dbcp.version}</version>
+    </dependency>
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+			<version>${log4j.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+</project>


[49/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-test-utils/src/main/resources/inMemoryActivityTestsContext.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-test-utils/src/main/resources/inMemoryActivityTestsContext.xml b/taverna-activity-test-utils/src/main/resources/inMemoryActivityTestsContext.xml
new file mode 100644
index 0000000..5268c9d
--- /dev/null
+++ b/taverna-activity-test-utils/src/main/resources/inMemoryActivityTestsContext.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- Context providing a full ReferenceService -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:raven="http://taverna.sf.net/schema/artifact-support"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans 
+	http://www.springframework.org/schema/beans/spring-beans-2.5.xsd 
+	http://taverna.sf.net/schema/artifact-support 
+	http://taverna.sf.net/schema/artifact-support/artifact-support.xsd">
+
+	<import resource="context-parts/raven_local.xml" />
+	<!--
+	<import resource="context-parts/hibernateprops_derby.xml" />
+	<import resource="context-parts/dao_hibernate.xml" />
+	-->
+	<import resource="context-parts/dao_inmemory.xml" />
+	<import resource="context-parts/componentservices.xml" />
+	<import resource="context-parts/referenceservice.xml" />
+
+	<!-- Load core extensions, needed for String to reference support -->
+	<bean
+		raven:artifact="net.sf.taverna.t2.core:reference-core-extensions:2.0.1-SNAPSHOT"
+		raven:repository="raven.repository"
+		class="net.sf.taverna.t2.reference.impl.core.LoadCoreExtensions">
+	</bean>
+
+
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-capability-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-capability-api/pom.xml b/taverna-capability-api/pom.xml
new file mode 100644
index 0000000..c0bfae5
--- /dev/null
+++ b/taverna-capability-api/pom.xml
@@ -0,0 +1,28 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.taverna.engine</groupId>
+		<artifactId>taverna-engine</artifactId>
+		<version>3.1.0-incubating-SNAPSHOT</version>
+	</parent>
+	<artifactId>taverna-capability-api</artifactId>
+	<packaging>bundle</packaging>
+	<name>Apache Taverna Platform Capability API</name>
+	<dependencies>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-workflowmodel-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.language</groupId>
+			<artifactId>taverna-scufl2-api</artifactId>
+			<version>${taverna.language.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-databind</artifactId>
+			<version>${jackson.version}</version>
+		</dependency>
+	</dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ActivityConfigurationException.java
----------------------------------------------------------------------
diff --git a/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ActivityConfigurationException.java b/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ActivityConfigurationException.java
new file mode 100644
index 0000000..c9833e9
--- /dev/null
+++ b/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ActivityConfigurationException.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.capability.api;
+
+/**
+ * Thrown when an activity's configuration is incorrect.
+ * 
+ * @author David Withers
+ */
+public class ActivityConfigurationException extends ConfigurationException {
+	private static final long serialVersionUID = 3132495676192826758L;
+
+	public ActivityConfigurationException() {
+		super();
+	}
+
+	public ActivityConfigurationException(String message) {
+		super(message);
+	}
+
+	public ActivityConfigurationException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+	public ActivityConfigurationException(Throwable cause) {
+		super(cause);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ActivityNotFoundException.java
----------------------------------------------------------------------
diff --git a/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ActivityNotFoundException.java b/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ActivityNotFoundException.java
new file mode 100644
index 0000000..82a6e71
--- /dev/null
+++ b/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ActivityNotFoundException.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.capability.api;
+
+/**
+ * Thrown when an activity is not found.
+ * 
+ * @author David Withers
+ */
+public class ActivityNotFoundException extends Exception {
+	private static final long serialVersionUID = 1232220199558615801L;
+
+	public ActivityNotFoundException() {
+		super();
+	}
+
+	public ActivityNotFoundException(String message) {
+		super(message);
+	}
+
+	public ActivityNotFoundException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+	public ActivityNotFoundException(Throwable cause) {
+		super(cause);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ActivityService.java
----------------------------------------------------------------------
diff --git a/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ActivityService.java b/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ActivityService.java
new file mode 100644
index 0000000..8fd1619
--- /dev/null
+++ b/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ActivityService.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.capability.api;
+
+import java.net.URI;
+import java.util.Set;
+
+import net.sf.taverna.t2.workflowmodel.processor.activity.Activity;
+import uk.org.taverna.scufl2.api.port.InputActivityPort;
+import uk.org.taverna.scufl2.api.port.OutputActivityPort;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+/**
+ * Service for discovering available activities and the properties required to
+ * configure the activities.
+ * 
+ * @author David Withers
+ */
+public interface ActivityService {
+	/**
+	 * Returns the available activity types.
+	 * 
+	 * @return the available activity types
+	 */
+	Set<URI> getActivityTypes();
+
+	/**
+	 * Returns true if and only if the activity type exists.
+	 * 
+	 * @param uri
+	 *            the activity type to check
+	 * @return whether the activity type exists
+	 */
+	boolean activityExists(URI activityType);
+
+	/**
+	 * Returns the JSON Schema for the configuration required by an activity.
+	 * 
+	 * @param activityType
+	 *            the activity type
+	 * @return the JSON Schema for the configuration required by an activity
+	 * @throws ActivityNotFoundException
+	 *             if an activity cannot be found for the specified URI
+	 * @throws ActivityConfigurationException
+	 *             if the JSON Schema cannot be created
+	 */
+	JsonNode getActivityConfigurationSchema(URI activityType)
+			throws ActivityNotFoundException, ActivityConfigurationException;
+
+	/**
+	 * Returns the input ports that the activity type requires to be present in
+	 * order to execute with the specified configuration.
+	 * <p>
+	 * If the activity does not require any input port for the configuration
+	 * then an empty set is returned.
+	 * 
+	 * @param configuration
+	 *            the activity configuration
+	 * @throws ActivityNotFoundException
+	 *             if the activity cannot be found
+	 * @throws ActivityConfigurationException
+	 *             if the activity configuration is incorrect
+	 * @return the input ports that the activity requires to be present in order
+	 *         to execute
+	 */
+	Set<InputActivityPort> getActivityInputPorts(URI activityType,
+			JsonNode configuration) throws ActivityNotFoundException,
+			ActivityConfigurationException;
+
+	/**
+	 * Returns the output ports that the activity type requires to be present in
+	 * order to execute with the specified configuration.
+	 * <p>
+	 * If the activity type does not require any output ports for the
+	 * configuration then an empty set is returned.
+	 * 
+	 * @param configuration
+	 *            the activity configuration
+	 * @throws ActivityNotFoundException
+	 *             if the activity cannot be found
+	 * @throws ActivityConfigurationException
+	 *             if the activity configuration is incorrect
+	 * @return the output ports that the activity requires to be present in
+	 *         order to execute
+	 */
+	Set<OutputActivityPort> getActivityOutputPorts(URI activityType,
+			JsonNode configuration) throws ActivityNotFoundException,
+			ActivityConfigurationException;
+
+	/**
+	 * Returns the activity for the specified activity type. If configuration is
+	 * not null the returned activity will be configured.
+	 * 
+	 * @param activityType
+	 *            the activity type
+	 * @param configuration
+	 *            the configuration for the activity, can be <code>null</code>
+	 * @return the activity for the specified activityType
+	 * @throws ActivityNotFoundException
+	 *             if an activity cannot be found for the specified activity
+	 *             type
+	 * @throws ActivityConfigurationException
+	 *             if the configuration is not valid
+	 */
+	Activity<?> createActivity(URI activityType, JsonNode configuration)
+			throws ActivityNotFoundException, ActivityConfigurationException;
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ConfigurationException.java
----------------------------------------------------------------------
diff --git a/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ConfigurationException.java b/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ConfigurationException.java
new file mode 100644
index 0000000..be0e8a5
--- /dev/null
+++ b/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ConfigurationException.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.capability.api;
+
+/**
+ * Thrown when a {@link uk.org.taverna.scufl2.api.common.Configurable
+ * Configurable} cannot be configured by a
+ * {@link uk.org.taverna.scufl2.api.configurations.Configuration Configuration}.
+ * 
+ * @author David Withers
+ */
+public class ConfigurationException extends Exception {
+	private static final long serialVersionUID = -6129960388197785712L;
+
+	public ConfigurationException() {
+		super();
+	}
+
+	public ConfigurationException(String message) {
+		super(message);
+	}
+
+	public ConfigurationException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+	public ConfigurationException(Throwable cause) {
+		super(cause);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/DispatchLayerConfigurationException.java
----------------------------------------------------------------------
diff --git a/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/DispatchLayerConfigurationException.java b/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/DispatchLayerConfigurationException.java
new file mode 100644
index 0000000..824df29
--- /dev/null
+++ b/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/DispatchLayerConfigurationException.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (C) 2011 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.capability.api;
+
+/**
+ * Thrown when a dispatch layer's configuration is incorrect.
+ * 
+ * @author David Withers
+ */
+public class DispatchLayerConfigurationException extends ConfigurationException {
+	private static final long serialVersionUID = -6180865500734235308L;
+
+	public DispatchLayerConfigurationException() {
+		super();
+	}
+
+	public DispatchLayerConfigurationException(String message) {
+		super(message);
+	}
+
+	public DispatchLayerConfigurationException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+	public DispatchLayerConfigurationException(Throwable cause) {
+		super(cause);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/DispatchLayerNotFoundException.java
----------------------------------------------------------------------
diff --git a/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/DispatchLayerNotFoundException.java b/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/DispatchLayerNotFoundException.java
new file mode 100644
index 0000000..7492b61
--- /dev/null
+++ b/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/DispatchLayerNotFoundException.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (C) 2011 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.capability.api;
+
+/**
+ * Thrown when a dispatch layer is not found.
+ * 
+ * @author David Withers
+ */
+public class DispatchLayerNotFoundException extends Exception {
+	private static final long serialVersionUID = -7227237239711803139L;
+
+	public DispatchLayerNotFoundException() {
+		super();
+	}
+
+	public DispatchLayerNotFoundException(String message) {
+		super(message);
+	}
+
+	public DispatchLayerNotFoundException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+	public DispatchLayerNotFoundException(Throwable cause) {
+		super(cause);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/DispatchLayerService.java
----------------------------------------------------------------------
diff --git a/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/DispatchLayerService.java b/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/DispatchLayerService.java
new file mode 100644
index 0000000..978b1b5
--- /dev/null
+++ b/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/DispatchLayerService.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (C) 2011 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.capability.api;
+
+import java.net.URI;
+import java.util.Set;
+
+import net.sf.taverna.t2.workflowmodel.processor.dispatch.DispatchLayer;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+/**
+ * Service for discovering available dispatch layers and the properties required
+ * to configure the layers.
+ * 
+ * @author David Withers
+ */
+public interface DispatchLayerService {
+	/**
+	 * Returns the available dispatch layer types.
+	 * 
+	 * @return a the available dispatch layer types
+	 */
+	Set<URI> getDispatchLayerTypes();
+
+	/**
+	 * Returns true iff a dispatch layer exists for the specified URI.
+	 * 
+	 * @param dispatchLayerType
+	 *            the dispatch layer type to check
+	 * @return true if a dispatch layer exists for the specified URI
+	 */
+	boolean dispatchLayerExists(URI dispatchLayerType);
+
+	/**
+	 * Returns the JSON Schema for the configuration required by a dispatch
+	 * layer.
+	 * 
+	 * @param activityType
+	 *            the activity type
+	 * @return the JSON Schema for the configuration required by a dispatch
+	 *         layer
+	 * @throws DispatchLayerNotFoundException
+	 *             if a dispatch layer cannot be found for the specified URI
+	 * @throws DispatchLayerConfigurationException
+	 *             if the JSON Schema cannot be created
+	 */
+	JsonNode getDispatchLayerConfigurationSchema(URI dispatchLayerType)
+			throws DispatchLayerNotFoundException,
+			DispatchLayerConfigurationException;
+
+	/**
+	 * Returns the dispatch layer for the specified URI.
+	 * 
+	 * If configuration is not null the returned dispatch layer will be
+	 * configured.
+	 * 
+	 * @param uri
+	 *            a URI that identifies a dispatch layer
+	 * @param configuration
+	 *            the configuration for the dispatch layer, can be
+	 *            <code>null</code>
+	 * @return the dispatch layer for the specified URI
+	 * @throws DispatchLayerNotFoundException
+	 *             if a dispatch layer cannot be found for the specified URI
+	 * @throws DispatchLayerConfigurationException
+	 *             if the configuration is not valid
+	 */
+	DispatchLayer<?> createDispatchLayer(URI uri, JsonNode configuration)
+			throws DispatchLayerNotFoundException,
+			DispatchLayerConfigurationException;
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-capability-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-capability-impl/pom.xml b/taverna-capability-impl/pom.xml
new file mode 100644
index 0000000..14c6212
--- /dev/null
+++ b/taverna-capability-impl/pom.xml
@@ -0,0 +1,59 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.taverna.engine</groupId>
+		<artifactId>taverna-engine</artifactId>
+		<version>3.1.0-incubating-SNAPSHOT</version>
+	</parent>
+	<artifactId>taverna-capability-impl</artifactId>
+	<packaging>bundle</packaging>
+	<name>Apache Taverna Platform Capability Implementation</name>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-bundle-plugin</artifactId>
+				<configuration>
+					<instructions>
+						<Import-Package>uk.org.taverna.platform.capability.api;provide:=true,*</Import-Package>
+					</instructions>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+	<dependencies>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-capability-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-workflowmodel-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.language</groupId>
+			<artifactId>taverna-scufl2-api</artifactId>
+			<version>${taverna.language.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.jdom</groupId>
+			<artifactId>com.springsource.org.jdom</artifactId>
+			<version>${jdom.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-databind</artifactId>
+			<version>${jackson.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+      <version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-capability-impl/src/main/java/uk/org/taverna/platform/capability/activity/impl/ActivityServiceImpl.java
----------------------------------------------------------------------
diff --git a/taverna-capability-impl/src/main/java/uk/org/taverna/platform/capability/activity/impl/ActivityServiceImpl.java b/taverna-capability-impl/src/main/java/uk/org/taverna/platform/capability/activity/impl/ActivityServiceImpl.java
new file mode 100644
index 0000000..91f910c
--- /dev/null
+++ b/taverna-capability-impl/src/main/java/uk/org/taverna/platform/capability/activity/impl/ActivityServiceImpl.java
@@ -0,0 +1,140 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.capability.activity.impl;
+
+import java.net.URI;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import net.sf.taverna.t2.workflowmodel.processor.activity.Activity;
+import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityFactory;
+import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityInputPort;
+import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityOutputPort;
+import uk.org.taverna.platform.capability.api.ActivityConfigurationException;
+import uk.org.taverna.platform.capability.api.ActivityNotFoundException;
+import uk.org.taverna.platform.capability.api.ActivityService;
+import uk.org.taverna.scufl2.api.port.InputActivityPort;
+import uk.org.taverna.scufl2.api.port.OutputActivityPort;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+public class ActivityServiceImpl implements ActivityService {
+	private List<ActivityFactory> activityFactories;
+
+	@Override
+	public Set<URI> getActivityTypes() {
+		Set<URI> activityTypes = new HashSet<>();
+		for (ActivityFactory activityFactory : activityFactories)
+			activityTypes.add(activityFactory.getActivityType());
+		return activityTypes;
+	}
+
+	@Override
+	public boolean activityExists(URI uri) {
+		for (ActivityFactory activityFactory : activityFactories)
+			if (activityFactory.getActivityType().equals(uri))
+				return true;
+		return false;
+	}
+
+	@Override
+	public JsonNode getActivityConfigurationSchema(URI activityType)
+			throws ActivityNotFoundException {
+		ActivityFactory factory = getActivityFactory(activityType);
+		return factory.getActivityConfigurationSchema();
+	}
+
+	@Override
+	public Activity<?> createActivity(URI activityType, JsonNode configuration)
+			throws ActivityNotFoundException, ActivityConfigurationException {
+		ActivityFactory factory = getActivityFactory(activityType);
+		@SuppressWarnings("unchecked")
+		Activity<JsonNode> activity = (Activity<JsonNode>) factory
+				.createActivity();
+		try {
+			if (configuration != null)
+				activity.configure(configuration);
+		} catch (net.sf.taverna.t2.workflowmodel.processor.activity.ActivityConfigurationException e) {
+			throw new ActivityConfigurationException(e);
+		}
+		return activity;
+	}
+
+	@Override
+	public Set<InputActivityPort> getActivityInputPorts(URI activityType,
+			JsonNode configuration) throws ActivityNotFoundException,
+			ActivityConfigurationException {
+		Set<InputActivityPort> inputPorts = new HashSet<>();
+		try {
+			for (ActivityInputPort port : getActivityFactory(activityType)
+					.getInputPorts(configuration)) {
+				InputActivityPort inputActivityPort = new InputActivityPort();
+				inputActivityPort.setName(port.getName());
+				inputActivityPort.setDepth(port.getDepth());
+				inputPorts.add(inputActivityPort);
+			}
+			return inputPorts;
+		} catch (net.sf.taverna.t2.workflowmodel.processor.activity.ActivityConfigurationException e) {
+			throw new ActivityConfigurationException(e);
+		}
+	}
+
+	@Override
+	public Set<OutputActivityPort> getActivityOutputPorts(URI activityType,
+			JsonNode configuration) throws ActivityNotFoundException,
+			ActivityConfigurationException {
+		Set<OutputActivityPort> outputPorts = new HashSet<>();
+		try {
+			for (ActivityOutputPort port : getActivityFactory(activityType)
+					.getOutputPorts(configuration)) {
+				OutputActivityPort outputActivityPort = new OutputActivityPort();
+				outputActivityPort.setName(port.getName());
+				outputActivityPort.setDepth(port.getDepth());
+				outputActivityPort.setGranularDepth(port.getGranularDepth());
+				outputPorts.add(outputActivityPort);
+			}
+		} catch (net.sf.taverna.t2.workflowmodel.processor.activity.ActivityConfigurationException e) {
+			throw new ActivityConfigurationException(e);
+		}
+		return outputPorts;
+	}
+
+	/**
+	 * Sets the list of available <code>ActivityFactory</code>s. In a production
+	 * environment this should be set by Spring DM.
+	 * 
+	 * @param activityFactories
+	 *            the list of available <code>ActivityFactory</code>s
+	 */
+	public void setActivityFactories(List<ActivityFactory> activityFactories) {
+		this.activityFactories = activityFactories;
+	}
+
+	private ActivityFactory getActivityFactory(URI activityType)
+			throws ActivityNotFoundException {
+		for (ActivityFactory activityFactory : activityFactories)
+			if (activityFactory.getActivityType().equals(activityType))
+				return activityFactory;
+		throw new ActivityNotFoundException("Could not find an activity for "
+				+ activityType);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-capability-impl/src/main/java/uk/org/taverna/platform/capability/dispatch/impl/DispatchLayerServiceImpl.java
----------------------------------------------------------------------
diff --git a/taverna-capability-impl/src/main/java/uk/org/taverna/platform/capability/dispatch/impl/DispatchLayerServiceImpl.java b/taverna-capability-impl/src/main/java/uk/org/taverna/platform/capability/dispatch/impl/DispatchLayerServiceImpl.java
new file mode 100644
index 0000000..0de59b1
--- /dev/null
+++ b/taverna-capability-impl/src/main/java/uk/org/taverna/platform/capability/dispatch/impl/DispatchLayerServiceImpl.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (C) 2011 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.capability.dispatch.impl;
+
+import java.net.URI;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.logging.Logger;
+
+import net.sf.taverna.t2.workflowmodel.processor.dispatch.DispatchLayer;
+import net.sf.taverna.t2.workflowmodel.processor.dispatch.DispatchLayerFactory;
+import uk.org.taverna.platform.capability.api.DispatchLayerConfigurationException;
+import uk.org.taverna.platform.capability.api.DispatchLayerNotFoundException;
+import uk.org.taverna.platform.capability.api.DispatchLayerService;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+/**
+ * @author David Withers
+ */
+public class DispatchLayerServiceImpl implements DispatchLayerService {
+	@SuppressWarnings("unused")
+	private static Logger logger = Logger
+			.getLogger(DispatchLayerServiceImpl.class.getName());
+
+	private List<DispatchLayerFactory> dispatchLayerFactories;
+
+	@Override
+	public Set<URI> getDispatchLayerTypes() {
+		Set<URI> dispatchLayerTypes = new HashSet<>();
+		for (DispatchLayerFactory dispatchLayerFactory : dispatchLayerFactories)
+			dispatchLayerTypes.addAll(dispatchLayerFactory
+					.getDispatchLayerTypes());
+		return dispatchLayerTypes;
+	}
+
+	@Override
+	public boolean dispatchLayerExists(URI dispatchLayerType) {
+		for (DispatchLayerFactory dispatchLayerFactory : dispatchLayerFactories)
+			if (dispatchLayerFactory.getDispatchLayerTypes().contains(
+					dispatchLayerType))
+				return true;
+		return false;
+	}
+
+	@Override
+	public JsonNode getDispatchLayerConfigurationSchema(URI dispatchLayerType)
+			throws DispatchLayerNotFoundException {
+		DispatchLayerFactory factory = getDispatchLayerFactory(dispatchLayerType);
+		return factory.getDispatchLayerConfigurationSchema(dispatchLayerType);
+	}
+
+	@Override
+	public DispatchLayer<?> createDispatchLayer(URI dispatchLayerType,
+			JsonNode configuration) throws DispatchLayerNotFoundException,
+			DispatchLayerConfigurationException {
+		DispatchLayerFactory factory = getDispatchLayerFactory(dispatchLayerType);
+		@SuppressWarnings("unchecked")
+		DispatchLayer<JsonNode> dispatchLayer = (DispatchLayer<JsonNode>) factory
+				.createDispatchLayer(dispatchLayerType);
+
+		try {
+			if (configuration != null)
+				dispatchLayer.configure(configuration);
+		} catch (net.sf.taverna.t2.workflowmodel.ConfigurationException e) {
+			throw new DispatchLayerConfigurationException(e);
+		}
+		return dispatchLayer;
+	}
+
+	/**
+	 * Sets the list of available <code>DispatchLayerFactory</code>s.
+	 * 
+	 * In a production environment this should be set by Spring DM.
+	 * 
+	 * @param dispatchLayerFactories
+	 *            the list of available <code>DispatchLayerFactory</code>s
+	 */
+	public void setDispatchLayerFactories(
+			List<DispatchLayerFactory> dispatchLayerFactories) {
+		this.dispatchLayerFactories = dispatchLayerFactories;
+	}
+
+	private DispatchLayerFactory getDispatchLayerFactory(URI dispatchLayerType)
+			throws DispatchLayerNotFoundException {
+		for (DispatchLayerFactory dispatchLayerFactory : dispatchLayerFactories)
+			if (dispatchLayerFactory.getDispatchLayerTypes().contains(
+					dispatchLayerType))
+				return dispatchLayerFactory;
+		throw new DispatchLayerNotFoundException(
+				"Could not find a dispatch layer for " + dispatchLayerType);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-capability-impl/src/main/resources/META-INF/spring/taverna-capability-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-capability-impl/src/main/resources/META-INF/spring/taverna-capability-context-osgi.xml b/taverna-capability-impl/src/main/resources/META-INF/spring/taverna-capability-context-osgi.xml
new file mode 100644
index 0000000..8aa5619
--- /dev/null
+++ b/taverna-capability-impl/src/main/resources/META-INF/spring/taverna-capability-context-osgi.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans:beans xmlns="http://www.springframework.org/schema/osgi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:beans="http://www.springframework.org/schema/beans"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+                                 http://www.springframework.org/schema/beans/spring-beans.xsd
+                                 http://www.springframework.org/schema/osgi
+                                 http://www.springframework.org/schema/osgi/spring-osgi.xsd">
+
+	<service ref="activityService" interface="uk.org.taverna.platform.capability.api.ActivityService" />
+
+	<list id="activityFactories" interface="net.sf.taverna.t2.workflowmodel.processor.activity.ActivityFactory" cardinality="0..N" />
+
+	<service ref="dispatchLayerService" interface="uk.org.taverna.platform.capability.api.DispatchLayerService" />
+
+	<list id="dispatchLayerFactories" interface="net.sf.taverna.t2.workflowmodel.processor.dispatch.DispatchLayerFactory" cardinality="0..N" />
+
+</beans:beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-capability-impl/src/main/resources/META-INF/spring/taverna-capability-context.xml
----------------------------------------------------------------------
diff --git a/taverna-capability-impl/src/main/resources/META-INF/spring/taverna-capability-context.xml b/taverna-capability-impl/src/main/resources/META-INF/spring/taverna-capability-context.xml
new file mode 100644
index 0000000..fad027e
--- /dev/null
+++ b/taverna-capability-impl/src/main/resources/META-INF/spring/taverna-capability-context.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+                           http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+	<bean id="activityService" class="uk.org.taverna.platform.capability.activity.impl.ActivityServiceImpl">
+		<property name="activityFactories" ref="activityFactories" />
+	</bean>
+
+	<bean id="dispatchLayerService" class="uk.org.taverna.platform.capability.dispatch.impl.DispatchLayerServiceImpl">
+		<property name="dispatchLayerFactories" ref="dispatchLayerFactories" />
+	</bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/pom.xml b/taverna-credential-manager-impl/pom.xml
new file mode 100644
index 0000000..ab1536c
--- /dev/null
+++ b/taverna-credential-manager-impl/pom.xml
@@ -0,0 +1,89 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+
+	<parent>
+    <groupId>org.apache.taverna.engine</groupId>
+    <artifactId>taverna-engine</artifactId>
+    <version>3.1.0-incubating-SNAPSHOT</version>
+	</parent>
+	<artifactId>taverna-credential-manager-impl</artifactId>
+	<packaging>bundle</packaging>
+	<name>Apache Taverna Credential Manager Implementation</name>
+
+  <profiles>
+    <profile>
+      <id>strongEncryption</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-failsafe-plugin</artifactId>
+            <version>2.9</version>
+            <configuration>
+              <forkMode>always</forkMode>
+            </configuration>
+            <executions>
+              <execution>
+                <id>integration-test</id>
+                <goals>
+                  <goal>integration-test</goal>
+                </goals>
+              </execution>
+              <execution>
+                <id>verify</id>
+                <goals>
+                  <goal>verify</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
+	<dependencies>
+		<dependency>
+      <groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-credential-manager</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.osgi</groupId>
+			<artifactId>taverna-app-configuration-api</artifactId>
+			<version>${taverna.osgi.version}</version>
+		</dependency>
+		<dependency>
+      <groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-observer</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.bouncycastle</groupId>
+			<artifactId>bcprov-jdk16</artifactId>
+			<version>${bcprov.jdk16.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+      <version>${log4j.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-io</groupId>
+			<artifactId>commons-io</artifactId>
+      <version>${commons.io.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+      <version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.mortbay.jetty</groupId>
+			<artifactId>jetty</artifactId>
+			<version>${jetty.version}</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/main/java/net/sf/taverna/t2/security/credentialmanager/impl/CredentialManagerAuthenticator.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/main/java/net/sf/taverna/t2/security/credentialmanager/impl/CredentialManagerAuthenticator.java b/taverna-credential-manager-impl/src/main/java/net/sf/taverna/t2/security/credentialmanager/impl/CredentialManagerAuthenticator.java
new file mode 100644
index 0000000..3a0193e
--- /dev/null
+++ b/taverna-credential-manager-impl/src/main/java/net/sf/taverna/t2/security/credentialmanager/impl/CredentialManagerAuthenticator.java
@@ -0,0 +1,112 @@
+package net.sf.taverna.t2.security.credentialmanager.impl;
+
+import static java.net.Authenticator.RequestorType.PROXY;
+
+import java.net.Authenticator;
+import java.net.PasswordAuthentication;
+import java.net.URI;
+import java.net.URISyntaxException;
+import net.sf.taverna.t2.security.credentialmanager.CMException;
+import net.sf.taverna.t2.security.credentialmanager.CredentialManager;
+import net.sf.taverna.t2.security.credentialmanager.UsernamePassword;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Credential Manager backed {@link Authenticator}.
+ * <p>
+ * Initialize by using: <code>
+ * Authenticator.setDefault(new CredentialManagerAuthenticator());
+ * </code>
+ * <p>
+ * Special case included for proxy authentication.
+ * 
+ * @author Stian Soiland-Reyes
+ * 
+ */
+public class CredentialManagerAuthenticator extends Authenticator {
+	private Logger logger;
+	private CredentialManager credManager;
+
+	public CredentialManagerAuthenticator(CredentialManager credManager) {
+		logger = Logger.getLogger(CredentialManagerAuthenticator.class);
+		setCredentialManager(credManager);
+	}
+
+	public void setCredentialManager(CredentialManager credManager) {
+		this.credManager = credManager;
+	}
+
+	@Override
+	protected PasswordAuthentication getPasswordAuthentication() {
+		if (getRequestorType().equals(PROXY)) {
+			String password = System.getProperty("http.proxyPassword");
+			String username = System.getProperty("http.proxyUser");
+			if (username == null || password == null)
+				// No proxy authentication set
+				return null;
+
+			return new PasswordAuthentication(username, password.toCharArray());
+		}
+
+		URI uri;
+		if (getRequestingURL() != null) {
+			try {
+				uri = getRequestingURL().toURI();
+			} catch (URISyntaxException e) {
+				logger.warn("Unsupported request (invalid URL) for "
+						+ getRequestingURL());
+				return null;
+			}
+		} else {
+			// Construct an URI of socket://hostname:port
+			String host = getRequestingHost();
+			if (host == null)
+				// Use IP address
+				host = getRequestingSite().getHostAddress();
+			int port = getRequestingPort();
+			if (host == null || port < 0) {
+				logger.warn("Unsupported request for " + getRequestingScheme()
+						+ " " + getRequestingSite());
+				return null;
+			}
+			uri = URI.create("socket://" + host + ":" + port);
+		}
+
+		if (credManager == null) {
+			logger.warn("No Credential Manager");
+			return null;
+		}
+		boolean usePathRecursion = false;
+		String realm = getRequestingPrompt();
+		if (getRequestingScheme().equals("basic")
+				|| getRequestingScheme().equals("digest")) {
+			usePathRecursion = true;
+			if (realm != null && realm.length() > 0)
+				try {
+					uri = DistinguishedNameParserImpl.resolveUriFragment(uri, realm);
+				} catch (URISyntaxException e) {
+					logger.warn("Could not URI-encode fragment for realm: "
+							+ realm);
+				}
+		}
+
+		UsernamePassword usernameAndPassword;
+		try {
+			usernameAndPassword = credManager.getUsernameAndPasswordForService(uri,
+					usePathRecursion, realm);
+		} catch (CMException e) {
+			logger.warn("Could not get username and password for " + uri, e);
+			return null;
+		}
+		if (usernameAndPassword == null) {
+			logger.warn("No username/password found for " + uri);
+			return null;
+		}
+		PasswordAuthentication pwAuth = new PasswordAuthentication(
+				usernameAndPassword.getUsername(), usernameAndPassword
+						.getPassword());
+		usernameAndPassword.resetPassword();
+		return pwAuth;
+	}
+}


[03/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/AppContextSetup.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/AppContextSetup.java b/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/AppContextSetup.java
new file mode 100644
index 0000000..62b6427
--- /dev/null
+++ b/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/AppContextSetup.java
@@ -0,0 +1,31 @@
+package net.sf.taverna.t2.reference.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class AppContextSetup {
+	public static List<ApplicationContext> contextList;
+
+	public static void setup() throws Exception {
+		if (contextList == null){
+			
+			contextList = new ArrayList<ApplicationContext>();
+			//Add all three contexts for storing referenced data
+			contextList = new ArrayList<ApplicationContext>();
+			ApplicationContext context = null;
+			context = new ClassPathXmlApplicationContext(
+					"vanillaHibernateAppContext.xml"); // hibernate context
+			contextList.add(context);
+			context = new ClassPathXmlApplicationContext(
+			"vanillaInMemoryAppContext.xml");
+			contextList.add(context); // in memory
+			context = new ClassPathXmlApplicationContext(
+			"vanillaHibernateTransactionalAppContext.xml");
+			contextList.add(context);	 // transactional hibernate context
+			
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/DatabaseSetupTest.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/DatabaseSetupTest.java b/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/DatabaseSetupTest.java
new file mode 100644
index 0000000..24f1ce9
--- /dev/null
+++ b/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/DatabaseSetupTest.java
@@ -0,0 +1,140 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import java.util.HashSet;
+
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ListDao;
+import net.sf.taverna.t2.reference.ReferenceSet;
+import net.sf.taverna.t2.reference.ReferenceSetDao;
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.reference.T2ReferenceType;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.context.ApplicationContext;
+
+/**
+ * Tests initialization of the Derby database and Hibernate ORM system
+ * 
+ * @author Tom Oinn
+ */
+public class DatabaseSetupTest {
+
+	@Before
+	public void setup() throws Exception {
+		AppContextSetup.setup();
+	}
+	
+	
+	@Test
+	public void testListStorage() {
+			ApplicationContext context = AppContextSetup.contextList.get(0); // Hibernate context
+			ListDao o = (ListDao) context.getBean("testListDao");
+			T2ReferenceImpl listReference = new T2ReferenceImpl();
+			listReference.setContainsErrors(false);
+			listReference.setDepth(1);
+			listReference.setLocalPart("list1");
+			listReference.setNamespacePart("testNamespace");
+			listReference.setReferenceType(T2ReferenceType.IdentifiedList);
+
+			T2ReferenceListImpl l = new T2ReferenceListImpl();
+
+			T2ReferenceImpl itemId1 = new T2ReferenceImpl();
+			itemId1.setNamespacePart("testNamespace");
+			itemId1.setLocalPart("item1");
+			T2ReferenceImpl itemId2 = new T2ReferenceImpl();
+			itemId2.setNamespacePart("testNamespace");
+			itemId2.setLocalPart("item2");
+
+			l.add(itemId1);
+			l.add(itemId2);
+
+			l.setTypedId(listReference);
+
+			System.out.println(l);
+
+			o.store(l);
+
+			T2ReferenceImpl listReference2 = new T2ReferenceImpl();
+			listReference2.setContainsErrors(false);
+			listReference2.setDepth(1);
+			listReference2.setLocalPart("list1");
+			listReference2.setNamespacePart("testNamespace");
+			listReference2.setReferenceType(T2ReferenceType.IdentifiedList);
+
+			System.out.println(o.get(listReference2));
+
+	}
+
+	@SuppressWarnings("serial")
+	@Test
+	public void testDatabaseReadWriteWithoutPlugins() {
+			ApplicationContext context = AppContextSetup.contextList.get(0); // Hibernate context
+			ReferenceSetDao o = (ReferenceSetDao) context
+					.getBean("testDao");
+			T2ReferenceImpl id = new T2ReferenceImpl();
+			id.setNamespacePart("testNamespace");
+			id.setLocalPart("testLocal");
+			ReferenceSetImpl rs = new ReferenceSetImpl(
+					new HashSet<ExternalReferenceSPI>(), id);
+			o.store(rs);
+			
+			
+			// Retrieve with a new instance of an anonymous subclass of
+			// ReferenceSetT2ReferenceImpl, just to check that hibernate can cope
+			// with this. It can, but this *must* be a subclass of the registered
+			// component type, which means we need to modify the component type to
+			// be the fully generic T2Reference with all fields accessed via
+			// properties.
+			T2Reference newReference = new T2ReferenceImpl() {
+
+				@Override
+				public boolean containsErrors() {
+					return false;
+				}
+
+				@Override
+				public int getDepth() {
+					return 0;
+				}
+
+				@Override
+				public String getLocalPart() {
+					return "testLocal";
+				}
+
+				@Override
+				public String getNamespacePart() {
+					return "testNamespace";
+				}
+
+			};
+
+			
+			ReferenceSet returnedset = o.get(newReference);
+			Assert.assertNotNull(returnedset.getId());	
+
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ErrorDocumentDaoTest.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ErrorDocumentDaoTest.java b/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ErrorDocumentDaoTest.java
new file mode 100644
index 0000000..d5d47af
--- /dev/null
+++ b/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ErrorDocumentDaoTest.java
@@ -0,0 +1,151 @@
+package net.sf.taverna.t2.reference.impl;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import net.sf.taverna.t2.reference.ErrorDocumentDao;
+import net.sf.taverna.t2.reference.T2ReferenceType;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.context.ApplicationContext;
+
+public class ErrorDocumentDaoTest {
+	
+	@Before
+	public void setup() throws Exception {
+		AppContextSetup.setup();
+	}
+	
+	@Test
+	public void testStore() throws Exception {
+		for (ApplicationContext context : AppContextSetup.contextList){
+			
+			ErrorDocumentDao dao = (ErrorDocumentDao) context.getBean("testErrorDao");
+			ErrorDocumentImpl doc = new ErrorDocumentImpl();
+			T2ReferenceImpl id = new T2ReferenceImpl();
+			id.setReferenceType(T2ReferenceType.ErrorDocument);
+			id.setDepth(0);
+			id.setContainsErrors(true);
+			id.setNamespacePart("testNamespace0");		
+			id.setLocalPart("testLocal0");
+			
+			doc.setExceptionMessage("An exception");		
+			
+			T2ReferenceImpl typedId = T2ReferenceImpl.getAsImpl(id);
+			
+			doc.setTypedId(typedId);
+			
+			dao.store(doc);
+			assertNotNull(dao.get(id));	
+		}
+	}
+	
+	/**
+	 * Tests that .get returns null when its missing, rather than throw an exception
+	 */
+	@Test
+	public void getMissingItemReturnsNull() {
+		for (ApplicationContext context : AppContextSetup.contextList){
+			ErrorDocumentDao dao = (ErrorDocumentDao) context.getBean("testErrorDao");
+			ErrorDocumentImpl doc = new ErrorDocumentImpl();
+			T2ReferenceImpl id = new T2ReferenceImpl();
+			id.setReferenceType(T2ReferenceType.ErrorDocument);
+			id.setDepth(0);
+			id.setContainsErrors(true);
+			id.setNamespacePart("testNamespace1");		
+			id.setLocalPart("testLocal1");
+			
+			doc.setExceptionMessage("An exception");		
+			
+			T2ReferenceImpl typedId = T2ReferenceImpl.getAsImpl(id);
+			
+			doc.setTypedId(typedId);
+			assertNull(dao.get(id));	
+		}
+	}
+	
+	@Test
+	public void testDelete() throws Exception {
+		for (ApplicationContext context : AppContextSetup.contextList){
+			
+			ErrorDocumentDao dao = (ErrorDocumentDao) context.getBean("testErrorDao");
+			ErrorDocumentImpl doc = new ErrorDocumentImpl();
+			T2ReferenceImpl id = new T2ReferenceImpl();
+			id.setReferenceType(T2ReferenceType.ErrorDocument);
+			id.setDepth(0);
+			id.setContainsErrors(true);
+			id.setNamespacePart("testNamespace2");		
+			id.setLocalPart("testLocal2");
+			
+			doc.setExceptionMessage("An exception");		
+			
+			T2ReferenceImpl typedId = T2ReferenceImpl.getAsImpl(id);
+			
+			doc.setTypedId(typedId);
+			
+			dao.store(doc);
+			assertNotNull(dao.get(id));
+			
+			assertTrue(dao.delete(doc));		
+			assertNull(dao.get(id));	
+		}
+
+	}
+
+	@Test
+	public void testDeleteErrorDocumentsForWFRun() throws Exception {
+		for (ApplicationContext context : AppContextSetup.contextList){
+			
+			ErrorDocumentDao dao = (ErrorDocumentDao) context.getBean("testErrorDao");
+			
+			ErrorDocumentImpl doc1 = new ErrorDocumentImpl();	
+			T2ReferenceImpl id1 = new T2ReferenceImpl();
+			id1.setReferenceType(T2ReferenceType.ErrorDocument);
+			id1.setDepth(0);
+			id1.setContainsErrors(true);
+			id1.setNamespacePart("wfRunErrorDocTest1");		
+			id1.setLocalPart("testLocal1");		
+			doc1.setExceptionMessage("An exception 1");			
+			T2ReferenceImpl typedId1 = T2ReferenceImpl.getAsImpl(id1);		
+			doc1.setTypedId(typedId1);	
+			dao.store(doc1);
+			assertNotNull(dao.get(id1));
+			
+			ErrorDocumentImpl doc2 = new ErrorDocumentImpl();	
+			T2ReferenceImpl id2 = new T2ReferenceImpl();
+			id2.setReferenceType(T2ReferenceType.ErrorDocument);
+			id2.setDepth(0);
+			id2.setContainsErrors(true);
+			id2.setNamespacePart("wfRunErrorDocTest1");		
+			id2.setLocalPart("testLocal2");		
+			doc2.setExceptionMessage("An exception 2");			
+			T2ReferenceImpl typedId2 = T2ReferenceImpl.getAsImpl(id2);		
+			doc2.setTypedId(typedId2);	
+			dao.store(doc2);
+			assertNotNull(dao.get(id2));
+			
+			ErrorDocumentImpl doc3 = new ErrorDocumentImpl();	
+			T2ReferenceImpl id3 = new T2ReferenceImpl();
+			id3.setReferenceType(T2ReferenceType.ErrorDocument);
+			id3.setDepth(0);
+			id3.setContainsErrors(true);
+			id3.setNamespacePart("wfRunErrorDocTest2");		
+			id3.setLocalPart("testLocal3");		
+			doc3.setExceptionMessage("An exception 3");			
+			T2ReferenceImpl typedId3 = T2ReferenceImpl.getAsImpl(id3);		
+			doc3.setTypedId(typedId3);	
+			dao.store(doc3);
+			assertNotNull(dao.get(id3));
+			
+			dao.deleteErrorDocumentsForWFRun("wfRunErrorDocTest1");
+			
+			assertNull(dao.get(id1));			
+			assertNull(dao.get(id2));
+			assertNotNull(dao.get(id3));	
+		}
+
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ErrorDocumentServiceTest.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ErrorDocumentServiceTest.java b/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ErrorDocumentServiceTest.java
new file mode 100644
index 0000000..e035922
--- /dev/null
+++ b/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ErrorDocumentServiceTest.java
@@ -0,0 +1,88 @@
+package net.sf.taverna.t2.reference.impl;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sf.taverna.t2.reference.ErrorDocument;
+import net.sf.taverna.t2.reference.ErrorDocumentDao;
+import net.sf.taverna.t2.reference.WorkflowRunIdEntity;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class ErrorDocumentServiceTest {
+	
+	private List<ErrorDocumentServiceImpl> serviceList = new ArrayList<ErrorDocumentServiceImpl>();
+	
+	@Before
+	public void setup() throws Exception {
+		
+		AppContextSetup.setup();
+		
+		ErrorDocumentServiceImpl service = null;
+
+			service = new ErrorDocumentServiceImpl();
+			service.setErrorDao((ErrorDocumentDao)AppContextSetup.contextList.get(0).getBean("testErrorDao")); // hiberate
+			service.setT2ReferenceGenerator(new SimpleT2ReferenceGenerator());
+			serviceList.add(service);	
+		
+			service = new ErrorDocumentServiceImpl();
+			service.setErrorDao((ErrorDocumentDao)AppContextSetup.contextList.get(1).getBean("testErrorDao")); // in memory
+			service.setT2ReferenceGenerator(new SimpleT2ReferenceGenerator());
+			serviceList.add(service);
+		
+			service = new ErrorDocumentServiceImpl();
+			service.setErrorDao((ErrorDocumentDao)AppContextSetup.contextList.get(2).getBean("testErrorDao")); // transactional hibernate
+			service.setT2ReferenceGenerator(new SimpleT2ReferenceGenerator());
+			serviceList.add(service);
+				
+	}
+	
+	@Test
+	public void testDelete() throws Exception {
+		ReferenceContextImpl invocationContext = new ReferenceContextImpl();
+		invocationContext.addEntity(new WorkflowRunIdEntity("wfRunErrorDocTest"));
+		for (ErrorDocumentServiceImpl service : serviceList){
+			ErrorDocument doc = service.registerError("Fred", 0, invocationContext);
+			assertNotNull(service.getError(doc.getId()));
+			assertTrue(service.delete(doc.getId()));
+			assertNull(service.getError(doc.getId()));
+			assertFalse(service.delete(doc.getId()));
+		}
+	}
+
+	@Test
+	public void testDeleteErrorDocumentsForWFRun() throws Exception {
+
+		for (ErrorDocumentServiceImpl service : serviceList){
+			
+			String wfRunId1 = "wfRunErrorDocTest1";
+			ReferenceContextImpl invocationContext1 = new ReferenceContextImpl();
+			invocationContext1.addEntity(new WorkflowRunIdEntity(wfRunId1));
+			
+			String wfRunId2 = "wfRunErrorDocTest2";
+			ReferenceContextImpl invocationContext2 = new ReferenceContextImpl();
+			invocationContext2.addEntity(new WorkflowRunIdEntity(wfRunId2));
+			
+			ErrorDocument doc1 = service.registerError("Fred1", 0, invocationContext1);
+			ErrorDocument doc2 = service.registerError("Fred2", 0, invocationContext1);
+			ErrorDocument doc3 = service.registerError("Fred3", 0, invocationContext2);
+
+			assertNotNull(service.getError(doc1.getId()));
+			assertNotNull(service.getError(doc2.getId()));
+			assertNotNull(service.getError(doc3.getId()));
+
+			service.deleteErrorDocumentsForWorkflowRun(wfRunId1);
+			
+			assertNull(service.getError(doc1.getId()));
+			assertNull(service.getError(doc2.getId()));
+			assertNotNull(service.getError(doc3.getId()));
+
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ListDaoTest.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ListDaoTest.java b/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ListDaoTest.java
new file mode 100644
index 0000000..a39d353
--- /dev/null
+++ b/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ListDaoTest.java
@@ -0,0 +1,121 @@
+package net.sf.taverna.t2.reference.impl;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import net.sf.taverna.t2.reference.ListDao;
+import net.sf.taverna.t2.reference.T2ReferenceType;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.context.ApplicationContext;
+
+public class ListDaoTest {
+	
+	@Before
+	public void setup() throws Exception {
+		AppContextSetup.setup();
+	}
+	
+	@Test
+	public void testStore() throws Exception {
+		for (ApplicationContext context : AppContextSetup.contextList){
+			ListDao dao = (ListDao)context.getBean("testListDao");
+			T2ReferenceImpl r = new T2ReferenceImpl();
+			r.setNamespacePart("testNamespace0");
+			r.setLocalPart("testLocal0");
+			r.setReferenceType(T2ReferenceType.IdentifiedList);
+			r.setDepth(0);
+			r.setContainsErrors(false);
+			T2ReferenceListImpl newList = new T2ReferenceListImpl();
+			newList.setTypedId(r);
+			dao.store(newList);
+			assertNotNull(dao.get(r));	
+		}	
+	}
+	
+	/**
+	 * Tests that .get returns null when its missing, rather than throw an exception
+	 */
+	@Test
+	public void getMissingItemReturnsNull() {
+		for (ApplicationContext context : AppContextSetup.contextList){
+			ListDao dao = (ListDao)context.getBean("testListDao");
+			T2ReferenceImpl r = new T2ReferenceImpl();
+			r.setNamespacePart("testNamespace1");
+			r.setLocalPart("testLocal1");
+			r.setReferenceType(T2ReferenceType.IdentifiedList);
+			r.setDepth(0);
+			r.setContainsErrors(false);
+			T2ReferenceListImpl newList = new T2ReferenceListImpl();
+			newList.setTypedId(r);
+			assertNull(dao.get(r));
+		}
+	}
+	
+	@Test
+	public void testDelete() throws Exception {
+		for (ApplicationContext context : AppContextSetup.contextList){
+			ListDao dao = (ListDao)context.getBean("testListDao");
+			T2ReferenceImpl r = new T2ReferenceImpl();
+			r.setNamespacePart("testNamespace2");
+			r.setLocalPart("testLocal2");
+			r.setReferenceType(T2ReferenceType.IdentifiedList);
+			r.setDepth(0);
+			r.setContainsErrors(false);
+			T2ReferenceListImpl newList = new T2ReferenceListImpl();
+			newList.setTypedId(r);
+			dao.store(newList);
+			assertNotNull(dao.get(r));	
+			assertTrue(dao.delete(newList));
+			assertNull(dao.get(r));	
+		}	
+	}
+
+	@Test
+	public void testIdentifiedListsForWFRun() throws Exception {
+		for (ApplicationContext context : AppContextSetup.contextList){
+			ListDao dao = (ListDao)context.getBean("testListDao");
+			
+			T2ReferenceImpl r1 = new T2ReferenceImpl();
+			r1.setReferenceType(T2ReferenceType.IdentifiedList);
+			r1.setDepth(0);
+			r1.setContainsErrors(true);
+			r1.setNamespacePart("wfRunListsTest1");		
+			r1.setLocalPart("testLocal1");		
+			T2ReferenceListImpl list1 = new T2ReferenceListImpl();		
+			list1.setTypedId(r1);	
+			dao.store(list1);
+			assertNotNull(dao.get(r1));
+			
+			T2ReferenceImpl r2 = new T2ReferenceImpl();
+			r2.setReferenceType(T2ReferenceType.IdentifiedList);
+			r2.setDepth(1);
+			r2.setContainsErrors(true);
+			r2.setNamespacePart("wfRunListsTest1");		
+			r2.setLocalPart("testLocal2");		
+			T2ReferenceListImpl list2 = new T2ReferenceListImpl();		
+			list2.setTypedId(r2);	
+			dao.store(list2);
+			assertNotNull(dao.get(r2));
+			
+			T2ReferenceImpl r3 = new T2ReferenceImpl();
+			r3.setReferenceType(T2ReferenceType.IdentifiedList);
+			r3.setDepth(0);
+			r3.setContainsErrors(true);
+			r3.setNamespacePart("wfRunListsTest2");		
+			r3.setLocalPart("testLocal3");		
+			T2ReferenceListImpl list3 = new T2ReferenceListImpl();		
+			list3.setTypedId(r3);	
+			dao.store(list3);
+			assertNotNull(dao.get(r3));
+			
+			dao.deleteIdentifiedListsForWFRun("wfRunListsTest1");
+			
+			assertNull(dao.get(r1));			
+			assertNull(dao.get(r2));
+			assertNotNull(dao.get(r3));	
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ListServiceTest.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ListServiceTest.java b/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ListServiceTest.java
new file mode 100644
index 0000000..062337a
--- /dev/null
+++ b/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ListServiceTest.java
@@ -0,0 +1,91 @@
+package net.sf.taverna.t2.reference.impl;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sf.taverna.t2.reference.IdentifiedList;
+import net.sf.taverna.t2.reference.ListDao;
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.reference.WorkflowRunIdEntity;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class ListServiceTest {
+	
+	private List<ListServiceImpl> serviceList = new ArrayList<ListServiceImpl>();
+
+	@Before
+	public void setup() throws Exception {
+		
+		AppContextSetup.setup();
+		
+		ListServiceImpl service = null;
+		
+			service = new ListServiceImpl();
+			service.setListDao((ListDao)AppContextSetup.contextList.get(0).getBean("testListDao")); // hibernate
+			service.setT2ReferenceGenerator(new SimpleT2ReferenceGenerator());	
+			serviceList.add(service);
+		
+			service = new ListServiceImpl();
+			service.setListDao((ListDao)AppContextSetup.contextList.get(1).getBean("testListDao")); // in memory
+			service.setT2ReferenceGenerator(new SimpleT2ReferenceGenerator());	
+			serviceList.add(service);
+
+		
+			service = new ListServiceImpl();
+			service.setListDao((ListDao)AppContextSetup.contextList.get(2).getBean("testListDao")); // transactional hibernate
+			service.setT2ReferenceGenerator(new SimpleT2ReferenceGenerator());	
+			serviceList.add(service);
+		
+	}
+	
+	@Test
+	public void testDelete() throws Exception {
+		ReferenceContextImpl invocationContext = new ReferenceContextImpl();
+		invocationContext.addEntity(new WorkflowRunIdEntity("wfRunListsTest"));
+		for (ListServiceImpl service : serviceList){
+			IdentifiedList<T2Reference> list =service.registerEmptyList(1, invocationContext);
+			assertNotNull(service.getList(list.getId()));
+			assertTrue(service.delete(list.getId()));
+			assertNull(service.getList(list.getId()));
+			assertFalse(service.delete(list.getId()));
+		}
+	}
+	
+	@Test
+	public void testDeleteIdentifiedListsForWFRun() throws Exception {
+
+		for (ListServiceImpl service : serviceList){
+			
+			String wfRunId1 = "wfRunListsTest1";
+			ReferenceContextImpl invocationContext1 = new ReferenceContextImpl();
+			invocationContext1.addEntity(new WorkflowRunIdEntity(wfRunId1));
+			
+			String wfRunId2 = "wfRunListsTest2";
+			ReferenceContextImpl invocationContext2 = new ReferenceContextImpl();
+			invocationContext2.addEntity(new WorkflowRunIdEntity(wfRunId2));
+			
+			IdentifiedList<T2Reference> list1 = service.registerEmptyList(2, invocationContext1);
+			IdentifiedList<T2Reference> list2 = service.registerEmptyList(1, invocationContext1);
+			IdentifiedList<T2Reference> list3 = service.registerEmptyList(1, invocationContext2);
+
+			assertNotNull(service.getList(list1.getId()));
+			assertNotNull(service.getList(list2.getId()));
+			assertNotNull(service.getList(list3.getId()));
+
+			service.deleteIdentifiedListsForWorkflowRun(wfRunId1);
+			
+			assertNull(service.getList(list1.getId()));
+			assertNull(service.getList(list2.getId()));
+			assertNotNull(service.getList(list3.getId()));
+
+		}
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ReferenceContextImpl.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ReferenceContextImpl.java b/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ReferenceContextImpl.java
new file mode 100644
index 0000000..a898d27
--- /dev/null
+++ b/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ReferenceContextImpl.java
@@ -0,0 +1,30 @@
+package net.sf.taverna.t2.reference.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sf.taverna.t2.reference.ReferenceContext;
+
+class ReferenceContextImpl implements ReferenceContext{
+	private List<Object> entities;
+
+	public ReferenceContextImpl(){
+		entities = new ArrayList<Object>();
+	}
+	
+	@Override
+	public <T> List<T> getEntities(Class<T> entityType) {
+		List<T> entitiesOfType = new ArrayList<T>();
+		for (Object entity : entities){
+			if (entityType.isInstance(entity)){
+				entitiesOfType.add(entityType.cast(entity));
+			}
+		}
+		return entitiesOfType;
+	}
+
+	@Override
+	public void addEntity(Object entity){
+		entities.add(entity);
+	}
+};

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ReferenceSetDaoTest.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ReferenceSetDaoTest.java b/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ReferenceSetDaoTest.java
new file mode 100644
index 0000000..f453cca
--- /dev/null
+++ b/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ReferenceSetDaoTest.java
@@ -0,0 +1,105 @@
+package net.sf.taverna.t2.reference.impl;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.HashSet;
+
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ReferenceSetDao;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.context.ApplicationContext;
+
+public class ReferenceSetDaoTest {
+
+	@Before
+	public void setup() throws Exception {
+
+		AppContextSetup.setup();
+	}
+
+	@Test
+	public void testStore() throws Exception {
+		for (ApplicationContext context : AppContextSetup.contextList){
+			ReferenceSetDao dao = (ReferenceSetDao) context.getBean("testDao");
+			T2ReferenceImpl id = new T2ReferenceImpl();
+			id.setNamespacePart("testNamespace0");		
+			id.setLocalPart("testLocal0");
+			ReferenceSetImpl rs = new ReferenceSetImpl(
+					new HashSet<ExternalReferenceSPI>(), id);
+			dao.store(rs);
+			assertNotNull(dao.get(id));
+		}
+	}
+	
+	@Test
+	public void testDelete() throws Exception {
+		for (ApplicationContext context : AppContextSetup.contextList){
+			ReferenceSetDao dao = (ReferenceSetDao) context.getBean("testDao");
+			T2ReferenceImpl id = new T2ReferenceImpl();
+			id.setNamespacePart("testNamespace1");
+			id.setLocalPart("testLocal1");
+			ReferenceSetImpl rs = new ReferenceSetImpl(
+					new HashSet<ExternalReferenceSPI>(), id);		
+			dao.store(rs);
+			assertNotNull(dao.get(id));
+			assertTrue(dao.delete(rs));
+			assertNull(dao.get(id));
+		}
+	}
+	
+	@Test
+	public void testDeleteRerefenceSetsForWFRun() throws Exception {
+		for (ApplicationContext context : AppContextSetup.contextList){
+			ReferenceSetDao dao = (ReferenceSetDao) context.getBean("testDao");
+			
+			T2ReferenceImpl id1 = new T2ReferenceImpl();
+			id1.setNamespacePart("wfRunRefSetTest1");
+			id1.setLocalPart("testLocal1");
+			ReferenceSetImpl rs1 = new ReferenceSetImpl(
+					new HashSet<ExternalReferenceSPI>(), id1);		
+			dao.store(rs1);
+			assertNotNull(dao.get(id1));
+			
+			T2ReferenceImpl id2 = new T2ReferenceImpl();
+			id2.setNamespacePart("wfRunRefSetTest1");
+			id2.setLocalPart("testLocal2");
+			ReferenceSetImpl rs2 = new ReferenceSetImpl(
+					new HashSet<ExternalReferenceSPI>(), id2);		
+			dao.store(rs2);
+			assertNotNull(dao.get(id2));
+			
+			T2ReferenceImpl id3 = new T2ReferenceImpl();
+			id3.setNamespacePart("wfRunRefSetTest2");
+			id3.setLocalPart("testLocal3");
+			ReferenceSetImpl rs3 = new ReferenceSetImpl(
+					new HashSet<ExternalReferenceSPI>(), id3);		
+			dao.store(rs3);
+			assertNotNull(dao.get(id3));
+			
+			dao.deleteReferenceSetsForWFRun("wfRunRefSetTest1");
+			
+			assertNull(dao.get(id1));			
+			assertNull(dao.get(id2));
+			assertNotNull(dao.get(id3));	
+		}
+	}
+	
+	/**
+	 * Tests that .get returns null when its missing, rather than throw an exception
+	 */
+	@Test
+	public void getMissingItemReturnsNull() {
+		for (ApplicationContext context : AppContextSetup.contextList){
+			ReferenceSetDao dao = (ReferenceSetDao) context.getBean("testDao");
+			T2ReferenceImpl id = new T2ReferenceImpl();
+			id.setNamespacePart("testNamespace2");		
+			id.setLocalPart("testLocal2");
+			assertNull(dao.get(id));
+		}
+	}
+		
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ReferenceSetServiceTest.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ReferenceSetServiceTest.java b/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ReferenceSetServiceTest.java
new file mode 100644
index 0000000..fc445ae
--- /dev/null
+++ b/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/ReferenceSetServiceTest.java
@@ -0,0 +1,92 @@
+package net.sf.taverna.t2.reference.impl;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+
+import net.sf.taverna.t2.reference.ReferenceSet;
+import net.sf.taverna.t2.reference.ReferenceSetDao;
+import net.sf.taverna.t2.reference.WorkflowRunIdEntity;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class ReferenceSetServiceTest {
+	
+	private List<ReferenceSetServiceImpl> serviceList = new ArrayList<ReferenceSetServiceImpl>();
+
+	@Before
+	public void setup() throws Exception {
+
+		AppContextSetup.setup();
+
+		ReferenceSetServiceImpl service = null;
+
+		service = new ReferenceSetServiceImpl();
+		service.setReferenceSetDao((ReferenceSetDao)AppContextSetup.contextList.get(0).getBean("testDao")); // hibernate
+		service.setT2ReferenceGenerator(new SimpleT2ReferenceGenerator());	
+		serviceList.add(service);
+		
+		service = new ReferenceSetServiceImpl();
+		service.setReferenceSetDao((ReferenceSetDao)AppContextSetup.contextList.get(1).getBean("testDao")); // in memory
+		service.setT2ReferenceGenerator(new SimpleT2ReferenceGenerator());	
+		serviceList.add(service);
+		
+		service = new ReferenceSetServiceImpl();
+		service.setReferenceSetDao((ReferenceSetDao)AppContextSetup.contextList.get(2).getBean("testDao")); // transactional hibernate
+		service.setT2ReferenceGenerator(new SimpleT2ReferenceGenerator());	
+		serviceList.add(service);
+
+	}
+	
+	@Test
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public void testDelete() throws Exception {
+		ReferenceContextImpl invocationContext = new ReferenceContextImpl();
+		invocationContext.addEntity(new WorkflowRunIdEntity("wfRunRefSetTest0"));
+		for (ReferenceSetServiceImpl service : serviceList){
+			ReferenceSet set = service.registerReferenceSet(new HashSet(), invocationContext);
+			assertNotNull(service.getReferenceSet(set.getId()));
+			assertTrue(service.delete(set.getId()));
+			assertNull(service.getReferenceSet(set.getId()));
+			assertFalse(service.delete(set.getId()));
+		}
+	}
+	
+	@Test
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public void testDeleteReferenceSetsForWFRun() throws Exception {
+
+		for (ReferenceSetServiceImpl service : serviceList){
+			
+			String wfRunId1 = "wfRunRefSetTest1";
+			ReferenceContextImpl invocationContext1 = new ReferenceContextImpl();
+			invocationContext1.addEntity(new WorkflowRunIdEntity(wfRunId1));
+			
+			String wfRunId2 = "wfRunRefSetTest2";
+			ReferenceContextImpl invocationContext2 = new ReferenceContextImpl();
+			invocationContext2.addEntity(new WorkflowRunIdEntity(wfRunId2));
+			
+			ReferenceSet set1 = service.registerReferenceSet(new HashSet(), invocationContext1);
+			ReferenceSet set2 = service.registerReferenceSet(new HashSet(), invocationContext1);
+			ReferenceSet set3 = service.registerReferenceSet(new HashSet(), invocationContext2);
+
+			assertNotNull(service.getReferenceSet(set1.getId()));
+			assertNotNull(service.getReferenceSet(set2.getId()));
+			assertNotNull(service.getReferenceSet(set3.getId()));
+
+			service.deleteReferenceSetsForWorkflowRun(wfRunId1);
+			
+			assertNull(service.getReferenceSet(set1.getId()));
+			assertNull(service.getReferenceSet(set2.getId()));
+			assertNotNull(service.getReferenceSet(set3.getId()));
+
+		}
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/TranslationPathTest.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/TranslationPathTest.java b/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/TranslationPathTest.java
new file mode 100644
index 0000000..35d6f64
--- /dev/null
+++ b/taverna-reference-impl/src/test/java/net/sf/taverna/t2/reference/impl/TranslationPathTest.java
@@ -0,0 +1,46 @@
+package net.sf.taverna.t2.reference.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Set;
+
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ReferenceContext;
+import net.sf.taverna.t2.reference.ReferenceSet;
+import net.sf.taverna.t2referencetest.DummyReferenceSet;
+import net.sf.taverna.t2referencetest.GreenBuilder;
+import net.sf.taverna.t2referencetest.GreenReference;
+import net.sf.taverna.t2referencetest.GreenToRed;
+import net.sf.taverna.t2referencetest.RedReference;
+
+import org.junit.Test;
+
+public class TranslationPathTest {
+
+	protected TranslationPath path  = new TranslationPath();
+	
+	@Test
+	public void doTranslationWithTranslator() throws Exception {
+		ReferenceContext context = new EmptyReferenceContext();
+		ReferenceSet rs = new DummyReferenceSet(new GreenReference("green"));		
+		path.getTranslators().add(new GreenToRed());
+		Set<ExternalReferenceSPI> set = path.doTranslation(rs, context);		
+		assertEquals(1, set.size());
+		assertTrue(set.iterator().next() instanceof RedReference);
+	}
+	
+	@Test
+	public void doTranslationByReadingStream() throws Exception {
+		ReferenceContext context = new EmptyReferenceContext();
+		path.setSourceReference(new RedReference("red"));
+		ReferenceSet rs = new DummyReferenceSet(path.getSourceReference());
+		path.setInitialBuilder(new GreenBuilder());
+		//augmentor.path.translators.add(new DummyTranslator());
+		Set<ExternalReferenceSPI> set = path.doTranslation(rs, context);		
+		assertEquals(1, set.size());
+		assertTrue(set.iterator().next() instanceof GreenReference);
+	}
+
+	
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/test/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/test/resources/log4j.xml b/taverna-reference-impl/src/test/resources/log4j.xml
new file mode 100644
index 0000000..f1f4d5e
--- /dev/null
+++ b/taverna-reference-impl/src/test/resources/log4j.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- Default Log4J configuration for integration test module -->
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+		<layout class="org.apache.log4j.PatternLayout">
+			<param name="ConversionPattern"
+				value="%p - %C{1}.%M(%L) | %m%n" />
+		</layout>
+	</appender>
+
+	<logger name="net.sf.taverna.platform.spring.orm">
+		<level value="TRACE" />
+	</logger>
+
+	<logger name="net.sf.taverna.platform.spring">
+		<level value="INFO" />
+	</logger>
+
+	<logger name="org.hibernate">
+		<level value="ERROR" />
+	</logger>
+	
+	<!-- 
+		<logger name="org.hibernate.SQL">
+		<level value="TRACE" />
+		</logger>
+		<logger name="org.hibernate.type">
+		<level value="DEBUG" />
+		</logger>
+	-->
+	
+	<logger name="org.springframework">
+		<level value="WARN" />
+	</logger>
+
+	<root>
+		<level value="ERROR" />
+		<appender-ref ref="CONSOLE" />
+	</root>
+
+</log4j:configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/test/resources/vanillaHibernateAppContext.xml
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/test/resources/vanillaHibernateAppContext.xml b/taverna-reference-impl/src/test/resources/vanillaHibernateAppContext.xml
new file mode 100644
index 0000000..8853410
--- /dev/null
+++ b/taverna-reference-impl/src/test/resources/vanillaHibernateAppContext.xml
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- A test context with no raven aware components used by the DatabaseSetupTest -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:aop="http://www.springframework.org/schema/aop"
+	xmlns:tx="http://www.springframework.org/schema/tx"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+		http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
+        http://www.springframework.org/schema/context
+        http://www.springframework.org/schema/context/spring-context-2.5.xsd
+        http://www.springframework.org/schema/tx 
+        http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
+
+	<!-- Transaction manager, commented out to use the regular dao implementations -->
+	<!-- 
+		<tx:annotation-driven transaction-manager="txManager" />
+		<bean id="txManager"
+		class="org.springframework.orm.hibernate3.HibernateTransactionManager">
+		<property name="sessionFactory" ref="sessionFactoryBean" />
+		</bean>
+	-->
+
+
+	<!-- Apache Derby rooted at a temporary directory -->
+	<bean id="t2reference.jdbc.temporaryjdbc"
+		class="net.sf.taverna.platform.spring.jdbc.TemporaryJDBC">
+	</bean>
+	<bean id="t2reference.jdbc.url" class="java.lang.String"
+		factory-bean="t2reference.jdbc.temporaryjdbc"
+		factory-method="getTemporaryDerbyJDBC" />
+
+	<!-- At least for testing purposes we use Apache Derby -->
+	<bean id="exampleDataSource"
+		class="org.springframework.jdbc.datasource.DriverManagerDataSource">
+		<property name="driverClassName">
+			<value>org.apache.derby.jdbc.EmbeddedDriver</value>
+		</property>
+		<property name="url">
+			<ref bean="t2reference.jdbc.url" />
+		</property>
+	</bean>
+
+	<!-- Configure hibernate to use dynamic schema update -->
+	<bean id="exampleHibernateProperties"
+		class="org.springframework.beans.factory.config.PropertiesFactoryBean">
+		<property name="properties">
+			<props>
+				<prop key="hibernate.hbm2ddl.auto">create</prop>
+				<prop key="hibernate.dialect">
+					org.hibernate.dialect.DerbyDialect
+				</prop>
+				<prop key="hibernate.query.substitutions">
+					true 'T', false 'F'
+				</prop>
+				<prop key="hibernate.show_sql">false</prop>
+				<prop key="hibernate.c3p0.minPoolSize">5</prop>
+				<prop key="hibernate.c3p0.maxPoolSize">20</prop>
+				<prop key="hibernate.c3p0.timeout">600</prop>
+				<prop key="hibernate.c3p0.max_statement">50</prop>
+				<prop key="hibernate.c3p0.testConnectionOnCheckout">
+					false
+				</prop>
+				<prop key="show_sql">true</prop>
+				<prop key="format_sql">true</prop>
+			</props>
+		</property>
+	</bean>
+
+	<!-- A regular hibernate session factory -->
+	<bean id="sessionFactoryBean"
+		class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
+		<property name="dataSource">
+			<ref local="exampleDataSource" />
+		</property>
+		<property name="hibernateProperties">
+			<ref bean="exampleHibernateProperties" />
+		</property>
+		<property name="mappingResources">
+			<list>
+				<value>
+					net/sf/taverna/t2/reference/AbstractExternalReference.hbm.xml
+				</value>
+				<value>
+					net/sf/taverna/t2/reference/impl/ReferenceSetImpl.hbm.xml
+				</value>
+				<value>
+					net/sf/taverna/t2/reference/impl/T2ReferenceListImpl.hbm.xml
+				</value>
+				<value>
+					net/sf/taverna/t2/reference/impl/ErrorDocumentImpl.hbm.xml
+				</value>
+			</list>
+		</property>
+	</bean>
+
+	<!-- Test data access object -->
+	<bean id="testDao"
+		class="net.sf.taverna.t2.reference.impl.HibernateReferenceSetDao">
+		<property name="sessionFactory">
+			<ref local="sessionFactoryBean" />
+		</property>
+	</bean>
+
+	<!-- Test list data access object -->
+	<bean id="testListDao"
+		class="net.sf.taverna.t2.reference.impl.HibernateListDao">
+		<property name="sessionFactory">
+			<ref local="sessionFactoryBean" />
+		</property>
+	</bean>
+	
+	<!-- Test list data access object -->
+	<bean id="testErrorDao"
+		class="net.sf.taverna.t2.reference.impl.HibernateErrorDocumentDao">
+		<property name="sessionFactory">
+			<ref local="sessionFactoryBean" />
+		</property>
+	</bean>
+
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/test/resources/vanillaHibernateTransactionalAppContext.xml
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/test/resources/vanillaHibernateTransactionalAppContext.xml b/taverna-reference-impl/src/test/resources/vanillaHibernateTransactionalAppContext.xml
new file mode 100644
index 0000000..be66358
--- /dev/null
+++ b/taverna-reference-impl/src/test/resources/vanillaHibernateTransactionalAppContext.xml
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- A test context with no raven aware components used by the DatabaseSetupTest -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:aop="http://www.springframework.org/schema/aop"
+	xmlns:tx="http://www.springframework.org/schema/tx"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+		http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
+        http://www.springframework.org/schema/context
+        http://www.springframework.org/schema/context/spring-context-2.5.xsd
+        http://www.springframework.org/schema/tx 
+        http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
+
+	<!-- Transaction manager, commented out to use the regular dao implementations -->
+	<tx:annotation-driven transaction-manager="txManager" />
+	
+	<bean id="txManager"
+		class="org.springframework.orm.hibernate3.HibernateTransactionManager">
+		<property name="sessionFactory" ref="sessionFactoryBean" />
+	</bean>
+
+	<!-- Apache Derby rooted at a temporary directory -->
+	<bean id="t2reference.jdbc.temporaryjdbc"
+		class="net.sf.taverna.platform.spring.jdbc.TemporaryJDBC">
+	</bean>
+	<bean id="t2reference.jdbc.url" class="java.lang.String"
+		factory-bean="t2reference.jdbc.temporaryjdbc"
+		factory-method="getTemporaryDerbyJDBC" />
+
+	<!-- At least for testing purposes we use Apache Derby -->
+	<bean id="exampleDataSource"
+		class="org.springframework.jdbc.datasource.DriverManagerDataSource">
+		<property name="driverClassName">
+			<value>org.apache.derby.jdbc.EmbeddedDriver</value>
+		</property>
+		<property name="url">
+			<ref bean="t2reference.jdbc.url" />
+		</property>
+	</bean>
+
+	<!-- Configure hibernate to use dynamic schema update -->
+	<bean id="exampleHibernateProperties"
+		class="org.springframework.beans.factory.config.PropertiesFactoryBean">
+		<property name="properties">
+			<props>
+				<prop key="hibernate.hbm2ddl.auto">create</prop>
+				<prop key="hibernate.dialect">
+					org.hibernate.dialect.DerbyDialect
+				</prop>
+				<prop key="hibernate.query.substitutions">
+					true 'T', false 'F'
+				</prop>
+				<prop key="hibernate.show_sql">false</prop>
+				<prop key="hibernate.c3p0.minPoolSize">5</prop>
+				<prop key="hibernate.c3p0.maxPoolSize">20</prop>
+				<prop key="hibernate.c3p0.timeout">600</prop>
+				<prop key="hibernate.c3p0.max_statement">50</prop>
+				<prop key="hibernate.c3p0.testConnectionOnCheckout">
+					false
+				</prop>
+				<prop key="show_sql">true</prop>
+				<prop key="format_sql">true</prop>
+			</props>
+		</property>
+	</bean>
+
+	<!-- A regular hibernate session factory -->
+	<bean id="sessionFactoryBean"
+		class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
+		<property name="dataSource">
+			<ref local="exampleDataSource" />
+		</property>
+		<property name="hibernateProperties">
+			<ref bean="exampleHibernateProperties" />
+		</property>
+		<property name="mappingResources">
+			<list>
+				<value>
+					net/sf/taverna/t2/reference/AbstractExternalReference.hbm.xml
+				</value>
+				<value>
+					net/sf/taverna/t2/reference/impl/ReferenceSetImpl.hbm.xml
+				</value>
+				<value>
+					net/sf/taverna/t2/reference/impl/T2ReferenceListImpl.hbm.xml
+				</value>
+				<value>
+					net/sf/taverna/t2/reference/impl/ErrorDocumentImpl.hbm.xml
+				</value>
+			</list>
+		</property>
+	</bean>
+
+	<!-- Test data access object -->
+	<bean id="testDao"
+		class="net.sf.taverna.t2.reference.impl.TransactionalHibernateReferenceSetDao">
+		<property name="sessionFactory">
+			<ref local="sessionFactoryBean" />
+		</property>
+	</bean>
+
+	<!-- Test list data access object -->
+	<bean id="testListDao"
+		class="net.sf.taverna.t2.reference.impl.TransactionalHibernateListDao">
+		<property name="sessionFactory">
+			<ref local="sessionFactoryBean" />
+		</property>
+	</bean>
+	
+	<!-- Test list data access object -->
+	<bean id="testErrorDao"
+		class="net.sf.taverna.t2.reference.impl.TransactionalHibernateErrorDocumentDao">
+		<property name="sessionFactory">
+			<ref local="sessionFactoryBean" />
+		</property>
+	</bean>
+
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/test/resources/vanillaInMemoryAppContext.xml
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/test/resources/vanillaInMemoryAppContext.xml b/taverna-reference-impl/src/test/resources/vanillaInMemoryAppContext.xml
new file mode 100644
index 0000000..6ea6565
--- /dev/null
+++ b/taverna-reference-impl/src/test/resources/vanillaInMemoryAppContext.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- A test context with no raven aware components used by the DatabaseSetupTest -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:aop="http://www.springframework.org/schema/aop"
+	xmlns:tx="http://www.springframework.org/schema/tx"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+		http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
+        http://www.springframework.org/schema/context
+        http://www.springframework.org/schema/context/spring-context-2.5.xsd
+        http://www.springframework.org/schema/tx 
+        http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
+
+	<!-- Test data access object -->
+	<bean id="testDao"
+		class="net.sf.taverna.t2.reference.impl.InMemoryReferenceSetDao">
+	</bean>
+
+	<!-- Test list data access object -->
+	<bean id="testListDao"
+		class="net.sf.taverna.t2.reference.impl.InMemoryListDao">
+	</bean>
+	
+	<!-- Test list data access object -->
+	<bean id="testErrorDao"
+		class="net.sf.taverna.t2.reference.impl.InMemoryErrorDocumentDao">
+	</bean>
+
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-testhelpers/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-reference-testhelpers/pom.xml b/taverna-reference-testhelpers/pom.xml
new file mode 100644
index 0000000..0f99adf
--- /dev/null
+++ b/taverna-reference-testhelpers/pom.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.taverna.engine</groupId>
+		<artifactId>taverna-engine</artifactId>
+		<version>3.1.0-incubating-SNAPSHOT</version>
+	</parent>
+	<artifactId>taverna-reference-testhelpers</artifactId>
+	<packaging>bundle</packaging>
+	<name>Apache Taverna Reference Test Helpers</name>
+
+	<description>
+		In order to properly test OSGi-loaded t2ference modules
+		we need a module that is entire external
+		to t2reference and to the test cases. If the test
+		implementations are included in either the api, core
+		implementation or test modules they will be loaded by the root
+		classloader of the test runner - by putting them in an
+		independent artifact we allow them to be loaded through
+		various SPI discovery mechanisms as they would be in a 'real'
+		environment.
+	</description>
+
+	<dependencies>
+		<!-- Only depend on the t2reference API package here -->
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-reference-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+      <version>${log4j.version}</version>
+		</dependency>
+	</dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/BlueReference.java
----------------------------------------------------------------------
diff --git a/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/BlueReference.java b/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/BlueReference.java
new file mode 100644
index 0000000..5eabe9d
--- /dev/null
+++ b/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/BlueReference.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2referencetest;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+
+import net.sf.taverna.t2.reference.AbstractExternalReference;
+import net.sf.taverna.t2.reference.DereferenceException;
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ReferenceContext;
+import net.sf.taverna.t2.reference.ReferencedDataNature;
+
+/**
+ * BlueReferences carry their data as an internal String and have a resolution
+ * cost of 1.0f whatever the value of that string.
+ * 
+ * @author Tom Oinn
+ * 
+ */
+public class BlueReference extends AbstractExternalReference implements
+		ExternalReferenceSPI {
+
+	// Hold the 'value' of this reference, probably the simplest backing store
+	// possible for an ExternalReferenceSPI implementation :)
+	private String contents;
+
+	public BlueReference() {
+		//
+	}
+
+	public BlueReference(String contents) {
+		this.contents = contents;
+	}
+
+	/**
+	 * Set the 'value' of this reference as a string. It's not really a
+	 * reference type in any true sense of the word, but it'll do for testing
+	 * the augmentation system. This method is really here so you can configure
+	 * test beans from spring.
+	 */
+	public void setContents(String contents) {
+		this.contents = contents;
+	}
+
+	/**
+	 * Get the 'value' of this reference as a string, really just returns the
+	 * internal string representation.
+	 */
+	public String getContents() {
+		return this.contents;
+	}
+
+	/**
+	 * Fakes a de-reference operation, returning a byte stream over the string
+	 * data.
+	 */
+	@Override
+	public InputStream openStream(ReferenceContext arg0) {
+		try {
+			return new ByteArrayInputStream(this.contents
+					.getBytes(getCharset()));
+		} catch (UnsupportedEncodingException e) {
+			throw new DereferenceException(e);
+		}
+	}
+
+	/**
+	 * Default resolution cost of 1.0f whatever the contents
+	 */
+	@Override
+	public float getResolutionCost() {
+		return 1.0f;
+	}
+
+	/**
+	 * Data nature set to 'ReferencedDataNature.TEXT'
+	 */
+	@Override
+	public ReferencedDataNature getDataNature() {
+		return ReferencedDataNature.TEXT;
+	}
+
+	/**
+	 * Character encoding set to 'UTF-8'
+	 */
+	@Override
+	public String getCharset() {
+		return "UTF-8";
+	}
+
+	/**
+	 * String representation for testing, returns <code>blue{CONTENTS}</code>
+	 */
+	@Override
+	public String toString() {
+		return "blue{" + contents + "}";
+	}
+
+	@Override
+	public Long getApproximateSizeInBytes() {
+		return new Long(contents.getBytes().length);
+	}
+
+	@Override
+	public ExternalReferenceSPI clone() throws CloneNotSupportedException {
+		return new BlueReference(this.getContents());
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/DummyReferenceSet.java
----------------------------------------------------------------------
diff --git a/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/DummyReferenceSet.java b/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/DummyReferenceSet.java
new file mode 100644
index 0000000..1d51fe9
--- /dev/null
+++ b/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/DummyReferenceSet.java
@@ -0,0 +1,32 @@
+package net.sf.taverna.t2referencetest;
+
+import java.util.Collections;
+import java.util.Set;
+
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ReferenceSet;
+import net.sf.taverna.t2.reference.T2Reference;
+
+public class DummyReferenceSet implements ReferenceSet {
+	
+	private Set<ExternalReferenceSPI> refs;
+
+	public DummyReferenceSet(ExternalReferenceSPI ref) {
+		refs = Collections.singleton(ref);
+	}
+	
+	@Override
+	public T2Reference getId() {
+		return null;
+	}
+
+	@Override
+	public Set<ExternalReferenceSPI> getExternalReferences() {
+		return refs;
+	}
+
+	@Override
+	public Long getApproximateSizeInBytes() {
+		return null;
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/GreenBuilder.java
----------------------------------------------------------------------
diff --git a/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/GreenBuilder.java b/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/GreenBuilder.java
new file mode 100644
index 0000000..6a11546
--- /dev/null
+++ b/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/GreenBuilder.java
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2referencetest;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+import net.sf.taverna.t2.reference.ExternalReferenceBuilderSPI;
+import net.sf.taverna.t2.reference.ExternalReferenceConstructionException;
+import net.sf.taverna.t2.reference.ReferenceContext;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Trivially build a GreenReference from an InputStream, implementing the
+ * ExternalReferenceBuilderSPI interface. Used in the augmentation test cases.
+ * 
+ * @author Tom Oinn
+ * 
+ */
+public class GreenBuilder implements
+		ExternalReferenceBuilderSPI<GreenReference> {
+
+	private static Logger logger = Logger
+	.getLogger(GreenBuilder.class);
+
+	/**
+	 * Construct a new GreenReference from the given input stream, ignoring the
+	 * otherwise helpful context as we don't need any resources from it. We
+	 * assume UTF-8 encoding as that's what all the test reference types use,
+	 * again, with a real example this might have to be a bit smarter!
+	 * 
+	 * @throws ExternalReferenceConstructionException
+	 *             if there are any issues building the new GreenReference
+	 *             (which there won't be)
+	 */
+	@Override
+	public GreenReference createReference(InputStream is,
+			ReferenceContext context)
+			throws ExternalReferenceConstructionException {
+		GreenReference newReference = new GreenReference();
+		// Read input stream into the 'contents' property of the reference
+		BufferedReader in = new BufferedReader(new InputStreamReader(is));
+		try {
+			newReference.setContents(in.readLine());
+		} catch (IOException e) {
+			throw new ExternalReferenceConstructionException(e);
+		} finally {
+			try {
+				is.close();
+				in.close();
+			} catch (IOException e) {
+				logger.error("Unable to close streams", e);
+			}
+		}
+		return newReference;
+	}
+
+	/**
+	 * Construction cost fixed at 1.5f
+	 * 
+	 * @return <code>1.5f</code>
+	 */
+	@Override
+	public float getConstructionCost() {
+		return 1.5f;
+	}
+
+	/**
+	 * @return <code>{@link net.sf.taverna.t2referencetest.GreenReference GreenReference}.class</code>
+	 */
+	@Override
+	public Class<GreenReference> getReferenceType() {
+		return GreenReference.class;
+	}
+
+	/**
+	 * Doesn't use any context resources so is always enabled
+	 * 
+	 * @return <code>true</code>
+	 */
+	@Override
+	public boolean isEnabled(ReferenceContext arg0) {
+		return true;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/GreenReference.java
----------------------------------------------------------------------
diff --git a/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/GreenReference.java b/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/GreenReference.java
new file mode 100644
index 0000000..e01f604
--- /dev/null
+++ b/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/GreenReference.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2referencetest;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+
+import net.sf.taverna.t2.reference.AbstractExternalReference;
+import net.sf.taverna.t2.reference.DereferenceException;
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ReferenceContext;
+import net.sf.taverna.t2.reference.ReferencedDataNature;
+
+/**
+ * GreenReferences carry their data as an internal String and have a resolution
+ * cost of 1.1f whatever the value of that string.
+ * 
+ * @author Tom Oinn
+ * 
+ */
+public class GreenReference extends AbstractExternalReference implements
+		ExternalReferenceSPI {
+
+	// Hold the 'value' of this reference, probably the simplest backing store
+	// possible for an ExternalReferenceSPI implementation :)
+	private String contents;
+
+	public GreenReference() {
+		//
+	}
+	
+	public GreenReference(String contents) {
+		this.contents = contents;
+	}
+	
+	/**
+	 * Set the 'value' of this reference as a string. It's not really a
+	 * reference type in any true sense of the word, but it'll do for testing
+	 * the augmentation system. This method is really here so you can configure
+	 * test beans from spring. 
+	 */
+	public void setContents(String contents) {
+		this.contents = contents;
+	}
+
+	/**
+	 * Get the 'value' of this reference as a string, really just returns the
+	 * internal string representation.
+	 */
+	public String getContents() {
+		return this.contents;
+	}
+
+	/**
+	 * Fakes a de-reference operation, returning a byte stream over the string
+	 * data.
+	 */
+	@Override
+	public InputStream openStream(ReferenceContext arg0) {
+		try {
+			return new ByteArrayInputStream(this.contents
+					.getBytes(getCharset()));
+		} catch (UnsupportedEncodingException e) {
+			throw new DereferenceException(e);
+		}
+	}
+
+	/**
+	 * Default resolution cost of 1.0f whatever the contents
+	 */
+	@Override
+	public float getResolutionCost() {
+		return 1.1f;
+	}
+
+	/**
+	 * Data nature set to 'ReferencedDataNature.TEXT'
+	 */
+	@Override
+	public ReferencedDataNature getDataNature() {
+		return ReferencedDataNature.TEXT;
+	}
+
+	/**
+	 * Character encoding set to 'UTF-8'
+	 */
+	@Override
+	public String getCharset() {
+		return "UTF-8";
+	}
+
+	/**
+	 * String representation for testing, returns <code>green{CONTENTS}</code>
+	 */
+	@Override
+	public String toString() {
+		return "green{" + contents + "}";
+	}
+
+	@Override
+	public Long getApproximateSizeInBytes() {
+		return new Long(contents.getBytes().length);
+	}
+
+	@Override
+	public ExternalReferenceSPI clone() throws CloneNotSupportedException {
+		return new GreenReference(this.getContents());
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/GreenToRed.java
----------------------------------------------------------------------
diff --git a/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/GreenToRed.java b/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/GreenToRed.java
new file mode 100644
index 0000000..8c673d6
--- /dev/null
+++ b/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/GreenToRed.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2referencetest;
+
+import net.sf.taverna.t2.reference.ExternalReferenceTranslatorSPI;
+import net.sf.taverna.t2.reference.ReferenceContext;
+
+public class GreenToRed implements
+		ExternalReferenceTranslatorSPI<GreenReference, RedReference> {
+
+	@Override
+	public RedReference createReference(GreenReference ref,
+			ReferenceContext context) {
+		RedReference newReference = new RedReference();
+		newReference.setContents(ref.getContents());
+		// Insert a two second pause to simulate reference translation and to
+		// test the behaviour of multiple concurrent translations
+		try {
+			Thread.sleep(2000);
+		} catch (InterruptedException ie) {
+			System.out
+					.println("Translation thread was interrupted, probably something wrong.");
+		}
+		return newReference;
+	}
+
+	@Override
+	public Class<GreenReference> getSourceReferenceType() {
+		return GreenReference.class;
+	}
+
+	@Override
+	public Class<RedReference> getTargetReferenceType() {
+		return RedReference.class;
+	}
+
+	@Override
+	public float getTranslationCost() {
+		return 0.4f;
+	}
+
+	@Override
+	public boolean isEnabled(ReferenceContext arg0) {
+		return true;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/RedReference.java
----------------------------------------------------------------------
diff --git a/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/RedReference.java b/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/RedReference.java
new file mode 100644
index 0000000..0c21c72
--- /dev/null
+++ b/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/RedReference.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2referencetest;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+
+import net.sf.taverna.t2.reference.AbstractExternalReference;
+import net.sf.taverna.t2.reference.DereferenceException;
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ReferenceContext;
+import net.sf.taverna.t2.reference.ReferencedDataNature;
+
+/**
+ * RedReferences carry their data as an internal String and have a resolution
+ * cost of 0.9f whatever the value of that string.
+ * 
+ * @author Tom Oinn
+ * 
+ */
+public class RedReference extends AbstractExternalReference implements
+		ExternalReferenceSPI {
+
+	// Hold the 'value' of this reference, probably the simplest backing store
+	// possible for an ExternalReferenceSPI implementation :)
+	private String contents;
+
+	public RedReference() {
+		//
+	}
+
+	public RedReference(String contents) {
+		this.contents = contents;
+	}
+
+	/**
+	 * Set the 'value' of this reference as a string. It's not really a
+	 * reference type in any true sense of the word, but it'll do for testing
+	 * the augmentation system. This method is really here so you can configure
+	 * test beans from spring.
+	 */
+	public void setContents(String contents) {
+		this.contents = contents;
+	}
+
+	/**
+	 * Get the 'value' of this reference as a string, really just returns the
+	 * internal string representation.
+	 */
+	public String getContents() {
+		return this.contents;
+	}
+
+	/**
+	 * Fakes a de-reference operation, returning a byte stream over the string
+	 * data.
+	 */
+	@Override
+	public InputStream openStream(ReferenceContext arg0) {
+		try {
+			return new ByteArrayInputStream(this.contents
+					.getBytes(getCharset()));
+		} catch (UnsupportedEncodingException e) {
+			throw new DereferenceException(e);
+		}
+	}
+
+	/**
+	 * Default resolution cost of 1.0f whatever the contents
+	 */
+	@Override
+	public float getResolutionCost() {
+		return 0.9f;
+	}
+
+	/**
+	 * Data nature set to 'ReferencedDataNature.TEXT'
+	 */
+	@Override
+	public ReferencedDataNature getDataNature() {
+		return ReferencedDataNature.TEXT;
+	}
+
+	/**
+	 * Character encoding set to 'UTF-8'
+	 */
+	@Override
+	public String getCharset() {
+		return "UTF-8";
+	}
+
+	/**
+	 * String representation for testing, returns <code>red{CONTENTS}</code>
+	 */
+	@Override
+	public String toString() {
+		return "red{" + contents + "}";
+	}
+	
+	@Override
+	public Long getApproximateSizeInBytes() {
+		return new Long(contents.getBytes().length);
+	}
+
+	@Override
+	public ExternalReferenceSPI clone() throws CloneNotSupportedException {
+		return new RedReference(this.getContents());
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/YellowReference.java
----------------------------------------------------------------------
diff --git a/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/YellowReference.java b/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/YellowReference.java
new file mode 100644
index 0000000..b276f58
--- /dev/null
+++ b/taverna-reference-testhelpers/src/main/java/net/sf/taverna/t2referencetest/YellowReference.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2referencetest;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+
+import net.sf.taverna.t2.reference.AbstractExternalReference;
+import net.sf.taverna.t2.reference.DereferenceException;
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ReferenceContext;
+import net.sf.taverna.t2.reference.ReferencedDataNature;
+
+
+/**
+ * YellowReferences carry their data as an internal String and have a resolution
+ * cost of 1.0f whatever the value of that string.
+ * 
+ * @author Tom Oinn
+ * 
+ */
+public class YellowReference extends AbstractExternalReference implements
+		ExternalReferenceSPI {
+
+	// Hold the 'value' of this reference, probably the simplest backing store
+	// possible for an ExternalReferenceSPI implementation :)
+	private String contents;
+
+	public YellowReference() {
+		//
+	}
+	
+	public YellowReference(String contents) {
+		this.contents = contents;
+	}
+	
+	/**
+	 * Set the 'value' of this reference as a string. It's not really a
+	 * reference type in any true sense of the word, but it'll do for testing
+	 * the augmentation system. This method is really here so you can configure
+	 * test beans from spring.
+	 */
+	public void setContents(String contents) {
+		this.contents = contents;
+	}
+
+	/**
+	 * Get the 'value' of this reference as a string, really just returns the
+	 * internal string representation.
+	 */
+	public String getContents() {
+		return this.contents;
+	}
+
+	/**
+	 * Fakes a de-reference operation, returning a byte stream over the string
+	 * data.
+	 */
+	@Override
+	public InputStream openStream(ReferenceContext arg0) {
+		try {
+			return new ByteArrayInputStream(this.contents
+					.getBytes(getCharset()));
+		} catch (UnsupportedEncodingException e) {
+			throw new DereferenceException(e);
+		}
+	}
+
+	/**
+	 * Default resolution cost of 1.0f whatever the contents
+	 */
+	@Override
+	public float getResolutionCost() {
+		return 1.0f;
+	}
+
+	/**
+	 * Data nature set to 'ReferencedDataNature.TEXT'
+	 */
+	@Override
+	public ReferencedDataNature getDataNature() {
+		return ReferencedDataNature.TEXT;
+	}
+
+	/**
+	 * Character encoding set to 'UTF-8'
+	 */
+	@Override
+	public String getCharset() {
+		return "UTF-8";
+	}
+
+	/**
+	 * String representation for testing, returns <code>yellow{CONTENTS}</code>
+	 */
+	@Override
+	public String toString() {
+		return "yellow{" + contents + "}";
+	}
+
+	@Override
+	public Long getApproximateSizeInBytes() {
+		return new Long(contents.getBytes().length);
+	}
+
+	@Override
+	public ExternalReferenceSPI clone() throws CloneNotSupportedException {
+		return new YellowReference(this.getContents());
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-testhelpers/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceBuilderSPI
----------------------------------------------------------------------
diff --git a/taverna-reference-testhelpers/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceBuilderSPI b/taverna-reference-testhelpers/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceBuilderSPI
new file mode 100644
index 0000000..3f1a123
--- /dev/null
+++ b/taverna-reference-testhelpers/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceBuilderSPI
@@ -0,0 +1,2 @@
+# Implementation classes of ExternalReferenceBuilderSPI go here, one per line
+net.sf.taverna.t2referencetest.GreenBuilder
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-testhelpers/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceSPI
----------------------------------------------------------------------
diff --git a/taverna-reference-testhelpers/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceSPI b/taverna-reference-testhelpers/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceSPI
new file mode 100644
index 0000000..20a63d6
--- /dev/null
+++ b/taverna-reference-testhelpers/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceSPI
@@ -0,0 +1,5 @@
+# Implementation classes of ExternalReferenceSPI go here, one per line
+net.sf.taverna.t2referencetest.GreenReference
+net.sf.taverna.t2referencetest.BlueReference
+net.sf.taverna.t2referencetest.RedReference
+net.sf.taverna.t2referencetest.YellowReference
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-testhelpers/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceTranslatorSPI
----------------------------------------------------------------------
diff --git a/taverna-reference-testhelpers/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceTranslatorSPI b/taverna-reference-testhelpers/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceTranslatorSPI
new file mode 100644
index 0000000..7fff1a3
--- /dev/null
+++ b/taverna-reference-testhelpers/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceTranslatorSPI
@@ -0,0 +1,2 @@
+# Implementation classes of ExternalReferenceTranslatorSPI go here, one per line
+net.sf.taverna.t2referencetest.GreenToRed
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-testhelpers/src/main/resources/META-INF/spring/reference-testhelpers-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-reference-testhelpers/src/main/resources/META-INF/spring/reference-testhelpers-context-osgi.xml b/taverna-reference-testhelpers/src/main/resources/META-INF/spring/reference-testhelpers-context-osgi.xml
new file mode 100644
index 0000000..dc6c0a4
--- /dev/null
+++ b/taverna-reference-testhelpers/src/main/resources/META-INF/spring/reference-testhelpers-context-osgi.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans:beans xmlns="http://www.springframework.org/schema/osgi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:beans="http://www.springframework.org/schema/beans"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans 
+                                 http://www.springframework.org/schema/beans/spring-beans.xsd
+                                 http://www.springframework.org/schema/osgi 
+                                 http://www.springframework.org/schema/osgi/spring-osgi.xsd" >
+
+	<service ref="greenBuilder" interface="net.sf.taverna.t2.reference.ExternalReferenceBuilderSPI" />
+
+	<service ref="greenReference" interface="net.sf.taverna.t2.reference.ExternalReferenceSPI" />
+	<service ref="blueReference" interface="net.sf.taverna.t2.reference.ExternalReferenceSPI" />
+	<service ref="redReference" interface="net.sf.taverna.t2.reference.ExternalReferenceSPI" />
+	<service ref="yellowReference" interface="net.sf.taverna.t2.reference.ExternalReferenceSPI" />
+		
+	<service ref="greenToRedTranslator" interface="net.sf.taverna.t2.reference.ExternalReferenceTranslatorSPI" />
+
+</beans:beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-testhelpers/src/main/resources/META-INF/spring/reference-testhelpers-context.xml
----------------------------------------------------------------------
diff --git a/taverna-reference-testhelpers/src/main/resources/META-INF/spring/reference-testhelpers-context.xml b/taverna-reference-testhelpers/src/main/resources/META-INF/spring/reference-testhelpers-context.xml
new file mode 100644
index 0000000..8838328
--- /dev/null
+++ b/taverna-reference-testhelpers/src/main/resources/META-INF/spring/reference-testhelpers-context.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans 
+                           http://www.springframework.org/schema/beans/spring-beans.xsd">
+                           
+	<bean id="greenBuilder" class="net.sf.taverna.t2referencetest.GreenBuilder" />
+
+	<bean id="greenReference" class="net.sf.taverna.t2referencetest.GreenReference" />
+	<bean id="blueReference" class="net.sf.taverna.t2referencetest.BlueReference" />
+	<bean id="redReference" class="net.sf.taverna.t2referencetest.RedReference" />
+	<bean id="yellowReference" class="net.sf.taverna.t2referencetest.YellowReference" />
+
+	<bean id="greenToRedTranslator" class="net.sf.taverna.t2referencetest.GreenToRed" />
+
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-testhelpers/src/main/resources/net/sf/taverna/t2referencetest/BlueReference.hbm.xml
----------------------------------------------------------------------
diff --git a/taverna-reference-testhelpers/src/main/resources/net/sf/taverna/t2referencetest/BlueReference.hbm.xml b/taverna-reference-testhelpers/src/main/resources/net/sf/taverna/t2referencetest/BlueReference.hbm.xml
new file mode 100644
index 0000000..9483784
--- /dev/null
+++ b/taverna-reference-testhelpers/src/main/resources/net/sf/taverna/t2referencetest/BlueReference.hbm.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+                "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+                "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<!-- Hibernate mapping for blue reference bean -->
+<hibernate-mapping>
+	<joined-subclass
+		name="net.sf.taverna.t2referencetest.BlueReference"
+		extends="net.sf.taverna.t2.reference.AbstractExternalReference">
+		<!-- Link to primary key from abstract superclass -->
+		<key column="bean_id" />
+		<!-- Dummy reference specific props -->
+		<property name="contents" type="string" />
+	</joined-subclass>
+</hibernate-mapping>
+

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-testhelpers/src/main/resources/net/sf/taverna/t2referencetest/GreenReference.hbm.xml
----------------------------------------------------------------------
diff --git a/taverna-reference-testhelpers/src/main/resources/net/sf/taverna/t2referencetest/GreenReference.hbm.xml b/taverna-reference-testhelpers/src/main/resources/net/sf/taverna/t2referencetest/GreenReference.hbm.xml
new file mode 100644
index 0000000..dc65151
--- /dev/null
+++ b/taverna-reference-testhelpers/src/main/resources/net/sf/taverna/t2referencetest/GreenReference.hbm.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+                "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+                "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<!-- Hibernate mapping for green reference bean -->
+<hibernate-mapping>
+	<joined-subclass
+		name="net.sf.taverna.t2referencetest.GreenReference"
+		extends="net.sf.taverna.t2.reference.AbstractExternalReference">
+		<!-- Link to primary key from abstract superclass -->
+		<key column="bean_id" />
+		<!-- Dummy reference specific props -->
+		<property name="contents" type="string" />
+	</joined-subclass>
+</hibernate-mapping>
+

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-testhelpers/src/main/resources/net/sf/taverna/t2referencetest/RedReference.hbm.xml
----------------------------------------------------------------------
diff --git a/taverna-reference-testhelpers/src/main/resources/net/sf/taverna/t2referencetest/RedReference.hbm.xml b/taverna-reference-testhelpers/src/main/resources/net/sf/taverna/t2referencetest/RedReference.hbm.xml
new file mode 100644
index 0000000..176f60d
--- /dev/null
+++ b/taverna-reference-testhelpers/src/main/resources/net/sf/taverna/t2referencetest/RedReference.hbm.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+                "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+                "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<!-- Hibernate mapping for red reference bean -->
+<hibernate-mapping>
+	<joined-subclass
+		name="net.sf.taverna.t2referencetest.RedReference"
+		extends="net.sf.taverna.t2.reference.AbstractExternalReference">
+		<!-- Link to primary key from abstract superclass -->
+		<key column="bean_id" />
+		<!-- Dummy reference specific props -->
+		<property name="contents" type="string" />
+	</joined-subclass>
+</hibernate-mapping>
+

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-testhelpers/src/main/resources/net/sf/taverna/t2referencetest/YellowReference.hbm.xml
----------------------------------------------------------------------
diff --git a/taverna-reference-testhelpers/src/main/resources/net/sf/taverna/t2referencetest/YellowReference.hbm.xml b/taverna-reference-testhelpers/src/main/resources/net/sf/taverna/t2referencetest/YellowReference.hbm.xml
new file mode 100644
index 0000000..6f357f8
--- /dev/null
+++ b/taverna-reference-testhelpers/src/main/resources/net/sf/taverna/t2referencetest/YellowReference.hbm.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+                "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+                "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<!-- Hibernate mapping for yellow reference bean -->
+<hibernate-mapping>
+	<joined-subclass
+		name="net.sf.taverna.t2referencetest.YellowReference"
+		extends="net.sf.taverna.t2.reference.AbstractExternalReference">
+		<!-- Link to primary key from abstract superclass -->
+		<key column="bean_id" />
+		<!-- Dummy reference specific props -->
+		<property name="contents" type="string" />
+	</joined-subclass>
+</hibernate-mapping>
+


[53/54] incubator-taverna-engine git commit: uk.org.taverna.databundle and uk.org.taverna.robundle

Posted by st...@apache.org.
uk.org.taverna.databundle and uk.org.taverna.robundle


Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/commit/b8bb0b6e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/tree/b8bb0b6e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/diff/b8bb0b6e

Branch: refs/heads/master
Commit: b8bb0b6e98738ecd137ef7f952aa6b33c48f3f0f
Parents: 4ee7aa0
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sat Feb 21 23:31:32 2015 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sat Feb 21 23:31:32 2015 +0000

----------------------------------------------------------------------
 .../platform/execution/api/AbstractExecution.java       |  2 +-
 .../execution/api/AbstractExecutionService.java         |  2 +-
 .../org/taverna/platform/execution/api/Execution.java   |  2 +-
 .../platform/execution/api/ExecutionService.java        |  2 +-
 .../platform/execution/api/AbstractExecutionTest.java   |  4 ++--
 .../platform/execution/impl/local/LocalExecution.java   |  4 ++--
 .../execution/impl/local/LocalExecutionMonitor.java     |  4 ++--
 .../execution/impl/local/LocalExecutionService.java     |  2 +-
 .../execution/impl/local/T2ReferenceConverter.java      |  2 +-
 .../platform/execution/impl/remote/RemoteExecution.java |  2 +-
 .../execution/impl/remote/RemoteExecutionService.java   |  2 +-
 .../test/java/uk/org/taverna/platform/PlatformIT.java   |  4 ++--
 .../src/test/java/uk/org/taverna/platform/RunIT.java    |  4 ++--
 .../java/org/purl/wf4ever/provtaverna/export/Saver.java |  4 ++--
 .../wf4ever/provtaverna/export/W3ProvenanceExport.java  | 12 ++++++------
 .../uk/org/taverna/platform/report/WorkflowReport.java  |  3 +--
 .../uk/org/taverna/platform/run/api/RunProfile.java     |  2 +-
 .../uk/org/taverna/platform/run/api/RunService.java     |  2 +-
 .../uk/org/taverna/platform/run/api/RunProfileTest.java |  6 +++---
 .../main/java/uk/org/taverna/platform/run/impl/Run.java |  6 +++---
 .../org/taverna/platform/run/impl/RunServiceImpl.java   |  4 ++--
 .../taverna/platform/run/impl/WorkflowReportJSON.java   | 12 ++++++------
 .../taverna/platform/run/impl/DummyWorkflowReport.java  |  4 ++--
 .../java/uk/org/taverna/platform/run/impl/RunTest.java  |  4 ++--
 .../platform/run/impl/WorkflowReportJSONTest.java       |  4 ++--
 25 files changed, 49 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/b8bb0b6e/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecution.java
----------------------------------------------------------------------
diff --git a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecution.java b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecution.java
index 5b464ef..5688460 100644
--- a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecution.java
+++ b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecution.java
@@ -22,7 +22,7 @@ package uk.org.taverna.platform.execution.api;
 
 import java.util.UUID;
 
-import org.purl.wf4ever.robundle.Bundle;
+import org.apache.taverna.robundle.Bundle;
 
 import uk.org.taverna.platform.report.ActivityReport;
 import uk.org.taverna.platform.report.ProcessorReport;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/b8bb0b6e/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecutionService.java
----------------------------------------------------------------------
diff --git a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecutionService.java b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecutionService.java
index d463795..18b5a09 100755
--- a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecutionService.java
+++ b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecutionService.java
@@ -24,7 +24,7 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.purl.wf4ever.robundle.Bundle;
+import org.apache.taverna.robundle.Bundle;
 
 import uk.org.taverna.platform.report.WorkflowReport;
 import org.apache.taverna.scufl2.api.container.WorkflowBundle;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/b8bb0b6e/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/Execution.java
----------------------------------------------------------------------
diff --git a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/Execution.java b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/Execution.java
index 8e2f03a..6f12edd 100644
--- a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/Execution.java
+++ b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/Execution.java
@@ -20,7 +20,7 @@
  ******************************************************************************/
 package uk.org.taverna.platform.execution.api;
 
-import org.purl.wf4ever.robundle.Bundle;
+import org.apache.taverna.robundle.Bundle;
 
 import uk.org.taverna.platform.report.WorkflowReport;
 import org.apache.taverna.scufl2.api.container.WorkflowBundle;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/b8bb0b6e/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionService.java
----------------------------------------------------------------------
diff --git a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionService.java b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionService.java
index 2b67788..0f73ab3 100755
--- a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionService.java
+++ b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionService.java
@@ -22,7 +22,7 @@ package uk.org.taverna.platform.execution.api;
 
 import java.util.Set;
 
-import org.purl.wf4ever.robundle.Bundle;
+import org.apache.taverna.robundle.Bundle;
 
 import uk.org.taverna.platform.report.WorkflowReport;
 import org.apache.taverna.scufl2.api.container.WorkflowBundle;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/b8bb0b6e/taverna-execution-api/src/test/java/uk/org/taverna/platform/execution/api/AbstractExecutionTest.java
----------------------------------------------------------------------
diff --git a/taverna-execution-api/src/test/java/uk/org/taverna/platform/execution/api/AbstractExecutionTest.java b/taverna-execution-api/src/test/java/uk/org/taverna/platform/execution/api/AbstractExecutionTest.java
index 92f705b..9b3361e 100644
--- a/taverna-execution-api/src/test/java/uk/org/taverna/platform/execution/api/AbstractExecutionTest.java
+++ b/taverna-execution-api/src/test/java/uk/org/taverna/platform/execution/api/AbstractExecutionTest.java
@@ -26,9 +26,9 @@ import static org.junit.Assert.assertNotNull;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
-import org.purl.wf4ever.robundle.Bundle;
+import org.apache.taverna.robundle.Bundle;
 
-import uk.org.taverna.databundle.DataBundles;
+import org.apache.taverna.databundle.DataBundles;
 import uk.org.taverna.platform.report.ActivityReport;
 import uk.org.taverna.platform.report.ProcessorReport;
 import uk.org.taverna.platform.report.WorkflowReport;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/b8bb0b6e/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecution.java
----------------------------------------------------------------------
diff --git a/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecution.java b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecution.java
index e4786ca..796828d 100644
--- a/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecution.java
+++ b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecution.java
@@ -47,9 +47,9 @@ import net.sf.taverna.t2.workflowmodel.DataflowInputPort;
 import net.sf.taverna.t2.workflowmodel.Edits;
 import net.sf.taverna.t2.workflowmodel.InvalidDataflowException;
 
-import org.purl.wf4ever.robundle.Bundle;
+import org.apache.taverna.robundle.Bundle;
 
-import uk.org.taverna.databundle.DataBundles;
+import org.apache.taverna.databundle.DataBundles;
 import uk.org.taverna.platform.capability.api.ActivityService;
 import uk.org.taverna.platform.capability.api.DispatchLayerService;
 import uk.org.taverna.platform.execution.api.AbstractExecution;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/b8bb0b6e/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionMonitor.java
----------------------------------------------------------------------
diff --git a/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionMonitor.java b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionMonitor.java
index bf6aaa6..4c57403 100755
--- a/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionMonitor.java
+++ b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionMonitor.java
@@ -67,9 +67,9 @@ import net.sf.taverna.t2.workflowmodel.processor.activity.Activity;
 import net.sf.taverna.t2.workflowmodel.processor.dispatch.events.DispatchJobEvent;
 import net.sf.taverna.t2.workflowmodel.processor.dispatch.events.DispatchResultEvent;
 
-import org.purl.wf4ever.robundle.Bundle;
+import org.apache.taverna.robundle.Bundle;
 
-import uk.org.taverna.databundle.DataBundles;
+import org.apache.taverna.databundle.DataBundles;
 import uk.org.taverna.platform.execution.api.InvalidWorkflowException;
 import uk.org.taverna.platform.report.ActivityReport;
 import uk.org.taverna.platform.report.Invocation;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/b8bb0b6e/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionService.java
----------------------------------------------------------------------
diff --git a/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionService.java b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionService.java
index 5cd238b..fe4b3bc 100644
--- a/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionService.java
+++ b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionService.java
@@ -29,7 +29,7 @@ import net.sf.taverna.t2.reference.ReferenceService;
 import net.sf.taverna.t2.workflowmodel.Dataflow;
 import net.sf.taverna.t2.workflowmodel.Edits;
 
-import org.purl.wf4ever.robundle.Bundle;
+import org.apache.taverna.robundle.Bundle;
 
 import uk.org.taverna.platform.capability.api.ActivityService;
 import uk.org.taverna.platform.capability.api.DispatchLayerService;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/b8bb0b6e/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/T2ReferenceConverter.java
----------------------------------------------------------------------
diff --git a/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/T2ReferenceConverter.java b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/T2ReferenceConverter.java
index 879074a..7de9f48 100644
--- a/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/T2ReferenceConverter.java
+++ b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/T2ReferenceConverter.java
@@ -10,7 +10,7 @@ import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.List;
 
-import uk.org.taverna.databundle.DataBundles;
+import org.apache.taverna.databundle.DataBundles;
 
 /**
  * @author David Withers

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/b8bb0b6e/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecution.java
----------------------------------------------------------------------
diff --git a/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecution.java b/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecution.java
index 8231409..eb33287 100644
--- a/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecution.java
+++ b/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecution.java
@@ -20,7 +20,7 @@
  ******************************************************************************/
 package uk.org.taverna.platform.execution.impl.remote;
 
-import org.purl.wf4ever.robundle.Bundle;
+import org.apache.taverna.robundle.Bundle;
 
 import uk.org.taverna.platform.execution.api.AbstractExecution;
 import uk.org.taverna.platform.report.ActivityReport;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/b8bb0b6e/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecutionService.java
----------------------------------------------------------------------
diff --git a/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecutionService.java b/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecutionService.java
index 6910a3d..3e4b030 100644
--- a/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecutionService.java
+++ b/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecutionService.java
@@ -23,7 +23,7 @@ package uk.org.taverna.platform.execution.impl.remote;
 import java.util.Collections;
 import java.util.Set;
 
-import org.purl.wf4ever.robundle.Bundle;
+import org.apache.taverna.robundle.Bundle;
 
 import uk.org.taverna.platform.execution.api.AbstractExecutionService;
 import uk.org.taverna.platform.execution.api.Execution;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/b8bb0b6e/taverna-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java b/taverna-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java
index 789ec33..7af6202 100644
--- a/taverna-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java
+++ b/taverna-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java
@@ -33,8 +33,8 @@ import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
 import org.junit.Ignore;
 
-import uk.org.taverna.databundle.DataBundles;
-import uk.org.taverna.databundle.ErrorDocument;
+import org.apache.taverna.databundle.DataBundles;
+import org.apache.taverna.databundle.ErrorDocument;
 import uk.org.taverna.platform.report.State;
 import uk.org.taverna.platform.report.WorkflowReport;
 import org.apache.taverna.scufl2.api.container.WorkflowBundle;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/b8bb0b6e/taverna-integration-tests/src/test/java/uk/org/taverna/platform/RunIT.java
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/java/uk/org/taverna/platform/RunIT.java b/taverna-integration-tests/src/test/java/uk/org/taverna/platform/RunIT.java
index b10d384..be24d24 100644
--- a/taverna-integration-tests/src/test/java/uk/org/taverna/platform/RunIT.java
+++ b/taverna-integration-tests/src/test/java/uk/org/taverna/platform/RunIT.java
@@ -44,9 +44,9 @@ import org.junit.BeforeClass;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.osgi.framework.BundleContext;
-import org.purl.wf4ever.robundle.Bundle;
+import org.apache.taverna.robundle.Bundle;
 
-import uk.org.taverna.databundle.DataBundles;
+import org.apache.taverna.databundle.DataBundles;
 import uk.org.taverna.osgi.starter.TavernaStarter;
 import uk.org.taverna.platform.execution.api.ExecutionEnvironment;
 import uk.org.taverna.platform.report.State;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/b8bb0b6e/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/Saver.java
----------------------------------------------------------------------
diff --git a/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/Saver.java b/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/Saver.java
index c903e98..b53d6e9 100644
--- a/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/Saver.java
+++ b/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/Saver.java
@@ -43,9 +43,9 @@ import org.openrdf.rio.RDFParserFactory;
 import org.openrdf.rio.RDFParserRegistry;
 import org.openrdf.rio.RDFWriterFactory;
 import org.openrdf.rio.RDFWriterRegistry;
-import org.purl.wf4ever.robundle.Bundle;
+import org.apache.taverna.robundle.Bundle;
 
-import uk.org.taverna.databundle.DataBundles;
+import org.apache.taverna.databundle.DataBundles;
 
 public class Saver {
 

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/b8bb0b6e/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/W3ProvenanceExport.java
----------------------------------------------------------------------
diff --git a/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/W3ProvenanceExport.java b/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/W3ProvenanceExport.java
index d776539..fb8e779 100644
--- a/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/W3ProvenanceExport.java
+++ b/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/W3ProvenanceExport.java
@@ -49,13 +49,13 @@ import org.apache.jena.riot.WriterGraphRIOT;
 import org.apache.jena.riot.system.RiotLib;
 import org.apache.log4j.Logger;
 import org.purl.wf4ever.provtaverna.owl.TavernaProvModel;
-import org.purl.wf4ever.robundle.Bundle;
-import org.purl.wf4ever.robundle.manifest.Agent;
-import org.purl.wf4ever.robundle.manifest.Manifest;
-import org.purl.wf4ever.robundle.manifest.PathAnnotation;
-import org.purl.wf4ever.robundle.manifest.PathMetadata;
+import org.apache.taverna.robundle.Bundle;
+import org.apache.taverna.robundle.manifest.Agent;
+import org.apache.taverna.robundle.manifest.Manifest;
+import org.apache.taverna.robundle.manifest.PathAnnotation;
+import org.apache.taverna.robundle.manifest.PathMetadata;
 
-import uk.org.taverna.databundle.DataBundles;
+import org.apache.taverna.databundle.DataBundles;
 import org.apache.taverna.scufl2.api.common.URITools;
 import org.apache.taverna.scufl2.api.container.WorkflowBundle;
 import org.apache.taverna.scufl2.api.io.ReaderException;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/b8bb0b6e/taverna-report-api/src/main/java/uk/org/taverna/platform/report/WorkflowReport.java
----------------------------------------------------------------------
diff --git a/taverna-report-api/src/main/java/uk/org/taverna/platform/report/WorkflowReport.java b/taverna-report-api/src/main/java/uk/org/taverna/platform/report/WorkflowReport.java
index fc000fc..1b0ca1c 100644
--- a/taverna-report-api/src/main/java/uk/org/taverna/platform/report/WorkflowReport.java
+++ b/taverna-report-api/src/main/java/uk/org/taverna/platform/report/WorkflowReport.java
@@ -27,8 +27,7 @@ import java.util.LinkedHashSet;
 import java.util.Set;
 import java.util.logging.Logger;
 
-import org.purl.wf4ever.robundle.Bundle;
-
+import org.apache.taverna.robundle.Bundle;
 import org.apache.taverna.scufl2.api.core.Workflow;
 
 import com.fasterxml.jackson.annotation.JsonIgnore;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/b8bb0b6e/taverna-run-api/src/main/java/uk/org/taverna/platform/run/api/RunProfile.java
----------------------------------------------------------------------
diff --git a/taverna-run-api/src/main/java/uk/org/taverna/platform/run/api/RunProfile.java b/taverna-run-api/src/main/java/uk/org/taverna/platform/run/api/RunProfile.java
index b3a94ad..deecf8e 100644
--- a/taverna-run-api/src/main/java/uk/org/taverna/platform/run/api/RunProfile.java
+++ b/taverna-run-api/src/main/java/uk/org/taverna/platform/run/api/RunProfile.java
@@ -1,6 +1,6 @@
 package uk.org.taverna.platform.run.api;
 
-import org.purl.wf4ever.robundle.Bundle;
+import org.apache.taverna.robundle.Bundle;
 
 import uk.org.taverna.platform.execution.api.ExecutionEnvironment;
 import org.apache.taverna.scufl2.api.container.WorkflowBundle;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/b8bb0b6e/taverna-run-api/src/main/java/uk/org/taverna/platform/run/api/RunService.java
----------------------------------------------------------------------
diff --git a/taverna-run-api/src/main/java/uk/org/taverna/platform/run/api/RunService.java b/taverna-run-api/src/main/java/uk/org/taverna/platform/run/api/RunService.java
index 1e98021..03705d7 100644
--- a/taverna-run-api/src/main/java/uk/org/taverna/platform/run/api/RunService.java
+++ b/taverna-run-api/src/main/java/uk/org/taverna/platform/run/api/RunService.java
@@ -5,7 +5,7 @@ import java.io.IOException;
 import java.util.List;
 import java.util.Set;
 
-import org.purl.wf4ever.robundle.Bundle;
+import org.apache.taverna.robundle.Bundle;
 
 import uk.org.taverna.platform.execution.api.ExecutionEnvironment;
 import uk.org.taverna.platform.execution.api.InvalidExecutionIdException;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/b8bb0b6e/taverna-run-api/src/test/java/uk/org/taverna/platform/run/api/RunProfileTest.java
----------------------------------------------------------------------
diff --git a/taverna-run-api/src/test/java/uk/org/taverna/platform/run/api/RunProfileTest.java b/taverna-run-api/src/test/java/uk/org/taverna/platform/run/api/RunProfileTest.java
index 5399ea6..ec3830a 100644
--- a/taverna-run-api/src/test/java/uk/org/taverna/platform/run/api/RunProfileTest.java
+++ b/taverna-run-api/src/test/java/uk/org/taverna/platform/run/api/RunProfileTest.java
@@ -27,9 +27,9 @@ import static org.junit.Assert.assertNull;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
-import org.purl.wf4ever.robundle.Bundle;
+import org.apache.taverna.robundle.Bundle;
 
-import uk.org.taverna.databundle.DataBundles;
+import org.apache.taverna.databundle.DataBundles;
 import uk.org.taverna.platform.execution.api.ExecutionEnvironment;
 import uk.org.taverna.platform.execution.impl.local.LocalExecutionEnvironment;
 import uk.org.taverna.platform.execution.impl.local.LocalExecutionService;
@@ -195,7 +195,7 @@ public class RunProfileTest {
 
 	/**
 	 * Test method for
-	 * {@link uk.org.taverna.platform.run.api.RunProfile#setDataBundle(org.purl.wf4ever.robundle.Bundle)}
+	 * {@link uk.org.taverna.platform.run.api.RunProfile#setDataBundle(org.apache.taverna.robundle.Bundle)}
 	 * .
 	 */
 	@Test

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/b8bb0b6e/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/Run.java
----------------------------------------------------------------------
diff --git a/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/Run.java b/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/Run.java
index 475796f..90b44db 100755
--- a/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/Run.java
+++ b/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/Run.java
@@ -34,10 +34,10 @@ import java.util.Date;
 import java.util.UUID;
 import java.util.logging.Logger;
 
-import org.purl.wf4ever.robundle.Bundle;
-import org.purl.wf4ever.robundle.manifest.Manifest;
+import org.apache.taverna.robundle.Bundle;
+import org.apache.taverna.robundle.manifest.Manifest;
 
-import uk.org.taverna.databundle.DataBundles;
+import org.apache.taverna.databundle.DataBundles;
 import uk.org.taverna.platform.execution.api.ExecutionEnvironment;
 import uk.org.taverna.platform.execution.api.InvalidExecutionIdException;
 import uk.org.taverna.platform.execution.api.InvalidWorkflowException;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/b8bb0b6e/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/RunServiceImpl.java
----------------------------------------------------------------------
diff --git a/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/RunServiceImpl.java b/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/RunServiceImpl.java
index e6da8d2..1a4ca29 100755
--- a/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/RunServiceImpl.java
+++ b/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/RunServiceImpl.java
@@ -38,9 +38,9 @@ import java.util.logging.Logger;
 
 import org.osgi.service.event.Event;
 import org.osgi.service.event.EventAdmin;
-import org.purl.wf4ever.robundle.Bundle;
+import org.apache.taverna.robundle.Bundle;
 
-import uk.org.taverna.databundle.DataBundles;
+import org.apache.taverna.databundle.DataBundles;
 import uk.org.taverna.platform.execution.api.ExecutionEnvironment;
 import uk.org.taverna.platform.execution.api.ExecutionEnvironmentService;
 import uk.org.taverna.platform.execution.api.InvalidExecutionIdException;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/b8bb0b6e/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/WorkflowReportJSON.java
----------------------------------------------------------------------
diff --git a/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/WorkflowReportJSON.java b/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/WorkflowReportJSON.java
index fb1cd43..0c6f8e3 100644
--- a/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/WorkflowReportJSON.java
+++ b/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/WorkflowReportJSON.java
@@ -13,10 +13,10 @@ import static java.nio.file.Files.newBufferedWriter;
 import static java.nio.file.StandardOpenOption.CREATE;
 import static java.nio.file.StandardOpenOption.TRUNCATE_EXISTING;
 import static java.nio.file.StandardOpenOption.WRITE;
-import static uk.org.taverna.databundle.DataBundles.getWorkflow;
-import static uk.org.taverna.databundle.DataBundles.getWorkflowBundle;
-import static uk.org.taverna.databundle.DataBundles.getWorkflowRunReport;
-import static uk.org.taverna.databundle.DataBundles.setWorkflowBundle;
+import static org.apache.taverna.databundle.DataBundles.getWorkflow;
+import static org.apache.taverna.databundle.DataBundles.getWorkflowBundle;
+import static org.apache.taverna.databundle.DataBundles.getWorkflowRunReport;
+import static org.apache.taverna.databundle.DataBundles.setWorkflowBundle;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -32,8 +32,8 @@ import java.util.Map;
 import java.util.SortedMap;
 import java.util.TreeMap;
 
-import org.purl.wf4ever.robundle.Bundle;
-import org.purl.wf4ever.robundle.manifest.Manifest.PathMixin;
+import org.apache.taverna.robundle.Bundle;
+import org.apache.taverna.robundle.manifest.Manifest.PathMixin;
 
 import uk.org.taverna.platform.report.ActivityReport;
 import uk.org.taverna.platform.report.Invocation;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/b8bb0b6e/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/DummyWorkflowReport.java
----------------------------------------------------------------------
diff --git a/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/DummyWorkflowReport.java b/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/DummyWorkflowReport.java
index 3dfed87..b30b90b 100644
--- a/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/DummyWorkflowReport.java
+++ b/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/DummyWorkflowReport.java
@@ -8,9 +8,9 @@ import java.util.TimeZone;
 import java.util.UUID;
 
 import org.junit.Before;
-import org.purl.wf4ever.robundle.Bundle;
+import org.apache.taverna.robundle.Bundle;
 
-import uk.org.taverna.databundle.DataBundles;
+import org.apache.taverna.databundle.DataBundles;
 import uk.org.taverna.platform.report.ActivityReport;
 import uk.org.taverna.platform.report.Invocation;
 import uk.org.taverna.platform.report.ProcessorReport;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/b8bb0b6e/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/RunTest.java
----------------------------------------------------------------------
diff --git a/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/RunTest.java b/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/RunTest.java
index f0da91d..38c2f8f 100644
--- a/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/RunTest.java
+++ b/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/RunTest.java
@@ -11,11 +11,11 @@ import java.util.UUID;
 
 import org.junit.Before;
 import org.junit.Test;
-import org.purl.wf4ever.robundle.Bundle;
+import org.apache.taverna.robundle.Bundle;
 
 import com.fasterxml.jackson.databind.JsonNode;
 
-import uk.org.taverna.databundle.DataBundles;
+import org.apache.taverna.databundle.DataBundles;
 import uk.org.taverna.platform.execution.api.ExecutionEnvironment;
 import uk.org.taverna.platform.execution.api.ExecutionService;
 import uk.org.taverna.platform.report.State;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/b8bb0b6e/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/WorkflowReportJSONTest.java
----------------------------------------------------------------------
diff --git a/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/WorkflowReportJSONTest.java b/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/WorkflowReportJSONTest.java
index fb8f61f..4e566e2 100644
--- a/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/WorkflowReportJSONTest.java
+++ b/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/WorkflowReportJSONTest.java
@@ -14,9 +14,9 @@ import java.util.Arrays;
 
 import org.junit.After;
 import org.junit.Test;
-import org.purl.wf4ever.robundle.Bundle;
+import org.apache.taverna.robundle.Bundle;
 
-import uk.org.taverna.databundle.DataBundles;
+import org.apache.taverna.databundle.DataBundles;
 import uk.org.taverna.platform.report.ActivityReport;
 import uk.org.taverna.platform.report.Invocation;
 import uk.org.taverna.platform.report.ProcessorReport;


[13/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/ProvenanceQuery.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/ProvenanceQuery.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/ProvenanceQuery.java
new file mode 100644
index 0000000..4b318fc
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/ProvenanceQuery.java
@@ -0,0 +1,2069 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.provenance.lineageservice;
+
+import static net.sf.taverna.t2.provenance.connector.AbstractProvenanceConnector.DataflowInvocationTable.DataflowInvocation;
+import static net.sf.taverna.t2.provenance.connector.AbstractProvenanceConnector.DataflowInvocationTable.parentProcessorEnactmentId;
+import static net.sf.taverna.t2.provenance.lineageservice.utils.ProvenanceProcessor.DATAFLOW_ACTIVITY;
+
+import java.sql.Blob;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import net.sf.taverna.t2.provenance.connector.AbstractProvenanceConnector.CollectionTable;
+import net.sf.taverna.t2.provenance.connector.AbstractProvenanceConnector.DataBindingTable;
+import net.sf.taverna.t2.provenance.connector.AbstractProvenanceConnector.DataflowInvocationTable;
+import net.sf.taverna.t2.provenance.connector.AbstractProvenanceConnector.ProcessorEnactmentTable;
+import net.sf.taverna.t2.provenance.lineageservice.utils.Collection;
+import net.sf.taverna.t2.provenance.lineageservice.utils.DDRecord;
+import net.sf.taverna.t2.provenance.lineageservice.utils.DataLink;
+import net.sf.taverna.t2.provenance.lineageservice.utils.DataflowInvocation;
+import net.sf.taverna.t2.provenance.lineageservice.utils.NestedListNode;
+import net.sf.taverna.t2.provenance.lineageservice.utils.Port;
+import net.sf.taverna.t2.provenance.lineageservice.utils.PortBinding;
+import net.sf.taverna.t2.provenance.lineageservice.utils.ProcessorEnactment;
+import net.sf.taverna.t2.provenance.lineageservice.utils.ProvenanceProcessor;
+import net.sf.taverna.t2.provenance.lineageservice.utils.Workflow;
+import net.sf.taverna.t2.provenance.lineageservice.utils.WorkflowTree;
+import net.sf.taverna.t2.provenance.lineageservice.utils.WorkflowRun;
+
+import org.apache.log4j.Logger;
+import org.jdom.Document;
+import org.jdom.Element;
+
+import uk.org.taverna.configuration.database.DatabaseManager;
+
+/**
+ * Handles all the querying of provenance items in the database layer. Uses
+ * standard SQL so all specific instances of this class can extend this writer
+ * to handle all of the db queries
+ *
+ * @author Paolo Missier
+ * @author Ian Dunlop
+ * @author Stuart Owen
+ *
+ */
+public abstract class ProvenanceQuery {
+	protected Logger logger = Logger.getLogger(ProvenanceQuery.class);
+	private final DatabaseManager databaseManager;
+
+	public ProvenanceQuery(DatabaseManager databaseManager) {
+		this.databaseManager = databaseManager;
+	}
+
+	public Connection getConnection() throws InstantiationException,
+			IllegalAccessException, ClassNotFoundException, SQLException {
+		return databaseManager.getConnection();
+	}
+
+	private Q query(String baseQuery) {
+		return new Q(baseQuery);
+	}
+	private class Q {
+		private String q;
+		private Map<String,String>where;
+		private List<String> order;
+
+		Q(String baseQuery) {
+			q = baseQuery;
+		}
+
+		public Q where(String key, String value) {
+			if (where == null)
+				where = new HashMap<>();
+			where.put(key, value);
+			return this;
+		}
+
+		public Q where(Map<String, String> clauses) {
+			if (where == null)
+				where = new HashMap<>();
+			where.putAll(clauses);
+			return this;
+		}
+
+		public Q orderBy(String key) {
+			if (order == null)
+				order = new ArrayList<>();
+			order.add(key);
+			return this;
+		}
+		public ResultSet exec(Statement statement) throws SQLException {
+			return statement.executeQuery(query());
+		}
+		public String query() {
+			return addOrderByToQuery(addWhereClauseToQuery(q, where, false), order, false);
+		}
+	}
+
+	/**
+	 * implements a set of query constraints of the form var = value into a
+	 * WHERE clause
+	 *
+	 * @param q
+	 * @param queryConstraints
+	 * @return
+	 */
+	protected String addWhereClauseToQuery(String q,
+			Map<String, String> queryConstraints, boolean terminate) {
+
+		// complete query according to constraints
+		StringBuilder buffer = new StringBuilder(q);
+
+		String sep = " WHERE ";
+		if (queryConstraints != null)
+			for (Entry<String, String> entry : queryConstraints.entrySet()) {
+				buffer.append(sep).append(entry.getKey())
+						.append(" = \'").append(entry.getValue()).append("\' ");
+				sep = " AND ";
+			}
+		return buffer.toString();
+	}
+
+	protected String addOrderByToQuery(String q, List<String> orderAttr,
+			boolean terminate) {
+		// complete query according to constraints
+		StringBuilder buffer = new StringBuilder(q);
+
+		String sep = " ORDER BY ";
+		if (orderAttr != null)
+			for (String attr : orderAttr) {
+				buffer.append(sep).append(attr);
+				sep = ",";
+			}
+		return buffer.toString();
+	}
+
+	/**
+	 * select Port records that satisfy constraints
+	 */
+	public List<Port> getPorts(Map<String, String> queryConstraints)
+			throws SQLException {
+		List<Port> result = new ArrayList<>();
+
+		try (Connection connection = getConnection();
+				Statement stmt = connection.createStatement();
+				ResultSet rs = query(
+						"SELECT DISTINCT V.* FROM Port V "
+								+ "JOIN WorkflowRun W ON W.workflowId = V.workflowId")
+						.where(queryConstraints)
+						.orderBy("V.iterationStrategyOrder").exec(stmt)) {
+			while (rs.next()) {
+				Port aPort = new Port();
+
+				aPort.setWorkflowId(rs.getString("workflowId"));
+				aPort.setInputPort(rs.getBoolean("isInputPort"));
+				aPort.setIdentifier(rs.getString("portId"));
+				aPort.setProcessorName(rs.getString("processorName"));
+				aPort.setProcessorId(rs.getString("processorId"));
+				aPort.setPortName(rs.getString("portName"));
+				aPort.setDepth(rs.getInt("depth"));
+				if (rs.getString("resolvedDepth") != null)
+					aPort.setResolvedDepth(rs.getInt("resolvedDepth"));
+				result.add(aPort);
+			}
+		} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
+			logger.warn("Could not execute query", e);
+		}
+		return result;
+	}
+
+
+	/**
+	 * return the input variables for a given processor and a workflowRunId
+	 *
+	 * @param pname
+	 * @param workflowRunId
+	 * @return list of input variables
+	 * @throws SQLException
+	 */
+	public List<Port> getInputPorts(String pname, String wfID)
+			throws SQLException {
+		// get (var, proc) from Port to see if it's input/output
+		Map<String, String> varQueryConstraints = new HashMap<>();
+
+		varQueryConstraints.put("V.workflowId", wfID);
+		varQueryConstraints.put("V.processorName", pname);
+		varQueryConstraints.put("V.isInputPort", "1");
+		return getPorts(varQueryConstraints);
+	}
+
+	/**
+	 * return the output variables for a given processor and a workflowRunId
+	 *
+	 * @param pname
+	 * @param workflowRunId
+	 * @return list of output variables
+	 * @throws SQLException
+	 */
+	public List<Port> getOutputPorts(String pname, String wfID)
+			throws SQLException {
+		// get (var, proc) from Port to see if it's input/output
+		Map<String, String> varQueryConstraints = new HashMap<>();
+
+		varQueryConstraints.put("V.workflowId", wfID);
+		varQueryConstraints.put("V.processorName", pname);
+		varQueryConstraints.put("V.isInputPort", "0");
+		return getPorts(varQueryConstraints);
+	}
+
+	/**
+	 * selects all Datalinks
+	 *
+	 * @param queryConstraints
+	 * @return
+	 * @throws SQLException
+	 */
+	public List<DataLink> getDataLinks(Map<String, String> queryConstraints)
+			throws SQLException {
+		List<DataLink> result = new ArrayList<>();
+
+		String q = addWhereClauseToQuery("SELECT A.* FROM Datalink A", queryConstraints, true);
+
+		try (Connection connection = getConnection();
+				Statement stmt = connection.createStatement()) {
+			ResultSet rs = stmt.executeQuery(q);
+			while (rs.next()) {
+				DataLink aDataLink = new DataLink();
+
+				aDataLink.setWorkflowId(rs.getString("workflowId"));
+				aDataLink.setSourceProcessorName(rs
+						.getString("sourceProcessorName"));
+				aDataLink.setSourcePortName(rs.getString("sourcePortName"));
+				aDataLink.setDestinationProcessorName(rs
+						.getString("destinationProcessorName"));
+				aDataLink.setDestinationPortName(rs
+						.getString("destinationPortName"));
+				aDataLink.setSourcePortId(rs.getString("sourcePortId"));
+				aDataLink.setDestinationPortId(rs
+						.getString("destinationPortId"));
+				result.add(aDataLink);
+			}
+		} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
+			logger.warn("Could not execute query", e);
+		}
+
+		return result;
+	}
+
+	public String getTopLevelWorkflowIdForRun(String runID) throws SQLException {
+		for (Workflow w : getWorkflowsForRun(runID))
+			if (w.getParentWorkflowId() == null)
+				return w.getWorkflowId();
+		return null;
+	}
+
+	/**
+	 * returns the names of all workflows (top level + nested) for a given runID
+	 * @param runID
+	 * @return
+	 * @throws SQLException
+	 */
+	public List<String> getWorkflowIdsForRun(String runID) throws SQLException {
+		List<String> workflowIds = new ArrayList<>();
+		for (Workflow w : getWorkflowsForRun(runID))
+			workflowIds.add(w.getWorkflowId());
+		return workflowIds;
+	}
+
+	/**
+	 * returns the workflows associated to a single runID
+	 * @param runID
+	 * @return
+	 * @throws SQLException
+	 */
+	public List<Workflow> getWorkflowsForRun(String runID) throws SQLException {
+		List<Workflow> result = new ArrayList<>();
+		String q = "SELECT DISTINCT W.* FROM WorkflowRun I JOIN Workflow W ON I.workflowId = W.workflowId WHERE workflowRunId = ?";
+		try (Connection connection = getConnection();
+				PreparedStatement stmt = connection.prepareStatement(q)) {
+			stmt.setString(1, runID);
+			ResultSet rs = stmt.executeQuery();
+			while (rs.next()) {
+				Workflow w = new Workflow();
+				w.setWorkflowId(rs.getString("workflowId"));
+				w.setParentWorkflowId(rs.getString("parentWorkflowId"));
+				result.add(w);
+			}
+		} catch (InstantiationException | IllegalAccessException
+				| ClassNotFoundException e) {
+			logger.error("Error finding the workflow reference", e);
+		}
+		return result;
+	}
+
+	public String getLatestRunID() throws SQLException {
+		String q = "SELECT workflowRunId FROM WorkflowRun ORDER BY timestamp DESC";
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(q)) {
+			ResultSet rs = ps.executeQuery();
+			if (rs.next())
+				return rs.getString("workflowRunId");
+		} catch (Exception e) {
+			logger.warn("Could not execute query", e);
+		}
+		return null;
+	}
+
+	/**
+	 * @param dataflowID
+	 * @param conditions currently only understands "from" and "to" as timestamps for range queries
+	 * @return
+	 * @throws SQLException
+	 */
+	public List<WorkflowRun> getRuns(String dataflowID,
+			Map<String, String> conditions) throws SQLException {
+		List<WorkflowRun> result = new ArrayList<>();
+		StringBuilder q = new StringBuilder(
+				"SELECT * FROM WorkflowRun I join Workflow W on I.workflowId = W.workflowId");
+		List<String> conds = new ArrayList<>();
+		if (dataflowID != null)
+			conds.add("I.workflowId = '" + dataflowID + "'");
+		if (conditions != null) {
+			if (conditions.get("from") != null)
+				conds.add("timestamp >= " + conditions.get("from"));
+			if (conditions.get("to") != null)
+				conds.add("timestamp <= " + conditions.get("to"));
+		}
+		String sep = " where ";
+		for (String cond : conds) {
+			q.append(sep).append(cond);
+			sep = " and ";
+		}
+
+		q.append(" ORDER BY timestamp desc ");
+
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(q.toString())) {
+			logger.debug(q);
+			ResultSet rs = ps.executeQuery();
+			while (rs.next()) {
+				WorkflowRun i = new WorkflowRun();
+				i.setWorkflowRunId(rs.getString("workflowRunId"));
+				i.setTimestamp(rs.getString("timestamp"));
+				i.setWorkflowId(rs.getString("workflowId"));
+				i.setWorkflowExternalName(rs.getString("externalName"));
+				Blob blob = rs.getBlob("dataflow");
+				long length = blob.length();
+				blob.getBytes(1, (int) length);
+				i.setDataflowBlob(blob.getBytes(1, (int) length));
+				result.add(i);
+			}
+		} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
+			logger.warn("Could not execute query", e);
+		}
+		return result;
+	}
+
+	/**
+	 * @param constraints
+	 *            a Map columnName -> value that defines the query constraints.
+	 *            Note: columnName must be fully qualified. This is not done
+	 *            well at the moment, i.e., processorNameRef should be
+	 *            PortBinding.processorNameRef to avoid ambiguities
+	 * @return
+	 * @throws SQLException
+	 */
+	public List<PortBinding> getPortBindings(Map<String, String> constraints)
+			throws SQLException {
+		List<PortBinding> result = new ArrayList<>();
+
+		String q = "SELECT * FROM PortBinding VB "
+				+ "JOIN Port V ON VB.portName = V.portName "
+				+ "AND VB.processorNameRef = V.processorName "
+				+ "AND VB.workflowId = V.workflowId ";
+
+		try (Connection connection = getConnection();
+				Statement stmt = connection.createStatement();) {
+			ResultSet rs = stmt.executeQuery(addWhereClauseToQuery(q,
+					constraints, true));
+			while (rs.next()) {
+				PortBinding vb = new PortBinding();
+
+				vb.setWorkflowId(rs.getString("workflowId"));
+				vb.setPortName(rs.getString("portName"));
+				vb.setWorkflowRunId(rs.getString("workflowRunId"));
+				vb.setValue(rs.getString("value"));
+
+				if (rs.getString("collIdRef") == null || rs.getString("collIdRef").equals("null")) {
+					vb.setCollIDRef(null);
+				} else {
+					vb.setCollIDRef(rs.getString("collIdRef"));
+				}
+
+				vb.setIteration(rs.getString("iteration"));
+				vb.setProcessorName(rs.getString("processorNameRef"));
+				vb.setPositionInColl(rs.getInt("positionInColl"));
+				vb.setPortId(rs.getString("portId"));
+				vb.setIsInputPort(rs.getBoolean("isInputPort"));
+				result.add(vb);
+			}
+		} catch (Exception e) {
+			logger.warn("Add VB failed", e);
+		}
+		return result;
+	}
+
+	public List<NestedListNode> getNestedListNodes(
+			Map<String, String> constraints) throws SQLException {
+		List<NestedListNode> result = new ArrayList<>();
+
+		try (Connection connection = getConnection();
+				Statement stmt = connection.createStatement();
+				ResultSet rs = query("SELECT * FROM Collection C ").where(
+						constraints).exec(stmt)) {
+			while (rs.next()) {
+				NestedListNode nln = new NestedListNode();
+
+				nln.setCollectionT2Reference(rs.getString("collId"));
+				nln.setParentCollIdRef(rs.getString("parentCollIdRef"));
+				nln.setWorkflowRunId(rs.getString("workflowRunId"));
+				nln.setProcessorName(rs.getString("processorNameRef"));
+				nln.setPortName(rs.getString("portName"));
+				nln.setIteration(rs.getString("iteration"));
+
+				result.add(nln);
+			}
+		} catch (InstantiationException | IllegalAccessException
+				| ClassNotFoundException e) {
+			logger.error("Error finding the nested list nodes", e);
+		}
+		return result;
+	}
+
+	public Map<String, Integer> getPredecessorsCount(String workflowRunId) {
+		Map<String, Integer> result = new HashMap<>();
+
+		// get all datalinks for the entire workflow structure for this particular instance
+		try (Connection connection = getConnection()) {
+			PreparedStatement ps = connection
+					.prepareStatement("SELECT A.sourceProcessorName as source , A.destinationProcessorName as sink, A.workflowId as workflowId1, W1.workflowId as workflowId2, W2.workflowId as workflowId3 "
+							+ "FROM Datalink A join WorkflowRun I on A.workflowId = I.workflowId "
+							+ "left outer join Workflow W1 on W1.externalName = A.sourceProcessorName "
+							+ "left outer join Workflow W2 on W2.externalName = A.destinationProcessorName "
+							+ "where I.workflowRunId = ?");
+			ps.setString(1, workflowRunId);
+			ResultSet rs = ps.executeQuery();
+			while (rs.next()) {
+				String sink = rs.getString("sink");
+				String source = rs.getString("source");
+
+				if (result.get(sink) == null)
+					result.put(sink, 0);
+
+				String name1 = rs.getString("workflowId1");
+				String name2 = rs.getString("workflowId2");
+				String name3 = rs.getString("workflowId3");
+
+				if (isDataflow(source) && name1.equals(name2))
+					continue;
+				if (isDataflow(sink) && name1.equals(name3))
+					continue;
+
+				result.put(sink, result.get(sink) + 1);
+			}
+		} catch (InstantiationException | SQLException | IllegalAccessException | ClassNotFoundException e1) {
+			logger.warn("Could not execute query", e1);
+		}
+		return result;
+	}
+
+	/**
+	 * new impl of getProcessorsIncomingLinks whicih avoids complications due to nesting, and relies on the workflowRunId
+	 * rather than the workflowId
+	 * @param workflowRunId
+	 * @return
+	 */
+	public Map<String, Integer> getPredecessorsCountOld(String workflowRunId) {
+		Map<String, Integer> result = new HashMap<>();
+
+		// get all datalinks for the entire workflow structure for this particular instance
+		try (Connection connection = getConnection()) {
+			PreparedStatement ps = connection
+					.prepareStatement("SELECT destinationProcessorName, P1.firstActivityClass, count(*) as pred "
+							+ " FROM Datalink A join WorkflowRun I on A.workflowId = I.workflowId "
+							+ " join Processor P1 on P1.processorName = A.destinationProcessorName "
+							+ " join Processor P2 on P2.processorName = A.sourceProcessorName "
+							+ "  where I.workflowRunId = ? "
+							+ "  and P2.firstActivityClass <> '"
+							+ DATAFLOW_ACTIVITY
+							+ "' "
+							+ " and ((P1.firstActivityClass = '"
+							+ DATAFLOW_ACTIVITY
+							+ "'  and P1.workflowId = A.workflowId) or "
+							+ " (P1.firstActivityClass <> '"
+							+ DATAFLOW_ACTIVITY
+							+ "' )) "
+							+ " group by A.destinationProcessorName, firstActivityClass");
+			ps.setString(1, workflowRunId);
+			ResultSet rs = ps.executeQuery();
+			while (rs.next())
+				result.put(rs.getString("destinationProcessorName"),
+						new Integer(rs.getInt("pred")));
+		} catch (InstantiationException | IllegalAccessException | ClassNotFoundException | SQLException e1) {
+			logger.warn("Could not execute query", e1);
+		}
+		return result;
+	}
+
+	/**
+	 * used in the toposort phase -- propagation of anl() values through the
+	 * graph
+	 *
+	 * @param workflowId
+	 *            reference to static wf name
+	 * @return a map <processor name> --> <incoming links count> for each
+	 *         processor, without counting the datalinks from the dataflow input to
+	 *         processors. So a processor is at the root of the graph if it has
+	 *         no incoming links, or all of its incoming links are from dataflow
+	 *         inputs.<br/>
+	 *         Note: this must be checked for processors that are roots of
+	 *         sub-flows... are these counted as top-level root nodes??
+	 */
+	public Map<String, Integer> getProcessorsIncomingLinks(String workflowId)
+			throws SQLException {
+		Map<String, Integer> result = new HashMap<>();
+
+		String currentWorkflowProcessor = null;
+		String sql = "SELECT processorName, firstActivityClass FROM Processor "
+				+ "WHERE workflowId = ?";
+
+		try (Connection c = getConnection()) {
+			try (PreparedStatement ps = c.prepareStatement(sql)) {
+				ps.setString(1, workflowId);
+				ResultSet rs = ps.executeQuery();
+				while (rs.next()) {
+					// PM CHECK 6/09
+					if (rs.getString("firstActivityClass").equals(
+							DATAFLOW_ACTIVITY)) {
+						currentWorkflowProcessor = rs
+								.getString("processorName");
+						logger.info("currentWorkflowProcessor = "
+								+ currentWorkflowProcessor);
+					}
+					result.put(rs.getString("processorName"), 0);
+				}
+			}
+
+			/*
+			 * fetch the name of the top-level dataflow. We use this to exclude
+			 * datalinks outgoing from its inputs
+			 */
+
+			// CHECK below -- gets confused on nested workflows
+			String parentWF = getParentOfWorkflow(workflowId);
+			if (parentWF == null)
+				parentWF = workflowId; // null parent means we are the top
+			logger.debug("parent WF: " + parentWF);
+
+			// get nested dataflows -- we want to avoid these in the toposort algorithm
+			List<ProvenanceProcessor> procs = getProcessorsShallow(c,
+					DATAFLOW_ACTIVITY, parentWF);
+
+			StringBuilder q = new StringBuilder("SELECT destinationProcessorName, count(*) AS cnt ");
+			q.append("FROM Datalink WHERE workflowId = \'").append(workflowId)
+					.append("\' AND destinationProcessorName NOT IN (");
+			String sep = "";
+			for (ProvenanceProcessor p : procs) {
+				q.append(sep).append("'").append(p.getProcessorName())
+						.append("'");
+				sep = ",";
+			}
+			q.append(") GROUP BY destinationProcessorName");
+
+			logger.info("executing \n" + q);
+
+			try (Statement stmt = c.createStatement();
+					ResultSet rs = stmt.executeQuery(q.toString())) {
+				while (rs.next())
+					if (!rs.getString("destinationProcessorName").equals(
+							currentWorkflowProcessor))
+						result.put(rs.getString("destinationProcessorName"),
+								rs.getInt("cnt"));
+				result.put(currentWorkflowProcessor, 0);
+			}
+		} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
+			logger.warn("Could not execute query", e);
+		}
+
+		return result;
+	}
+
+	public List<Port> getSuccPorts(String processorName, String portName,
+			String workflowId) throws SQLException {
+		List<Port> result = new ArrayList<>();
+		String sql = "SELECT v.* "
+				+ "FROM Datalink a JOIN Port v ON a.destinationProcessorName = v.processorName "
+				+ "AND  a.destinationPortName = v.portName "
+				+ "AND a.workflowId = v.workflowId "
+				+ "WHERE sourcePortName=? AND sourceProcessorName=?";
+		if (workflowId != null)
+			sql += " AND a.workflowId=?";
+
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql)) {
+			ps.setString(1, portName);
+			ps.setString(2, processorName);
+			if (workflowId != null)
+				ps.setString(3, workflowId);
+
+			ResultSet rs = ps.executeQuery();
+			while (rs.next()) {
+				Port aPort = new Port();
+
+				aPort.setWorkflowId(rs.getString("workflowId"));
+				aPort.setInputPort(rs.getBoolean("isInputPort"));
+				aPort.setIdentifier(rs.getString("portId"));
+				aPort.setProcessorName(rs.getString("processorName"));
+				aPort.setProcessorId(rs.getString("processorId"));
+				aPort.setPortName(rs.getString("portName"));
+				aPort.setDepth(rs.getInt("depth"));
+				if (rs.getString("resolvedDepth") != null)
+					aPort.setResolvedDepth(rs.getInt("resolvedDepth"));
+				result.add(aPort);
+			}
+		} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
+			logger.warn("Could not execute query", e);
+		}
+		return result;
+	}
+
+	public List<String> getSuccProcessors(String pName, String workflowId,
+			String workflowRunId) throws SQLException {
+		List<String> result = new ArrayList<>();
+		String sql = "SELECT distinct destinationProcessorName FROM Datalink A JOIN WorkflowRun I on A.workflowId = I.workflowId "
+				+ "WHERE A.workflowId = ? and I.workflowRunId = ? AND sourceProcessorName = ?";
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql)) {
+			ps.setString(1, workflowId);
+			ps.setString(2, workflowRunId);
+			ps.setString(3, pName);
+			ResultSet rs = ps.executeQuery();
+			while (rs.next())
+				result.add(rs.getString("destinationProcessorName"));
+		} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
+			logger.warn("Could not execute query", e);
+		}
+		return result;
+	}
+
+	/**
+	 * get all processors of a given type within a structure identified by
+	 * workflowId (reference to dataflow). type constraint is ignored if value is null.<br>
+	 * this only returns the processor for the input workflowId, without going into any neted workflows
+	 *
+	 * @param workflowId
+	 * @param firstActivityClass
+	 * @return a list, that contains at most one element
+	 * @throws SQLException
+	 */
+	public List<ProvenanceProcessor> getProcessorsShallow(
+			String firstActivityClass, String workflowId) throws SQLException {
+		Map<String, String> constraints = new HashMap<>();
+		constraints.put("P.workflowId", workflowId);
+		if (firstActivityClass != null)
+			constraints.put("P.firstActivityClass", firstActivityClass);
+		return getProcessors(constraints);
+	}
+
+	private List<ProvenanceProcessor> getProcessorsShallow(Connection c,
+			String firstActivityClass, String workflowId) throws SQLException {
+		Map<String, String> constraints = new HashMap<>();
+		constraints.put("P.workflowId", workflowId);
+		if (firstActivityClass != null)
+			constraints.put("P.firstActivityClass", firstActivityClass);
+		return getProcessors(c, constraints);
+	}
+
+	public ProvenanceProcessor getProvenanceProcessorByName(
+			String workflowId, String processorName) {
+		Map<String, String> constraints = new HashMap<>();
+		constraints.put("P.workflowId", workflowId);
+		constraints.put("P.processorName", processorName);
+		List<ProvenanceProcessor> processors;
+		try {
+			processors = getProcessors(constraints);
+		} catch (SQLException e1) {
+			logger.warn("Could not find processor for " + constraints, e1);
+			return null;
+		}
+		if (processors.size() != 1) {
+			logger.warn("Could not uniquely find processor for " + constraints + ", got: " + processors);
+			return null;
+		}
+		return processors.get(0);
+	}
+
+	public ProvenanceProcessor getProvenanceProcessorById(String processorId) {
+		Map<String, String> constraints = new HashMap<>();
+		constraints.put("P.processorId", processorId);
+		List<ProvenanceProcessor> processors;
+		try {
+			processors = getProcessors(constraints);
+		} catch (SQLException e1) {
+			logger.warn("Could not find processor for " + constraints, e1);
+			return null;
+		}
+		if (processors.size() != 1) {
+			logger.warn("Could not uniquely find processor for " + constraints
+					+ ", got: " + processors);
+			return null;
+		}
+		return processors.get(0);
+	}
+
+	/**
+	 * this is similar to {@link #getProcessorsShallow(String, String)} but it
+	 * recursively fetches all processors within nested workflows. The result is
+	 * collected in the form of a map: workflowId -> {ProvenanceProcessor}
+	 * 
+	 * @param firstActivityClass
+	 * @param workflowId
+	 * @return a map: workflowId -> {ProvenanceProcessor} where workflowId is
+	 *         the name of a (possibly nested) workflow, and the values are the
+	 *         processors within that workflow
+	 */
+	public Map<String, List<ProvenanceProcessor>> getProcessorsDeep(
+			String firstActivityClass, String workflowId) {
+		Map<String, List<ProvenanceProcessor>> result = new HashMap<>();
+
+		try {
+			List<ProvenanceProcessor> currentProcs = getProcessorsShallow(null,
+					workflowId);
+			List<ProvenanceProcessor> matchingProcessors = new ArrayList<>();
+			result.put(workflowId, matchingProcessors);
+			for (ProvenanceProcessor pp:currentProcs) {
+				if (firstActivityClass == null
+						|| pp.getFirstActivityClassName().equals(
+								firstActivityClass))
+					matchingProcessors.add(pp);
+				if (pp.getFirstActivityClassName().equals(DATAFLOW_ACTIVITY)) {
+					// Can't recurse as there's no way to find ID of nested workflow
+					continue;
+					//result.putAll(getProcessorsDeep(firstActivityClass, NESTED_WORKFLOW_ID));
+				}
+			}
+
+			// Silly fallback - use the broken getChildrenOfWorkflow() assuming that no other workflows
+			// have used the same nested workflow
+			for (String childWf : getChildrenOfWorkflow(workflowId))
+				result.putAll(getProcessorsDeep(firstActivityClass, childWf));
+		} catch (SQLException e) {
+			logger.error("Problem getting nested workflow processors for: " + workflowId, e);
+		}
+		return result;
+	}
+
+	public String getDataValue(String valueRef) {
+		String q = "SELECT * FROM Data where dataReference = ?;";
+
+		try (Connection connection = getConnection();
+				PreparedStatement stmt = connection.prepareStatement(q)) {
+			stmt.setString(1, valueRef);
+			ResultSet rs = stmt.executeQuery(q);
+			if (rs.next())
+				return rs.getString("data");
+		} catch (Exception e) {
+			logger.warn("Could not execute query", e);
+		}
+		return null;
+	}
+
+	/**
+	 * generic method to fetch processors subject to additional query constraints
+	 * @param constraints
+	 * @return
+	 * @throws SQLException
+	 */
+	public List<ProvenanceProcessor> getProcessors(
+			Map<String, String> constraints) throws SQLException {
+		try (Connection connection = getConnection()) {
+			return getProcessors(connection, constraints);
+		} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
+			logger.warn("Could not execute query", e);
+		}
+		return new ArrayList<ProvenanceProcessor>();
+	}
+
+	private List<ProvenanceProcessor> getProcessors(Connection c,
+			Map<String, String> constraints) throws SQLException {
+		List<ProvenanceProcessor> result = new ArrayList<>();
+		try (Statement stmt = c.createStatement();
+				ResultSet rs = query("SELECT P.* FROM Processor P").where(
+						constraints).exec(stmt)) {
+			while (rs.next()) {
+				ProvenanceProcessor proc = new ProvenanceProcessor();
+				proc.setIdentifier(rs.getString("processorId"));
+				proc.setProcessorName(rs.getString("processorName"));
+				proc.setFirstActivityClassName(rs
+						.getString("firstActivityClass"));
+				proc.setWorkflowId(rs.getString("workflowId"));
+				proc.setTopLevelProcessor(rs.getBoolean("isTopLevel"));
+				result.add(proc);
+			}
+		}
+		return result;
+	}
+
+	public List<ProvenanceProcessor> getProcessorsForWorkflow(String workflowID) {
+		List<ProvenanceProcessor> result = new ArrayList<>();
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection
+						.prepareStatement("SELECT * from Processor WHERE workflowId=?")) {
+			ps.setString(1, workflowID);
+			ResultSet rs = ps.executeQuery();
+			while (rs.next()) {
+				ProvenanceProcessor proc = new ProvenanceProcessor();
+				proc.setIdentifier(rs.getString("processorId"));
+				proc.setProcessorName(rs.getString("processorName"));
+				proc.setFirstActivityClassName(rs
+						.getString("firstActivityClass"));
+				proc.setWorkflowId(rs.getString("workflowId"));
+				proc.setTopLevelProcessor(rs.getBoolean("isTopLevel"));
+				result.add(proc);
+			}
+		} catch (SQLException | InstantiationException | IllegalAccessException
+				| ClassNotFoundException e) {
+			logger.error("Problem getting processor for workflow: "
+					+ workflowID, e);
+		}
+		return result;
+	}
+
+	/**
+	 * simplest possible pinpoint query. Uses iteration info straight away. Assumes result is in PortBinding not in Collection
+	 *
+	 * @param workflowRun
+	 * @param pname
+	 * @param vname
+	 * @param iteration
+	 * @return
+	 */
+	public LineageSQLQuery simpleLineageQuery(String workflowRun, String workflowId, String pname,
+			String vname, String iteration) {
+		LineageSQLQuery lq = new LineageSQLQuery();
+		Q q = query("SELECT * FROM PortBinding VB "
+				+ "JOIN Port V ON (VB.portName = V.portName AND VB.processorNameRef = V.processorName AND VB.workflowId = V.workflowId) "
+				+ "JOIN WorkflowRun W ON VB.workflowRunId = W.workflowRunId AND VB.workflowId = W.workflowId ");
+
+		// constraints:
+		q.where("W.workflowRunId", workflowRun)
+				.where("VB.processorNameRef", pname)
+				.where("VB.workflowId", workflowId);
+
+		if (vname != null)
+			q.where("VB.portName", vname);
+		if (iteration != null)
+			q.where("VB.iteration", iteration);
+
+		// add order by clauses
+		q.orderBy("V.portName").orderBy("iteration");
+
+		logger.debug("Query is: " + q.query());
+		lq.setVbQuery(q.query());
+		return lq;
+	}
+
+	/**
+	 * if var2Path is null this generates a trivial query for the current output
+	 * var and current path
+	 *
+	 * @param workflowRunId
+	 * @param proc
+	 * @param var2Path
+	 * @param outputVar
+	 * @param path
+	 * @param returnOutputs
+	 *            returns inputs *and* outputs if set to true
+	 * @return
+	 */
+	public List<LineageSQLQuery> lineageQueryGen(String workflowRunId, String proc,
+			Map<Port, String> var2Path, Port outputVar, String path,
+			boolean returnOutputs) {
+		// setup
+		List<LineageSQLQuery> newQueries = new ArrayList<>();
+
+		// use the calculated path for each input var
+		boolean isInput = true;
+		for (Port v : var2Path.keySet()) {
+			LineageSQLQuery q = generateSQL2(workflowRunId, proc, v.getPortName(), var2Path.get(v), isInput);
+			if (q != null)
+				newQueries.add(q);
+		}
+
+		// is returnOutputs is true, then use proc, path for the output var as well
+		if (returnOutputs) {
+			isInput = false;
+			LineageSQLQuery q = generateSQL2(workflowRunId, proc, outputVar.getPortName(), path, isInput);  // && !var2Path.isEmpty());
+			if (q != null)
+				newQueries.add(q);
+		}
+		return newQueries;
+	}
+
+	protected LineageSQLQuery generateSQL2(String workflowRun, String proc,
+			String var, String path, boolean returnInput) {
+		LineageSQLQuery lq = new LineageSQLQuery();
+		Q q;
+
+		// base Collection query
+		q = query("SELECT C.*,W.workflowId,V.isInputPort FROM Collection C "
+				+ "JOIN WorkflowRun W ON C.workflowRunId = W.workflowRunId "
+				+ "JOIN Port V ON V.workflowId = W.workflowId "
+				+ "AND C.processorNameRef = V.processorName "
+				+ "AND C.portName = V.portName ");
+		if (path != null && path.length() > 0)
+			q.where("C.iteration", "[" + path + "]"); // PM 1/09 -- path
+		lq.setCollQuery(q.where("W.workflowRunId", workflowRun).where("C.processorNameRef",
+				proc).where("V.isInputPort", returnInput ? "1" : "0").query());
+
+		// base PortBinding query
+		q = query("SELECT VB.*,V.isInputPort FROM PortBinding VB "
+				+ "JOIN WorkflowRun W ON VB.workflowRunId = W.workflowRunId "
+				+ "JOIN Port V on V.workflowId = W.workflowId "
+				+ "AND VB.processorNameRef = V.processorName "
+				+ "AND VB.portName = V.portName ");
+		if (path != null && path.length() > 0)
+			q.where("VB.iteration", "[" + path + "]"); // PM 1/09 -- path
+		lq.setVbQuery(q.where("W.workflowRunId", workflowRun)
+				.where("VB.processorNameRef", proc).where("VB.portName", var)
+				.where("V.isInputPort", returnInput ? "1" : "0")
+				.orderBy("V.portName").orderBy("iteration").query());
+		return lq;
+	}
+
+	/**
+	 * if effectivePath is not null: query varBinding using: workflowRunId =
+	 * workflowRun, iteration = effectivePath, processorNameRef = proc if input vars is
+	 * null, then use the output var this returns the bindings for the set of
+	 * input vars at the correct iteration if effectivePath is null: fetch
+	 * PortBindings for all input vars, without constraint on the iteration<br/>
+	 * additionally, try querying the collection table first -- if the query succeeds, it means
+	 * the path is pointing to an internal node in the collection, and we just got the right node.
+	 * Otherwise, query PortBinding for the leaves
+	 *
+	 * @param workflowRun
+	 * @param proc
+	 * @param effectivePath
+	 * @param returnOutputs
+	 *            returns both inputs and outputs if set to true
+	 * @return
+	 */
+	public LineageSQLQuery generateSQL(String workflowRun, String proc,
+			String effectivePath, boolean returnOutputs) {
+		LineageSQLQuery lq = new LineageSQLQuery();
+		Q q;
+
+		// base Collection query
+		q = query("SELECT * FROM Collection C "
+				+ "JOIN WorkflowRun W ON C.workflowRunId = W.workflowRunId "
+				+ "JOIN Port V ON V.workflowRunId = W.workflowId "
+				+ "AND C.processorNameRef = V.processorNameRef "
+				+ "AND C.portName = V.portName ");
+
+		if (effectivePath != null && effectivePath.length() > 0)
+			q.where("C.iteration", "[" + effectivePath.toString() + "]"); // PM 1/09 -- path
+		// limit to inputs?
+		if (returnOutputs)
+			q.where("V.isInputPort", "1");
+
+		lq.setCollQuery(q.where("W.workflowRunId", workflowRun).where("C.processorNameRef",
+				proc).query());
+
+		// base PortBinding query
+		q = query("SELECT * FROM PortBinding VB "
+				+ "JOIN WorkflowRun W ON VB.workflowRunId = W.workflowRunId "
+				+ "JOIN Port V on V.workflowRunId = W.workflowId "
+				+ "AND VB.processorNameRef = V.processorNameRef "
+				+ "AND VB.portName = V.portName ");
+
+		if (effectivePath != null && effectivePath.length() > 0)
+			q.where("VB.iteration", "[" + effectivePath.toString() + "]"); // PM 1/09 -- path
+		// limit to inputs?
+		if (!returnOutputs)
+			q.where("V.isInputPort", "1");
+
+		lq.setVbQuery(q.where("W.workflowRunId", workflowRun)
+				.where("VB.processorNameRef", proc).orderBy("portName")
+				.orderBy("iteration").query());
+		return lq;
+	}
+
+	public Dependencies runCollectionQuery(LineageSQLQuery lq) throws SQLException {
+		String q = lq.getCollQuery();
+		Dependencies lqr = new Dependencies();
+		if (q == null)
+			return lqr;
+
+		logger.debug("running collection query: " + q);
+
+		try (Connection connection = getConnection();
+				Statement stmt = connection.createStatement()) {
+			ResultSet rs = stmt.executeQuery(q);
+			while (rs.next()) {
+				String type = Dependencies.ATOM_TYPE; // temp -- FIXME
+
+				String workflowId = rs.getString("workflowId");
+				String workflowRun = rs.getString("workflowRunId");
+				String proc = rs.getString("processorNameRef");
+				String var = rs.getString("portName");
+				String it = rs.getString("iteration");
+				String coll = rs.getString("collID");
+				String parentColl = rs.getString("parentCollIDRef");
+				//boolean isInput = rs.getBoolean("isInputPort");
+
+				lqr.addLineageQueryResultRecord(workflowId, proc, var, workflowRun,
+						it, coll, parentColl, null, null, type, false, true);  // true -> is a collection
+			}
+		} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
+			logger.warn("Could not execute query", e);
+		}
+		return lqr;
+	}
+
+	/**
+	 *
+	 * @param lq
+	 * @param includeDataValue  IGNORED. always false
+	 * @return
+	 * @throws SQLException
+	 */
+	public Dependencies runVBQuery(LineageSQLQuery lq, boolean includeDataValue)
+			throws SQLException {
+		String q = lq.getVbQuery();
+
+		logger.info("running VB query: " + q);
+
+		try (Connection connection = getConnection();
+				Statement stmt = connection.createStatement()) {
+			ResultSet rs = stmt.executeQuery(q);
+			Dependencies lqr = new Dependencies();
+
+			while (rs.next()) {
+				String type = Dependencies.ATOM_TYPE; // temp -- FIXME
+
+				String workflowId = rs.getString("workflowId");
+				String workflowRun = rs.getString("workflowRunId");
+				String proc = rs.getString("processorNameRef");
+				String var = rs.getString("portName");
+				String it = rs.getString("iteration");
+				String coll = rs.getString("collIDRef");
+				String value = rs.getString("value");
+				boolean isInput = rs.getBoolean("isInputPort");
+
+				// FIXME if the data is required then the query needs fixing
+				lqr.addLineageQueryResultRecord(workflowId, proc, var, workflowRun,
+						it, coll, null, value, null, type, isInput, false);
+			}
+			return lqr;
+		} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
+			logger.warn("Could not execute query", e);
+		}
+		return null;
+	}
+
+	/**
+	 * executes one of the lineage queries produced by the graph visit algorithm. This first executes the collection query, and then
+	 * if no result is returned, the varBinding query
+	 *
+	 * @param lq
+	 *            a lineage query computed during the graph traversal
+	 * @param includeDataValue
+	 *            if true, then the referenced value is included in the result.
+	 *            This may only be necessary for testing: the data reference in
+	 *            field value (which is a misleading field name, and actually
+	 *            refers to the data reference) should be sufficient
+	 * @return
+	 * @throws SQLException
+	 */
+	public Dependencies runLineageQuery(LineageSQLQuery lq,
+			boolean includeDataValue) throws SQLException {
+		Dependencies result = runCollectionQuery(lq);
+		if (result.getRecords().isEmpty())
+			return runVBQuery(lq, includeDataValue);
+		return result;
+	}
+
+	public List<Dependencies> runLineageQueries(List<LineageSQLQuery> lqList,
+			boolean includeDataValue) throws SQLException {
+		List<Dependencies> allResults = new ArrayList<>();
+		if (lqList == null)
+			logger.warn("lineage queries list is NULL, nothing to evaluate");
+		else
+			for (LineageSQLQuery lq : lqList)
+				if (lq != null)
+					allResults.add(runLineageQuery(lq, includeDataValue));
+		return allResults;
+	}
+
+	/**
+	 * takes an ordered set of records for the same variable with iteration
+	 * indexes and builds a collection out of it
+	 *
+	 * @param lqr
+	 * @return a jdom Document with the collection
+	 */
+	public Document recordsToCollection(Dependencies lqr) {
+		// process each var name in turn
+		// lqr ordered by var name and by iteration number
+		Document d = new Document(new Element("list"));
+
+		String currentVar = null;
+		for (ListIterator<LineageQueryResultRecord> it = lqr.iterator(); it.hasNext();) {
+			LineageQueryResultRecord record = it.next();
+
+			if (currentVar != null && record.getPortName().equals(currentVar)) {
+				// multiple occurrences
+				addToCollection(record, d);
+				// adds record to d in the correct position given by the iteration vector
+			}
+			if (currentVar == null)
+				currentVar = record.getPortName();
+		}
+		return d;
+	}
+
+	private void addToCollection(LineageQueryResultRecord record, Document d) {
+		Element root = d.getRootElement();
+		String[] itVector = record.getIteration().split(",");
+		Element currentEl = root;
+		// each element gives us a corresponding child in the tree
+		for (int i = 0; i < itVector.length; i++) {
+			int index = Integer.parseInt(itVector[i]);
+			List<?> children = currentEl.getChildren();
+			if (index < children.size())
+				currentEl = (Element) children.get(index);
+			else if (i == itVector.length - 1)
+				currentEl.addContent(new Element(record.getValue()));
+			else
+				currentEl.addContent(new Element("list"));
+		}
+	}
+
+	/**
+	 *
+	 * returns the set of all processors that are structurally contained within
+	 * the wf corresponding to the input dataflow name
+	 * @param workflowName the name of a processor of type DataFlowActivity
+	 * @return
+	 *
+	 * @deprecated as workflow 'names' are not globally unique, this method should not be used!
+	 */
+	@Deprecated
+	public List<String> getContainedProcessors(String workflowName) {
+		List<String> result = new ArrayList<>();
+
+		// dataflow name -> wfRef
+		String containerDataflow = getWorkflowIdForExternalName(workflowName);
+
+		// get all processors within containerDataflow
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection
+						.prepareStatement("SELECT processorName FROM Processor P "
+								+ "WHERE workflowId = ?")) {
+			ps.setString(1, containerDataflow);
+			ResultSet rs = ps.executeQuery();
+			while (rs.next())
+				result.add(rs.getString("processorName"));
+		} catch (InstantiationException | SQLException | IllegalAccessException | ClassNotFoundException e) {
+			logger.warn("Could not execute query", e);
+		}
+		return result;
+	}
+
+	public String getTopLevelDataflowName(String workflowRunId) {
+		String sql = "SELECT processorName FROM Processor P "
+				+ "JOIN WorkflowRun I on P.workflowId = I.workflowId "
+				+ "WHERE I.workflowRunId = ? AND isTopLevel = 1";
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql)) {
+			ps.setString(1, workflowRunId);
+			ResultSet rs = ps.executeQuery();
+			if (rs.next())
+				return rs.getString("processorName");
+		} catch (InstantiationException | SQLException | IllegalAccessException
+				| ClassNotFoundException e) {
+			logger.warn("Could not execute query", e);
+		}
+		return null;
+	}
+
+	/**
+	 * retrieve a tree structure starting from the top parent
+	 * @param workflowID
+	 * @return
+	 * @throws SQLException
+	 */
+	public WorkflowTree getWorkflowNestingStructure(String workflowID) throws SQLException {
+		WorkflowTree tree = new WorkflowTree();
+
+	    Workflow wf = getWorkflow(workflowID);
+	    tree.setNode(wf);
+
+	    List<String> children = getChildrenOfWorkflow(workflowID);
+	    for (String childWfName:children) {
+	    	WorkflowTree childStructure = getWorkflowNestingStructure(childWfName);
+	    	tree.addChild(childStructure);
+	    }
+	    return tree;
+	}
+
+	/**
+	 * returns the internal ID of a dataflow given its external name
+	 * @param externalName
+	 * @param workflowRunId
+	 * @return
+	 * @deprecated as workflow 'names' are not globally unique, this method should not be used!
+	 */
+	@Deprecated
+	public String getWorkflowIdForExternalName(String externalName) {
+		//"SELECT workflowId FROM Workflow W join WorkflowRun I on W.workflowId = I.workflowId WHERE W.externalName = ? and I.workflowRunId = ?");
+		String sql = "SELECT workflowId FROM Workflow W WHERE W.externalName = ?";
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql)) {
+			ps.setString(1, externalName);
+			// ps.setString(2, workflowRunId);
+			ResultSet rs = ps.executeQuery();
+			if (rs.next())
+				return rs.getString("workflowId");
+		} catch (InstantiationException | IllegalAccessException | ClassNotFoundException | SQLException e) {
+			logger.warn("Could not execute query", e);
+		}
+		return null;
+	}
+
+	/**
+	 * This method is deprecated as parent workflow ID is not correctly
+	 * recorded. If two workflows both contain the same nested workflow, only
+	 * one of them (the most recently added) will return that nested workflow
+	 * from this method.
+	 *
+	 * @deprecated
+	 * @param parentWorkflowId
+	 * @return
+	 * @throws SQLException
+	 */
+	@Deprecated
+	public List<String> getChildrenOfWorkflow(String parentWorkflowId)
+			throws SQLException {
+		List<String> result = new ArrayList<>();
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection
+						.prepareStatement("SELECT workflowId FROM Workflow WHERE parentWorkflowId = ? ")) {
+			ps.setString(1, parentWorkflowId);
+			ResultSet rs = ps.executeQuery();
+			while (rs.next())
+				result.add(rs.getString("workflowId"));
+		} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
+			logger.warn("Could not execute query", e);
+		}
+		return result;
+	}
+
+	/**
+	 * fetch children of parentWorkflowId from the Workflow table
+	 *
+	 * @return
+	 * @param childworkflowId
+	 * @throws SQLException
+	 */
+	public String getParentOfWorkflow(String childworkflowId)
+			throws SQLException {
+		String result = null;
+		String q = "SELECT parentWorkflowId FROM Workflow WHERE workflowId = ?";
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(q)) {
+			ps.setString(1, childworkflowId);
+
+			logger.debug("getParentOfWorkflow - query: " + q
+					+ "  with workflowId = " + childworkflowId);
+
+			ResultSet rs = ps.executeQuery();
+			while (rs.next()) {
+				result = rs.getString("parentWorkflowId");
+				logger.debug("result: " + result);
+				break;
+			}
+		} catch (InstantiationException | IllegalAccessException
+				| ClassNotFoundException e) {
+			logger.warn("Could not execute query", e);
+		}
+		return result;
+	}
+
+	public List<String> getAllworkflowIds() throws SQLException {
+		List<String> result = new ArrayList<>();
+		String q = "SELECT workflowId FROM Workflow";
+		try (Connection connection = getConnection();
+				Statement stmt = connection.createStatement()) {
+			ResultSet rs = stmt.executeQuery(q);
+			while (rs.next())
+				result.add(rs.getString("workflowId"));
+		} catch (InstantiationException | IllegalAccessException
+				| ClassNotFoundException e) {
+			logger.warn("Could not execute query", e);
+		}
+		return result;
+	}
+
+	/**
+	 * @deprecated This method is not workflowId aware and should not be used
+	 * @param procName
+	 * @return true if procName is the external name of a dataflow, false
+	 *         otherwise
+	 * @throws SQLException
+	 */
+	public boolean isDataflow(String procName) throws SQLException {
+		String sql = "SELECT firstActivityClass FROM Processor WHERE processorName = ?";
+		try (Connection c = getConnection();
+				PreparedStatement ps = c.prepareStatement(sql)) {
+			ps.setString(1, procName);
+			ResultSet rs = ps.executeQuery();
+			if (rs.next()
+					&& DATAFLOW_ACTIVITY.equals(rs
+							.getString("firstActivityClass")))
+				return true;
+		} catch (InstantiationException | IllegalAccessException
+				| ClassNotFoundException e) {
+			logger.warn("Could not execute query", e);
+		}
+		return false;
+	}
+
+	public boolean isTopLevelDataflow(String workflowIdID) {
+		String sql = "SELECT * FROM Workflow W where W.workflowId = ?";
+		try (Connection c = getConnection();
+				PreparedStatement ps = c.prepareStatement(sql)) {
+			ps.setString(1, workflowIdID);
+			ResultSet rs = ps.executeQuery();
+			if (rs.next())
+				return (rs.getString("parentWorkflowId") == null);
+		} catch (SQLException | InstantiationException | IllegalAccessException | ClassNotFoundException e) {
+			logger.warn("Could not execute query", e);
+		}
+		return false;
+	}
+
+	public boolean isTopLevelDataflow(String workflowId, String workflowRunId) {
+		String sql = "SELECT " + parentProcessorEnactmentId + " AS parent"
+				+ " FROM " + DataflowInvocation + " W " + " WHERE "
+				+ DataflowInvocationTable.workflowId + "=? AND "
+				+ DataflowInvocationTable.workflowRunId + "=?";
+		try (Connection c = getConnection();
+				PreparedStatement ps = c.prepareStatement(sql)) {
+			ps.setString(1, workflowId);
+			ps.setString(2, workflowRunId);
+			ResultSet rs = ps.executeQuery();
+			if (rs.next())
+				return (rs.getString("parent") == null);
+		} catch (SQLException | InstantiationException | IllegalAccessException | ClassNotFoundException e) {
+			logger.warn("Could not execute query", e);
+		}
+		return false;
+	}
+
+	public String getTopDataflow(String workflowRunId) {
+		String sql = "SELECT processorName FROM "
+				+ "Processor P JOIN WorkflowRun I ON P.workflowId = I.workflowId "
+				+ " WHERE I.workflowRunId = ? AND isTopLevel = 1 ";
+		try (Connection c = getConnection();
+				PreparedStatement ps = c.prepareStatement(sql)) {
+			ps.setString(1, workflowRunId);
+			ResultSet rs = ps.executeQuery();
+			if (rs.next())
+				return rs.getString("processorName");
+		} catch (SQLException | InstantiationException | IllegalAccessException
+				| ClassNotFoundException e) {
+			logger.warn("Could not execute query", e);
+		}
+		return null;
+	}
+
+	/**
+	 *
+	 * @param p
+	 *            pTo processor
+	 * @param var
+	 *            vTo
+	 * @param value
+	 *            valTo
+	 * @return a set of DDRecord
+	 * @throws SQLException
+	 */
+	public List<DDRecord> queryDD(String p, String var, String value,
+			String iteration, String workflowRun) throws SQLException {
+		Q q = query("SELECT * FROM DD ");
+		q.where("pTo", p);
+		q.where("vTo", var);
+		if (value != null)
+			q.where("valTo", value);
+		if (iteration != null)
+			q.where("iteration", iteration);
+		if (workflowRun != null)
+			q.where("workflowRun", workflowRun);
+
+		try (Connection connection = getConnection();
+				Statement stmt = connection.createStatement();
+				ResultSet rs = q.exec(stmt)) {
+			List<DDRecord> result = new ArrayList<>();
+			while (rs.next()) {
+				DDRecord aDDrecord = new DDRecord();
+				aDDrecord.setPFrom(rs.getString("pFrom"));
+				aDDrecord.setVFrom(rs.getString("vFrom"));
+				aDDrecord.setValFrom(rs.getString("valFrom"));
+				aDDrecord.setPTo(rs.getString("pTo"));
+				aDDrecord.setVTo(rs.getString("vTo"));
+				aDDrecord.setValTo(rs.getString("valTo"));
+				result.add(aDDrecord);
+			}
+			return result;
+		} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
+			logger.warn("Could not execute query", e);
+		}
+		return null;
+	}
+
+	public Set<DDRecord> queryDataLinksForDD(String p, String v, String val,
+			String workflowRun) throws SQLException {
+		String sql = "SELECT DISTINCT A.sourceProcessorName AS p, A.sourcePortName AS var, VB.value AS val "
+				+ "FROM   Datalink A "
+				+ "JOIN   PortBinding VB ON VB.portName = A.destinationPortName AND VB.processorNameRef = A.destinationProcessorName "
+				+ "JOIN   WorkflowRun WF ON WF.workflowId = A.workflowId AND WF.workflowRunId = VB.workflowRunId  "
+				+ "WHERE  WF.workflowRunId = ? AND A.destinationProcessorName = ? AND A.destinationPortName = ? AND VB.value = ?";
+
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql)) {
+			ps.setString(1, workflowRun);
+			ps.setString(2, p);
+			ps.setString(3, v);
+			ps.setString(4, val);
+			ResultSet rs = ps.executeQuery();
+			Set<DDRecord> result = new HashSet<>();
+			while (rs.next()) {
+				DDRecord aDDrecord = new DDRecord();
+				aDDrecord.setPTo(rs.getString("p"));
+				aDDrecord.setVTo(rs.getString("var"));
+				aDDrecord.setValTo(rs.getString("val"));
+				result.add(aDDrecord);
+			}
+			return result;
+		} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
+			logger.warn("Could not execute query", e);
+		}
+		return null;
+	}
+
+	public Set<DDRecord> queryAllFromValues(String workflowRun)
+			throws SQLException {
+		String sql = "SELECT DISTINCT PFrom, vFrom, valFrom FROM DD where workflowRun = ?";
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql)) {
+			ps.setString(1, workflowRun);
+			ResultSet rs = ps.executeQuery();
+			Set<DDRecord> result = new HashSet<>();
+			while (rs.next()) {
+				DDRecord aDDrecord = new DDRecord();
+				aDDrecord.setPFrom(rs.getString("PFrom"));
+				aDDrecord.setVFrom(rs.getString("vFrom"));
+				aDDrecord.setValFrom(rs.getString("valFrom"));
+				result.add(aDDrecord);
+			}
+			return result;
+		} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
+			logger.warn("Could not execute query", e);
+			return null;
+		}
+	}
+
+	public boolean isRootProcessorOfWorkflow(String procName, String workflowId,
+			String workflowRunId) {
+		String sql = "SELECT * FROM Datalink A JOIN WorkflowRun I ON A.workflowId = I.workflowId "
+				+ "JOIN Processor P on P.processorName = A.sourceProcessorName "
+				+ "WHERE sourceProcessorName = ? "
+				+ "AND P.workflowId <> A.workflowId "
+				+ "AND I.workflowRunId = ? "
+				+ "AND destinationProcessorName = ? ";
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql)) {
+			ps.setString(1, workflowId);
+			ps.setString(2, workflowRunId);
+			ps.setString(3, procName);
+			if (ps.executeQuery().next())
+				return true;
+		} catch (InstantiationException | IllegalAccessException | ClassNotFoundException | SQLException e) {
+			logger.warn("Could not execute query", e);
+		}
+		return false;
+	}
+
+	/**
+	 * returns a Workflow record from the DB given the workflow internal ID
+	 * @param dataflowID
+	 * @return
+	 */
+	public Workflow getWorkflow(String dataflowID) {
+		String sql = "SELECT * FROM Workflow W WHERE workflowId = ? ";
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql)) {
+			ps.setString(1, dataflowID);
+			ResultSet rs = ps.executeQuery();
+			if (rs.next()) {
+				Workflow wf = new Workflow();
+				wf.setWorkflowId(rs.getString("workflowId"));
+				wf.setParentWorkflowId(rs.getString("parentWorkflowId"));
+				wf.setExternalName(rs.getString("externalName"));
+
+				return wf;
+			} else {
+				logger.warn("Could not find workflow " + dataflowID);
+			}
+		} catch (InstantiationException | IllegalAccessException | ClassNotFoundException | SQLException e) {
+			logger.warn("Could not execute query", e);
+		}
+		return null;
+	}
+
+	/**
+	 * @param record
+	 *            a record representing a single value -- possibly within a list
+	 *            hierarchy
+	 * @return the URI for topmost containing collection when the input record
+	 *         is within a list hierarchy, or null otherwise
+	 */
+	public String getContainingCollection(LineageQueryResultRecord record) {
+		if (record.getCollectionT2Reference() == null)
+			return null;
+		String sql = "SELECT * FROM Collection "
+				+ "WHERE collID = ? and workflowRunId = ? and processorNameRef = ? and portName = ?";
+		try (Connection connection = getConnection()) {
+			String parentCollIDRef = null;
+			try (PreparedStatement stmt = connection.prepareStatement(sql)) {
+				stmt.setString(1, record.getCollectionT2Reference());
+				stmt.setString(2, record.getWorkflowRunId());
+				stmt.setString(3, record.getProcessorName());
+				stmt.setString(4, record.getPortName());
+				ResultSet rs = stmt.executeQuery();
+				if (rs.next())
+					parentCollIDRef = rs.getString("parentCollIDRef");
+			}
+
+			// INITIALLY not null -- would be TOP if the initial had no parent
+			while (parentCollIDRef != null) {
+				String oldParentCollIDRef = parentCollIDRef;
+
+				// query Collection again for parent collection
+				try (PreparedStatement stmt = connection.prepareStatement(sql)) {
+					stmt.setString(1, oldParentCollIDRef);
+					stmt.setString(2, record.getWorkflowRunId());
+					stmt.setString(3, record.getProcessorName());
+					stmt.setString(4, record.getPortName());
+					ResultSet rs = stmt.executeQuery();
+					if (rs.next()) {
+						parentCollIDRef = rs.getString("parentCollIDRef");
+						if (parentCollIDRef.equals("TOP"))
+							return oldParentCollIDRef;
+					}
+				} catch (Exception e) {
+					logger.warn("Could not execute query", e);
+				}
+			}
+		} catch (InstantiationException | IllegalAccessException | ClassNotFoundException | SQLException e) {
+			logger.warn("Could not execute query", e);
+		}
+		return null;
+	}
+
+	public List<ProcessorEnactment> getProcessorEnactments(
+			String workflowRunId, String... processorPath) {
+		return getProcessorEnactments(workflowRunId,
+				(List<ProcessorEnactment>) null, Arrays.asList(processorPath));
+	}
+
+	private List<ProcessorEnactment> getProcessorEnactments(
+			String workflowRunId, List<ProcessorEnactment> parentProcessorEnactments,
+			List<String> processorPath) {
+		List<String> processorEnactmentIds = null;
+		if (parentProcessorEnactments != null) {
+			processorEnactmentIds = new ArrayList<>();
+			for (ProcessorEnactment processorEnactment : parentProcessorEnactments)
+				processorEnactmentIds.add(processorEnactment.getProcessEnactmentId());
+		}
+		if (processorPath.size() > 1) {
+			return getProcessorEnactments(
+					workflowRunId,
+					getProcessorEnactmentsByProcessorName(workflowRunId,
+							processorEnactmentIds, processorPath.get(0)),
+					processorPath.subList(1, processorPath.size()));
+		} else if (processorPath.size() == 1) {
+			return getProcessorEnactmentsByProcessorName(workflowRunId,
+					processorEnactmentIds, processorPath.get(0));
+		} else {
+			return getProcessorEnactmentsByProcessorName(workflowRunId,
+					processorEnactmentIds, null);
+		}
+	}
+
+	public List<ProcessorEnactment> getProcessorEnactmentsByProcessorName(
+			String workflowRunId, List<String> parentProcessorEnactmentIds,
+			String processorName) {
+		StringBuilder query = new StringBuilder();
+		query.append("SELECT ")
+				.append(ProcessorEnactmentTable.enactmentStarted).append(", ")
+				.append(ProcessorEnactmentTable.enactmentEnded).append(", ")
+				.append(ProcessorEnactmentTable.finalOutputsDataBindingId)
+				.append(", ")
+				.append(ProcessorEnactmentTable.initialInputsDataBindingId)
+				.append(", ")
+				.append(ProcessorEnactmentTable.ProcessorEnactment).append(".")
+				.append(ProcessorEnactmentTable.processorId)
+				.append(" AS procId, ")
+				.append(ProcessorEnactmentTable.processIdentifier).append(", ")
+				.append(ProcessorEnactmentTable.processEnactmentId)
+				.append(", ")
+				.append(ProcessorEnactmentTable.parentProcessorEnactmentId)
+				.append(", ").append(ProcessorEnactmentTable.workflowRunId)
+				.append(", ").append(ProcessorEnactmentTable.iteration)
+				.append(", Processor.processorName FROM ")
+				.append(ProcessorEnactmentTable.ProcessorEnactment)
+				.append(" INNER JOIN Processor ON ")
+				.append(ProcessorEnactmentTable.ProcessorEnactment).append(".")
+				.append(ProcessorEnactmentTable.processorId)
+				.append(" = Processor.processorId WHERE ")
+				.append(ProcessorEnactmentTable.workflowRunId).append(" = ? ");
+
+		if (processorName != null)
+			// Specific processor
+			query.append(" AND Processor.processorName = ? ");
+		if ((parentProcessorEnactmentIds == null || parentProcessorEnactmentIds.isEmpty()) && processorName != null) {
+			// null - ie. top level
+			query.append(" AND " + ProcessorEnactmentTable.parentProcessorEnactmentId + " IS NULL");
+		} else if (parentProcessorEnactmentIds != null) {
+			// not null, ie. inside nested workflow
+			query.append(" AND " + ProcessorEnactmentTable.parentProcessorEnactmentId + " IN (");
+			for (int i=0; i<parentProcessorEnactmentIds.size(); i++) {
+				query.append('?');
+				if (i < (parentProcessorEnactmentIds.size()-1))
+					query.append(',');
+			}
+			query.append(')');
+		}
+
+		ArrayList<ProcessorEnactment> procEnacts = new ArrayList<>();
+
+		try (Connection connection = getConnection();
+				PreparedStatement statement = connection.prepareStatement(query
+						.toString())) {
+			int pos = 1;
+			statement.setString(pos++, workflowRunId);
+			if (processorName != null)
+				statement.setString(pos++, processorName);
+			if (parentProcessorEnactmentIds != null)
+				for (String parentId : parentProcessorEnactmentIds)
+					statement.setString(pos++, parentId);
+			ResultSet resultSet = statement.executeQuery();
+			while (resultSet.next()) {
+				ProcessorEnactment procEnact = readProcessorEnactment(resultSet);
+				procEnacts.add(procEnact);
+			}
+		} catch (SQLException | InstantiationException | IllegalAccessException | ClassNotFoundException e) {
+			logger.warn("Could not execute query " + query, e);
+		}
+		return procEnacts;
+	}
+
+	private ProcessorEnactment readProcessorEnactment(ResultSet resultSet) throws SQLException {
+		Timestamp enactmentStarted = resultSet.getTimestamp(ProcessorEnactmentTable.enactmentStarted.name());
+		Timestamp enactmentEnded = resultSet.getTimestamp(ProcessorEnactmentTable.enactmentEnded.name());
+		//String pName = resultSet.getString("processorName");
+		String finalOutputsDataBindingId = resultSet.getString(ProcessorEnactmentTable.finalOutputsDataBindingId.name());
+		String initialInputsDataBindingId = resultSet.getString(ProcessorEnactmentTable.initialInputsDataBindingId.name());
+
+		String iteration = resultSet.getString(ProcessorEnactmentTable.iteration.name());
+		String processorId = resultSet.getString("procId");
+		String processIdentifier = resultSet.getString(ProcessorEnactmentTable.processIdentifier.name());
+		String processEnactmentId = resultSet.getString(ProcessorEnactmentTable.processEnactmentId.name());
+		String parentProcessEnactmentId = resultSet.getString(ProcessorEnactmentTable.parentProcessorEnactmentId.name());
+		String workflowRunId = resultSet.getString(ProcessorEnactmentTable.workflowRunId.name());
+
+		ProcessorEnactment procEnact = new ProcessorEnactment();
+		procEnact.setEnactmentEnded(enactmentEnded);
+		procEnact.setEnactmentStarted(enactmentStarted);
+		procEnact.setFinalOutputsDataBindingId(finalOutputsDataBindingId);
+		procEnact.setInitialInputsDataBindingId(initialInputsDataBindingId);
+		procEnact.setIteration(iteration);
+		procEnact.setParentProcessorEnactmentId(parentProcessEnactmentId);
+		procEnact.setProcessEnactmentId(processEnactmentId);
+		procEnact.setProcessIdentifier(processIdentifier);
+		procEnact.setProcessorId(processorId);
+		procEnact.setWorkflowRunId(workflowRunId);
+		return procEnact;
+	}
+
+	public ProcessorEnactment getProcessorEnactment(String processorEnactmentId) {
+		String query  =
+				"SELECT " + ProcessorEnactmentTable.enactmentStarted + ","
+						+ ProcessorEnactmentTable.enactmentEnded + ","
+						+ ProcessorEnactmentTable.finalOutputsDataBindingId + ","
+						+ ProcessorEnactmentTable.initialInputsDataBindingId + ","
+						+ ProcessorEnactmentTable.ProcessorEnactment + "."
+						+ ProcessorEnactmentTable.processorId + " AS procId,"
+						+ ProcessorEnactmentTable.processIdentifier + ","
+						+ ProcessorEnactmentTable.workflowRunId + ","
+						+ ProcessorEnactmentTable.processEnactmentId + ","
+						+ ProcessorEnactmentTable.parentProcessorEnactmentId + ","
+						+ ProcessorEnactmentTable.iteration
+						+ " FROM "
+						+ ProcessorEnactmentTable.ProcessorEnactment
+						+ " WHERE "
+						+ ProcessorEnactmentTable.processEnactmentId + "=?";
+
+		ProcessorEnactment procEnact = null;
+		try (Connection connection = getConnection();
+				PreparedStatement statement = connection
+						.prepareStatement(query)) {
+			statement.setString(1, processorEnactmentId);
+			ResultSet resultSet = statement.executeQuery();
+			if (!resultSet.next()) {
+				logger.warn("Could not find ProcessorEnactment processEnactmentId="
+						+ processorEnactmentId);
+				return null;
+			}
+			procEnact = readProcessorEnactment(resultSet);
+			if (resultSet.next()) {
+				logger.error("Found more than one ProcessorEnactment processEnactmentId="
+						+ processorEnactmentId);
+				return null;
+			}
+		} catch (SQLException | InstantiationException | IllegalAccessException | ClassNotFoundException e) {
+			logger.warn("Could not execute query " + query, e);
+		}
+		return procEnact;
+	}
+
+	public ProcessorEnactment getProcessorEnactmentByProcessId(
+			String workflowRunId, String processIdentifier, String iteration) {
+		String query = "SELECT " + ProcessorEnactmentTable.enactmentStarted
+				+ "," + ProcessorEnactmentTable.enactmentEnded + ","
+				+ ProcessorEnactmentTable.finalOutputsDataBindingId + ","
+				+ ProcessorEnactmentTable.initialInputsDataBindingId + ","
+				+ ProcessorEnactmentTable.ProcessorEnactment + "."
+				+ ProcessorEnactmentTable.processorId + " AS procId,"
+				+ ProcessorEnactmentTable.processIdentifier + ","
+				+ ProcessorEnactmentTable.workflowRunId + ","
+				+ ProcessorEnactmentTable.processEnactmentId + ","
+				+ ProcessorEnactmentTable.parentProcessorEnactmentId + ","
+				+ ProcessorEnactmentTable.iteration + " FROM "
+				+ ProcessorEnactmentTable.ProcessorEnactment + " WHERE "
+				+ ProcessorEnactmentTable.workflowRunId + "=?" + " AND "
+				+ ProcessorEnactmentTable.processIdentifier + "=?" + " AND "
+				+ ProcessorEnactmentTable.iteration + "=?";
+
+		ProcessorEnactment procEnact = null;
+		try (Connection connection = getConnection();
+				PreparedStatement statement = connection
+						.prepareStatement(query)) {
+			statement.setString(1, workflowRunId);
+			statement.setString(2, processIdentifier);
+			statement.setString(3, iteration);
+
+			ResultSet resultSet = statement.executeQuery();
+			String debugString = "ProcessorEnactment runId=" + workflowRunId
+					+ " processIdentifier=" + processIdentifier + " iteration="
+					+ iteration;
+			if (!resultSet.next()) {
+				logger.warn("Could not find " + debugString);
+				return null;
+			}
+			procEnact = readProcessorEnactment(resultSet);
+			if (resultSet.next()) {
+				logger.error("Found more than one " + debugString);
+				return null;
+			}
+		} catch (SQLException | InstantiationException | IllegalAccessException | ClassNotFoundException e) {
+			logger.warn("Could not execute query " + query, e);
+		}
+		return procEnact;
+	}
+
+	public Map<Port, String> getDataBindings(String dataBindingId) {
+		HashMap<Port, String> dataBindings = new HashMap<>();
+		String query = "SELECT " + DataBindingTable.t2Reference + ","
+				+ "Port.portId AS portId," + "Port.processorName,"
+				+ "Port.processorId," + "Port.isInputPort," + "Port.portName,"
+				+ "Port.depth," + "Port.resolvedDepth," + "Port.workflowId"
+				+ " FROM " + DataBindingTable.DataBinding + " INNER JOIN "
+				+ "Port" + " ON " + " Port.portId="
+				+ DataBindingTable.DataBinding + "." + DataBindingTable.portId
+				+ " WHERE " + DataBindingTable.dataBindingId + "=?";
+		try (Connection connection = getConnection();
+				PreparedStatement statement = connection
+						.prepareStatement(query)) {
+			statement.setString(1, dataBindingId);
+			ResultSet rs = statement.executeQuery();
+			while (rs.next()) {
+				String t2Ref = rs.getString(DataBindingTable.t2Reference.name());
+
+				Port port = new Port();
+				port.setWorkflowId(rs.getString("workflowId"));
+				port.setInputPort(rs.getBoolean("isInputPort"));
+				port.setIdentifier(rs.getString("portId"));
+				port.setProcessorName(rs.getString("processorName"));
+				port.setProcessorId(rs.getString("processorId"));
+				port.setPortName(rs.getString("portName"));
+				port.setDepth(rs.getInt("depth"));
+				if (rs.getString("resolvedDepth") != null)
+					port.setResolvedDepth(rs.getInt("resolvedDepth"));
+				dataBindings.put(port, t2Ref);
+			}
+		} catch (SQLException | InstantiationException | IllegalAccessException | ClassNotFoundException e) {
+			logger.warn("Could not execute query " + query, e);
+		}
+		return dataBindings;
+	}
+
+	public List<Port> getAllPortsInDataflow(String workflowID) {
+		Map<String, String> queryConstraints = new HashMap<>();
+		queryConstraints.put("V.workflowId", workflowID);
+		try {
+			return getPorts(queryConstraints);
+		} catch (SQLException e) {
+			logger.error("Problem getting ports for dataflow: " + workflowID, e);
+			return null;
+		}
+	}
+
+	public List<Port> getPortsForDataflow(String workflowID) {
+		Workflow w = getWorkflow(workflowID);
+
+		Map<String, String> queryConstraints = new HashMap<>();
+		queryConstraints.put("V.workflowId", workflowID);
+		queryConstraints.put("processorName", w.getExternalName());
+
+		try {
+			return getPorts(queryConstraints);
+		} catch (SQLException e) {
+			logger.error("Problem getting ports for dataflow: " + workflowID, e);
+			return null;
+		}
+	}
+
+	public List<Port> getPortsForProcessor(String workflowID,
+			String processorName) {
+		Map<String, String> queryConstraints = new HashMap<>();
+		queryConstraints.put("V.workflowId", workflowID);
+		queryConstraints.put("processorName", processorName);
+
+		try {
+			return getPorts(queryConstraints);
+		} catch (SQLException e) {
+			logger.error("Problem getting ports for processor: "
+					+ processorName + " worflow: " + workflowID, e);
+			return null;
+		}
+	}
+
+	public DataflowInvocation getDataflowInvocation(String workflowRunId) {
+		String query = "SELECT " +
+				  DataflowInvocationTable.dataflowInvocationId + ","
+				+ DataflowInvocationTable.inputsDataBinding + ","
+				+ DataflowInvocationTable.invocationEnded + ","
+				+ DataflowInvocationTable.invocationStarted + ","
+				+ DataflowInvocationTable.outputsDataBinding + ","
+				+ DataflowInvocationTable.parentProcessorEnactmentId + ","
+				+ DataflowInvocationTable.workflowId + ","
+				+ DataflowInvocationTable.workflowRunId + ","
+				+ DataflowInvocationTable.completed
+				+ " FROM "
+				+ DataflowInvocationTable.DataflowInvocation +
+				" WHERE "
+				+ DataflowInvocationTable.parentProcessorEnactmentId + " IS NULL AND "
+				+ DataflowInvocationTable.workflowRunId + "=?";
+		DataflowInvocation dataflowInvocation = null;
+		try (Connection connection = getConnection();
+				PreparedStatement statement = connection
+						.prepareStatement(query)) {
+			statement.setString(1, workflowRunId);
+			ResultSet rs = statement.executeQuery();
+			if (!rs.next()) {
+				logger.warn("Could not find DataflowInvocation for workflowRunId=" + workflowRunId);
+				return null;
+			}
+			dataflowInvocation = new DataflowInvocation();
+			dataflowInvocation.setDataflowInvocationId(rs.getString(DataflowInvocationTable.dataflowInvocationId.name()));
+			dataflowInvocation.setInputsDataBindingId(rs.getString(DataflowInvocationTable.inputsDataBinding.name()));
+			dataflowInvocation.setInvocationEnded(rs.getTimestamp(DataflowInvocationTable.invocationEnded.name()));
+			dataflowInvocation.setInvocationStarted(rs.getTimestamp(DataflowInvocationTable.invocationStarted.name()));
+			dataflowInvocation.setOutputsDataBindingId(rs.getString(DataflowInvocationTable.outputsDataBinding.name()));
+			dataflowInvocation.setParentProcessorEnactmentId(rs.getString(DataflowInvocationTable.parentProcessorEnactmentId.name()));
+			dataflowInvocation.setWorkflowId(rs.getString(DataflowInvocationTable.workflowId.name()));
+			dataflowInvocation.setWorkflowRunId(rs.getString(DataflowInvocationTable.workflowRunId.name()));
+			dataflowInvocation.setCompleted(rs.getBoolean(DataflowInvocationTable.completed.name()));
+			if (rs.next()) {
+				logger.error("Found more than one DataflowInvocation for workflowRunId=" + workflowRunId);
+				return null;
+			}
+		} catch (SQLException | InstantiationException | IllegalAccessException | ClassNotFoundException e) {
+			logger.warn("Could not execute query " + query, e);
+		}
+		return dataflowInvocation;
+	}
+
+	public DataflowInvocation getDataflowInvocation(
+			ProcessorEnactment processorEnactment) {
+		String query = "SELECT " + DataflowInvocationTable.dataflowInvocationId
+				+ "," + DataflowInvocationTable.inputsDataBinding + ","
+				+ DataflowInvocationTable.invocationEnded + ","
+				+ DataflowInvocationTable.invocationStarted + ","
+				+ DataflowInvocationTable.outputsDataBinding + ","
+				+ DataflowInvocationTable.parentProcessorEnactmentId + ","
+				+ DataflowInvocationTable.workflowId + ","
+				+ DataflowInvocationTable.workflowRunId + ","
+				+ DataflowInvocationTable.completed + " FROM "
+				+ DataflowInvocationTable.DataflowInvocation + " WHERE "
+				+ DataflowInvocationTable.parentProcessorEnactmentId + "=?";
+		DataflowInvocation dataflowInvocation = null;
+		try (Connection connection = getConnection();
+				PreparedStatement statement = connection
+						.prepareStatement(query)) {
+			statement.setString(1, processorEnactment.getProcessEnactmentId());
+			ResultSet rs = statement.executeQuery();
+			if (!rs.next()) {
+				logger.warn("Could not find DataflowInvocation for processorEnactmentId="
+						+ processorEnactment.getProcessEnactmentId());
+				return null;
+			}
+			dataflowInvocation = new DataflowInvocation();
+			dataflowInvocation.setDataflowInvocationId(rs
+					.getString(DataflowInvocationTable.dataflowInvocationId
+							.name()));
+			dataflowInvocation
+					.setInputsDataBindingId(rs
+							.getString(DataflowInvocationTable.inputsDataBinding
+									.name()));
+			dataflowInvocation.setInvocationEnded(rs
+					.getTimestamp(DataflowInvocationTable.invocationEnded
+							.name()));
+			dataflowInvocation.setInvocationStarted(rs
+					.getTimestamp(DataflowInvocationTable.invocationStarted
+							.name()));
+			dataflowInvocation.setOutputsDataBindingId(rs
+					.getString(DataflowInvocationTable.outputsDataBinding
+							.name()));
+			dataflowInvocation
+					.setParentProcessorEnactmentId(rs
+							.getString(DataflowInvocationTable.parentProcessorEnactmentId
+									.name()));
+			dataflowInvocation.setWorkflowId(rs
+					.getString(DataflowInvocationTable.workflowId.name()));
+			dataflowInvocation.setWorkflowRunId(rs
+					.getString(DataflowInvocationTable.workflowRunId.name()));
+			dataflowInvocation.setCompleted(rs
+					.getBoolean(DataflowInvocationTable.completed.name()));
+
+			if (rs.next()) {
+				logger.error("Found more than one DataflowInvocation for processorEnactmentId="
+						+ processorEnactment.getProcessEnactmentId());
+				return null;
+			}
+		} catch (SQLException | InstantiationException | IllegalAccessException | ClassNotFoundException e) {
+			logger.warn("Could not execute query " + query, e);
+		}
+		return dataflowInvocation;
+	}
+
+	public List<DataflowInvocation> getDataflowInvocations(String workflowRunId) {
+		String query = "SELECT " + DataflowInvocationTable.dataflowInvocationId
+				+ "," + DataflowInvocationTable.inputsDataBinding + ","
+				+ DataflowInvocationTable.invocationEnded + ","
+				+ DataflowInvocationTable.invocationStarted + ","
+				+ DataflowInvocationTable.outputsDataBinding + ","
+				+ DataflowInvocationTable.parentProcessorEnactmentId + ","
+				+ DataflowInvocationTable.workflowId + ","
+				+ DataflowInvocationTable.workflowRunId + ","
+				+ DataflowInvocationTable.completed + " FROM "
+				+ DataflowInvocationTable.DataflowInvocation + " WHERE "
+				+ DataflowInvocationTable.workflowRunId + "=?";
+		List<DataflowInvocation> invocations = new ArrayList<>();
+		try (Connection connection = getConnection();
+				PreparedStatement statement = connection
+						.prepareStatement(query)) {
+			statement.setString(1, workflowRunId);
+			ResultSet rs = statement.executeQuery();
+			if (! rs.next()) {
+				logger.warn("Could not find DataflowInvocation for workflowRunId=" + workflowRunId);
+				return null;
+			}
+			DataflowInvocation dataflowInvocation = new DataflowInvocation();
+			dataflowInvocation.setDataflowInvocationId(rs.getString(DataflowInvocationTable.dataflowInvocationId.name()));
+			dataflowInvocation.setInputsDataBindingId(rs.getString(DataflowInvocationTable.inputsDataBinding.name()));
+			dataflowInvocation.setInvocationEnded(rs.getTimestamp(DataflowInvocationTable.invocationEnded.name()));
+			dataflowInvocation.setInvocationStarted(rs.getTimestamp(DataflowInvocationTable.invocationStarted.name()));
+			dataflowInvocation.setOutputsDataBindingId(rs.getString(DataflowInvocationTable.outputsDataBinding.name()));
+			dataflowInvocation.setParentProcessorEnactmentId(rs.getString(DataflowInvocationTable.parentProcessorEnactmentId.name()));
+			dataflowInvocation.setWorkflowId(rs.getString(DataflowInvocationTable.workflowId.name()));
+			dataflowInvocation.setWorkflowRunId(rs.getString(DataflowInvocationTable.workflowRunId.name()));
+			dataflowInvocation.setCompleted(rs.getBoolean(DataflowInvocationTable.completed.name()));
+			invocations.add(dataflowInvocation);
+		} catch (SQLException | InstantiationException | IllegalAccessException | ClassNotFoundException e) {
+			logger.warn("Could not execute query " + query, e);
+		}
+		return invocations;
+	}
+
+	public List<Collection> getCollectionsForRun(String wfInstanceID) {
+		ArrayList<Collection> result = new ArrayList<>();
+		String sql = "SELECT * FROM Collection C WHERE workflowRunId = ?";
+		try (Connection c = getConnection();
+				PreparedStatement ps = c.prepareStatement(sql)) {
+			ps.setString(1, wfInstanceID);
+			ResultSet rs = ps.executeQuery();
+			while (rs.next()) {
+				Collection coll = new Collection();
+				coll.setCollId(rs.getString(CollectionTable.collID.name()));
+				coll.setParentIdentifier(rs
+						.getString(CollectionTable.parentCollIDRef.name()));
+				coll.setWorkflowRunIdentifier(rs
+						.getString(CollectionTable.workflowRunId.name()));
+				coll.setProcessorName(rs
+						.getString(CollectionTable.processorNameRef.name()));
+				coll.setPortName(rs.getString(CollectionTable.portName.name()));
+				coll.setIteration(rs.getString(CollectionTable.iteration.name()));
+				result.add(coll);
+			}
+		} catch (Exception e) {
+			logger.warn("Could not execute query", e);
+		}
+		return result;
+	}
+}


[02/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/README.md
----------------------------------------------------------------------
diff --git a/taverna-reference-types/README.md b/taverna-reference-types/README.md
new file mode 100644
index 0000000..faaf57d
--- /dev/null
+++ b/taverna-reference-types/README.md
@@ -0,0 +1,5 @@
+Taverna Workflow system Execution Engine data reference management implementation
+
+Implementations of certain SPIs to provide a core set of functionality for the reference management framework. This includes ExternalReference implementations to reference data held in local files and URLs along with the appropriate translate / publish logic. Implementations in this package are tied only to the API, although certain metadata files such as hibernate mappings are also included where appropriate (these will be silently ignored if using a backing store that is not hibernate based)
+
+This code was previously hosted at http://taverna.googlecode.com/svn/taverna/engine/net.sf.taverna.t2.core.reference-core-extensions

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-reference-types/pom.xml b/taverna-reference-types/pom.xml
new file mode 100644
index 0000000..7e26efb
--- /dev/null
+++ b/taverna-reference-types/pom.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.taverna.engine</groupId>
+		<artifactId>taverna-engine</artifactId>
+		<version>3.1.0-incubating-SNAPSHOT</version>
+	</parent>
+	<artifactId>taverna-reference-types</artifactId>
+	<packaging>bundle</packaging>
+	<name>Apache Taverna Engine Reference Types</name>
+	<description>
+		Implementations of certain SPIs to provide a core set of
+		functionality for the reference management framework. This
+		includes ExternalReference implementations to reference data
+		held in local files and URLs along with the appropriate
+		translate / publish logic.
+		Implementations in this package are tied only to the API, although
+		certain metadata files such as hibernate mappings are also included
+		where appropriate (these will be silently ignored if using a backing
+		store that is not hibernate based)
+	</description>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-bundle-plugin</artifactId>
+				<extensions>true</extensions>
+				<configuration>
+					<instructions>
+						<Export-Package>net.sf.taverna.t2.reference.impl.external.*</Export-Package>
+					</instructions>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+	<dependencies>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-reference-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-codec</groupId>
+			<artifactId>commons-codec</artifactId>
+			<version>${commons.codec.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>com.springsource.org.apache.commons.httpclient</artifactId>
+			<version>${commons.httpclient.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-reference-testhelpers</artifactId>
+			<version>${project.parent.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-reference-impl</artifactId>
+			<version>${project.parent.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+			<version>${log4j.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/file/FileReference.java
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/file/FileReference.java b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/file/FileReference.java
new file mode 100644
index 0000000..eeca752
--- /dev/null
+++ b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/file/FileReference.java
@@ -0,0 +1,210 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl.external.file;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.nio.charset.Charset;
+
+import net.sf.taverna.t2.reference.AbstractExternalReference;
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ReferenceContext;
+import net.sf.taverna.t2.reference.ReferencedDataNature;
+
+/**
+ * Implementation of ExternalReference used to refer to data held in a locally
+ * accessible file. Inherits from
+ * {@link net.sf.taverna.t2.reference.AbstractExternalReference
+ * AbstractExternalReference} to enable hibernate based persistence.
+ * 
+ * @author Tom Oinn
+ */
+public class FileReference extends AbstractExternalReference implements
+		ExternalReferenceSPI {
+	private String filePathString = null;
+	private String charset = null;
+	private File file = null;
+	private String dataNatureName = ReferencedDataNature.UNKNOWN.name();
+
+	/**
+	 * Explicitly declare default constructor, will be used by hibernate when
+	 * constructing instances of this bean from the database.
+	 */
+	public FileReference() {
+		super();
+	}
+
+	/**
+	 * Construct a file reference pointed at the specified file and with no
+	 * character set defined.
+	 */
+	public FileReference(File theFile) {
+		super();
+		this.file = theFile.getAbsoluteFile();
+		this.filePathString = this.file.getPath();
+		this.charset = Charset.defaultCharset().name();
+	}
+
+	/**
+	 * {@inheritDoc}
+	 */
+	@Override
+	public InputStream openStream(ReferenceContext context) {
+		try {
+			return new FileInputStream(file);
+		} catch (FileNotFoundException e) {
+			throw new RuntimeException(e);
+		}
+	}
+
+	/**
+	 * Setter used by hibernate to set the charset property of the file
+	 * reference
+	 */
+	public void setCharset(String charset) {
+		this.charset = charset;
+	}
+
+	/**
+	 * {@inheritDoc}
+	 */
+	@Override
+	public String getCharset() {
+		return this.charset;
+	}
+
+	/**
+	 * Setter used by hibernate to set the file path property of the file
+	 * reference
+	 */
+	public void setFilePath(String filePathString) {
+		this.filePathString = filePathString;
+		this.file = new File(filePathString).getAbsoluteFile();
+	}
+
+	/**
+	 * Getter used by hibernate to retrieve the file path string property
+	 */
+	public String getFilePath() {
+		return this.filePathString;
+	}
+
+	/**
+	 * Human readable string form for debugging, should not be regarded as
+	 * stable.
+	 */
+	@Override
+	public String toString() {
+		return "file{" + file.getAbsolutePath() + "}";
+	}
+
+	@Override
+	public int hashCode() {
+		final int prime = 31;
+		int result = 1;
+		result = prime * result + ((file == null) ? 0 : file.hashCode());
+		return result;
+	}
+
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		final FileReference other = (FileReference) obj;
+		if (file == null) {
+			if (other.file != null)
+				return false;
+		} else if (!file.equals(other.file))
+			return false;
+		return true;
+	}
+
+	@Override
+	public Long getApproximateSizeInBytes() {
+		return new Long(file.length());
+	}
+
+	/**
+	 * @return the dataNature
+	 */
+	@Override
+	public ReferencedDataNature getDataNature() {
+		return Enum.valueOf(ReferencedDataNature.class, getDataNatureName());
+	}
+
+	/**
+	 * @param dataNature
+	 *            the dataNature to set
+	 */
+	public void setDataNature(ReferencedDataNature dataNature) {
+		setDataNatureName(dataNature.name());
+	}
+
+	/**
+	 * @return the file
+	 */
+	public final File getFile() {
+		return file;
+	}
+
+	@Override
+	public float getResolutionCost() {
+		return (float) 100.0;
+	}
+
+	/**
+	 * @return the dataNatureName
+	 */
+	public String getDataNatureName() {
+		return dataNatureName;
+	}
+
+	/**
+	 * @param dataNatureName
+	 *            the dataNatureName to set
+	 */
+	public void setDataNatureName(String dataNatureName) {
+		this.dataNatureName = dataNatureName;
+	}
+
+	public void deleteData() {
+		try {
+			getFile().delete();
+		} catch (SecurityException e) {
+			// TODO
+		}
+	}
+
+	@Override
+	public FileReference clone() {
+		FileReference result = new FileReference();
+		result.setFilePath(this.getFilePath());
+		result.setCharset(this.getCharset());
+		result.setDataNature(this.getDataNature());
+		return result;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/file/FileToFileReference.java
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/file/FileToFileReference.java b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/file/FileToFileReference.java
new file mode 100644
index 0000000..cde79a5
--- /dev/null
+++ b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/file/FileToFileReference.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl.external.file;
+
+import java.io.File;
+import java.io.IOException;
+
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ReferenceContext;
+import net.sf.taverna.t2.reference.ValueToReferenceConversionException;
+import net.sf.taverna.t2.reference.ValueToReferenceConverterSPI;
+
+/**
+ * Converts java.lang.File instances to FileReference reference type
+ * 
+ * @author Tom Oinn
+ */
+public class FileToFileReference implements ValueToReferenceConverterSPI {
+	/*
+	 * TODO - should probably do more sophisticated checks such as whether the
+	 * file is a file or directory etc etc, for now just checks whether the
+	 * specified object is a java.io.File
+	 */
+	@Override
+	public boolean canConvert(Object o, ReferenceContext context) {
+		return (o instanceof File);
+	}
+
+	/**
+	 * Return a FileReference
+	 */
+	@Override
+	public ExternalReferenceSPI convert(Object o, ReferenceContext context)
+			throws ValueToReferenceConversionException {
+		FileReference result = new FileReference();
+		try {
+			result.setFilePath(((File) o).getCanonicalPath());
+		} catch (IOException ioe) {
+			throw new ValueToReferenceConversionException(ioe);
+		}
+		return result;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/file/package.html
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/file/package.html b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/file/package.html
new file mode 100644
index 0000000..8be59b3
--- /dev/null
+++ b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/file/package.html
@@ -0,0 +1,4 @@
+<body>
+Support for references to a file on a local (or otherwise mounted)
+filesystem
+</body>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/http/HttpReference.java
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/http/HttpReference.java b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/http/HttpReference.java
new file mode 100644
index 0000000..d72eed6
--- /dev/null
+++ b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/http/HttpReference.java
@@ -0,0 +1,217 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl.external.http;
+
+import static java.lang.System.currentTimeMillis;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Date;
+
+import net.sf.taverna.t2.reference.AbstractExternalReference;
+import net.sf.taverna.t2.reference.DereferenceException;
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ExternalReferenceValidationException;
+import net.sf.taverna.t2.reference.ReferenceContext;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.methods.HeadMethod;
+
+/**
+ * Implementation of ExternalReference used to refer to data held in a locally
+ * accessible file. Inherits from
+ * {@link net.sf.taverna.t2.reference.AbstractExternalReference
+ * AbstractExternalReference} to enable hibernate based persistence.
+ * 
+ * @author Tom Oinn
+ */
+public class HttpReference extends AbstractExternalReference implements
+		ExternalReferenceSPI {
+	private String httpUrlString = null;
+	private URL httpUrl = null;
+	private String charsetName = null;
+	private boolean charsetFetched = false;
+	private transient Long cachedLength;
+	private transient Date cacheTime;
+
+	/**
+	 * Explicitly declare default constructor, will be used by hibernate when
+	 * constructing instances of this bean from the database.
+	 */
+	public HttpReference() {
+		super();
+	}
+
+	/**
+	 * Return the data at the {@link URL} represented by this external reference
+	 */
+	@Override
+	public InputStream openStream(ReferenceContext context)
+			throws DereferenceException {
+		try {
+			return httpUrl.openStream();
+		} catch (IOException e) {
+			throw new DereferenceException(e);
+		}
+	}
+
+	@Override
+	public String getCharset() throws DereferenceException {
+		if (charsetFetched)
+			return charsetName;
+		charsetFetched = true;
+		if (!httpUrl.getProtocol().equals("http")
+				&& !httpUrl.getProtocol().equals("https")) {
+			charsetName = null;
+			return null;
+		}
+		HeadMethod method = new HeadMethod(httpUrl.toExternalForm());
+		HttpClient httpClient = new HttpClient();
+		try {
+			httpClient.executeMethod(method);
+			charsetName = method.getResponseCharSet();
+			return charsetName;
+		} catch (HttpException e) {
+			// throw new DereferenceException(e);
+		} catch (IOException e) {
+			// throw new DereferenceException(e);
+		} finally {
+			method.releaseConnection();
+		}
+		charsetName = null;
+		return null;
+	}
+
+	/**
+	 * Setter used by hibernate to set the file path property of the file
+	 * reference
+	 * 
+	 * @throws ExternalReferenceValidationException
+	 *             if there is some problem parsing the supplied string as a URL
+	 */
+	public void setHttpUrlString(String httpUrlString) {
+		try {
+			this.httpUrlString = httpUrlString;
+			this.httpUrl = new URL(httpUrlString);
+		} catch (MalformedURLException e) {
+			throw new ExternalReferenceValidationException(e);
+		}
+	}
+
+	/**
+	 * Getter used by hibernate to retrieve the file path string property
+	 */
+	public String getHttpUrlString() {
+		return this.httpUrlString;
+	}
+
+	/**
+	 * Human readable string form for debugging, should not be regarded as
+	 * stable.
+	 */
+	@Override
+	public String toString() {
+		return "http{" + httpUrl.toExternalForm() + "}";
+	}
+
+	@Override
+	public int hashCode() {
+		final int prime = 31;
+		int result = 1;
+		result = prime * result
+				+ ((httpUrl == null) ? 0 : httpUrl.toExternalForm().hashCode());
+		return result;
+	}
+
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (!(obj instanceof HttpReference))
+			return false;
+		final HttpReference other = (HttpReference) obj;
+		if (httpUrl == null) {
+			if (other.httpUrl != null)
+				return false;
+		} else if (!httpUrl.toExternalForm().equals(
+				other.httpUrl.toExternalForm()))
+			return false;
+		return true;
+	}
+
+	// One minute
+	private static final int CACHE_TIMEOUT = 60000;
+
+	@Override
+	public Long getApproximateSizeInBytes() {
+		long now = currentTimeMillis();
+		if (cachedLength != null && cacheTime != null
+				&& cacheTime.getTime() + CACHE_TIMEOUT > now)
+			return cachedLength;
+		try {
+			HttpURLConnection c = (HttpURLConnection) httpUrl.openConnection();
+			c.setRequestMethod("HEAD");
+			c.connect();
+			String lenString = c.getHeaderField("Content-Length");
+			if (lenString != null && !lenString.isEmpty()) {
+				cachedLength = new Long(lenString);
+				cacheTime = new Date(now);
+				return cachedLength;
+			}
+			// there is no Content-Length field so we cannot know the size
+		} catch (Exception e) {
+			// something went wrong, but we don't care what
+		}
+		cachedLength = null;
+		cacheTime = null;
+		return new Long(-1);
+	}
+
+	/**
+	 * @return the httpUrl
+	 */
+	public final URL getHttpUrl() {
+		return httpUrl;
+	}
+
+	@Override
+	public float getResolutionCost() {
+		return (float) 200.0;
+	}
+
+	public void deleteData() {
+		throw new UnsupportedOperationException(
+				"Cannot delete data referenced by a URL");
+	}
+
+	@Override
+	public HttpReference clone() {
+		HttpReference result = new HttpReference();
+		result.setHttpUrlString(this.getHttpUrlString());
+		return result;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/http/UrlToHttpReference.java
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/http/UrlToHttpReference.java b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/http/UrlToHttpReference.java
new file mode 100644
index 0000000..67c3fc8
--- /dev/null
+++ b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/http/UrlToHttpReference.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl.external.http;
+
+import java.net.URL;
+
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ReferenceContext;
+import net.sf.taverna.t2.reference.ValueToReferenceConversionException;
+import net.sf.taverna.t2.reference.ValueToReferenceConverterSPI;
+
+/**
+ * Convert a URL with http protocol to a HttpReference reference type
+ * 
+ * @author Tom Oinn
+ * 
+ */
+public class UrlToHttpReference implements ValueToReferenceConverterSPI {
+	/**
+	 * Can convert if the object is an instance of java.net.URL and the protocol
+	 * is HTTP
+	 */
+	@Override
+	public boolean canConvert(Object o, ReferenceContext context) {
+		if (o instanceof URL) {
+			String protocol = ((URL) o).getProtocol();
+			if (protocol.equalsIgnoreCase("http") || protocol.equals("https"))
+				return true;
+		}
+		return false;
+	}
+
+	/**
+	 * Return a new HttpReference constructed from
+	 * <code>((URL)o).toExternalForm()</code>
+	 */
+	@Override
+	public ExternalReferenceSPI convert(Object o, ReferenceContext context)
+			throws ValueToReferenceConversionException {
+		HttpReference result = new HttpReference();
+		result.setHttpUrlString(((URL) o).toExternalForm());
+		return result;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/http/package.html
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/http/package.html b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/http/package.html
new file mode 100644
index 0000000..49d1d32
--- /dev/null
+++ b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/http/package.html
@@ -0,0 +1,3 @@
+<body>
+Support for references to a URL with the HTTP protocol
+</body>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/BooleanToStringReference.java
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/BooleanToStringReference.java b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/BooleanToStringReference.java
new file mode 100644
index 0000000..77d54fb
--- /dev/null
+++ b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/BooleanToStringReference.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl.external.object;
+
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ReferenceContext;
+import net.sf.taverna.t2.reference.ValueToReferenceConversionException;
+import net.sf.taverna.t2.reference.ValueToReferenceConverterSPI;
+
+/**
+ * Convert a java.lang.Boolean to a StringReference.
+ * 
+ * @author Alan R Williams
+ */
+public class BooleanToStringReference implements ValueToReferenceConverterSPI {
+	/**
+	 * Can convert if the object is an instance of java.lang.Boolean
+	 */
+	@Override
+	public boolean canConvert(Object o, ReferenceContext context) {
+		return o instanceof Boolean;
+	}
+
+	/**
+	 * Return a new InlineStringReference wrapping the supplied String
+	 */
+	@Override
+	public ExternalReferenceSPI convert(Object o, ReferenceContext context)
+			throws ValueToReferenceConversionException {
+		InlineStringReference result = new InlineStringReference();
+		String stringValue = ((Boolean) o).toString();
+		result.setContents(stringValue);
+		return result;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/ByteArrayToByteArrayReference.java
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/ByteArrayToByteArrayReference.java b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/ByteArrayToByteArrayReference.java
new file mode 100644
index 0000000..41e60ea
--- /dev/null
+++ b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/ByteArrayToByteArrayReference.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl.external.object;
+
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ReferenceContext;
+import net.sf.taverna.t2.reference.ValueToReferenceConversionException;
+import net.sf.taverna.t2.reference.ValueToReferenceConverterSPI;
+
+/**
+ * Convert a byte[] to a ByteArrayReference
+ * 
+ * @author Tom Oinn
+ */
+public class ByteArrayToByteArrayReference implements
+		ValueToReferenceConverterSPI {
+	/**
+	 * Can convert if the object is an instance of byte[]
+	 */
+	@Override
+	public boolean canConvert(Object o, ReferenceContext context) {
+		return (o instanceof byte[]);
+	}
+
+	/**
+	 * Return a new InlineByteArrayReference wrapping the supplied byte[]
+	 */
+	@Override
+	public ExternalReferenceSPI convert(Object o, ReferenceContext context)
+			throws ValueToReferenceConversionException {
+		InlineByteArrayReference result = new InlineByteArrayReference();
+		result.setValue((byte[]) o);
+		return result;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/CharacterToStringReference.java
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/CharacterToStringReference.java b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/CharacterToStringReference.java
new file mode 100644
index 0000000..c5d6c66
--- /dev/null
+++ b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/CharacterToStringReference.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl.external.object;
+
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ReferenceContext;
+import net.sf.taverna.t2.reference.ValueToReferenceConversionException;
+import net.sf.taverna.t2.reference.ValueToReferenceConverterSPI;
+
+/**
+ * Convert a {@link Character} to a StringReference.
+ * 
+ * @author Alan R Williams
+ */
+public class CharacterToStringReference implements ValueToReferenceConverterSPI {
+	/**
+	 * Can convert if the object is an instance of java.lang.Character
+	 */
+	@Override
+	public boolean canConvert(Object o, ReferenceContext context) {
+		return (o instanceof Character);
+	}
+
+	/**
+	 * Return a new {@link InlineStringReference} wrapping the supplied String
+	 */
+	@Override
+	public ExternalReferenceSPI convert(Object o, ReferenceContext context)
+			throws ValueToReferenceConversionException {
+		InlineStringReference result = new InlineStringReference();
+		String stringValue = ((Character) o).toString();
+		result.setContents(stringValue);
+		return result;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/InlineByteArrayReference.java
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/InlineByteArrayReference.java b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/InlineByteArrayReference.java
new file mode 100644
index 0000000..fac9f02
--- /dev/null
+++ b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/InlineByteArrayReference.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl.external.object;
+
+import static org.apache.commons.codec.binary.Base64.decodeBase64;
+import static org.apache.commons.codec.binary.Base64.encodeBase64;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.nio.charset.Charset;
+
+import net.sf.taverna.t2.reference.AbstractExternalReference;
+import net.sf.taverna.t2.reference.DereferenceException;
+import net.sf.taverna.t2.reference.ReferenceContext;
+import net.sf.taverna.t2.reference.ValueCarryingExternalReference;
+
+/**
+ * A reference implementation that inlines an array of bytes. Rather
+ * unpleasantly this currently exposes the byte array to Hibernate through a
+ * textual value, as Derby allows long textual values but not long binary ones
+ * (yuck). As it uses a fixed character set (UTF-8) to store and load I believe
+ * this doesn't break things.
+ * <p>
+ * Unfortunately this does break things (binaries get corrupted) so I've added
+ * base64 encoding of the value as a workaround.
+ * 
+ * @author Tom Oinn
+ * @author David Withers
+ */
+public class InlineByteArrayReference extends AbstractExternalReference
+		implements ValueCarryingExternalReference<byte[]> {
+	private byte[] bytes = new byte[0];
+
+	public void setValue(byte[] newBytes) {
+		this.bytes = newBytes;
+	}
+
+	@Override
+	public byte[] getValue() {
+		return bytes;
+	}
+
+	@Override
+	public Class<byte[]> getValueType() {
+		return byte[].class;
+	}
+
+	@Override
+	public InputStream openStream(ReferenceContext context)
+			throws DereferenceException {
+		return new ByteArrayInputStream(bytes);
+	}
+
+	private static final Charset charset = Charset.forName("UTF-8");
+
+	public String getContents() {
+		return new String(encodeBase64(bytes), charset);
+	}
+
+	public void setContents(String contentsAsString) {
+		this.bytes = decodeBase64(contentsAsString.getBytes(charset));
+	}
+
+	@Override
+	public Long getApproximateSizeInBytes() {
+		return new Long(bytes.length);
+	}
+
+	@Override
+	public InlineByteArrayReference clone() {
+		InlineByteArrayReference result = new InlineByteArrayReference();
+		result.setValue(this.getValue().clone());
+		return result;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/InlineByteArrayReferenceBuilder.java
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/InlineByteArrayReferenceBuilder.java b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/InlineByteArrayReferenceBuilder.java
new file mode 100644
index 0000000..f58f77b
--- /dev/null
+++ b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/InlineByteArrayReferenceBuilder.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl.external.object;
+
+import static net.sf.taverna.t2.reference.impl.external.object.StreamToByteArrayConverter.readFile;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import net.sf.taverna.t2.reference.ExternalReferenceBuilderSPI;
+import net.sf.taverna.t2.reference.ExternalReferenceConstructionException;
+import net.sf.taverna.t2.reference.ReferenceContext;
+
+/**
+ * Build an InlineByteArrayReference from an InputStream
+ * 
+ * @author Tom Oinn
+ * 
+ */
+public class InlineByteArrayReferenceBuilder implements
+		ExternalReferenceBuilderSPI<InlineByteArrayReference> {
+	@Override
+	public InlineByteArrayReference createReference(InputStream byteStream,
+			ReferenceContext context) {
+		try {
+			byte[] contents = readFile(byteStream);
+			InlineByteArrayReference ref = new InlineByteArrayReference();
+			ref.setValue(contents);
+			return ref;
+		} catch (IOException e) {
+			throw new ExternalReferenceConstructionException(e);
+		}
+	}
+
+	@Override
+	public float getConstructionCost() {
+		return 0.1f;
+	}
+
+	@Override
+	public Class<InlineByteArrayReference> getReferenceType() {
+		return InlineByteArrayReference.class;
+	}
+
+	@Override
+	public boolean isEnabled(ReferenceContext context) {
+		return true;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/InlineByteToInlineStringTranslator.java
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/InlineByteToInlineStringTranslator.java b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/InlineByteToInlineStringTranslator.java
new file mode 100644
index 0000000..b9aa66c
--- /dev/null
+++ b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/InlineByteToInlineStringTranslator.java
@@ -0,0 +1,51 @@
+package net.sf.taverna.t2.reference.impl.external.object;
+
+import java.io.UnsupportedEncodingException;
+
+import net.sf.taverna.t2.reference.ExternalReferenceConstructionException;
+import net.sf.taverna.t2.reference.ExternalReferenceTranslatorSPI;
+import net.sf.taverna.t2.reference.ReferenceContext;
+
+public class InlineByteToInlineStringTranslator
+		implements
+		ExternalReferenceTranslatorSPI<InlineByteArrayReference, InlineStringReference> {
+	@Override
+	public InlineStringReference createReference(
+			InlineByteArrayReference sourceReference, ReferenceContext context) {
+		String contents;
+		try {
+			String charset = sourceReference.getCharset();
+			if (charset == null)
+				// usual fallback:
+				charset = "UTF-8";
+			contents = new String(sourceReference.getValue(), charset);
+		} catch (UnsupportedEncodingException e) {
+			String msg = "Unknown character set "
+					+ sourceReference.getCharset();
+			throw new ExternalReferenceConstructionException(msg, e);
+		}
+		InlineStringReference ref = new InlineStringReference();
+		ref.setContents(contents);
+		return ref;
+	}
+
+	@Override
+	public Class<InlineByteArrayReference> getSourceReferenceType() {
+		return InlineByteArrayReference.class;
+	}
+
+	@Override
+	public Class<InlineStringReference> getTargetReferenceType() {
+		return InlineStringReference.class;
+	}
+
+	@Override
+	public boolean isEnabled(ReferenceContext context) {
+		return true;
+	}
+
+	@Override
+	public float getTranslationCost() {
+		return 0.001f;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/InlineStringReference.java
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/InlineStringReference.java b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/InlineStringReference.java
new file mode 100644
index 0000000..cf3de46
--- /dev/null
+++ b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/InlineStringReference.java
@@ -0,0 +1,133 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl.external.object;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+
+import net.sf.taverna.t2.reference.AbstractExternalReference;
+import net.sf.taverna.t2.reference.DereferenceException;
+import net.sf.taverna.t2.reference.ReferenceContext;
+import net.sf.taverna.t2.reference.ReferencedDataNature;
+import net.sf.taverna.t2.reference.ValueCarryingExternalReference;
+
+/**
+ * Contains and references a String value
+ * 
+ * @author Tom Oinn
+ */
+public class InlineStringReference extends AbstractExternalReference implements
+		ValueCarryingExternalReference<String> {
+	/**
+	 * Hold the 'value' of this reference, probably the simplest backing store
+	 * possible for an ExternalReferenceSPI implementation :)
+	 */
+	private String contents;
+	private transient Long length;
+
+	/**
+	 * Set the 'value' of this reference as a string. It's not really a
+	 * reference type in any true sense of the word, but it'll do for testing
+	 * the augmentation system. This method is really here so you can configure
+	 * test beans from spring.
+	 */
+	public void setContents(String contents) {
+		this.contents = contents;
+	}
+
+	/**
+	 * Get the 'value' of this reference as a string, really just returns the
+	 * internal string representation.
+	 */
+	public String getContents() {
+		return this.contents;
+	}
+
+	/**
+	 * Fakes a de-reference operation, returning a byte stream over the string
+	 * data.
+	 */
+	@Override
+	public InputStream openStream(ReferenceContext arg0) {
+		try {
+			return new ByteArrayInputStream(contents.getBytes(getCharset()));
+		} catch (UnsupportedEncodingException e) {
+			throw new DereferenceException(e);
+		}
+	}
+
+	/**
+	 * Default resolution cost of 0.0f whatever the contents
+	 */
+	@Override
+	public float getResolutionCost() {
+		return 0.0f;
+	}
+
+	/**
+	 * Data nature set to 'ReferencedDataNature.TEXT'
+	 */
+	@Override
+	public ReferencedDataNature getDataNature() {
+		return ReferencedDataNature.TEXT;
+	}
+
+	/**
+	 * Character encoding set to 'UTF-8' by default
+	 */
+	@Override
+	public String getCharset() {
+		return "UTF-8";
+	}
+
+	/**
+	 * String representation for testing, returns <code>string{CONTENTS}</code>
+	 */
+	@Override
+	public String toString() {
+		return "string{" + contents + "}";
+	}
+
+	@Override
+	public String getValue() {
+		return getContents();
+	}
+
+	@Override
+	public Class<String> getValueType() {
+		return String.class;
+	}
+
+	@Override
+	public Long getApproximateSizeInBytes() {
+		if (length == null)
+			length = new Long(contents.getBytes().length);
+		return length;
+	}
+
+	@Override
+	public InlineStringReference clone() {
+		InlineStringReference result = new InlineStringReference();
+		result.setContents(this.getContents());
+		return result;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/InlineStringReferenceBuilder.java
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/InlineStringReferenceBuilder.java b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/InlineStringReferenceBuilder.java
new file mode 100644
index 0000000..66c5512
--- /dev/null
+++ b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/InlineStringReferenceBuilder.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl.external.object;
+
+import static net.sf.taverna.t2.reference.impl.external.object.StreamToStringConverter.readFile;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.nio.charset.Charset;
+
+import net.sf.taverna.t2.reference.ExternalReferenceBuilderSPI;
+import net.sf.taverna.t2.reference.ExternalReferenceConstructionException;
+import net.sf.taverna.t2.reference.ReferenceContext;
+
+/**
+ * Build an InlineStringReference from an InputStream
+ * 
+ * @author Tom Oinn
+ */
+public class InlineStringReferenceBuilder implements
+		ExternalReferenceBuilderSPI<InlineStringReference> {
+	private static final Charset UTF8 = Charset.forName("UTF-8");
+	
+	@Override
+	public InlineStringReference createReference(InputStream byteStream,
+			ReferenceContext context) {
+		try {
+			/*
+			 * UTF8 is a slightly saner default than system default for most
+			 * bytestreams
+			 */
+			String contents = readFile(new BufferedReader(
+					new InputStreamReader(byteStream, UTF8)));
+			InlineStringReference ref = new InlineStringReference();
+			ref.setContents(contents);
+			return ref;
+		} catch (IOException e) {
+			throw new ExternalReferenceConstructionException(e);
+		}
+	}
+
+	@Override
+	public float getConstructionCost() {
+		return 0.1f;
+	}
+
+	@Override
+	public Class<InlineStringReference> getReferenceType() {
+		return InlineStringReference.class;
+	}
+
+	@Override
+	public boolean isEnabled(ReferenceContext context) {
+		return true;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/InlineStringToInlineByteTranslator.java
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/InlineStringToInlineByteTranslator.java b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/InlineStringToInlineByteTranslator.java
new file mode 100644
index 0000000..e603a93
--- /dev/null
+++ b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/InlineStringToInlineByteTranslator.java
@@ -0,0 +1,40 @@
+package net.sf.taverna.t2.reference.impl.external.object;
+
+import java.nio.charset.Charset;
+
+import net.sf.taverna.t2.reference.ExternalReferenceTranslatorSPI;
+import net.sf.taverna.t2.reference.ReferenceContext;
+
+public class InlineStringToInlineByteTranslator implements
+		ExternalReferenceTranslatorSPI<InlineStringReference, InlineByteArrayReference> {
+	private static final Charset UTF8 = Charset.forName("UTF-8");
+	
+	@Override
+	public InlineByteArrayReference createReference(
+			InlineStringReference sourceReference, ReferenceContext context) {
+		byte[] bytes = sourceReference.getValue().getBytes(UTF8);
+		InlineByteArrayReference ref = new InlineByteArrayReference();
+		ref.setValue(bytes);	
+		return ref;
+	}
+
+	@Override
+	public Class<InlineStringReference> getSourceReferenceType() {
+		return InlineStringReference.class;
+	}
+
+	@Override
+	public Class<InlineByteArrayReference> getTargetReferenceType() {
+		return InlineByteArrayReference.class;
+	}
+
+	@Override
+	public boolean isEnabled(ReferenceContext context) {
+		return true;
+	}
+
+	@Override
+	public float getTranslationCost() {
+		return 0.001f;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/NumberToStringReference.java
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/NumberToStringReference.java b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/NumberToStringReference.java
new file mode 100644
index 0000000..58fbc09
--- /dev/null
+++ b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/NumberToStringReference.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl.external.object;
+
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ReferenceContext;
+import net.sf.taverna.t2.reference.ValueToReferenceConversionException;
+import net.sf.taverna.t2.reference.ValueToReferenceConverterSPI;
+
+/**
+ * Convert a java.lang.Number to a StringReference.
+ * 
+ * @author Alex Nenadic
+ */
+public class NumberToStringReference implements ValueToReferenceConverterSPI {
+	/**
+	 * Can convert if the object is an instance of java.lang.Number
+	 */
+	@Override
+	public boolean canConvert(Object o, ReferenceContext context) {
+		return o instanceof Number;
+	}
+
+	/**
+	 * Return a new InlineStringReference wrapping the supplied String
+	 */
+	@Override
+	public ExternalReferenceSPI convert(Object o, ReferenceContext context)
+			throws ValueToReferenceConversionException {
+		InlineStringReference result = new InlineStringReference();
+		result.setContents(o.toString());
+		return result;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StreamToBooleanConverter.java
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StreamToBooleanConverter.java b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StreamToBooleanConverter.java
new file mode 100644
index 0000000..a26f4df
--- /dev/null
+++ b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StreamToBooleanConverter.java
@@ -0,0 +1,29 @@
+/**
+ * 
+ */
+package net.sf.taverna.t2.reference.impl.external.object;
+
+import java.io.InputStream;
+
+import net.sf.taverna.t2.reference.ReferencedDataNature;
+import net.sf.taverna.t2.reference.StreamToValueConverterSPI;
+
+/**
+ * @author alanrw
+ */
+public class StreamToBooleanConverter implements
+		StreamToValueConverterSPI<Boolean> {
+	@Override
+	public Class<Boolean> getPojoClass() {
+		return Boolean.class;
+	}
+
+	@Override
+	public Boolean renderFrom(InputStream stream,
+			ReferencedDataNature dataNature, String charset) {
+		StreamToStringConverter stringConverter = new StreamToStringConverter();
+		String s = stringConverter.renderFrom(stream, dataNature, charset);
+		Boolean result = Boolean.valueOf(s.trim());
+		return result;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StreamToByteArrayConverter.java
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StreamToByteArrayConverter.java b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StreamToByteArrayConverter.java
new file mode 100644
index 0000000..e8c3a5a
--- /dev/null
+++ b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StreamToByteArrayConverter.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl.external.object;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import net.sf.taverna.t2.reference.ReferencedDataNature;
+import net.sf.taverna.t2.reference.StreamToValueConverterSPI;
+
+/**
+ * Build a byte[] from an InputStream
+ * 
+ * @author Tom Oinn
+ */
+public class StreamToByteArrayConverter implements
+		StreamToValueConverterSPI<byte[]> {
+	private static final int CHUNK_SIZE = 4096;
+
+	static byte[] readFile(InputStream reader) throws IOException {
+		ByteArrayOutputStream bos = new ByteArrayOutputStream();
+		byte[] buf = new byte[CHUNK_SIZE];
+		int len;
+		while ((len = reader.read(buf)) > 0)
+			bos.write(buf, 0, len);
+		return bos.toByteArray();
+	}
+
+	@Override
+	public Class<byte[]> getPojoClass() {
+		return byte[].class;
+	}
+
+	@Override
+	public byte[] renderFrom(InputStream stream,
+			ReferencedDataNature dataNature, String charset) {
+		try {
+			return readFile(stream);
+		} catch (IOException e) {
+			throw new RuntimeException(e);
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StreamToDoubleConverter.java
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StreamToDoubleConverter.java b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StreamToDoubleConverter.java
new file mode 100644
index 0000000..835c8cd
--- /dev/null
+++ b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StreamToDoubleConverter.java
@@ -0,0 +1,29 @@
+/**
+ * 
+ */
+package net.sf.taverna.t2.reference.impl.external.object;
+
+import java.io.InputStream;
+
+import net.sf.taverna.t2.reference.ReferencedDataNature;
+import net.sf.taverna.t2.reference.StreamToValueConverterSPI;
+
+/**
+ * @author alanrw
+ */
+public class StreamToDoubleConverter implements
+		StreamToValueConverterSPI<Double> {
+	@Override
+	public Class<Double> getPojoClass() {
+		return Double.class;
+	}
+
+	@Override
+	public Double renderFrom(InputStream stream,
+			ReferencedDataNature dataNature, String charset) {
+		StreamToStringConverter stringConverter = new StreamToStringConverter();
+		String s = stringConverter.renderFrom(stream, dataNature, charset);
+		Double result = Double.valueOf(s.trim());
+		return result;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StreamToIntegerConverter.java
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StreamToIntegerConverter.java b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StreamToIntegerConverter.java
new file mode 100644
index 0000000..2a42a24
--- /dev/null
+++ b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StreamToIntegerConverter.java
@@ -0,0 +1,29 @@
+/**
+ * 
+ */
+package net.sf.taverna.t2.reference.impl.external.object;
+
+import java.io.InputStream;
+
+import net.sf.taverna.t2.reference.ReferencedDataNature;
+import net.sf.taverna.t2.reference.StreamToValueConverterSPI;
+
+/**
+ * @author alanrw
+ */
+public class StreamToIntegerConverter implements
+		StreamToValueConverterSPI<Integer> {
+	@Override
+	public Class<Integer> getPojoClass() {
+		return Integer.class;
+	}
+
+	@Override
+	public Integer renderFrom(InputStream stream,
+			ReferencedDataNature dataNature, String charset) {
+		StreamToStringConverter stringConverter = new StreamToStringConverter();
+		String s = stringConverter.renderFrom(stream, dataNature, charset);
+		Integer result = Integer.valueOf(s.trim());
+		return result;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StreamToStringConverter.java
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StreamToStringConverter.java b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StreamToStringConverter.java
new file mode 100644
index 0000000..03edf56
--- /dev/null
+++ b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StreamToStringConverter.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl.external.object;
+
+import static net.sf.taverna.t2.reference.ReferencedDataNature.TEXT;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.nio.charset.Charset;
+
+import net.sf.taverna.t2.reference.ReferencedDataNature;
+import net.sf.taverna.t2.reference.StreamToValueConverterSPI;
+
+/**
+ * Build a String from an InputStream
+ * 
+ * @author Tom Oinn
+ */
+public class StreamToStringConverter implements
+		StreamToValueConverterSPI<String> {
+	private static final int END_OF_FILE = -1;
+	private static final int CHUNK_SIZE = 4096;
+	private static final Charset UTF8 = Charset.forName("UTF-8");
+
+	/**
+	 * Reads a text file and returns a string.
+	 */
+	static String readFile(Reader reader) throws IOException {
+		BufferedReader br = new BufferedReader(reader);
+		StringBuilder buffer = new StringBuilder();
+		char[] chunk = new char[CHUNK_SIZE];
+		int character;
+		while ((character = br.read(chunk)) != END_OF_FILE)
+			buffer.append(chunk, 0, character);
+		return buffer.toString();
+	}
+
+	@Override
+	public Class<String> getPojoClass() {
+		return String.class;
+	}
+
+	@Override
+	public String renderFrom(InputStream stream,
+			ReferencedDataNature dataNature, String charset) {
+		try {
+			if (charset != null && dataNature.equals(TEXT))
+				try {
+					Charset c = Charset.forName(charset);
+					return readFile(new InputStreamReader(stream, c));
+				} catch (IllegalArgumentException e1) {
+					// Ignore; fallback below is good enough
+				}
+			return readFile(new InputStreamReader(stream, UTF8));
+		} catch (IOException e) {
+			throw new RuntimeException(e);
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StreamToVMObjectReferenceConverter.java
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StreamToVMObjectReferenceConverter.java b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StreamToVMObjectReferenceConverter.java
new file mode 100644
index 0000000..45cbb5c
--- /dev/null
+++ b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StreamToVMObjectReferenceConverter.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl.external.object;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+
+import net.sf.taverna.t2.reference.ReferencedDataNature;
+import net.sf.taverna.t2.reference.StreamToValueConverterSPI;
+
+/**
+ * Builds a VMObjectReference from an InputStream.
+ * 
+ * @author Alex Nenadic
+ */
+public class StreamToVMObjectReferenceConverter implements
+		StreamToValueConverterSPI<VMObjectReference> {
+	@Override
+	public Class<VMObjectReference> getPojoClass() {
+		return VMObjectReference.class;
+	}
+
+	@Override
+	public VMObjectReference renderFrom(InputStream stream,
+			ReferencedDataNature dataNature, String charset) {
+		VMObjectReference vmRef = new VMObjectReference();
+		try {
+			ObjectInputStream in = new ObjectInputStream(stream);
+			vmRef = (VMObjectReference) in.readObject();
+			return vmRef;
+		} catch (IOException e) {
+			throw new RuntimeException(e);
+		} catch (ClassNotFoundException e) {
+			throw new RuntimeException(e);
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StringToStringReference.java
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StringToStringReference.java b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StringToStringReference.java
new file mode 100644
index 0000000..55b0573
--- /dev/null
+++ b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/StringToStringReference.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl.external.object;
+
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ReferenceContext;
+import net.sf.taverna.t2.reference.ValueToReferenceConversionException;
+import net.sf.taverna.t2.reference.ValueToReferenceConverterSPI;
+
+/**
+ * Convert a String to a StringReference
+ * 
+ * @author Tom Oinn
+ */
+public class StringToStringReference implements ValueToReferenceConverterSPI {
+	/**
+	 * Can convert if the object is an instance of java.lang.String
+	 */
+	@Override
+	public boolean canConvert(Object o, ReferenceContext context) {
+		return o instanceof String;
+	}
+
+	/**
+	 * Return a new InlineStringReference wrapping the supplied String
+	 */
+	@Override
+	public ExternalReferenceSPI convert(Object o, ReferenceContext context)
+			throws ValueToReferenceConversionException {
+		InlineStringReference result = new InlineStringReference();
+		result.setContents((String) o);
+		return result;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/VMObjectReference.java
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/VMObjectReference.java b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/VMObjectReference.java
new file mode 100644
index 0000000..18b66f2
--- /dev/null
+++ b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/VMObjectReference.java
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl.external.object;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.Serializable;
+import java.nio.charset.Charset;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import net.sf.taverna.t2.reference.AbstractExternalReference;
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ReferenceContext;
+
+/**
+ * Implementation of ExternalReferenceSPI used to refer to objects in the local
+ * virtual machine.
+ * 
+ * @author Stian Soiland-Reyes
+ * @author Alex Nenadic
+ */
+public class VMObjectReference extends AbstractExternalReference implements
+		ExternalReferenceSPI, Serializable {
+	private static final long serialVersionUID = 6708284419760319684L;
+	private static final Charset UTF8 = Charset.forName("UTF-8");
+
+	/**
+	 * Mapping from objects to their UUIDs.
+	 */
+	private static Map<Object, UUID> objectToUUID = new HashMap<>();
+	/**
+	 * Mapping from UUIDs to objects.
+	 */
+	private static Map<UUID, Object> uuidToObject = new HashMap<>();
+
+	/**
+	 * Unique reference to the object.
+	 */
+	private String uuid;
+
+	@Override
+	public InputStream openStream(ReferenceContext context) {
+		return new ByteArrayInputStream(getObject().toString().getBytes(UTF8));
+	}
+
+	/**
+	 * Getter used by hibernate to retrieve the object uuid property.
+	 */
+	public String getUuid() {
+		return uuid;
+	}
+
+	/**
+	 * Setter used by hibernate to set the object uuid property.
+	 */
+	public void setUuid(String id) {
+		if (uuid != null)
+			throw new IllegalStateException("Can't set UUID of an object twice");
+		this.uuid = id;
+	}
+
+	public void setObject(Object object) {
+		if (uuid != null)
+			throw new IllegalStateException("Can't set UUID an object twice");
+		UUID knownUUID = objectToUUID.get(object);
+		if (knownUUID == null) {
+			// register object
+			knownUUID = UUID.randomUUID();
+			objectToUUID.put(object, knownUUID);
+			uuidToObject.put(knownUUID, object);
+		}
+		setUuid(knownUUID.toString());
+	}
+
+	public Object getObject() {
+		return uuidToObject.get(UUID.fromString(uuid));
+	}
+
+	@Override
+	public Long getApproximateSizeInBytes() {
+		// We do not know the object size
+		return new Long(-1);
+	}
+
+	@Override
+	public VMObjectReference clone() {
+		VMObjectReference result = new VMObjectReference();
+		result.setUuid(this.getUuid());
+		return result;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/package.html
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/package.html b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/package.html
new file mode 100644
index 0000000..b5b3b72
--- /dev/null
+++ b/taverna-reference-types/src/main/java/net/sf/taverna/t2/reference/impl/external/object/package.html
@@ -0,0 +1,4 @@
+<body>
+Support for representation of inlined objects as references. Replaces
+the old Literal support
+</body>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceBuilderSPI
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceBuilderSPI b/taverna-reference-types/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceBuilderSPI
new file mode 100644
index 0000000..b90bb55
--- /dev/null
+++ b/taverna-reference-types/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceBuilderSPI
@@ -0,0 +1,3 @@
+# Implementation classes of ExternalReferenceBuilderSPI go here, one per line
+net.sf.taverna.t2.reference.impl.external.object.InlineStringReferenceBuilder
+net.sf.taverna.t2.reference.impl.external.object.InlineByteArrayReferenceBuilder
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceSPI
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceSPI b/taverna-reference-types/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceSPI
new file mode 100644
index 0000000..d4ad547
--- /dev/null
+++ b/taverna-reference-types/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceSPI
@@ -0,0 +1,6 @@
+# Implementation classes of ExternalReferenceSPI go here, one per line
+net.sf.taverna.t2.reference.impl.external.file.FileReference
+net.sf.taverna.t2.reference.impl.external.http.HttpReference
+net.sf.taverna.t2.reference.impl.external.object.InlineStringReference
+net.sf.taverna.t2.reference.impl.external.object.InlineByteArrayReference
+net.sf.taverna.t2.reference.impl.external.object.VMObjectReference
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceTranslatorSPI
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceTranslatorSPI b/taverna-reference-types/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceTranslatorSPI
new file mode 100644
index 0000000..a5547db
--- /dev/null
+++ b/taverna-reference-types/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceTranslatorSPI
@@ -0,0 +1,3 @@
+# Implementation classes of ExternalReferenceTranslatorSPI go here, one per line
+net.sf.taverna.t2.reference.impl.external.object.InlineByteToInlineStringTranslator
+net.sf.taverna.t2.reference.impl.external.object.InlineStringToInlineByteTranslator

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.StreamToValueConverterSPI
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.StreamToValueConverterSPI b/taverna-reference-types/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.StreamToValueConverterSPI
new file mode 100644
index 0000000..a433461
--- /dev/null
+++ b/taverna-reference-types/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.StreamToValueConverterSPI
@@ -0,0 +1,7 @@
+# Implementation classes of StreamToValueConverterSPI go here, one per line
+net.sf.taverna.t2.reference.impl.external.object.StreamToStringConverter
+net.sf.taverna.t2.reference.impl.external.object.StreamToByteArrayConverter
+net.sf.taverna.t2.reference.impl.external.object.StreamToVMObjectReferenceConverter
+net.sf.taverna.t2.reference.impl.external.object.StreamToDoubleConverter
+net.sf.taverna.t2.reference.impl.external.object.StreamToBooleanConverter
+net.sf.taverna.t2.reference.impl.external.object.StreamToIntegerConverter

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ValueToReferenceConverterSPI
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ValueToReferenceConverterSPI b/taverna-reference-types/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ValueToReferenceConverterSPI
new file mode 100644
index 0000000..e1c3593
--- /dev/null
+++ b/taverna-reference-types/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ValueToReferenceConverterSPI
@@ -0,0 +1,8 @@
+# Implementation classes of ValueToReferenceConverterSPI go here, one per line
+net.sf.taverna.t2.reference.impl.external.file.FileToFileReference
+net.sf.taverna.t2.reference.impl.external.http.UrlToHttpReference
+net.sf.taverna.t2.reference.impl.external.object.StringToStringReference
+net.sf.taverna.t2.reference.impl.external.object.ByteArrayToByteArrayReference
+net.sf.taverna.t2.reference.impl.external.object.NumberToStringReference
+net.sf.taverna.t2.reference.impl.external.object.CharacterToStringReference
+net.sf.taverna.t2.reference.impl.external.object.BooleanToStringReference

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-types/src/main/resources/META-INF/spring/reference-core-extensions-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-reference-types/src/main/resources/META-INF/spring/reference-core-extensions-context-osgi.xml b/taverna-reference-types/src/main/resources/META-INF/spring/reference-core-extensions-context-osgi.xml
new file mode 100644
index 0000000..aeed47f
--- /dev/null
+++ b/taverna-reference-types/src/main/resources/META-INF/spring/reference-core-extensions-context-osgi.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans:beans xmlns="http://www.springframework.org/schema/osgi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:beans="http://www.springframework.org/schema/beans"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans 
+                                 http://www.springframework.org/schema/beans/spring-beans.xsd
+                                 http://www.springframework.org/schema/osgi 
+                                 http://www.springframework.org/schema/osgi/spring-osgi.xsd" >
+
+	<service ref="inlineStringReferenceBuilder" interface="net.sf.taverna.t2.reference.ExternalReferenceBuilderSPI" />
+	<service ref="inlineByteArrayReferenceBuilder" interface="net.sf.taverna.t2.reference.ExternalReferenceBuilderSPI" />
+
+	<service ref="fileReference" interface="net.sf.taverna.t2.reference.ExternalReferenceSPI" />
+	<service ref="httpReference" interface="net.sf.taverna.t2.reference.ExternalReferenceSPI" />
+	<service ref="inlineStringReference" interface="net.sf.taverna.t2.reference.ExternalReferenceSPI" />
+	<service ref="inlineByteArrayReference" interface="net.sf.taverna.t2.reference.ExternalReferenceSPI" />
+	<service ref="vmObjectReference" interface="net.sf.taverna.t2.reference.ExternalReferenceSPI" />
+		
+	<service ref="streamToStringConverter" interface="net.sf.taverna.t2.reference.StreamToValueConverterSPI" />
+	<service ref="streamToByteArrayConverter" interface="net.sf.taverna.t2.reference.StreamToValueConverterSPI" />
+	<service ref="streamToVMObjectReferenceConverter" interface="net.sf.taverna.t2.reference.StreamToValueConverterSPI" />
+	<service ref="streamToDoubleConverter" interface="net.sf.taverna.t2.reference.StreamToValueConverterSPI" />
+	<service ref="streamToBooleanConverter" interface="net.sf.taverna.t2.reference.StreamToValueConverterSPI" />
+	<service ref="streamToIntegerConverter" interface="net.sf.taverna.t2.reference.StreamToValueConverterSPI" />
+
+	<service ref="fileToFileReference" interface="net.sf.taverna.t2.reference.ValueToReferenceConverterSPI" />
+	<service ref="urlToHttpReference" interface="net.sf.taverna.t2.reference.ValueToReferenceConverterSPI" />
+	<service ref="stringToStringReference" interface="net.sf.taverna.t2.reference.ValueToReferenceConverterSPI" />
+	<service ref="byteArrayToByteArrayReference" interface="net.sf.taverna.t2.reference.ValueToReferenceConverterSPI" />
+	<service ref="numberToStringReference" interface="net.sf.taverna.t2.reference.ValueToReferenceConverterSPI" />
+	<service ref="characterToStringReference" interface="net.sf.taverna.t2.reference.ValueToReferenceConverterSPI" />
+	<service ref="booleanToStringReference" interface="net.sf.taverna.t2.reference.ValueToReferenceConverterSPI" />
+
+</beans:beans>


[33/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunIT.java
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunIT.java b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunIT.java
new file mode 100644
index 0000000..9911e7c
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunIT.java
@@ -0,0 +1,1005 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform;
+
+import java.io.File;
+import java.net.URI;
+import java.net.URL;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import net.sf.taverna.t2.security.credentialmanager.UsernamePassword;
+
+import org.osgi.framework.ServiceReference;
+
+import uk.org.taverna.platform.data.api.Data;
+import uk.org.taverna.platform.data.api.DataService;
+import uk.org.taverna.platform.execution.api.ExecutionEnvironment;
+import uk.org.taverna.platform.report.State;
+import uk.org.taverna.platform.report.WorkflowReport;
+import uk.org.taverna.platform.run.api.RunProfile;
+import uk.org.taverna.platform.run.api.RunService;
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+
+public class RunIT extends PlatformIT {
+
+	private RunService runService;
+	private DataService dataService;
+
+	protected void setup() throws Exception {
+		super.setup();
+		if (runService == null) {
+			ServiceReference runServiceReference = bundleContext
+					.getServiceReference("uk.org.taverna.platform.run.api.RunService");
+			runService = (RunService) bundleContext.getService(runServiceReference);
+		}
+		if (dataService == null) {
+			ServiceReference dataServiceReference = bundleContext
+					.getServiceReference("uk.org.taverna.platform.data.DataService");
+			dataService = (DataService) bundleContext.getService(dataServiceReference);
+		}
+		databaseConfiguration.setProvenanceEnabled(false);
+	}
+
+	public void testRun() throws Exception {
+		setup();
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/in-out.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			Map<String, Data> inputs = new HashMap<String, Data>();
+			inputs.put("in", dataService.create("test-input"));
+
+			String runId = runService.createRun(new RunProfile(executionEnvironment,
+					workflowBundle, inputs));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(runService.getState(runId).equals(State.RUNNING)
+					|| runService.getState(runId).equals(State.COMPLETED));
+			System.out.println(report);
+
+			Map<String, Data> results = runService.getOutputs(runId);
+			assertNotNull(results);
+			waitForResults(results, runService.getWorkflowReport(runId), "out");
+
+			assertTrue(checkResult(results.get("out"), "test-input"));
+
+			assertEquals(State.COMPLETED, runService.getState(runId));
+			System.out.println(report);
+		}
+	}
+
+	public void testRunApiConsumer() throws Exception {
+		setup();
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/apiconsumer.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			Map<String, Data> inputs = new HashMap<String, Data>();
+			inputs.put("in", dataService.create("test-input"));
+
+			String runId = runService.createRun(new RunProfile(executionEnvironment,
+					workflowBundle, inputs));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(runService.getState(runId).equals(State.RUNNING)
+					|| runService.getState(runId).equals(State.COMPLETED));
+			System.out.println(report);
+
+			Map<String, Data> results = runService.getOutputs(runId);
+			assertNotNull(results);
+			waitForResults(results, report, "out");
+
+			assertTrue(checkResult(results.get("out"), "TEST-INPUT"));
+
+			assertEquals(State.COMPLETED, runService.getState(runId));
+			System.out.println(report);
+		}
+	}
+
+	public void testRunBeanshell() throws Exception {
+		setup();
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/beanshell.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			Map<String, Data> inputs = new HashMap<String, Data>();
+			inputs.put("in", dataService.create("test-input"));
+
+			String runId = runService.createRun(new RunProfile(executionEnvironment,
+					workflowBundle, inputs));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(runService.getState(runId).equals(State.RUNNING)
+					|| runService.getState(runId).equals(State.COMPLETED));
+			System.out.println(report);
+
+			Map<String, Data> results = runService.getOutputs(runId);
+			assertNotNull(results);
+			waitForResults(results, report, "out");
+
+			List<Data> result = results.get("out").getElements();
+			assertEquals(1000, result.size());
+			assertEquals("test-input:0", result.get(0).getValue());
+			assertEquals(State.COMPLETED, runService.getState(runId));
+			System.out.println(report);
+		}
+	}
+
+	public void testRunBiomart() throws Exception {
+		setup();
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/biomart.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(runService.getState(runId).equals(State.RUNNING)
+					|| runService.getState(runId).equals(State.COMPLETED));
+			System.out.println(report);
+
+			Map<String, Data> results = runService.getOutputs(runId);
+			assertNotNull(results);
+			waitForResults(results, report, "out");
+
+			List<Data> result = results.get("out").getElements();
+			assertEquals(5, result.size());
+			assertEquals("ENSBTAG00000018854", result.get(0).getValue());
+			assertEquals(State.COMPLETED, runService.getState(runId));
+			System.out.println(report);
+		}
+	}
+
+	// public void testRunBiomoby() throws Exception {
+	// setup();
+	// WorkflowBundle workflowBundle = loadWorkflow("/t2flow/biomoby.t2flow");
+	//
+	// Set<ExecutionEnvironment> executionEnvironments = runService
+	// .getExecutionEnvironments(workflowBundle);
+	// for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+	//
+	//
+	// String runId = runService.createRun(new RunProfile(executionEnvironment, workflowBundle));
+	// assertEquals(State.CREATED, runService.getState(runId));
+	//
+	// WorkflowReport report = runService.getWorkflowReport(runId);
+	// System.out.println(report);
+	//
+	// runService.start(runId);
+	// assertTrue(runService.getState(runId).equals(State.RUNNING)
+	// || runService.getState(runId).equals(State.COMPLETED));
+	// System.out.println(report);
+	//
+	// Map<String, Data> results = runService.getOutputs(runId);
+	// assertNotNull(results);
+	// waitForResults(results, report, "out");
+	//
+	// T2Reference resultReference = results.get("out");
+	// if (resultReference.containsErrors()) {
+	// printErrors(referenceService, resultReference);
+	// }
+	// assertFalse(resultReference.containsErrors());
+	// @SuppressWarnings("unchecked")
+	// List<String> result = (List<String>) referenceService.renderIdentifier(resultReference,
+	// String.class, null);
+	// assertEquals(5, result.size());
+	// assertEquals("ENSBTAG00000018854", result.get(0));
+	// assertEquals(State.COMPLETED, runService.getState(runId));
+	// System.out.println(report);
+	// }
+	// }
+
+	public void testRunDataflow() throws Exception {
+		setup();
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/dataflow.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			Map<String, Data> inputs = new HashMap<String, Data>();
+			inputs.put("in", dataService.create("test input"));
+
+			String runId = runService.createRun(new RunProfile(executionEnvironment,
+					workflowBundle, inputs));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertFalse(runService.getState(runId).equals(State.CREATED));
+			System.out.println(report);
+
+			Map<String, Data> results = runService.getOutputs(runId);
+			waitForResults(results, report, "out");
+
+			assertTrue(checkResult(results.get("out"),
+					"nested dataflow : test input"));
+
+			assertEquals(State.COMPLETED, runService.getState(runId));
+			System.out.println(report);
+		}
+	}
+
+	public void testRunLocalworker() throws Exception {
+		setup();
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/localworker.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			Map<String, Data> inputs = new HashMap<String, Data>();
+			inputs.put("in", dataService.create("Tom"));
+
+			String runId = runService.createRun(new RunProfile(executionEnvironment,
+					workflowBundle, inputs));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(runService.getState(runId).equals(State.RUNNING)
+					|| runService.getState(runId).equals(State.COMPLETED));
+			System.out.println(report);
+
+			Map<String, Data> results = runService.getOutputs(runId);
+			assertNotNull(results);
+			waitForResults(results, report, "out");
+
+			assertTrue(checkResult(results.get("out"), "Hello Tom"));
+
+			assertEquals(State.COMPLETED, runService.getState(runId));
+			System.out.println(report);
+		}
+	}
+
+	public void testRunRest() throws Exception {
+		setup();
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/rest.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertEquals(State.RUNNING, runService.getState(runId));
+			System.out.println(report);
+
+			Map<String, Data> results = runService.getOutputs(runId);
+			waitForResults(results, report, "out");
+
+			Object outResult = results.get("out").getValue();
+			if (outResult instanceof byte[]) {
+				outResult = new String((byte[]) outResult);
+			}
+			assertTrue(outResult instanceof String);
+			String outString = (String) outResult;
+			assertTrue(outString.contains("<name>AATM_RABIT</name>"));
+
+			assertEquals(State.COMPLETED, runService.getState(runId));
+			System.out.println(report);
+		}
+	}
+
+	public void testRunRestSecureBasic() throws Exception {
+		setup();
+		credentialManager.addUsernameAndPasswordForService(new UsernamePassword("testuser",
+				"testpasswd"), URI
+				.create("http://heater.cs.man.ac.uk:7070/#Example+HTTP+BASIC+Authentication"));
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/secure-basic-authentication.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertEquals(State.RUNNING, runService.getState(runId));
+			System.out.println(report);
+
+			Map<String, Data> results = runService.getOutputs(runId);
+			waitForResults(results, report, "out");
+
+			assertTrue(checkResult(results.get("out"),
+					"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n"
+							+ "<HTML><HEAD><TITLE>Apache Tomcat Examples</TITLE>\n"
+							+ "<META http-equiv=Content-Type content=\"text/html\">\n"
+							+ "</HEAD>\n"
+							+ "<BODY>\n"
+							+ "<P>\n"
+							+ "<H3>Secure Apache Tomcat Examples</H3>\n"
+							+ "<P>Congratulations! If you see this page that means that you have authenticated yourself successfully using HTTP Basic Authentication.</P>\n"
+							+ "</BODY></HTML>"));
+
+			assertEquals(State.COMPLETED, runService.getState(runId));
+			System.out.println(report);
+		}
+	}
+
+	public void testRunRestSecureBasicHttps() throws Exception {
+		setup();
+		credentialManager.addUsernameAndPasswordForService(new UsernamePassword("testuser",
+				"testpasswd"), URI
+				.create("https://heater.cs.man.ac.uk:7443/#Example+HTTP+BASIC+Authentication"));
+
+		URL trustedCertficateFileURL = getClass().getResource(
+				"/security/tomcat_heater_certificate.pem");
+		CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
+		X509Certificate trustedCertficate = (X509Certificate) certFactory
+				.generateCertificate(trustedCertficateFileURL.openStream());
+		credentialManager.addTrustedCertificate(trustedCertficate);
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/secure-basic-authentication-https.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertEquals(State.RUNNING, runService.getState(runId));
+			System.out.println(report);
+
+			Map<String, Data> results = runService.getOutputs(runId);
+			waitForResults(results, report, "out");
+
+			assertTrue(checkResult(results.get("out"),
+					"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n"
+							+ "<HTML><HEAD><TITLE>Apache Tomcat Examples</TITLE>\n"
+							+ "<META http-equiv=Content-Type content=\"text/html\">\n"
+							+ "</HEAD>\n"
+							+ "<BODY>\n"
+							+ "<P>\n"
+							+ "<H3>Secure Apache Tomcat Examples</H3>\n"
+							+ "<P>Congratulations! If you see this page that means that you have authenticated yourself successfully using HTTP Basic Authentication.</P>\n"
+							+ "</BODY></HTML>"));
+
+			assertEquals(State.COMPLETED, runService.getState(runId));
+			System.out.println(report);
+		}
+	}
+
+	public void testRunRestSecureDigest() throws Exception {
+		setup();
+		credentialManager.addUsernameAndPasswordForService(new UsernamePassword("testuser",
+				"testpasswd"), URI
+				.create("http://heater.cs.man.ac.uk:7070/#Example+HTTP+BASIC+Authentication"));
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/secure-digest-authentication.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertEquals(State.RUNNING, runService.getState(runId));
+			System.out.println(report);
+
+			Map<String, Data> results = runService.getOutputs(runId);
+			waitForResults(results, report, "out");
+
+			assertTrue(checkResult(results.get("out"),
+					"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n"
+							+ "<HTML><HEAD><TITLE>Apache Tomcat Examples</TITLE>\n"
+							+ "<META http-equiv=Content-Type content=\"text/html\">\n"
+							+ "</HEAD>\n"
+							+ "<BODY>\n"
+							+ "<P>\n"
+							+ "<H3>Secure Apache Tomcat Examples</H3>\n"
+							+ "<P>Congratulations! If you see this page that means that you have authenticated yourself successfully using HTTP Digest Authentication.</P>\n"
+							+ "</BODY></HTML>"));
+
+			assertEquals(State.COMPLETED, runService.getState(runId));
+			System.out.println(report);
+		}
+	}
+
+	public void testRunRestSecureDigestHttps() throws Exception {
+		setup();
+		credentialManager.addUsernameAndPasswordForService(new UsernamePassword("testuser",
+				"testpasswd"), URI
+				.create("http://heater.cs.man.ac.uk:7443/#Example+HTTP+BASIC+Authentication"));
+
+		URL trustedCertficateFileURL = getClass().getResource(
+				"/security/tomcat_heater_certificate.pem");
+		CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
+		X509Certificate trustedCertficate = (X509Certificate) certFactory
+				.generateCertificate(trustedCertficateFileURL.openStream());
+		credentialManager.addTrustedCertificate(trustedCertficate);
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/secure-digest-authentication-https.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertEquals(State.RUNNING, runService.getState(runId));
+			System.out.println(report);
+
+			Map<String, Data> results = runService.getOutputs(runId);
+			waitForResults(results, report, "out");
+
+			assertTrue(checkResult(results.get("out"),
+					"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n"
+							+ "<HTML><HEAD><TITLE>Apache Tomcat Examples</TITLE>\n"
+							+ "<META http-equiv=Content-Type content=\"text/html\">\n"
+							+ "</HEAD>\n"
+							+ "<BODY>\n"
+							+ "<P>\n"
+							+ "<H3>Secure Apache Tomcat Examples</H3>\n"
+							+ "<P>Congratulations! If you see this page that means that you have authenticated yourself successfully using HTTP Digest Authentication.</P>\n"
+							+ "</BODY></HTML>"));
+
+			assertEquals(State.COMPLETED, runService.getState(runId));
+			System.out.println(report);
+		}
+	}
+
+	public void testRunSpreadsheetImport() throws Exception {
+		setup();
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/spreadsheetimport.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertEquals(State.RUNNING, runService.getState(runId));
+			System.out.println(report);
+
+			Map<String, Data> results = runService.getOutputs(runId);
+			waitForResults(results, report, "out");
+
+			List<Data> result = results.get("out").getElements();
+			assertEquals(35, result.size());
+			assertEquals("1971.0", result.get(1).getValue());
+			assertEquals("2004.0", result.get(34).getValue());
+
+			assertEquals(State.COMPLETED, runService.getState(runId));
+			System.out.println(report);
+		}
+	}
+
+	public void testRunSoaplab() throws Exception {
+		setup();
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/soaplab.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertEquals(State.RUNNING, runService.getState(runId));
+			System.out.println(report);
+
+			Map<String, Data> results = runService.getOutputs(runId);
+			waitForResults(results, report, "sequence");
+
+			assertTrue(checkResult(results.get("sequence"),
+					"ID   X52524; SV 1; linear; genomic DNA; STD; INV; 4507 BP."));
+
+			assertEquals(State.COMPLETED, runService.getState(runId));
+			System.out.println(report);
+		}
+	}
+
+	public void testRunStringConstant() throws Exception {
+		setup();
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/stringconstant.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle));
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			runService.start(runId);
+			assertTrue(runService.getState(runId).equals(State.RUNNING)
+					|| runService.getState(runId).equals(State.COMPLETED));
+
+			Map<String, Data> results = runService.getOutputs(runId);
+			waitForResults(results, report, "out");
+
+			assertTrue(checkResult(results.get("out"), "Test Value"));
+
+			assertEquals(State.COMPLETED, runService.getState(runId));
+		}
+	}
+
+	public void testRunTool() throws Exception {
+		setup();
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/tool.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle));
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			runService.start(runId);
+			assertTrue(runService.getState(runId).equals(State.RUNNING)
+					|| runService.getState(runId).equals(State.COMPLETED));
+
+			Map<String, Data> results = runService.getOutputs(runId);
+			waitForResults(results, report, "out");
+
+			assertTrue(checkResult(results.get("out"), "HelloWorld"));
+
+			assertEquals(State.COMPLETED, runService.getState(runId));
+		}
+	}
+
+	public void testRunIteration() throws Exception {
+		setup();
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/iteration.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			Map<String, Data> inputs = new HashMap<String, Data>();
+			inputs.put("in", dataService.create("test"));
+
+			String runId = runService.createRun(new RunProfile(executionEnvironment,
+					workflowBundle, inputs));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertEquals(State.RUNNING, runService.getState(runId));
+			System.out.println(report);
+
+			Map<String, Data> results = runService.getOutputs(runId);
+
+			waitForResults(results, report, "cross");
+			List<Data> crossResult = results.get("cross").getElements();
+			assertEquals(10, crossResult.size());
+			assertEquals(10, crossResult.get(0).getElements().size());
+			assertEquals(10, crossResult.get(5).getElements().size());
+			assertEquals("test:0test:0", crossResult.get(0).getElements().get(0).getValue());
+			assertEquals("test:0test:1", crossResult.get(0).getElements().get(1).getValue());
+			assertEquals("test:4test:2", crossResult.get(4).getElements().get(2).getValue());
+			assertEquals("test:7test:6", crossResult.get(7).getElements().get(6).getValue());
+
+			waitForResults(results, report, "dot");
+
+			List<Data> dotResult = results.get("dot").getElements();
+			assertEquals(10, dotResult.size());
+			assertEquals("test:0test:0", dotResult.get(0).getValue());
+			assertEquals("test:5test:5", dotResult.get(5).getValue());
+
+			waitForResults(results, report, "crossdot");
+
+			List<Data> crossdotResult = results.get("crossdot").getElements();
+			assertEquals(10, crossdotResult.size());
+			assertEquals(10, crossdotResult.get(0).getElements().size());
+			assertEquals(10, crossdotResult.get(5).getElements().size());
+			assertEquals("test:0test:0test", crossdotResult.get(0).getElements().get(0).getValue());
+			assertEquals("test:0test:1test", crossdotResult.get(0).getElements().get(1).getValue());
+			assertEquals("test:4test:2test", crossdotResult.get(4).getElements().get(2).getValue());
+			assertEquals("test:7test:6test", crossdotResult.get(7).getElements().get(6).getValue());
+
+			waitForResults(results, report, "dotcross");
+
+			List<Data> dotcrossResult = results.get("dotcross").getElements();
+			assertEquals(10, dotResult.size());
+			assertEquals("test:0test:0test", dotcrossResult.get(0).getValue());
+			assertEquals("test:5test:5test", dotcrossResult.get(5).getValue());
+
+			waitForResults(results, report, "dotdot");
+
+			List<Data> dotdotResult = results.get("dotdot").getElements();
+			assertEquals(10, dotResult.size());
+			assertEquals("test:0test:0test:0", dotdotResult.get(0).getValue());
+			assertEquals("test:5test:5test:5", dotdotResult.get(5).getValue());
+
+			assertEquals(State.COMPLETED, runService.getState(runId));
+			System.out.println(report);
+		}
+	}
+
+	public void testRunWSDL() throws Exception {
+		setup();
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/wsdl.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertEquals(State.RUNNING, runService.getState(runId));
+			System.out.println(report);
+
+			Map<String, Data> results = runService.getOutputs(runId);
+			waitForResults(results, report, "out");
+
+			// assertTrue(checkResult(results.get("out"),
+			// "Apache Axis version: 1.4\nBuilt on Apr 22, 2006 (06:55:48 PDT)"));
+			assertTrue(checkResult(results.get("out"),
+					"Apache Axis version: 1.2\nBuilt on May 03, 2005 (02:20:24 EDT)"));
+
+			assertEquals(State.COMPLETED, runService.getState(runId));
+			System.out.println(report);
+		}
+	}
+
+	public void testRunWSDLSecure() throws Exception {
+		setup();
+		credentialManager
+				.addUsernameAndPasswordForService(
+						new UsernamePassword("testuser", "testpasswd"),
+						URI.create("http://heater.cs.man.ac.uk:7070/axis/services/HelloService-PlaintextPassword?wsdl"));
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/wsdl-secure.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertEquals(State.RUNNING, runService.getState(runId));
+			System.out.println(report);
+
+			Map<String, Data> results = runService.getOutputs(runId);
+			waitForResults(results, report, "out");
+
+			assertTrue(checkResult(results.get("out"), "Hello Alan!"));
+
+			assertEquals(State.COMPLETED, runService.getState(runId));
+			System.out.println(report);
+		}
+	}
+
+	public void testRunWSDLSecureFull() throws Exception {
+		setup();
+		credentialManager
+				.addUsernameAndPasswordForService(
+						new UsernamePassword("testuser", "testpasswd"),
+						URI.create("http://heater.cs.man.ac.uk:7070/axis/services/HelloService-PlaintextPassword?wsdl"));
+		credentialManager
+				.addUsernameAndPasswordForService(
+						new UsernamePassword("testuser", "testpasswd"),
+						URI.create("http://heater.cs.man.ac.uk:7070/axis/services/HelloService-DigestPassword?wsdl"));
+		credentialManager
+				.addUsernameAndPasswordForService(
+						new UsernamePassword("testuser", "testpasswd"),
+						URI.create("http://heater.cs.man.ac.uk:7070/axis/services/HelloService-DigestPassword-Timestamp?wsdl"));
+		credentialManager
+				.addUsernameAndPasswordForService(
+						new UsernamePassword("testuser", "testpasswd"),
+						URI.create("http://heater.cs.man.ac.uk:7070/axis/services/HelloService-PlaintextPassword-Timestamp?wsdl"));
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/secure-ws.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertEquals(State.RUNNING, runService.getState(runId));
+			System.out.println(report);
+
+			Map<String, Data> results = runService.getOutputs(runId);
+			waitForResults(results, report, "out_plaintext", "out_digest", "out_digest_timestamp",
+					"out_plaintext_timestamp");
+
+			assertTrue(checkResult(results.get("out_plaintext"), "Hello Alan!"));
+			assertTrue(checkResult(results.get("out_digest"), "Hello Stian!"));
+			assertTrue(checkResult(results.get("out_digest_timestamp"),
+					"Hello David!"));
+			assertTrue(checkResult(results.get("out_plaintext_timestamp"),
+					"Hello Alex!"));
+
+			assertEquals(State.COMPLETED, runService.getState(runId));
+			System.out.println(report);
+		}
+	}
+
+	public void testRunWSDLSecureSsh() throws Exception {
+		setup();
+		credentialManager
+				.addUsernameAndPasswordForService(
+						new UsernamePassword("testuser", "testpasswd"),
+						URI.create("https://heater.cs.man.ac.uk:7443/axis/services/HelloService-PlaintextPassword?wsdl"));
+		credentialManager
+				.addUsernameAndPasswordForService(
+						new UsernamePassword("testuser", "testpasswd"),
+						URI.create("https://heater.cs.man.ac.uk:7443/axis/services/HelloService-DigestPassword?wsdl"));
+		credentialManager
+				.addUsernameAndPasswordForService(
+						new UsernamePassword("testuser", "testpasswd"),
+						URI.create("https://heater.cs.man.ac.uk:7443/axis/services/HelloService-DigestPassword-Timestamp?wsdl"));
+		credentialManager
+				.addUsernameAndPasswordForService(
+						new UsernamePassword("testuser", "testpasswd"),
+						URI.create("https://heater.cs.man.ac.uk:7443/axis/services/HelloService-PlaintextPassword-Timestamp?wsdl"));
+
+		URL trustedCertficateFileURL = getClass().getResource(
+				"/security/tomcat_heater_certificate.pem");
+		CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
+		X509Certificate trustedCertficate = (X509Certificate) certFactory
+				.generateCertificate(trustedCertficateFileURL.openStream());
+		credentialManager.addTrustedCertificate(trustedCertficate);
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/secure-ws-https.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertEquals(State.RUNNING, runService.getState(runId));
+			System.out.println(report);
+
+			Map<String, Data> results = runService.getOutputs(runId);
+			waitForResults(results, report, "out_plaintext", "out_digest", "out_digest_timestamp",
+					"out_plaintext_timestamp");
+
+			assertTrue(checkResult(results.get("out_plaintext"), "Hello Alan!"));
+			assertTrue(checkResult(results.get("out_digest"), "Hello Stian!"));
+			assertTrue(checkResult(results.get("out_digest_timestamp"),
+					"Hello David!"));
+			assertTrue(checkResult(results.get("out_plaintext_timestamp"),
+					"Hello Alex!"));
+
+			assertEquals(State.COMPLETED, runService.getState(runId));
+			System.out.println(report);
+		}
+	}
+
+	public void testRunXMLSplitter() throws Exception {
+		setup();
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/xmlSplitter.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			Map<String, Data> inputs = new HashMap<String, Data>();
+			inputs.put("firstName", dataService.create("John"));
+			inputs.put("lastName", dataService.create("Smith"));
+			inputs.put("age", dataService.create("21"));
+
+			String runId = runService.createRun(new RunProfile(executionEnvironment,
+					workflowBundle, inputs));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(runService.getState(runId).equals(State.RUNNING)
+					|| runService.getState(runId).equals(State.COMPLETED));
+			System.out.println(report);
+
+			Map<String, Data> results = runService.getOutputs(runId);
+			waitForResults(results, report, "out");
+
+			assertTrue(checkResult(results.get("out"),
+					"John Smith (21) of 40, Oxford Road. Manchester."));
+
+			assertEquals(State.COMPLETED, runService.getState(runId));
+			System.out.println(report);
+		}
+	}
+
+	public void testRunXPath() throws Exception {
+		setup();
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/xpath.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(runService.getState(runId).equals(State.RUNNING)
+					|| runService.getState(runId).equals(State.COMPLETED));
+			System.out.println(report);
+
+			Map<String, Data> results = runService.getOutputs(runId);
+			waitForResults(results, report, "out");
+
+			assertTrue(checkResult(results.get("out"),
+					"<test-element>test</test-element>"));
+
+			assertEquals(State.COMPLETED, runService.getState(runId));
+			System.out.println(report);
+		}
+	}
+
+	public void testRunFromFile() throws Exception {
+		setup();
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/in-out.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			Map<String, Data> inputs = new HashMap<String, Data>();
+			File file = loadFile("/t2flow/input.txt");
+			Data data = dataService.create(file.toURI());
+			assertTrue(data.isReference());
+			inputs.put("in", data);
+
+			String runId = runService.createRun(new RunProfile(executionEnvironment,
+					workflowBundle, inputs));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(runService.getState(runId).equals(State.RUNNING)
+					|| runService.getState(runId).equals(State.COMPLETED));
+			System.out.println(report);
+
+			Map<String, Data> results = runService.getOutputs(runId);
+			assertNotNull(results);
+			waitForResults(results, runService.getWorkflowReport(runId), "out");
+
+			assertTrue(checkResult(results.get("out"), "test input value"));
+
+			assertEquals(State.COMPLETED, runService.getState(runId));
+			System.out.println(report);
+		}
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunParallelIT.java
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunParallelIT.java b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunParallelIT.java
new file mode 100644
index 0000000..7ba4a4f
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunParallelIT.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (C) 2011 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform;
+
+import java.net.URI;
+import java.util.HashSet;
+import java.util.Set;
+
+import net.sf.taverna.t2.security.credentialmanager.UsernamePassword;
+
+import org.osgi.framework.ServiceReference;
+
+import uk.org.taverna.platform.execution.api.ExecutionEnvironment;
+import uk.org.taverna.platform.report.State;
+import uk.org.taverna.platform.report.WorkflowReport;
+import uk.org.taverna.platform.run.api.RunProfile;
+import uk.org.taverna.platform.run.api.RunService;
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+
+public class RunParallelIT extends PlatformIT {
+
+	private RunService runService;
+
+	private ExecutionEnvironment executionEnvironment;
+
+	protected void setup() throws Exception {
+		super.setup();
+		if (runService == null) {
+			ServiceReference runServiceReference = bundleContext
+					.getServiceReference("uk.org.taverna.platform.run.api.RunService");
+			runService = (RunService) bundleContext.getService(runServiceReference);
+		}
+		if (executionEnvironment == null) {
+			executionEnvironment = runService.getExecutionEnvironments().iterator().next();
+		}
+		credentialManager.addUsernameAndPasswordForService(new UsernamePassword("testuser",
+				"testpasswd"), URI
+				.create("http://heater.cs.man.ac.uk:7070/#Example+HTTP+BASIC+Authentication"));
+		credentialManager
+				.addUsernameAndPasswordForService(
+						new UsernamePassword("testuser", "testpasswd"),
+						URI.create("http://heater.cs.man.ac.uk:7070/axis/services/HelloService-PlaintextPassword?wsdl"));
+	}
+
+	public void testRun() throws Exception {
+		setup();
+
+		String[] workflows = { "biomart", "rest", "secure-basic-authentication",
+				"spreadsheetimport", "stringconstant", "wsdl", "wsdl-secure", "xpath" };
+		Set<String> runIDs= new HashSet<String>();
+
+		for (int i = 0; i < workflows.length; i++) {
+			int runs = Math.max(1, (int) Math.ceil(Math.random() * 10));
+			System.out.println("Creating " + runs + " runs for workflow " + workflows[i]);
+			for (int j = 0; j < runs; j++) {
+				WorkflowBundle workflowBundle = loadWorkflow("/t2flow/" + workflows[i] + ".t2flow");
+				String run = runService.createRun(new RunProfile(executionEnvironment, workflowBundle));
+				runService.getWorkflowReport(run).getSubject().setName(workflows[i] + j);
+				runIDs.add(run);
+			}
+		}
+
+		for (String runId : runIDs) {
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println("Starting " + report.getSubject().getName());
+			runService.start(runId);
+		}
+
+		for (String runId : runIDs) {
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println("Waiting for " + report.getSubject().getName() + " to complete");
+			assertTrue(waitForState(report, State.COMPLETED, false));
+		}
+
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunWorkflowsIT.java
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunWorkflowsIT.java b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunWorkflowsIT.java
new file mode 100644
index 0000000..6c36821
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunWorkflowsIT.java
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.osgi.framework.ServiceReference;
+
+import uk.org.taverna.platform.data.api.Data;
+import uk.org.taverna.platform.execution.api.ExecutionEnvironment;
+import uk.org.taverna.platform.report.State;
+import uk.org.taverna.platform.report.WorkflowReport;
+import uk.org.taverna.platform.run.api.RunProfile;
+import uk.org.taverna.platform.run.api.RunService;
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+
+public class RunWorkflowsIT extends PlatformIT {
+
+	private RunService runService;
+
+	protected void setup() throws Exception {
+		super.setup();
+		if (runService == null) {
+			ServiceReference runServiceReference = bundleContext
+					.getServiceReference("uk.org.taverna.platform.run.api.RunService");
+			runService = (RunService) bundleContext.getService(runServiceReference);
+		}
+	}
+
+	public void testRunFetchTodaysXkcdComic() throws Exception {
+		setup();
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/FetchTodaysXkcdComic.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(runService.getState(runId).equals(State.RUNNING)
+					|| runService.getState(runId).equals(State.COMPLETED));
+			System.out.println(report);
+
+			Map<String, Data> results = runService.getOutputs(runId);
+			assertNotNull(results);
+			waitForResults(results, report, "todaysXkcd");
+
+			List<Data> result = results.get("todaysXkcd").getElements();
+			assertEquals(1, result.size());
+			Object value = result.get(0).getValue();
+			assert(value instanceof byte[]);
+			byte[] binaryValue = (byte[]) value;
+			assertEquals('P', (char) binaryValue[1]);
+			assertEquals('N', (char) binaryValue[2]);
+			assertEquals('G', (char) binaryValue[3]);
+			assertEquals(State.COMPLETED, runService.getState(runId));
+			System.out.println(report);
+		}
+	}
+
+	public void testRunGBSeqTest() throws Exception {
+		setup();
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/GBSeqTest.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = runService
+				.getExecutionEnvironments(workflowBundle);
+		assertTrue(executionEnvironments.size() > 0);
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			String runId = runService
+					.createRun(new RunProfile(executionEnvironment, workflowBundle));
+			assertEquals(State.CREATED, runService.getState(runId));
+
+			WorkflowReport report = runService.getWorkflowReport(runId);
+			System.out.println(report);
+
+			runService.start(runId);
+			assertTrue(runService.getState(runId).equals(State.RUNNING)
+					|| runService.getState(runId).equals(State.COMPLETED));
+			System.out.println(report);
+
+			Map<String, Data> results = runService.getOutputs(runId);
+			assertNotNull(results);
+			waitForResults(results, runService.getWorkflowReport(runId), "nuc_tiny");
+
+			assertTrue(checkResult(results.get("nuc_tiny"),
+					"<?xml version=\"1.0\"?>\n"
+							+ " <!DOCTYPE TSeqSet PUBLIC \"-//NCBI//NCBI TSeq/EN\" \"http://www.ncbi.nlm.nih.gov/dtd/NCBI_TSeq.dtd\">\n"
+							+ " <TSeqSet>\n"
+							+ "<TSeq>\n"
+							+ "  <TSeq_seqtype value=\"nucleotide\"/>\n"
+							+ "  <TSeq_gi>119395733</TSeq_gi>\n"
+							+ "  <TSeq_accver>NM_000059.3</TSeq_accver>\n"
+							+ "  <TSeq_taxid>9606</TSeq_taxid>\n"
+							+ "  <TSeq_orgname>Homo sapiens</TSeq_orgname>\n"
+							+ "  <TSeq_defline>Homo sapiens breast cancer 2, early onset (BRCA2), mRNA</TSeq_defline>\n"
+							+ "  <TSeq_length>11386</TSeq_length>\n"
+							+ "  <TSeq_sequence>GTGGCGCGAGCTTCTGAAACTAGGCGGCAGAGGCGGAGCCGCTGTGGCACTGCTGCGCCTCTGCTGCGCCTCGGGTGTCTTTTGCGGCGGTGGGTCGCCGCCGGGAGAAGCGTGAGGGGACAGATTTGTGACCGGCGCGGTTTTTGTCAGCTTACTCCGGCCAAAAAAGAACTGCACCTCTGGAGCGGACTTATTTACCAAGCATTGGAGGAATATCGTAGGTAAAAATGCCTATTGGATCCAAAGAGAGGCCAACATTTTTTGAAATTTTTAAGACACGCTGCAACAAAGCAGATTTAGGACCAATAAGTCTTAATTGGTTTGAAGAACTTTCTTCAGAAGCTCCACCCTATAATTCTGAACCTGCAGAAGAATCTGAACATAAAAACAACAATTACGAACCAAACCTATTTAAAACTCCACAAAGGAAACCATCTTATAATCAGCTGGCTTCAACTCCAATAATATTCAAAGAGCAAGGGCTGACTCTGCCGCTGTACCAATCTCCTGTAAAAGAATTAGATAAATTCAAATTAGACTTAGGAAGGAATGTTCCCAATAGTAGACATAAAAGTCTTCGCACAGTGAAAACTAAAATGGATCAAGCAGATGATGTTTCCTGTCCACTTCTAAATTCTTGTCTTAGTGAAAGTCCTGTTGTTCTACAATGTACACATGTAACACCACAAAGAGATAAGTCAGTGGTATGTGGGAGTTTGTTTCATACACCAAAGTTTGTGAAGGGTCGTCAGACACCAAAACATATTTCTGAAAGTCTAGGAGCTGAGGTGGATCCTGATATGTCTTGGTCAAGTTCTTTAGCTACACCACCCACCCTTAGTTCTACTGTGCTCATAGTCAGAAATGAAGAAGCATCTGAAACTGTATTTCCTCATGATACTACTGCTAATGTGAAAAGCTATTTTTCCAATCATGATGAAAGTCTGAAGAAAAATGATAGATTTATCGC
 TTCTGTGACAGACAGTGAAAACACAAATCAAAGAGAAGCTGCAAGTCATGGATTTGGAAAAACATCAGGGAATTCATTTAAAGTAAATAGCTGCAAAGACCACATTGGAAAGTCAATGCCAAATGTCCTAGAAGATGAAGTATATGAAACAGTTGTAGATACCTCTGAAGAAGATAGTTTTTCATTATGTTTTTCTAAATGTAGAACAAAAAATCTACAAAAAGTAAGAACTAGCAAGACTAGGAAAAAAATTTTCCATGAAGCAAACGCTGATGAATGTGAAAAATCTAAAAACCAAGTGAAAGAAAAATACTCATTTGTATCTGAAGTGGAACCAAATGATACTGATCCATTAGATTCAAATGTAGCAAATCAGAAGCCCTTTGAGAGTGGAAGTGACAAAATCTCCAAGGAAGTTGTACCGTCTTTGGCCTGTGAATGGTCTCAACTAACCCTTTCAGGTCTAAATGGAGCCCAGATGGAGAAAATACCCCTATTGCATATTTCTTCATGTGACCAAAATATTTCAGAAAAAGACCTATTAGACACAGAGAACAAAAGAAAGAAAGATTTTCTTACTTCAGAGAATTCTTTGCCACGTATTTCTAGCCTACCAAAATCAGAGAAGCCATTAAATGAGGAAACAGTGGTAAATAAGAGAGATGAAGAGCAGCATCTTGAATCTCATACAGACTGCATTCTTGCAGTAAAGCAGGCAATATCTGGAACTTCTCCAGTGGCTTCTTCATTTCAGGGTATCAAAAAGTCTATATTCAGAATAAGAGAATCACCTAAAGAGACTTTCAATGCAAGTTTTTCAGGTCATATGACTGATCCAAACTTTAAAAAAGAAACTGAAGCCTCTGAAAGTGGACTGGAAATACATACTGTTTGCTCACAGAAGGAGGACTCCTTATGTCCAAATTTAATTGATAATGGAAGCTGGCCAGCCACCACCACACAGAATTCTGTAGCTTTGAAGAATGCAGGTTTAATA
 TCCACTTTGAAAAAGAAAACAAATAAGTTTATTTATGCTATACATGATGAAACATCTTATAAAGGAAAAAAAATACCGAAAGACCAAAAATCAGAACTAATTAACTGTTCAGCCCAGTTTGAAGCAAATGCTTTTGAAGCACCACTTACATTTGCAAATGCTGATTCAGGTTTATTGCATTCTTCTGTGAAAAGAAGCTGTTCACAGAATGATTCTGAAGAACCAACTTTGTCCTTAACTAGCTCTTTTGGGACAATTCTGAGGAAATGTTCTAGAAATGAAACATGTTCTAATAATACAGTAATCTCTCAGGATCTTGATTATAAAGAAGCAAAATGTAATAAGGAAAAACTACAGTTATTTATTACCCCAGAAGCTGATTCTCTGTCATGCCTGCAGGAAGGACAGTGTGAAAATGATCCAAAAAGCAAAAAAGTTTCAGATATAAAAGAAGAGGTCTTGGCTGCAGCATGTCACCCAGTACAACATTCAAAAGTGGAATACAGTGATACTGACTTTCAATCCCAGAAAAGTCTTTTATATGATCATGAAAATGCCAGCACTCTTATTTTAACTCCTACTTCCAAGGATGTTCTGTCAAACCTAGTCATGATTTCTAGAGGCAAAGAATCATACAAAATGTCAGACAAGCTCAAAGGTAACAATTATGAATCTGATGTTGAATTAACCAAAAATATTCCCATGGAAAAGAATCAAGATGTATGTGCTTTAAATGAAAATTATAAAAACGTTGAGCTGTTGCCACCTGAAAAATACATGAGAGTAGCATCACCTTCAAGAAAGGTACAATTCAACCAAAACACAAATCTAAGAGTAATCCAAAAAAATCAAGAAGAAACTACTTCAATTTCAAAAATAACTGTCAATCCAGACTCTGAAGAACTTTTCTCAGACAATGAGAATAATTTTGTCTTCCAAGTAGCTAATGAAAGGAATAATCTTGCTTTAGGAAATACTAAGGAACTTCATGAAACAG
 ACTTGACTTGTGTAAACGAACCCATTTTCAAGAACTCTACCATGGTTTTATATGGAGACACAGGTGATAAACAAGCAACCCAAGTGTCAATTAAAAAAGATTTGGTTTATGTTCTTGCAGAGGAGAACAAAAATAGTGTAAAGCAGCATATAAAAATGACTCTAGGTCAAGATTTAAAATCGGACATCTCCTTGAATATAGATAAAATACCAGAAAAAAATAATGATTACATGAACAAATGGGCAGGACTCTTAGGTCCAATTTCAAATCACAGTTTTGGAGGTAGCTTCAGAACAGCTTCAAATAAGGAAATCAAGCTCTCTGAACATAACATTAAGAAGAGCAAAATGTTCTTCAAAGATATTGAAGAACAATATCCTACTAGTTTAGCTTGTGTTGAAATTGTAAATACCTTGGCATTAGATAATCAAAAGAAACTGAGCAAGCCTCAGTCAATTAATACTGTATCTGCACATTTACAGAGTAGTGTAGTTGTTTCTGATTGTAAAAATAGTCATATAACCCCTCAGATGTTATTTTCCAAGCAGGATTTTAATTCAAACCATAATTTAACACCTAGCCAAAAGGCAGAAATTACAGAACTTTCTACTATATTAGAAGAATCAGGAAGTCAGTTTGAATTTACTCAGTTTAGAAAACCAAGCTACATATTGCAGAAGAGTACATTTGAAGTGCCTGAAAACCAGATGACTATCTTAAAGACCACTTCTGAGGAATGCAGAGATGCTGATCTTCATGTCATAATGAATGCCCCATCGATTGGTCAGGTAGACAGCAGCAAGCAATTTGAAGGTACAGTTGAAATTAAACGGAAGTTTGCTGGCCTGTTGAAAAATGACTGTAACAAAAGTGCTTCTGGTTATTTAACAGATGAAAATGAAGTGGGGTTTAGGGGCTTTTATTCTGCTCATGGCACAAAACTGAATGTTTCTACTGAAGCTCTGCAAAAAGCTGTGAAACTGTTTAGTGATATTGA
 GAATATTAGTGAGGAAACTTCTGCAGAGGTACATCCAATAAGTTTATCTTCAAGTAAATGTCATGATTCTGTTGTTTCAATGTTTAAGATAGAAAATCATAATGATAAAACTGTAAGTGAAAAAAATAATAAATGCCAACTGATATTACAAAATAATATTGAAATGACTACTGGCACTTTTGTTGAAGAAATTACTGAAAATTACAAGAGAAATACTGAAAATGAAGATAACAAATATACTGCTGCCAGTAGAAATTCTCATAACTTAGAATTTGATGGCAGTGATTCAAGTAAAAATGATACTGTTTGTATTCATAAAGATGAAACGGACTTGCTATTTACTGATCAGCACAACATATGTCTTAAATTATCTGGCCAGTTTATGAAGGAGGGAAACACTCAGATTAAAGAAGATTTGTCAGATTTAACTTTTTTGGAAGTTGCGAAAGCTCAAGAAGCATGTCATGGTAATACTTCAAATAAAGAACAGTTAACTGCTACTAAAACGGAGCAAAATATAAAAGATTTTGAGACTTCTGATACATTTTTTCAGACTGCAAGTGGGAAAAATATTAGTGTCGCCAAAGAGTCATTTAATAAAATTGTAAATTTCTTTGATCAGAAACCAGAAGAATTGCATAACTTTTCCTTAAATTCTGAATTACATTCTGACATAAGAAAGAACAAAATGGACATTCTAAGTTATGAGGAAACAGACATAGTTAAACACAAAATACTGAAAGAAAGTGTCCCAGTTGGTACTGGAAATCAACTAGTGACCTTCCAGGGACAACCCGAACGTGATGAAAAGATCAAAGAACCTACTCTATTGGGTTTTCATACAGCTAGCGGGAAAAAAGTTAAAATTGCAAAGGAATCTTTGGACAAAGTGAAAAACCTTTTTGATGAAAAAGAGCAAGGTACTAGTGAAATCACCAGTTTTAGCCATCAATGGGCAAAGACCCTAAAGTACAGAGAGGCCTGTAAAGACCTTGAA
 TTAGCATGTGAGACCATTGAGATCACAGCTGCCCCAAAGTGTAAAGAAATGCAGAATTCTCTCAATAATGATAAAAACCTTGTTTCTATTGAGACTGTGGTGCCACCTAAGCTCTTAAGTGATAATTTATGTAGACAAACTGAAAATCTCAAAACATCAAAAAGTATCTTTTTGAAAGTTAAAGTACATGAAAATGTAGAAAAAGAAACAGCAAAAAGTCCTGCAACTTGTTACACAAATCAGTCCCCTTATTCAGTCATTGAAAATTCAGCCTTAGCTTTTTACACAAGTTGTAGTAGAAAAACTTCTGTGAGTCAGACTTCATTACTTGAAGCAAAAAAATGGCTTAGAGAAGGAATATTTGATGGTCAACCAGAAAGAATAAATACTGCAGATTATGTAGGAAATTATTTGTATGAAAATAATTCAAACAGTACTATAGCTGAAAATGACAAAAATCATCTCTCCGAAAAACAAGATACTTATTTAAGTAACAGTAGCATGTCTAACAGCTATTCCTACCATTCTGATGAGGTATATAATGATTCAGGATATCTCTCAAAAAATAAACTTGATTCTGGTATTGAGCCAGTATTGAAGAATGTTGAAGATCAAAAAAACACTAGTTTTTCCAAAGTAATATCCAATGTAAAAGATGCAAATGCATACCCACAAACTGTAAATGAAGATATTTGCGTTGAGGAACTTGTGACTAGCTCTTCACCCTGCAAAAATAAAAATGCAGCCATTAAATTGTCCATATCTAATAGTAATAATTTTGAGGTAGGGCCACCTGCATTTAGGATAGCCAGTGGTAAAATCGTTTGTGTTTCACATGAAACAATTAAAAAAGTGAAAGACATATTTACAGACAGTTTCAGTAAAGTAATTAAGGAAAACAACGAGAATAAATCAAAAATTTGCCAAACGAAAATTATGGCAGGTTGTTACGAGGCATTGGATGATTCAGAGGATATTCTTCATAACTCTCTAGATA
 ATGATGAATGTAGCACGCATTCACATAAGGTTTTTGCTGACATTCAGAGTGAAGAAATTTTACAACATAACCAAAATATGTCTGGATTGGAGAAAGTTTCTAAAATATCACCTTGTGATGTTAGTTTGGAAACTTCAGATATATGTAAATGTAGTATAGGGAAGCTTCATAAGTCAGTCTCATCTGCAAATACTTGTGGGATTTTTAGCACAGCAAGTGGAAAATCTGTCCAGGTATCAGATGCTTCATTACAAAACGCAAGACAAGTGTTTTCTGAAATAGAAGATAGTACCAAGCAAGTCTTTTCCAAAGTATTGTTTAAAAGTAACGAACATTCAGACCAGCTCACAAGAGAAGAAAATACTGCTATACGTACTCCAGAACATTTAATATCCCAAAAAGGCTTTTCATATAATGTGGTAAATTCATCTGCTTTCTCTGGATTTAGTACAGCAAGTGGAAAGCAAGTTTCCATTTTAGAAAGTTCCTTACACAAAGTTAAGGGAGTGTTAGAGGAATTTGATTTAATCAGAACTGAGCATAGTCTTCACTATTCACCTACGTCTAGACAAAATGTATCAAAAATACTTCCTCGTGTTGATAAGAGAAACCCAGAGCACTGTGTAAACTCAGAAATGGAAAAAACCTGCAGTAAAGAATTTAAATTATCAAATAACTTAAATGTTGAAGGTGGTTCTTCAGAAAATAATCACTCTATTAAAGTTTCTCCATATCTCTCTCAATTTCAACAAGACAAACAACAGTTGGTATTAGGAACCAAAGTGTCACTTGTTGAGAACATTCATGTTTTGGGAAAAGAACAGGCTTCACCTAAAAACGTAAAAATGGAAATTGGTAAAACTGAAACTTTTTCTGATGTTCCTGTGAAAACAAATATAGAAGTTTGTTCTACTTACTCCAAAGATTCAGAAAACTACTTTGAAACAGAAGCAGTAGAAATTGCTAAAGCTTTTATGGAAGATGATGAACTGACAGA
 TTCTAAACTGCCAAGTCATGCCACACATTCTCTTTTTACATGTCCCGAAAATGAGGAAATGGTTTTGTCAAATTCAAGAATTGGAAAAAGAAGAGGAGAGCCCCTTATCTTAGTGGGAGAACCCTCAATCAAAAGAAACTTATTAAATGAATTTGACAGGATAATAGAAAATCAAGAAAAATCCTTAAAGGCTTCAAAAAGCACTCCAGATGGCACAATAAAAGATCGAAGATTGTTTATGCATCATGTTTCTTTAGAGCCGATTACCTGTGTACCCTTTCGCACAACTAAGGAACGTCAAGAGATACAGAATCCAAATTTTACCGCACCTGGTCAAGAATTTCTGTCTAAATCTCATTTGTATGAACATCTGACTTTGGAAAAATCTTCAAGCAATTTAGCAGTTTCAGGACATCCATTTTATCAAGTTTCTGCTACAAGAAATGAAAAAATGAGACACTTGATTACTACAGGCAGACCAACCAAAGTCTTTGTTCCACCTTTTAAAACTAAATCACATTTTCACAGAGTTGAACAGTGTGTTAGGAATATTAACTTGGAGGAAAACAGACAAAAGCAAAACATTGATGGACATGGCTCTGATGATAGTAAAAATAAGATTAATGACAATGAGATTCATCAGTTTAACAAAAACAACTCCAATCAAGCAGCAGCTGTAACTTTCACAAAGTGTGAAGAAGAACCTTTAGATTTAATTACAAGTCTTCAGAATGCCAGAGATATACAGGATATGCGAATTAAGAAGAAACAAAGGCAACGCGTCTTTCCACAGCCAGGCAGTCTGTATCTTGCAAAAACATCCACTCTGCCTCGAATCTCTCTGAAAGCAGCAGTAGGAGGCCAAGTTCCCTCTGCGTGTTCTCATAAACAGCTGTATACGTATGGCGTTTCTAAACATTGCATAAAAATTAACAGCAAAAATGCAGAGTCTTTTCAGTTTCACACTGAAGATTATTTTGGTAAGGAAAGTTTATGG
 ACTGGAAAAGGAATACAGTTGGCTGATGGTGGATGGCTCATACCCTCCAATGATGGAAAGGCTGGAAAAGAAGAATTTTATAGGGCTCTGTGTGACACTCCAGGTGTGGATCCAAAGCTTATTTCTAGAATTTGGGTTTATAATCACTATAGATGGATCATATGGAAACTGGCAGCTATGGAATGTGCCTTTCCTAAGGAATTTGCTAATAGATGCCTAAGCCCAGAAAGGGTGCTTCTTCAACTAAAATACAGATATGATACGGAAATTGATAGAAGCAGAAGATCGGCTATAAAAAAGATAATGGAAAGGGATGACACAGCTGCAAAAACACTTGTTCTCTGTGTTTCTGACATAATTTCATTGAGCGCAAATATATCTGAAACTTCTAGCAATAAAACTAGTAGTGCAGATACCCAAAAAGTGGCCATTATTGAACTTACAGATGGGTGGTATGCTGTTAAGGCCCAGTTAGATCCTCCCCTCTTAGCTGTCTTAAAGAATGGCAGACTGACAGTTGGTCAGAAGATTATTCTTCATGGAGCAGAACTGGTGGGCTCTCCTGATGCCTGTACACCTCTTGAAGCCCCAGAATCTCTTATGTTAAAGATTTCTGCTAACAGTACTCGGCCTGCTCGCTGGTATACCAAACTTGGATTCTTTCCTGACCCTAGACCTTTTCCTCTGCCCTTATCATCGCTTTTCAGTGATGGAGGAAATGTTGGTTGTGTTGATGTAATTATTCAAAGAGCATACCCTATACAGTGGATGGAGAAGACATCATCTGGATTATACATATTTCGCAATGAAAGAGAGGAAGAAAAGGAAGCAGCAAAATATGTGGAGGCCCAACAAAAGAGACTAGAAGCCTTATTCACTAAAATTCAGGAGGAATTTGAAGAACATGAAGAAAACACAACAAAACCATATTTACCATCACGTGCACTAACAAGACAGCAAGTTCGTGCTTTGCAAGATGGTGCAGAGCTTTATGAAG
 CAGTGAAGAATGCAGCAGACCCAGCTTACCTTGAGGGTTATTTCAGTGAAGAGCAGTTAAGAGCCTTGAATAATCACAGGCAAATGTTGAATGATAAGAAACAAGCTCAGATCCAGTTGGAAATTAGGAAGGCCATGGAATCTGCTGAACAAAAGGAACAAGGTTTATCAAGGGATGTCACAACCGTGTGGAAGTTGCGTATTGTAAGCTATTCAAAAAAAGAAAAAGATTCAGTTATACTGAGTATTTGGCGTCCATCATCAGATTTATATTCTCTGTTAACAGAAGGAAAGAGATACAGAATTTATCATCTTGCAACTTCAAAATCTAAAAGTAAATCTGAAAGAGCTAACATACAGTTAGCAGCGACAAAAAAAACTCAGTATCAACAACTACCGGTTTCAGATGAAATTTTATTTCAGATTTACCAGCCACGGGAGCCCCTTCACTTCAGCAAATTTTTAGATCCAGACTTTCAGCCATCTTGTTCTGAGGTGGACCTAATAGGATTTGTCGTTTCTGTTGTGAAAAAAACAGGACTTGCCCCTTTCGTCTATTTGTCAGACGAATGTTACAATTTACTGGCAATAAAGTTTTGGATAGACCTTAATGAGGACATTATTAAGCCTCATATGTTAATTGCTGCAAGCAACCTCCAGTGGCGACCAGAATCCAAATCAGGCCTTCTTACTTTATTTGCTGGAGATTTTTCTGTGTTTTCTGCTAGTCCAAAAGAGGGCCACTTTCAAGAGACATTCAACAAAATGAAAAATACTGTTGAGAATATTGACATACTTTGCAATGAAGCAGAAAACAAGCTTATGCATATACTGCATGCAAATGATCCCAAGTGGTCCACCCCAACTAAAGACTGTACTTCAGGGCCGTACACTGCTCAAATCATTCCTGGTACAGGAAACAAGCTTCTGATGTCTTCTCCTAATTGTGAGATATATTATCAAAGTCCTTTATCACTTTGTATGGCCAAAAGGAAGTC
 TGTTTCCACACCTGTCTCAGCCCAGATGACTTCAAAGTCTTGTAAAGGGGAGAAAGAGATTGATGACCAAAAGAACTGCAAAAAGAGAAGAGCCTTGGATTTCTTGAGTAGACTGCCTTTACCTCCACCTGTTAGTCCCATTTGTACATTTGTTTCTCCGGCTGCACAGAAGGCATTTCAGCCACCAAGGAGTTGTGGCACCAAATACGAAACACCCATAAAGAAAAAAGAACTGAATTCTCCTCAGATGACTCCATTTAAAAAATTCAATGAAATTTCTCTTTTGGAAAGTAATTCAATAGCTGACGAAGAACTTGCATTGATAAATACCCAAGCTCTTTTGTCTGGTTCAACAGGAGAAAAACAATTTATATCTGTCAGTGAATCCACTAGGACTGCTCCCACCAGTTCAGAAGATTATCTCAGACTGAAACGACGTTGTACTACATCTCTGATCAAAGAACAGGAGAGTTCCCAGGCCAGTACGGAAGAATGTGAGAAAAATAAGCAGGACACAATTACAACTAAAAAATATATCTAAGCATTTGCAAAGGCGACAATAAATTATTGACGCTTAACCTTTCCAGTTTATAAGACTGGAATATAATTTCAAACCACACATTAGTACTTATGTTGCACAATGAGAAAAGAAATTAGTTTCAAATTTACCTCAGCGTTTGTGTATCGGGCAAAAATCGTTTTGCCCGATTCCGTATTGGTATACTTTTGCTTCAGTTGCATATCTTAAAACTAAATGTAATTTATTAACTAATCAAGAAAAACATCTTTGGCTGAGCTCGGTGGCTCATGCCTGTAATCCCAACACTTTGAGAAGCTGAGGTGGGAGGAGTGCTTGAGGCCAGGAGTTCAAGACCAGCCTGGGCAACATAGGGAGACCCCCATCTTTACAAAGAAAAAAAAAAGGGGAAAAGAAAATCTTTTAAATCTTTGGATTTGATCACTACAAGTATTATTTTACAAGTGAAATAAACATACC
 ATTTTCTTTTAGATTGTGTCATTAAATGGAATGAGGTCTCTTAGTACAGTTATTTTGATGCAGATAATTCCTTTTAGTTTAGCTACTATTTTAGGGGATTTTTTTTAGAGGTAACTCACTATGAAATAGTTCTCCTTAATGCAAATATGTTGGTTCTGCTATAGTTCCATCCTGTTCAAAAGTCAGGATGAATATGAAGAGTGGTGTTTCCTTTTGAGCAATTCTTCATCCTTAAGTCAGCATGATTATAAGAAAAATAGAACCCTCAGTGTAACTCTAATTCCTTTTTACTATTCCAGTGTGATCTCTGAAATTAAATTACTTCAACTAAAAATTCAAATACTTTAAATCAGAAGATTTCATAGTTAATTTATTTTTTTTTTCAACAAAATGGTCATCCAAACTCAAACTTGAGAAAATATCTTGCTTTCAAATTGGCACTGATT</TSeq_sequence>\n"
+							+ "</TSeq>\n" + "\n" + "</TSeqSet>"));
+
+			waitForState(report, State.COMPLETED);
+
+			assertEquals(State.COMPLETED, runService.getState(runId));
+			System.out.println(report);
+		}
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/log4j.properties b/taverna-platform-integration-tests/src/test/resources/log4j.properties
new file mode 100644
index 0000000..6babb60
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/log4j.properties
@@ -0,0 +1,11 @@
+#log4j.rootLogger=DEBUG, CONSOLE
+log4j.rootLogger=WARN, CONSOLE
+#log4j.rootLogger=ERROR, CONSOLE
+
+log4j.logger.uk.org.taverna.platform.execution=DEBUG
+
+# Default output to console
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=%-5p %d{ISO8601} (%c:%L) - %m%n
+

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/security/tomcat_heater_certificate.pem
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/security/tomcat_heater_certificate.pem b/taverna-platform-integration-tests/src/test/resources/security/tomcat_heater_certificate.pem
new file mode 100644
index 0000000..c729258
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/security/tomcat_heater_certificate.pem
@@ -0,0 +1,20 @@
+-----BEGIN CERTIFICATE-----
+MIIDyDCCArCgAwIBAgIETlYTBzANBgkqhkiG9w0BAQUFADCBpTELMAkGA1UEBhMCVUsxGzAZBgNV
+BAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjETMBEGA1UEBxMKTWFuY2hlc3RlcjEhMB8GA1UEChMYVW5p
+dmVyc2l0eSBvZiBNYW5jaGVzdGVyMSMwIQYDVQQLExpTY2hvb2wgb2YgQ29tcHV0ZXIgU2NpZW5j
+ZTEcMBoGA1UEAxMTaGVhdGVyLmNzLm1hbi5hYy51azAeFw0xMTA4MjUwOTE2NTVaFw0yMTA4MjIw
+OTE2NTVaMIGlMQswCQYDVQQGEwJVSzEbMBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRMwEQYD
+VQQHEwpNYW5jaGVzdGVyMSEwHwYDVQQKExhVbml2ZXJzaXR5IG9mIE1hbmNoZXN0ZXIxIzAhBgNV
+BAsTGlNjaG9vbCBvZiBDb21wdXRlciBTY2llbmNlMRwwGgYDVQQDExNoZWF0ZXIuY3MubWFuLmFj
+LnVrMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1/TuezSNYFpD2NTtw5UGECCPwClV
+Om08Nca1aanOVxv5rcn4eUVbu6Btm/dqgiCeV8nCyu7nEPvWP+Kvktseikx3LZ08qKdDRLpNa68/
+WrjcbS6ICs2hphhqftHSpl0OPnWkQicbI7Z4uUdqmF6DsLDOLpRfiYhh9lZ0FM7PD3yt42GR5E2B
+j465IJQweZxLCsRKwuZlvOsWJxnx1MHVj7ZFBYl7HSBfEpvThyqKL5R7FOZW0zpG3+Y+S9HmfQYk
+BipXrrNS1+lsIwPU8jD31PBzVPBNxIeKYHxXCKLf+EBah/tAKSxIzUihxhh1pdNEPvUyy2zY9vyv
+1PfXd8Uk0wIDAQABMA0GCSqGSIb3DQEBBQUAA4IBAQAtiPDBRlmjhFd9DP1NvbyfMApdjLufMLvr
+mzze3W6A4XUZj+kXR/Z3KYj84pWOnhe+Benvw5bIf2JM+sqIiSUA+TB8losx+SeY5hZ3lqEFY1wZ
+1qy47hH3rY98RdSAXlAhvGCEL/CktvIEHgaSlCmrOvK76ySwRCTYA9DJTWeB81R7bP7le2ewSg5c
+MY/Hy3VBkMGbVnZQoHhkUd7TIsPqD1SvYQDCug49JFsKsyrfep3nANAQO7uR8FYrCYtXj66z9ziO
+m0gZm+h/Rq8StgMrNwmi+3mGAgRJ6JKj4vAWJfyUSaOjLLf9u3BvrxVtQKCMSDGx25dBFlZXHIhE
+rONf
+-----END CERTIFICATE-----


[43/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-hadoop/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-execution-hadoop/pom.xml b/taverna-execution-hadoop/pom.xml
new file mode 100644
index 0000000..039f3f2
--- /dev/null
+++ b/taverna-execution-hadoop/pom.xml
@@ -0,0 +1,33 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.taverna.engine</groupId>
+		<artifactId>taverna-engine</artifactId>
+		<version>3.1.0-incubating-SNAPSHOT</version>
+	</parent>
+	<artifactId>taverna-execution-hadoop</artifactId>
+	<name>Apache Taverna Hadoop Workflow Execution Service</name>
+	<description>An (experimental) Execution Service for executing Taverna workflows using Hadoop</description>
+	<dependencies>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-reference-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<!-- <dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-workflowmodel-api</artifactId>
+			<version>${pjoject.parent.version}</version>
+		</dependency> -->
+		<dependency>
+			<groupId>org.apache.hadoop</groupId>
+			<artifactId>hadoop-core</artifactId>
+			<version>0.20.204.0</version>
+		</dependency>
+		<!-- <dependency>
+			<groupId>org.apache.hadoop</groupId>
+			<artifactId>hadoop-mapred</artifactId>
+			<version>0.23.0-SNAPSHOT</version>
+		</dependency> -->
+	</dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-hadoop/src/main/java/org/pingel/util/CrossProduct.java
----------------------------------------------------------------------
diff --git a/taverna-execution-hadoop/src/main/java/org/pingel/util/CrossProduct.java b/taverna-execution-hadoop/src/main/java/org/pingel/util/CrossProduct.java
new file mode 100644
index 0000000..1e3b4c1
--- /dev/null
+++ b/taverna-execution-hadoop/src/main/java/org/pingel/util/CrossProduct.java
@@ -0,0 +1,159 @@
+/***
+ * Copyright (c) 2008 Adam Pingel
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in the
+*    documentation and/or other materials provided with the distribution.
+* 3. The name of the author may not be used to endorse or promote products
+*    derived from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+*/
+
+package org.pingel.util;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.NoSuchElementException;
+
+public class CrossProduct<E> implements Iterable<List<E>>
+{
+	private List<Iterable<E>> iterables = new ArrayList<Iterable<E>>();
+
+   public CrossProduct(List<? extends Iterable<E>> iterables)
+   {
+       this.iterables.addAll(iterables);
+   }
+   
+	public CrossProduct(Iterable<E>... iterables)
+	{
+	    this.iterables = new ArrayList<Iterable<E>>();
+       for( Iterable<E> it : iterables ) {
+           this.iterables.add(it);
+       }
+	}
+	
+	public List<? extends Iterable<E>> getCollections()
+	{
+		return iterables;
+	}
+
+	public void addIterable(Iterable<E> iterable)
+	{
+		this.iterables.add(iterable);
+	}
+	
+	public Iterator<List<E>> iterator()
+	{
+		return new CrossProductIterator<E>(this);
+	}
+
+	public static void main(String[] argv)
+	{
+	    List<String> v1 = new ArrayList<String>();
+		List<String> v2 = new ArrayList<String>();
+		List<String> v3 = new ArrayList<String>();
+		
+		v1.add("a");
+		v1.add("b");
+		v2.add("0");
+		v2.add("1");
+		v3.add("X");
+		
+		CrossProduct<String> cp = new CrossProduct<String>(v1, v2, v3, v2);
+		
+		Iterator<List<String>> it = cp.iterator();
+		while( it.hasNext() ) {
+		    List<String> tuple = it.next();
+			System.out.println(tuple);
+		}
+		
+	}
+		
+	
+	class CrossProductIterator<InE> implements Iterator<List<InE>>
+	{
+       private CrossProduct<InE> cp;
+		private List<Iterator<InE>> iterators;
+		private List<InE> tuple;
+		
+		public CrossProductIterator(CrossProduct<InE> cp)
+		{
+          this.cp = cp;
+           
+			iterators = new ArrayList<Iterator<InE>>();
+			tuple = new ArrayList<InE>();
+			
+			for(int i=0; i < cp.getCollections().size(); i++ ) {
+				iterators.add(cp.getCollections().get(i).iterator());
+				tuple.add(iterators.get(i).next());
+			}
+		}
+		
+		public void remove()
+		{
+			// I don't think there are any reasonable semantics
+			// for "remove" since the "underlying collection"
+			// is never actually instantiated
+		    throw new UnsupportedOperationException();
+      }
+		
+		public boolean hasNext()
+		{
+			return tuple != null;
+		}
+		
+		boolean incrementFirstAvailable(int i)
+		{
+			if( i == iterators.size() ) {
+				return true;
+			}
+			else if( iterators.get(i).hasNext() ) {
+				tuple.set(i, iterators.get(i).next());
+				return false;
+			}
+			else {
+			    iterators.set(i, cp.iterables.get(i).iterator());
+			    tuple.set(i, iterators.get(i).next());
+				return incrementFirstAvailable(i+1);
+			}
+		}
+		
+		public List<InE> next()
+		{
+			if( tuple == null ) {
+				throw new NoSuchElementException();    		
+			}
+			
+			List<InE> result = new ArrayList<InE>();
+			for(int i=0; i < tuple.size(); i++) {
+				result.add(tuple.get(i));
+			}
+			
+			if( incrementFirstAvailable(0) ) {
+				tuple = null;
+			}
+			
+			return result;
+		}
+	}
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/CrossProductInputFormat.java
----------------------------------------------------------------------
diff --git a/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/CrossProductInputFormat.java b/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/CrossProductInputFormat.java
new file mode 100644
index 0000000..122b473
--- /dev/null
+++ b/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/CrossProductInputFormat.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (C) 2011 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.impl.hadoop;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.fs.BlockLocation;
+import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.fs.PathFilter;
+import org.apache.hadoop.io.ArrayWritable;
+import org.apache.hadoop.io.MapWritable;
+import org.apache.hadoop.io.Text;
+import org.apache.hadoop.mapreduce.InputSplit;
+import org.apache.hadoop.mapreduce.JobContext;
+import org.apache.hadoop.mapreduce.RecordReader;
+import org.apache.hadoop.mapreduce.TaskAttemptContext;
+import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
+
+/**
+ * An input format that receives an input directory containing a number of directories with input files 
+ * for each input port to a Taverna processor/activity that will be executed as part of this
+ * MapReduce job. Mapping between directory name -> Taverna processor/activity input port name
+ * is carried in the job's Context.
+ * 
+ * @author Alex Nenadic
+ *
+ */
+public class CrossProductInputFormat extends
+		FileInputFormat<Text, TextArrayWritable> {
+
+	private static final Log Logger = LogFactory.getLog(CrossProductInputFormat.class);
+
+	// Do not split files into blocks
+	@Override
+	protected boolean isSplitable(JobContext context, Path filename) {
+		return false;
+	}
+
+	@Override
+	public RecordReader<Text, TextArrayWritable> createRecordReader(
+			InputSplit split, TaskAttemptContext context) {
+		return new CrossProductRecordReader();
+	}
+
+	@Override
+	public List<InputSplit> getSplits(JobContext job) throws IOException {
+
+	    // Generate splits. Split is a list of directories where each directory 
+		// contains inputs for one input port of the Taverna processor/activity we 
+		// are invoking. 
+		// We will have only one split for cross product that will know about all
+		// the files in all input directories and will generate RecordReaders 
+		// for every combination of files inside these directories.
+//	    CrossProductInputSplit split = new CrossProductInputSplit();
+	    
+	    // List the input port directories contained in the input directory passed 
+	    // in from the command line.
+	    List<FileStatus> inputPortDirectories = listStatus(job); 
+	    
+		final FileSystem fs = job.getWorkingDirectory().getFileSystem(job.getConfiguration());
+		Path workingDirectory = job.getWorkingDirectory();
+		System.out.println("Working directory: " + workingDirectory);
+		System.out.println("Adding directories to the cross product split:");
+		ArrayList<Path> inputPortDirectoriesPaths = new ArrayList<Path>();
+    	for (FileStatus inputPortDirectory : inputPortDirectories){
+    		// TODO input port directories need to be ordered in the order of the 
+    		// input ports of the Taverna processor/activity they are going into
+            
+    		//inputPortDirectoriesPaths.add(new Text(inputPortDirectory.getPath().toString()));
+    		inputPortDirectoriesPaths.add(inputPortDirectory.getPath());
+    		System.out.println(inputPortDirectory.getPath());
+
+    	}
+	    CrossProductInputSplit split = new CrossProductInputSplit(workingDirectory, inputPortDirectoriesPaths);
+	    
+
+	    List<InputSplit> splits = new ArrayList<InputSplit>();
+	    splits.add(split);
+		
+	    return splits;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/CrossProductInputSplit.java
----------------------------------------------------------------------
diff --git a/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/CrossProductInputSplit.java b/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/CrossProductInputSplit.java
new file mode 100644
index 0000000..2ff9113
--- /dev/null
+++ b/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/CrossProductInputSplit.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (C) 2011 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.impl.hadoop;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.io.Text;
+import org.apache.hadoop.mapreduce.lib.input.FileSplit;
+
+/**
+ *
+ *
+ * @author Alex Nenadic
+ */
+public class CrossProductInputSplit extends FileSplit {
+	//
+	// private long length = 0;
+	// private String[] hosts;
+	private List<Path> inputPortDirectories;
+	private Path workingDirectory;
+
+	public CrossProductInputSplit() {
+		super(null,0,0,null);
+		inputPortDirectories = new ArrayList<Path>();
+		System.out.println("Calling default constructor for cross product split");
+	}
+
+	public CrossProductInputSplit(Path workingDirectory, List<Path> inputPortDirectories) {
+		// this.length = length;
+		// this.hosts = hosts;
+		super(workingDirectory, 0, 0, new String[0]);
+		this.workingDirectory = workingDirectory;
+		this.inputPortDirectories = inputPortDirectories;
+		System.out.println("Calling non-default constructor for cross product split");
+	}
+
+	public void addInputPortDirectory(Path path) {
+		inputPortDirectories.add(path);
+	}
+
+	public List<Path> getInputPortDirectories() {
+		return inputPortDirectories;
+	}
+
+	@Override
+	public void write(DataOutput out) throws IOException {
+		super.write(out);
+		Text.writeString(out, workingDirectory.toString());
+		out.writeInt(inputPortDirectories.size());
+		for (Path path : inputPortDirectories) {
+			Text.writeString(out, path.toString());
+		}
+	}
+
+	@Override
+	public void readFields(DataInput in) throws IOException {
+		super.readFields(in);
+		workingDirectory = new Path(Text.readString(in));
+		int length = in.readInt();
+		for (int i = 0; i < length; i++) {
+			inputPortDirectories.add(new Path(Text.readString(in)));
+		}
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/CrossProductRecordReader.java
----------------------------------------------------------------------
diff --git a/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/CrossProductRecordReader.java b/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/CrossProductRecordReader.java
new file mode 100644
index 0000000..6602f55
--- /dev/null
+++ b/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/CrossProductRecordReader.java
@@ -0,0 +1,112 @@
+package uk.org.taverna.platform.execution.impl.hadoop;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.io.Text;
+import org.apache.hadoop.mapreduce.InputSplit;
+import org.apache.hadoop.mapreduce.RecordReader;
+import org.apache.hadoop.mapreduce.TaskAttemptContext;
+import org.pingel.util.CrossProduct;
+
+public class CrossProductRecordReader extends RecordReader<Text, TextArrayWritable>{
+
+	private static final Log Logger = LogFactory.getLog(CrossProductRecordReader.class);
+
+	// Input directories (one for each port) containing files that are used 
+	// as inputs to Taverna processor/activity
+	private List<Path> inputPortDirectories;
+	
+	private CrossProduct<String> crossProduct ;
+
+	private Iterator<List<String>> crossProductIterator;
+
+	private List<String> currentIndexes;
+
+	@Override
+	public void initialize(InputSplit split, TaskAttemptContext context)
+			throws IOException, InterruptedException {
+
+		System.out.println("Inside record reader's initialize");
+		
+		CrossProductInputSplit crossProductSplit = (CrossProductInputSplit)split;
+		inputPortDirectories = crossProductSplit.getInputPortDirectories();
+		System.out.println("Record reader received " + +inputPortDirectories.size() + " input port directories");
+
+		List<List<String>> iterables = new ArrayList<List<String>>();
+		for (int i=0; i<inputPortDirectories.size();i++ ){
+	
+			Path inputPortDirectory = inputPortDirectories.get(i);
+			//Path inputPortDirectory = inputPortDirectories.get(i);
+			FileStatus[] files = inputPortDirectory.getFileSystem(context.getConfiguration()).listStatus(inputPortDirectory);
+			List<String> fileNames = new ArrayList<String>();
+			for (FileStatus file : files){
+				fileNames.add(file.getPath().getName());
+			}
+			iterables.add(fileNames);
+		}
+
+		crossProduct = new CrossProduct<String>(iterables);
+		crossProductIterator = crossProduct.iterator();
+		
+	}
+
+	@Override
+	public boolean nextKeyValue(){
+
+		boolean hasNextKey = crossProductIterator.hasNext();
+		System.out.println("Has record reader next key value? " + hasNextKey);
+		if (hasNextKey){
+			currentIndexes = crossProductIterator.next();
+		}
+		return hasNextKey;
+	}
+
+	@Override
+	public Text getCurrentKey() throws IOException, InterruptedException {
+	
+		StringBuffer sb = new StringBuffer();
+		for (String index : currentIndexes){
+			sb.append(index + ".");
+		}
+		// Remove last "."
+		String indexesString = sb.toString();
+		System.out.println("Get current key: " + indexesString);
+		if (indexesString.contains(".")){
+			indexesString = indexesString.substring(0, indexesString.length() - 1);
+		}
+		return new Text(indexesString);
+	}
+
+	@Override
+	public TextArrayWritable getCurrentValue() {
+				
+		TextArrayWritable arrayWritable = new TextArrayWritable();
+		Text[] array = new Text[currentIndexes.size()];
+		for(int i= 0; i< currentIndexes.size(); i++){
+			Path file = new Path(inputPortDirectories.get(i).toString(), currentIndexes.get(i));
+			array[i] = new Text(file.toString());
+		}
+		arrayWritable.set(array);
+		return arrayWritable;
+	}
+
+	@Override
+	public float getProgress() throws IOException, InterruptedException {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	@Override
+	public void close() throws IOException {
+		// TODO Auto-generated method stub
+		
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/CrossProductTest.java
----------------------------------------------------------------------
diff --git a/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/CrossProductTest.java b/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/CrossProductTest.java
new file mode 100644
index 0000000..e5dc063
--- /dev/null
+++ b/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/CrossProductTest.java
@@ -0,0 +1,116 @@
+/*******************************************************************************
+ * Copyright (C) 2011 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 1 of
+ *  the License, or (at your option) any later version.
+ *
+ *  This program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.impl.hadoop;
+
+import java.io.IOException;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.conf.Configured;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.io.ArrayWritable;
+import org.apache.hadoop.io.LongWritable;
+import org.apache.hadoop.io.MapWritable;
+import org.apache.hadoop.io.Text;
+import org.apache.hadoop.mapreduce.Job;
+import org.apache.hadoop.mapreduce.Mapper;
+import org.apache.hadoop.mapreduce.Reducer;
+import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
+import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
+import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
+import org.apache.hadoop.util.Tool;
+import org.apache.hadoop.util.ToolRunner;
+
+public class CrossProductTest extends Configured implements Tool {
+
+	public static class Map extends Mapper<Text, TextArrayWritable, Text, TextArrayWritable> {
+		public void map(Text key, TextArrayWritable value, Context context) throws IOException,
+				InterruptedException {
+			System.out.println("Map key = " + key);
+			System.out.println("Map value = " );
+
+			for (int i = 0; i < value.get().length; i++){
+				System.out.println("  " + value.get()[i]);
+			}
+
+			context.write(key, value);
+		}
+	}
+
+	public static class Reduce extends Reducer<Text, TextArrayWritable, Text, Text> {
+		public void reduce(Text key, Iterable<TextArrayWritable> values, Context context)
+				throws IOException, InterruptedException {
+
+			System.out.println("Reduce key = " + key);
+			context.write(key, f(values));
+		}
+
+		private Text f(Iterable<TextArrayWritable> values) {
+			StringBuilder sb = new StringBuilder();
+
+			// There should be only one array
+			TextArrayWritable arrayValue = values.iterator().next();
+
+			for (int i = 0; i < arrayValue.get().length; i++){
+				sb.append(arrayValue.get()[i] + "\nx");
+			}
+			String str = sb.toString();
+			if (str.contains("\nx")){
+				str = str.substring(0, sb.lastIndexOf("\nx") -1);
+			}
+			System.out.println("Result of function f(): " + str);
+
+			return new Text(str);
+		}
+	}
+
+	public int run(String[] args) throws Exception {
+
+		Configuration configuration = getConf();
+		configuration.set("taverna.datalinks", "A|X,B|Y");
+		System.out.println(configuration);
+		Job job = new Job(configuration);
+		job.setJarByClass(CrossProductTest.class);
+		job.setJobName("crossproduct");
+
+		job.setOutputKeyClass(Text.class);
+		job.setOutputValueClass(TextArrayWritable.class);
+
+		job.setMapperClass(Map.class);
+//		job.setCombinerClass(Reduce.class);
+		job.setReducerClass(Reduce.class);
+
+		job.setInputFormatClass(CrossProductInputFormat.class);
+		job.setOutputFormatClass(TextOutputFormat.class);
+
+		FileInputFormat.setInputPaths(job, new Path(args[0]));
+		System.out.println("Input dir: " + args[0]);
+		FileOutputFormat.setOutputPath(job, new Path(args[1]));
+		System.out.println("Output dir: " + args[1]);
+
+		boolean success = job.waitForCompletion(true);
+		return success ? 0 : 1;
+	}
+
+	public static void main(String[] args) throws Exception {
+		int ret = ToolRunner.run(new CrossProductTest(), args);
+		System.exit(ret);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/DotProductTest.java
----------------------------------------------------------------------
diff --git a/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/DotProductTest.java b/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/DotProductTest.java
new file mode 100644
index 0000000..2fa38e4
--- /dev/null
+++ b/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/DotProductTest.java
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (C) 2011 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 1 of
+ *  the License, or (at your option) any later version.
+ *
+ *  This program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.impl.hadoop;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.conf.Configured;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.io.LongWritable;
+import org.apache.hadoop.io.MapWritable;
+import org.apache.hadoop.io.Text;
+import org.apache.hadoop.mapreduce.Job;
+import org.apache.hadoop.mapreduce.Mapper;
+import org.apache.hadoop.mapreduce.Reducer;
+import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
+import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
+import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
+import org.apache.hadoop.util.Tool;
+import org.apache.hadoop.util.ToolRunner;
+
+public class DotProductTest extends Configured implements Tool {
+
+	public static class Map extends Mapper<LongWritable, MapWritable, LongWritable, MapWritable> {
+		public void map(LongWritable key, MapWritable value, Context context) throws IOException,
+				InterruptedException {
+			System.out.println("Map key = " + key);
+			System.out.println("Map value tag = " + value.get(new Text("tag")));
+			System.out.println("Map value record = " + value.get(new Text("record")));
+			context.write(key, value);
+		}
+	}
+
+	public static class Reduce extends Reducer<LongWritable, MapWritable, LongWritable, Text> {
+		public void reduce(LongWritable key, Iterable<MapWritable> values, Context context)
+				throws IOException, InterruptedException {
+
+			System.out.println("Reduce key = " + key);
+			context.write(key, f(values));
+			context.write(key, f(values));
+		}
+
+		private Text f(Iterable<MapWritable> values) {
+			StringBuilder sb = new StringBuilder();
+			for (MapWritable value : values) {
+				System.out.println("Reduce tag = " + value.get(new Text("tag")));
+				System.out.println("Reduce value = " + value.get(new Text("record")));
+				sb.append(value.get(new Text("record")) + " ");
+			}
+			return new Text(sb.toString());
+		}
+	}
+
+	public int run(String[] args) throws Exception {
+		java.util.Map datalinks = new HashMap();
+
+
+		Configuration configuration = getConf();
+		configuration.set("taverna.datalinks", "A|X,B|Y");
+		System.out.println(configuration);
+		Job job = new Job(configuration);
+		job.setJarByClass(DotProductTest.class);
+		job.setJobName("dotproduct");
+
+		job.setOutputKeyClass(LongWritable.class);
+		job.setOutputValueClass(MapWritable.class);
+
+		job.setMapperClass(Map.class);
+//		job.setCombinerClass(Reduce.class);
+		job.setReducerClass(Reduce.class);
+
+		job.setInputFormatClass(TavernaInputFormat.class);
+		job.setOutputFormatClass(TextOutputFormat.class);
+
+		FileInputFormat.setInputPaths(job, new Path(args[0]));
+		FileOutputFormat.setOutputPath(job, new Path(args[1]));
+
+		boolean success = job.waitForCompletion(true);
+		return success ? 0 : 1;
+	}
+
+	public static void main(String[] args) throws Exception {
+		int ret = ToolRunner.run(new DotProductTest(), args);
+		System.exit(ret);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/TavernaInputFormat.java
----------------------------------------------------------------------
diff --git a/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/TavernaInputFormat.java b/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/TavernaInputFormat.java
new file mode 100644
index 0000000..57b41c5
--- /dev/null
+++ b/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/TavernaInputFormat.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (C) 2011 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.impl.hadoop;
+
+import java.io.IOException;
+
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.io.LongWritable;
+import org.apache.hadoop.io.MapWritable;
+import org.apache.hadoop.mapreduce.InputSplit;
+import org.apache.hadoop.mapreduce.JobContext;
+import org.apache.hadoop.mapreduce.RecordReader;
+import org.apache.hadoop.mapreduce.TaskAttemptContext;
+import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
+
+/**
+ *
+ *
+ * @author David Withers
+ */
+public class TavernaInputFormat extends FileInputFormat<LongWritable, MapWritable> {
+
+	@Override
+	public RecordReader<LongWritable, MapWritable> createRecordReader(InputSplit split,
+			TaskAttemptContext context) throws IOException, InterruptedException {
+		return new TavernaRecordReader();
+	}
+
+	@Override
+	protected boolean isSplitable(JobContext context, Path filename) {
+		return false;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/TavernaInputSplit.java
----------------------------------------------------------------------
diff --git a/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/TavernaInputSplit.java b/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/TavernaInputSplit.java
new file mode 100644
index 0000000..d1bf0b3
--- /dev/null
+++ b/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/TavernaInputSplit.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (C) 2011 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.impl.hadoop;
+
+import java.io.IOException;
+import java.util.Map;
+
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.mapreduce.InputSplit;
+
+/**
+ *
+ *
+ * @author David Withers
+ */
+public class TavernaInputSplit extends InputSplit {
+	private int[] index;
+	private Map<String, Path> inputs;
+	private long length;
+	private String[] hosts;
+
+	public TavernaInputSplit(int[] index, Map<String, Path> inputs, long length, String[] hosts) {
+		this.index = index;
+		this.inputs = inputs;
+		this.length = length;
+		this.hosts = hosts;
+	}
+
+	public int[] getIndex() {
+		return index;
+	}
+
+	public Map<String, Path> getInputs() {
+		return inputs;
+	}
+
+	@Override
+	public long getLength() throws IOException, InterruptedException {
+		return length;
+	}
+
+	@Override
+	public String[] getLocations() throws IOException, InterruptedException {
+		if (hosts == null) {
+			return new String[] {};
+		} else {
+			return this.hosts;
+		}
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/TavernaMapper.java
----------------------------------------------------------------------
diff --git a/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/TavernaMapper.java b/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/TavernaMapper.java
new file mode 100644
index 0000000..fa5d1dc
--- /dev/null
+++ b/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/TavernaMapper.java
@@ -0,0 +1,75 @@
+package uk.org.taverna.platform.execution.impl.hadoop;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.hadoop.fs.FSDataInputStream;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.mapreduce.Reducer.Context;
+
+public class TavernaMapper extends org.apache.hadoop.mapreduce.Mapper<int[], Map<String, Path>, Object, Object> {
+
+	private org.apache.hadoop.mapreduce.Mapper.Context context;
+
+	@Override
+	protected void setup(Context context) throws IOException,
+			InterruptedException {
+		this.context = context;
+	}
+	
+	@Override
+	protected void map(int[] key, Map<String, Path> value, 
+              Context context) throws IOException, InterruptedException {
+		
+		// Value contains a map of input ports to data values on those ports 
+		// (i.e. file paths to data on the input ports) 
+
+		
+		// Get the activity and invoke it with the passed inputs per port
+//		
+//		String activityClassName = context.getConfiguration().get("taverna.activity.class");
+//		String activityConfigurationXML = context.getConfiguration().get("taverna.activity.configuration");
+//	
+//	    ClassLoader classLoader = this.getClass().getClassLoader();
+//	    Class<?> activityClass = null;
+//	    AbstractAsynchronousActivity<?> activity = null;
+//	    try {
+//	        activityClass = classLoader.loadClass(activityClassName);
+//	        activity = (AbstractAsynchronousActivity<?>) activityClass.newInstance();
+//	    } catch (ClassNotFoundException e) {
+//			// TODO Auto-generated catch block
+//	        e.printStackTrace();
+//	    } catch (InstantiationException e) {
+//			// TODO Auto-generated catch block
+//			e.printStackTrace();
+//		} catch (IllegalAccessException e) {
+//			// TODO Auto-generated catch block
+//			e.printStackTrace();
+//		}
+//	    
+//	    activity.configure(activityConfigurationXML);
+//	    activity.executeAsynch(data, callback);
+
+		System.out.println("Index: " + key);
+
+		// Input port names
+		Iterator<String> iterator = value.keySet().iterator();
+		while(iterator.hasNext()){
+			String inputPortName = iterator.next();
+			// Simply read values from input files and concatenate them
+			Path inputFilePath = value.get(inputPortName);
+			FSDataInputStream fileInputStream = inputFilePath.getFileSystem(null).open(inputFilePath);
+			//fileInputStream.
+			System.out.println("Input port: " + inputPortName + ". Input value: "+ inputFilePath +".");
+		}
+		
+		// Map of output ports to data values on those ports 
+		// (i.e. file paths to data on the output ports)
+		Map<String, Path> outputValue = new HashMap<String, Path>();
+		context.write(key, outputValue);
+	}
+	  
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/TavernaRecordReader.java
----------------------------------------------------------------------
diff --git a/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/TavernaRecordReader.java b/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/TavernaRecordReader.java
new file mode 100644
index 0000000..190d91a
--- /dev/null
+++ b/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/TavernaRecordReader.java
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (C) 2011 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.impl.hadoop;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.io.LongWritable;
+import org.apache.hadoop.io.MapWritable;
+import org.apache.hadoop.io.Text;
+import org.apache.hadoop.mapreduce.InputSplit;
+import org.apache.hadoop.mapreduce.RecordReader;
+import org.apache.hadoop.mapreduce.TaskAttemptContext;
+import org.apache.hadoop.mapreduce.lib.input.FileSplit;
+
+/**
+ *
+ *
+ * @author David Withers
+ */
+public class TavernaRecordReader extends RecordReader<LongWritable, MapWritable> {
+
+	private FileSplit fileSplit;
+	private String recordName;
+	private FileStatus[] files;
+	private int index = -1;
+	private Map<String, String> datalinks;
+
+	@Override
+	public void initialize(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException {
+		fileSplit = (FileSplit) split;
+		Path path = fileSplit.getPath();
+		recordName = path.getName();
+		files = path.getFileSystem(context.getConfiguration()).listStatus(path);
+		setDatalinks(context);
+	}
+
+	/**
+	 * @param context
+	 */
+	private void setDatalinks(TaskAttemptContext context) {
+		datalinks = new HashMap<String, String>();
+		String datalinkConfig = context.getConfiguration().get("taverna.datalinks");
+		if (datalinkConfig != null) {
+			String[] datalinksSplit = datalinkConfig.split(",");
+			for (String datalink : datalinksSplit) {
+				String[] split = datalink.split("\\|");
+				if (split.length == 2) {
+					datalinks.put(split[0], split[1]);
+				}
+			}
+		}
+	}
+
+	@Override
+	public boolean nextKeyValue() throws IOException, InterruptedException {
+		index++;
+		return index < files.length;
+	}
+
+	@Override
+	public LongWritable getCurrentKey() throws IOException, InterruptedException {
+		return new LongWritable(Long.valueOf(files[index].getPath().getName()));
+	}
+
+	@Override
+	public MapWritable getCurrentValue() throws IOException, InterruptedException {
+		MapWritable mapWritable = new MapWritable();
+		mapWritable.put(new Text("tag"), new Text(datalinks.get(recordName)));
+		mapWritable.put(new Text("record"), new Text(files[index].getPath().toString()));
+		return mapWritable;
+	}
+
+	@Override
+	public float getProgress() throws IOException, InterruptedException {
+		return files.length == 0 ? 1 : (index + 1) / files.length;
+	}
+
+	@Override
+	public void close() throws IOException {
+
+	}
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/TavernaReducer.java
----------------------------------------------------------------------
diff --git a/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/TavernaReducer.java b/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/TavernaReducer.java
new file mode 100644
index 0000000..11f85dd
--- /dev/null
+++ b/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/TavernaReducer.java
@@ -0,0 +1,24 @@
+package uk.org.taverna.platform.execution.impl.hadoop;
+
+import java.io.IOException;
+import java.util.Map;
+
+import org.apache.hadoop.fs.Path;
+
+public class TavernaReducer extends
+		org.apache.hadoop.mapreduce.Reducer<int[], Map<String, Path>, Object, Object> {
+
+	private Context context;
+
+	@Override
+	protected void setup(Context context) throws IOException,
+			InterruptedException {
+		this.context = context;
+	}
+
+	@Override
+	protected void reduce(int[] key, Iterable<Map<String, Path>> values,
+			Context context) throws IOException, InterruptedException {
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/Test.java
----------------------------------------------------------------------
diff --git a/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/Test.java b/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/Test.java
new file mode 100644
index 0000000..65a75d8
--- /dev/null
+++ b/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/Test.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (C) 2011 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.impl.hadoop;
+
+import java.util.Map;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.conf.Configured;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.mapreduce.Job;
+import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
+import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
+import org.apache.hadoop.util.Tool;
+import org.apache.hadoop.util.ToolRunner;
+
+/**
+ *
+ *
+ * @author David Withers
+ */
+public class Test extends Configured implements Tool {
+
+	@Override
+	public int run(String[] args) throws Exception {
+		Configuration configuration = getConf();
+		Job job = new Job(configuration);
+		job.setJarByClass(Test.class);
+		job.setJobName("wordcount");
+
+		job.setOutputKeyClass(int[].class);
+		job.setOutputValueClass(Map.class);
+
+		job.setMapperClass(TavernaMapper.class);
+//		job.setCombinerClass(Reduce.class);
+		job.setReducerClass(TavernaReducer.class);
+
+		job.setInputFormatClass(TavernaInputFormat.class);
+		job.setOutputFormatClass(TextOutputFormat.class);
+
+		TavernaInputFormat.setInputPaths(job, new Path(args[0]));
+		FileOutputFormat.setOutputPath(job, new Path(args[1]));
+
+		boolean success = job.waitForCompletion(true);
+		return success ? 0 : 1;
+	}
+
+	public static void main(String[] args) throws Exception {
+		int ret = ToolRunner.run(new Test(), args);
+		System.exit(ret);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/TextArrayWritable.java
----------------------------------------------------------------------
diff --git a/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/TextArrayWritable.java b/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/TextArrayWritable.java
new file mode 100644
index 0000000..1b64c77
--- /dev/null
+++ b/taverna-execution-hadoop/src/main/java/uk/org/taverna/platform/execution/impl/hadoop/TextArrayWritable.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (C) 2011 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 1 of
+ *  the License, or (at your option) any later version.
+ *
+ *  This program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.impl.hadoop;
+
+import org.apache.hadoop.io.ArrayWritable;
+import org.apache.hadoop.io.Text;
+
+public class TextArrayWritable extends ArrayWritable {
+	public TextArrayWritable() {
+		super(Text.class);
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-execution-impl/pom.xml b/taverna-execution-impl/pom.xml
new file mode 100644
index 0000000..ec7a6b0
--- /dev/null
+++ b/taverna-execution-impl/pom.xml
@@ -0,0 +1,42 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.taverna.engine</groupId>
+		<artifactId>taverna-engine</artifactId>
+		<version>3.1.0-incubating-SNAPSHOT</version>
+	</parent>
+	<artifactId>taverna-execution-impl</artifactId>
+	<packaging>bundle</packaging>
+	<name>Apache Taverna Platform Execution Service Implementation</name>
+	<description>A Service for executing Taverna workflows</description>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-bundle-plugin</artifactId>
+				<configuration>
+					<instructions>
+						<Import-Package>uk.org.taverna.platform.execution.api;provide:=true,*</Import-Package>
+					</instructions>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+	<dependencies>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-execution-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.language</groupId>
+			<artifactId>taverna-scufl2-api</artifactId>
+			<version>${taverna.language.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.language</groupId>
+			<artifactId>taverna-databundle</artifactId>
+			<version>${taverna.language.version}</version>
+		</dependency>
+	</dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-impl/src/main/java/uk/org/taverna/platform/execution/impl/ExecutionEnvironmentServiceImpl.java
----------------------------------------------------------------------
diff --git a/taverna-execution-impl/src/main/java/uk/org/taverna/platform/execution/impl/ExecutionEnvironmentServiceImpl.java b/taverna-execution-impl/src/main/java/uk/org/taverna/platform/execution/impl/ExecutionEnvironmentServiceImpl.java
new file mode 100644
index 0000000..13eeec2
--- /dev/null
+++ b/taverna-execution-impl/src/main/java/uk/org/taverna/platform/execution/impl/ExecutionEnvironmentServiceImpl.java
@@ -0,0 +1,354 @@
+/*******************************************************************************
+ * Copyright (C) 2011 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.impl;
+
+import java.net.URI;
+import java.text.MessageFormat;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Logger;
+
+import uk.org.taverna.platform.capability.api.ActivityConfigurationException;
+import uk.org.taverna.platform.capability.api.ActivityNotFoundException;
+import uk.org.taverna.platform.capability.api.DispatchLayerConfigurationException;
+import uk.org.taverna.platform.capability.api.DispatchLayerNotFoundException;
+import uk.org.taverna.platform.execution.api.ExecutionEnvironment;
+import uk.org.taverna.platform.execution.api.ExecutionEnvironmentService;
+import uk.org.taverna.platform.execution.api.ExecutionService;
+import uk.org.taverna.scufl2.api.activity.Activity;
+import uk.org.taverna.scufl2.api.common.NamedSet;
+import uk.org.taverna.scufl2.api.common.Scufl2Tools;
+import uk.org.taverna.scufl2.api.configurations.Configuration;
+import uk.org.taverna.scufl2.api.core.Processor;
+import uk.org.taverna.scufl2.api.profiles.ProcessorBinding;
+import uk.org.taverna.scufl2.api.profiles.Profile;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+/**
+ * Implementation of the ExecutionEnvironmentService.
+ *
+ * @author David Withers
+ */
+public class ExecutionEnvironmentServiceImpl implements ExecutionEnvironmentService {
+	private static final Logger logger = Logger.getLogger(ExecutionEnvironmentServiceImpl.class.getName());
+
+	@SuppressWarnings("unused")
+	private final Scufl2Tools scufl2Tools = new Scufl2Tools();
+	private Set<ExecutionService> executionServices;
+
+	@Override
+	public Set<ExecutionEnvironment> getExecutionEnvironments() {
+		Set<ExecutionEnvironment> executionEnvironments = new HashSet<>();
+		for (ExecutionService executionService : executionServices)
+			executionEnvironments.addAll(executionService
+					.getExecutionEnvironments());
+		return executionEnvironments;
+	}
+
+	@Override
+	public Set<ExecutionEnvironment> getExecutionEnvironments(Profile profile) {
+		Set<ExecutionEnvironment> validExecutionEnvironments = new HashSet<>();
+		for (ExecutionEnvironment executionEnvironment : getExecutionEnvironments())
+			if (isValidExecutionEnvironment(executionEnvironment, profile))
+				validExecutionEnvironments.add(executionEnvironment);
+		return validExecutionEnvironments;
+	}
+
+	/**
+	 * Sets the ExecutionServices that will be used to find ExecutionEnvironments.
+	 *
+	 * @param executionServices
+	 *            the ExecutionServices that will be used to find ExecutionEnvironments
+	 */
+	public void setExecutionServices(Set<ExecutionService> executionServices) {
+		this.executionServices = executionServices;
+	}
+
+	/**
+	 * @param executionEnvironment
+	 * @param profile
+	 * @return
+	 */
+	private boolean isValidExecutionEnvironment(ExecutionEnvironment executionEnvironment,
+			Profile profile) {
+		NamedSet<ProcessorBinding> processorBindings = profile.getProcessorBindings();
+		for (ProcessorBinding processorBinding : processorBindings) {
+			Activity activity = processorBinding.getBoundActivity();
+			if (!executionEnvironment.activityExists(activity.getType())) {
+				logger.fine(MessageFormat.format("{0} does not contain activity {1}",
+						executionEnvironment.getName(), activity.getType()));
+				return false;
+			}
+			Configuration activityConfiguration = activity.getConfiguration();
+			if (!isValidActivityConfiguration(executionEnvironment, activityConfiguration, activity)) {
+				logger.fine(MessageFormat.format("Invalid activity configuration for {1} in {0}",
+						executionEnvironment.getName(), activity.getType()));
+				return false;
+			}
+			@SuppressWarnings("unused")
+			Processor processor = processorBinding.getBoundProcessor();
+			// TODO check that environment has required dispatch layers for processor configuration
+//			for (DispatchStackLayer dispatchStackLayer : processor.getDispatchStack()) {
+//				if (!executionEnvironment.dispatchLayerExists(dispatchStackLayer
+//						.getType())) {
+//					logger.fine(MessageFormat.format("{0} does not contain dispatch layer {1}",
+//							executionEnvironment.getName(),
+//							dispatchStackLayer.getType()));
+//					return false;
+//				}
+//
+//				List<Configuration> dispatchLayerConfigurations = scufl2Tools.configurationsFor(dispatchStackLayer, profile);
+//				if (dispatchLayerConfigurations.size() > 1) {
+//					logger.fine(MessageFormat.format("{0} contains multiple configurations for dispatch layer {1}",
+//							executionEnvironment.getName(),
+//							dispatchStackLayer.getType()));
+//				} else if (dispatchLayerConfigurations.size() == 1) {
+//					if (!isValidDispatchLayerConfiguration(executionEnvironment, dispatchLayerConfigurations.get(0), dispatchStackLayer)) {
+//						logger.fine(MessageFormat.format("Invalid dispatch layer configuration for {1} in {0}",
+//								executionEnvironment.getName(), dispatchStackLayer.getType()));
+//						return false;
+//					}
+//				}
+//			}
+		}
+		return true;
+	}
+
+	private boolean isValidActivityConfiguration(ExecutionEnvironment executionEnvironment,
+			Configuration configuration, Activity activity) {
+		try {
+			configuration.getJson();
+			configuration.getJsonSchema();
+			@SuppressWarnings("unused")
+			JsonNode environmentSchema = executionEnvironment.getActivityConfigurationSchema(activity.getType());
+			// TODO validate against schema
+		} catch (ActivityNotFoundException e) {
+			logger.fine(MessageFormat.format("{0} does not contain activity {1}",
+					executionEnvironment.getName(), activity.getType()));
+			return false;
+		} catch (ActivityConfigurationException e) {
+			logger.fine(MessageFormat.format("Configuration for {1} is incorrect in {0}",
+					executionEnvironment.getName(), activity.getType()));
+			return false;
+		}
+		return true;
+	}
+
+	@SuppressWarnings("unused")
+	private boolean isValidDispatchLayerConfiguration(ExecutionEnvironment executionEnvironment,
+			Configuration configuration, URI dispatchLayerType) {
+		try {
+			JsonNode environmentSchema = executionEnvironment.getDispatchLayerConfigurationSchema(dispatchLayerType);
+			// TODO validate against schema
+		} catch (DispatchLayerNotFoundException e) {
+			logger.fine(MessageFormat.format("{0} does not contain dispatch layer {1}",
+					executionEnvironment.getName(), dispatchLayerType));
+			return false;
+		} catch (DispatchLayerConfigurationException e) {
+			logger.fine(MessageFormat.format("Configuration for {1} is incorrect in {0}",
+					executionEnvironment.getName(), dispatchLayerType));
+			return false;
+		}
+		return true;
+	}
+
+//	/**
+//	 * @param propertyResourceDefinition
+//	 * @param propertyResource
+//	 * @return
+//	 */
+//	private boolean isValidPropertyResource(Configuration configuration,
+//			PropertyResourceDefinition propertyResourceDefinition, PropertyResource propertyResource) {
+//		if (!propertyResourceDefinition.getTypeURI().equals(propertyResource.getTypeURI())) {
+//			logger.fine(MessageFormat.format(
+//					"Property type {0} does not equal property definition type {1}",
+//					propertyResource.getTypeURI(), propertyResourceDefinition.getTypeURI()));
+//			return false;
+//		}
+//		List<PropertyDefinition> propertyDefinitions = propertyResourceDefinition
+//				.getPropertyDefinitions();
+//		Map<URI, SortedSet<PropertyObject>> properties = propertyResource.getProperties();
+//		for (PropertyDefinition propertyDefinition : propertyDefinitions) {
+//			SortedSet<PropertyObject> propertySet = properties.get(propertyDefinition
+//					.getPredicate());
+//			if (propertySet == null) {
+//				if (propertyDefinition.isRequired()) {
+//					logger.fine(MessageFormat.format("Required property {0} is missing",
+//							propertyDefinition.getPredicate()));
+//					return false;
+//				}
+//			} else {
+//				if (propertySet.size() == 0 && propertyDefinition.isRequired()) {
+//					logger.fine(MessageFormat.format("Required property {0} is missing",
+//							propertyDefinition.getPredicate()));
+//					return false;
+//				}
+//				if (propertySet.size() > 1 && !propertyDefinition.isMultiple()) {
+//					logger.fine(MessageFormat.format(
+//							"{0} properties found for singleton property {1}", propertySet.size(),
+//							propertyDefinition.getPredicate()));
+//					return false;
+//				}
+//				if (propertySet.size() > 1 && propertyDefinition.isMultiple() && propertyDefinition.isOrdered()) {
+//					logger.fine(MessageFormat.format(
+//							"{0} property lists found for property {1}", propertySet.size(),
+//							propertyDefinition.getPredicate()));
+//					return false;
+//				}
+//				for (PropertyObject property : propertySet) {
+//					if (propertyDefinition.isMultiple() && propertyDefinition.isOrdered()) {
+//						if (property instanceof PropertyList) {
+//							PropertyList propertyList = (PropertyList) property;
+//							for (PropertyObject propertyObject : propertyList) {
+//								if (!isValidProperty(configuration, propertyDefinition, propertyObject)) {
+//									logger.fine(MessageFormat.format("Property {0} is invalid",
+//											propertyDefinition.getPredicate()));
+//									return false;
+//								}
+//							}
+//						}
+//
+//					} else if (!isValidProperty(configuration, propertyDefinition, property)) {
+//						logger.fine(MessageFormat.format("Property {0} is invalid",
+//								propertyDefinition.getPredicate()));
+//						return false;
+//					}
+//				}
+//			}
+//		}
+//		return true;
+//	}
+//
+//	/**
+//	 * @param propertyDefinition
+//	 * @param property
+//	 * @return
+//	 */
+//	private boolean isValidProperty(Configuration configuration,
+//			PropertyDefinition propertyDefinition, PropertyObject property) {
+//		if (propertyDefinition instanceof PropertyLiteralDefinition) {
+//			if (property instanceof PropertyLiteral) {
+//				PropertyLiteralDefinition propertyLiteralDefinition = (PropertyLiteralDefinition) propertyDefinition;
+//				PropertyLiteral propertyLiteral = (PropertyLiteral) property;
+//				if (!propertyLiteral.getLiteralType().equals(
+//						propertyLiteralDefinition.getLiteralType())) {
+//					logger.fine(MessageFormat.format(
+//							"Property type {0} does not equal property definition type {1}",
+//							propertyLiteral.getLiteralType(),
+//							propertyLiteralDefinition.getLiteralType()));
+//					return false;
+//				}
+//				LinkedHashSet<String> options = propertyLiteralDefinition.getOptions();
+//				if (options != null && options.size() > 0) {
+//					if (!options.contains(propertyLiteral.getLiteralValue())) {
+//						logger.fine(MessageFormat.format("Property value {0} is not permitted",
+//								propertyLiteral.getLiteralValue()));
+//						return false;
+//					}
+//				}
+//			} else {
+//				logger.fine(MessageFormat.format("Expected a PropertyLiteral but got a {0}",
+//						property.getClass().getSimpleName()));
+//				return false;
+//			}
+//		} else if (propertyDefinition instanceof PropertyReferenceDefinition) {
+//			if (property instanceof PropertyReference) {
+//				PropertyReferenceDefinition propertyReferenceDefinition = (PropertyReferenceDefinition) propertyDefinition;
+//				PropertyReference propertyReference = (PropertyReference) property;
+//				LinkedHashSet<URI> options = propertyReferenceDefinition.getOptions();
+//				if (options != null && options.size() > 0) {
+//					if (!options.contains(propertyReference.getResourceURI())) {
+//						logger.fine(MessageFormat.format("Property value {0} is not permitted",
+//								propertyReference.getResourceURI()));
+//						return false;
+//					}
+//				}
+//			} else {
+//				logger.fine(MessageFormat.format("Expected a PropertyReference but got a {0}",
+//						property.getClass().getSimpleName()));
+//				return false;
+//			}
+//		} else if (propertyDefinition instanceof PropertyResourceDefinition) {
+//			if (property instanceof PropertyResource) {
+//				PropertyResourceDefinition propertyResourceDefinition = (PropertyResourceDefinition) propertyDefinition;
+//				PropertyResource propertyResource = (PropertyResource) property;
+//				return isValidPropertyResource(configuration, propertyResourceDefinition,
+//						propertyResource);
+//			} else if (property instanceof PropertyReference) {
+//				// special cases where a PropertyResource is actually a reference to a WorkflowBundle component
+//				PropertyReference propertyReference = (PropertyReference) property;
+//				WorkflowBundle workflowBundle = scufl2Tools.findParent(WorkflowBundle.class,
+//						configuration);
+//				URI configUri = uriTools.uriForBean(configuration);
+//				URI referenceUri = configUri.resolve(propertyReference.getResourceURI());
+//				if (workflowBundle != null) {
+//					URI predicate = propertyDefinition.getPredicate();
+//					WorkflowBean workflowBean = uriTools.resolveUri(referenceUri, workflowBundle);
+//					if (workflowBean == null) {
+//						logger.fine(MessageFormat.format(
+//								"Cannot resolve {0} in WorkflowBundle {1}",
+//								propertyReference.getResourceURI(), workflowBundle.getName()));
+//					}
+//					if (predicate.equals(SCUFL2.resolve("#definesInputPort"))) {
+//						if (workflowBean == null) {
+//							return false;
+//						}
+//						if (!(workflowBean instanceof InputActivityPort)) {
+//							logger.fine(MessageFormat.format(
+//									"{0} resolved to a {1}, expected a InputActivityPort",
+//									propertyReference.getResourceURI(), workflowBean.getClass()
+//											.getSimpleName()));
+//							return false;
+//						}
+//					} else if (predicate.equals(SCUFL2.resolve("#definesOutputPort"))) {
+//						if (workflowBean == null) {
+//							return false;
+//						}
+//						if (!(workflowBean instanceof OutputActivityPort)) {
+//							logger.fine(MessageFormat.format(
+//									"{0} resolved to a {1}, expected a OutputActivityPort",
+//									propertyReference.getResourceURI(), workflowBean.getClass()
+//											.getSimpleName()));
+//							return false;
+//						}
+//					} else {
+//						logger.fine(MessageFormat.format("Unexpected reference to {0}", predicate));
+//					}
+//				} else {
+//					logger.fine(MessageFormat
+//							.format("Cannot resolve reference to {0} because Configuration {1} not contained within a WorkflowBundle",
+//									referenceUri, configuration.getName()));
+//				}
+//			} else {
+//				logger.fine(MessageFormat.format("Expected a PropertyResource or PropertyReference but got a {0}",
+//						property.getClass().getSimpleName()));
+//				return false;
+//			}
+//		} else {
+//			logger.fine(MessageFormat.format("Unknown propery definition class {0}",
+//					propertyDefinition.getClass().getSimpleName()));
+//			return false;
+//		}
+//		return true;
+//	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-impl/src/main/resources/META-INF/spring/execution-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-execution-impl/src/main/resources/META-INF/spring/execution-context-osgi.xml b/taverna-execution-impl/src/main/resources/META-INF/spring/execution-context-osgi.xml
new file mode 100644
index 0000000..87eef58
--- /dev/null
+++ b/taverna-execution-impl/src/main/resources/META-INF/spring/execution-context-osgi.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans:beans xmlns="http://www.springframework.org/schema/osgi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:beans="http://www.springframework.org/schema/beans"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+                                 http://www.springframework.org/schema/beans/spring-beans.xsd
+                                 http://www.springframework.org/schema/osgi
+                                 http://www.springframework.org/schema/osgi/spring-osgi.xsd">
+
+	<service ref="executionEnvironmentService" interface="uk.org.taverna.platform.execution.api.ExecutionEnvironmentService" />
+
+	<set id="executionServices" interface="uk.org.taverna.platform.execution.api.ExecutionService" />
+
+</beans:beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-impl/src/main/resources/META-INF/spring/execution-context.xml
----------------------------------------------------------------------
diff --git a/taverna-execution-impl/src/main/resources/META-INF/spring/execution-context.xml b/taverna-execution-impl/src/main/resources/META-INF/spring/execution-context.xml
new file mode 100644
index 0000000..61f5107
--- /dev/null
+++ b/taverna-execution-impl/src/main/resources/META-INF/spring/execution-context.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+                           http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+	<bean id="executionEnvironmentService" class="uk.org.taverna.platform.execution.impl.ExecutionEnvironmentServiceImpl">
+		<property name="executionServices" ref="executionServices" />
+	</bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-local/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-execution-local/pom.xml b/taverna-execution-local/pom.xml
new file mode 100644
index 0000000..83eea60
--- /dev/null
+++ b/taverna-execution-local/pom.xml
@@ -0,0 +1,90 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.taverna.engine</groupId>
+		<artifactId>taverna-engine</artifactId>
+		<version>3.1.0-incubating-SNAPSHOT</version>
+	</parent>
+	<artifactId>taverna-execution-local</artifactId>
+	<packaging>bundle</packaging>
+	<name>Apache Taverna Platform Local Execution Service</name>
+	<description>An Execution Service for executing Taverna workflows using a local Taverna Dataflow Engine</description>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-bundle-plugin</artifactId>
+				<configuration>
+					<instructions>
+						<Import-Package>uk.org.taverna.platform.execution.api;provide:=true,*</Import-Package>
+					</instructions>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+	<dependencies>
+		<dependency>
+      <groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-capability-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+      <groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-execution-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+      <groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-report-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+      <groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-workflowmodel-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+      <groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-reference-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+      <groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-reference-types</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<!--
+		<dependency>
+      <groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-provenanceconnector</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		 -->
+		<dependency>
+      <groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-observer</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+      <groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-database-configuration-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.language</groupId>
+			<artifactId>taverna-scufl2-api</artifactId>
+			<version>${taverna.language.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.language</groupId>
+			<artifactId>taverna-databundle</artifactId>
+			<version>${taverna.language.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+      <version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecution.java
----------------------------------------------------------------------
diff --git a/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecution.java b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecution.java
new file mode 100644
index 0000000..e176d4d
--- /dev/null
+++ b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecution.java
@@ -0,0 +1,243 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.impl.local;
+
+import static java.util.logging.Level.SEVERE;
+import static uk.org.taverna.platform.execution.impl.local.T2ReferenceConverter.convertPathToObject;
+
+import java.io.IOException;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.logging.Logger;
+
+import net.sf.taverna.t2.facade.ResultListener;
+import net.sf.taverna.t2.facade.WorkflowInstanceFacade;
+import net.sf.taverna.t2.invocation.InvocationContext;
+import net.sf.taverna.t2.invocation.TokenOrderException;
+import net.sf.taverna.t2.invocation.WorkflowDataToken;
+import net.sf.taverna.t2.monitor.MonitorManager;
+import net.sf.taverna.t2.provenance.reporter.ProvenanceReporter;
+import net.sf.taverna.t2.reference.ReferenceService;
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.workflowmodel.Dataflow;
+import net.sf.taverna.t2.workflowmodel.DataflowInputPort;
+import net.sf.taverna.t2.workflowmodel.Edits;
+import net.sf.taverna.t2.workflowmodel.InvalidDataflowException;
+
+import org.purl.wf4ever.robundle.Bundle;
+
+import uk.org.taverna.databundle.DataBundles;
+import uk.org.taverna.platform.capability.api.ActivityService;
+import uk.org.taverna.platform.capability.api.DispatchLayerService;
+import uk.org.taverna.platform.execution.api.AbstractExecution;
+import uk.org.taverna.platform.execution.api.InvalidWorkflowException;
+import uk.org.taverna.platform.report.ActivityReport;
+import uk.org.taverna.platform.report.ProcessorReport;
+import uk.org.taverna.platform.report.WorkflowReport;
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+import uk.org.taverna.scufl2.api.core.Workflow;
+import uk.org.taverna.scufl2.api.profiles.Profile;
+
+/**
+ * An {@link uk.org.taverna.platform.execution.api.Execution Execution} for
+ * executing Taverna workflows on a local Taverna Dataflow Engine.
+ * 
+ * @author David Withers
+ */
+public class LocalExecution extends AbstractExecution implements ResultListener {
+
+	private static Logger logger = Logger.getLogger(LocalExecution.class
+			.getName());
+
+	private final WorkflowToDataflowMapper mapping;
+
+	private final WorkflowInstanceFacade facade;
+
+	private final LocalExecutionMonitor executionMonitor;
+
+	private final ReferenceService referenceService;
+
+	private final Map<String, DataflowInputPort> inputPorts = new HashMap<String, DataflowInputPort>();
+
+	/**
+	 * Constructs an Execution for executing Taverna workflows on a local
+	 * Taverna Dataflow Engine.
+	 * 
+	 * @param workflowBundle
+	 *            the <code>WorkflowBundle</code> containing the
+	 *            <code>Workflow</code>s required for execution
+	 * @param workflow
+	 *            the <code>Workflow</code> to execute
+	 * @param profile
+	 *            the <code>Profile</code> to use when executing the
+	 *            <code>Workflow</code>
+	 * @param dataBundle
+	 *            the <code>Bundle</code> containing the data values for the
+	 *            <code>Workflow</code>
+	 * @param referenceService
+	 *            the <code>ReferenceService</code> used to register inputs,
+	 *            outputs and intermediate values
+	 * @throws InvalidWorkflowException
+	 *             if the specified workflow is invalid
+	 */
+	public LocalExecution(WorkflowBundle workflowBundle, Workflow workflow,
+			Profile profile, Bundle dataBundle,
+			ReferenceService referenceService, Edits edits,
+			ActivityService activityService,
+			DispatchLayerService dispatchLayerService)
+			throws InvalidWorkflowException {
+		super(workflowBundle, workflow, profile, dataBundle);
+		this.referenceService = referenceService;
+		try {
+			mapping = new WorkflowToDataflowMapper(workflowBundle, profile,
+					edits, activityService, dispatchLayerService);
+			Dataflow dataflow = mapping.getDataflow(workflow);
+			for (DataflowInputPort dataflowInputPort : dataflow.getInputPorts())
+				inputPorts.put(dataflowInputPort.getName(), dataflowInputPort);
+			facade = edits.createWorkflowInstanceFacade(dataflow,
+					createContext(), "");
+			executionMonitor = new LocalExecutionMonitor(getWorkflowReport(),
+					getDataBundle(), mapping, facade.getIdentifier());
+		} catch (InvalidDataflowException e) {
+			throw new InvalidWorkflowException(e);
+		}
+	}
+
+	@Override
+	public void delete() {
+		cancel();
+	}
+
+	@Override
+	public void start() {
+		MonitorManager.getInstance().addObserver(executionMonitor);
+		/*
+		 * have to add a result listener otherwise facade doesn't record when
+		 * workflow is finished
+		 */
+		facade.addResultListener(this);
+		facade.fire();
+		try {
+			if (DataBundles.hasInputs(getDataBundle())) {
+				Path inputs = DataBundles.getInputs(getDataBundle());
+				for (Entry<String, DataflowInputPort> inputPort : inputPorts
+						.entrySet()) {
+					String portName = inputPort.getKey();
+					Path path = DataBundles.getPort(inputs, portName);
+					if (!DataBundles.isMissing(path)) {
+						T2Reference identifier = referenceService.register(
+								convertPathToObject(path), inputPort.getValue()
+										.getDepth(), true, null);
+						int[] index = new int[] {};
+						WorkflowDataToken token = new WorkflowDataToken("",
+								index, identifier, facade.getContext());
+						try {
+							facade.pushData(token, portName);
+						} catch (TokenOrderException e) {
+							logger.log(SEVERE, "Unable to push data for input "
+									+ portName, e);
+						}
+					}
+				}
+			}
+		} catch (IOException e) {
+			logger.log(SEVERE, "Error getting input data", e);
+		}
+	}
+
+	@Override
+	public void pause() {
+		facade.pauseWorkflowRun();
+	}
+
+	@Override
+	public void resume() {
+		facade.resumeWorkflowRun();
+	}
+
+	@Override
+	public void cancel() {
+		facade.cancelWorkflowRun();
+		facade.removeResultListener(this);
+		MonitorManager.getInstance().removeObserver(executionMonitor);
+	}
+
+	@Override
+	protected WorkflowReport createWorkflowReport(Workflow workflow) {
+		return new WorkflowReport(workflow);
+	}
+
+	@Override
+	public ProcessorReport createProcessorReport(
+			uk.org.taverna.scufl2.api.core.Processor processor) {
+		return new LocalProcessorReport(processor);
+	}
+
+	@Override
+	public ActivityReport createActivityReport(
+			uk.org.taverna.scufl2.api.activity.Activity activity) {
+		return new ActivityReport(activity);
+	}
+
+	private InvocationContext createContext() {
+		InvocationContext context = new InvocationContext() {
+			private List<Object> entities = Collections
+					.synchronizedList(new ArrayList<Object>());
+
+			@Override
+			public <T> List<T> getEntities(Class<T> entityType) {
+				List<T> entitiesOfType = new ArrayList<>();
+				synchronized (entities) {
+					for (Object entity : entities)
+						if (entityType.isInstance(entity))
+							entitiesOfType.add(entityType.cast(entity));
+				}
+				return entitiesOfType;
+			}
+
+			@Override
+			public void addEntity(Object entity) {
+				entities.add(entity);
+			}
+
+			@Override
+			public ReferenceService getReferenceService() {
+				return referenceService;
+			}
+
+			@Override
+			public ProvenanceReporter getProvenanceReporter() {
+				return null;
+			}
+
+		};
+		return context;
+	}
+
+	@Override
+	public void resultTokenProduced(WorkflowDataToken token, String portName) {
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionEnvironment.java
----------------------------------------------------------------------
diff --git a/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionEnvironment.java b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionEnvironment.java
new file mode 100644
index 0000000..674dcd1
--- /dev/null
+++ b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionEnvironment.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (C) 2011 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.impl.local;
+
+import java.net.URI;
+import java.util.Set;
+
+import uk.org.taverna.platform.capability.api.ActivityConfigurationException;
+import uk.org.taverna.platform.capability.api.ActivityNotFoundException;
+import uk.org.taverna.platform.capability.api.ActivityService;
+import uk.org.taverna.platform.capability.api.DispatchLayerConfigurationException;
+import uk.org.taverna.platform.capability.api.DispatchLayerNotFoundException;
+import uk.org.taverna.platform.capability.api.DispatchLayerService;
+import uk.org.taverna.platform.execution.api.AbstractExecutionEnvironment;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+/**
+ * Execution Environment for a local Taverna Dataflow Engine
+ *
+ * @author David Withers
+ */
+public class LocalExecutionEnvironment extends AbstractExecutionEnvironment {
+
+	private final ActivityService activityService;
+	private final DispatchLayerService dispatchLayerService;
+
+	public LocalExecutionEnvironment(LocalExecutionService localExecutionService,
+			ActivityService activityService, DispatchLayerService dispatchLayerService) {
+		super(LocalExecutionEnvironment.class.getName(), "Taverna Local Execution Environment",
+				"Execution Environment for a local Taverna Dataflow Engine", localExecutionService);
+		this.activityService = activityService;
+		this.dispatchLayerService = dispatchLayerService;
+	}
+
+	@Override
+	public Set<URI> getActivityTypes() {
+		return activityService.getActivityTypes();
+	}
+
+	@Override
+	public boolean activityExists(URI uri) {
+		return activityService.activityExists(uri);
+	}
+
+	@Override
+	public JsonNode getActivityConfigurationSchema(URI uri)
+			throws ActivityNotFoundException, ActivityConfigurationException {
+		return activityService.getActivityConfigurationSchema(uri);
+	}
+
+	@Override
+	public Set<URI> getDispatchLayerTypes() {
+		return dispatchLayerService.getDispatchLayerTypes();
+	}
+
+	@Override
+	public boolean dispatchLayerExists(URI uri) {
+		return dispatchLayerService.dispatchLayerExists(uri);
+	}
+
+	@Override
+	public JsonNode getDispatchLayerConfigurationSchema(URI uri)
+			throws DispatchLayerNotFoundException, DispatchLayerConfigurationException {
+		return dispatchLayerService.getDispatchLayerConfigurationSchema(uri);
+	}
+
+}


[07/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceService.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceService.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceService.java
new file mode 100644
index 0000000..ed52ecd
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceService.java
@@ -0,0 +1,294 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+import static org.springframework.transaction.annotation.Propagation.REQUIRED;
+import static org.springframework.transaction.annotation.Propagation.SUPPORTS;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * Top level access point to the reference manager for client code which is
+ * aware of references and error documents. Provides methods to store and
+ * retrieve instances of ReferenceSet, IdentifiedList&lt;T2Reference&gt; and
+ * ErrorDocument. Acts as an integration layer for the three sub-component
+ * service, providing in addition collection traversal and retrieval of lists of
+ * identified entities (ReferenceSet, IdentifiedList&lt;Identified&gt; and
+ * ErrorDocument) from a T2Reference identifying a list.
+ * <p>
+ * Also provides registration and retrieval logic for POJOs where supported by
+ * appropriate plug-in instances, these methods can be used by code which is not
+ * 'reference aware' to store and retrieve value types transparently.
+ * <p>
+ * Resolution of collections can happen at three different levels:
+ * <ol>
+ * <li>The embedded {@link ListService} resolves the collection ID to a list of
+ * child IDs, and doesn't traverse these children if they are themselves lists.
+ * Use the {@link #getListService()}.{@link ListService#getList(T2Reference)
+ * getList()} to call this method directly on the list service if you need this
+ * functionality, returning a list of {@link T2Reference}</li>
+ * <li>The {@link #resolveIdentifier(T2Reference, Set, ReferenceContext)
+ * resolveIdentifier} method in this service instead resolves to a fully
+ * realized collection of the entities which those IDs reference, and does
+ * recursively apply this to child lists, resulting in a nested collection
+ * structure where the leaf nodes are ReferenceSet and ErrorDocument instances
+ * and non-leaf are IdentifiedList of Identified (the super-interface for
+ * IdentifiedList, ReferenceSet and ErrorDocument). Use this method if you want
+ * to access the ExternalReferenceSPI and ErrorDocument entities directly
+ * because your code can act on a particular reference type - in general in
+ * these cases you would also be using the augmentation system to ensure that
+ * the required reference type was actually present in the collection structure.
+ * </li>
+ * <li>The third level of resolution is to render the identifier through
+ * {@link #renderIdentifier(T2Reference, Class, ReferenceContext)
+ * renderIdentifier} to a nested structure as in
+ * {@link #resolveIdentifier(T2Reference, Set, ReferenceContext)
+ * resolveIdentifier} but where the structure consists of POJOs of the specified
+ * type and lists or either list or the leaf type. This is used when your code
+ * is reference agnostic and just requires the values in an easy to consume
+ * fashion. Note that because this involves pulling the entire structure into
+ * memory it may not be suitable for large data, use with caution. This method
+ * will, unlike {@link #resolveIdentifier(T2Reference, Set, ReferenceContext)
+ * resolveIdentifier}, fail if the reference contains or is an error.</li>
+ * </ol>
+ * 
+ * @author Tom Oinn
+ */
+public interface ReferenceService {
+	/**
+	 * Perform recursive identifier resolution, building a collection structure
+	 * of Identified objects, any collection elements being IdentifiedLists of
+	 * Identified subclasses. If the id has depth 0 this will just return the
+	 * Identified to which that id refers.
+	 * 
+	 * @param id
+	 *            the T2Reference to resolve
+	 * @param ensureTypes
+	 *            a set of ExternalReferenceSPI classes, this is used to augment
+	 *            any resolved ReferenceSet instances to ensure that each one
+	 *            has at least one of the specified types. If augmentation is
+	 *            not required this can be set to null.
+	 * @param context
+	 *            the ReferenceContext to use to resolve this and any
+	 *            recursively resolved identifiers <br/>
+	 *            If null the implementation should insert a new empty context
+	 *            and proceed.
+	 * @return fully resolved Identified subclass - this is either a (recursive)
+	 *         IdentifiedList of Identified, a ReferenceSet or an ErrorDocument
+	 * @throws ReferenceServiceException
+	 *             if any problems occur during resolution
+	 */
+	@Transactional(propagation = REQUIRED, readOnly = false)
+	Identified resolveIdentifier(T2Reference id,
+			Set<Class<ExternalReferenceSPI>> ensureTypes,
+			ReferenceContext context) throws ReferenceServiceException;
+
+	/**
+	 * As resolveIdentifier but using a callback object and returning
+	 * immediately
+	 * 
+	 * @throws ReferenceServiceException
+	 *             if anything goes wrong with the setup of the resolution job.
+	 *             Any exceptions during the resolution process itself are
+	 *             communicated through the callback object.
+	 */
+	@Transactional(propagation = REQUIRED, readOnly = false)
+	void resolveIdentifierAsynch(T2Reference id,
+			Set<Class<ExternalReferenceSPI>> ensureTypes,
+			ReferenceContext context,
+			ReferenceServiceResolutionCallback callback)
+			throws ReferenceServiceException;
+
+	/**
+	 * Resolve the given identifier, building a POJO structure where the
+	 * non-list items are of the desired class. This makes of any external
+	 * references that can directly expose the appropriate object type, then, if
+	 * none are present in a given reference set, it attempts to locate a POJO
+	 * builder and uses the cheapest available reference to get an InputStream
+	 * and build the target object. If no appropriate builder or embedded value
+	 * can be found the process throws ReferenceServiceException, it also does
+	 * this if any error occurs during retrieval of a (potentially nested)
+	 * identifier.
+	 * <p>
+	 * This method will return a collection structure mirroring that of the
+	 * specified T2Reference, client code should use T2Reference.getDepth() to
+	 * determine the depth of this structure; a reference with depth of 0 means
+	 * that the object returned is of the specified class, one of depth 1 is a
+	 * list of this class and so on.
+	 * <p>
+	 * If the T2Reference contains or is an error this method will not retrieve
+	 * it, and instead throws ReferenceServiceException
+	 * 
+	 * @see StreamToValueConverterSPI
+	 * @see ValueCarryingExternalReference
+	 * @param id
+	 *            the T2Reference to render to a POJO
+	 * @param leafClass
+	 *            the java class for leaves in the resulting POJO structure
+	 * @param context
+	 *            a reference context, potentially used if required by the
+	 *            openStream methods of ExternalReferenceSPI implementations
+	 *            used as sources for the POJO construction <br/>
+	 *            If null the implementation should insert a new empty context
+	 *            and proceed.
+	 * @return a java structure as defined above
+	 * @throws ReferenceServiceException
+	 *             if anything fails during this process
+	 */
+	Object renderIdentifier(T2Reference id, Class<?> leafClass,
+			ReferenceContext context) throws ReferenceServiceException;
+
+	/**
+	 * The top level registration method is used to register either as yet
+	 * unregistered ErrorDocuments and ReferenceSets (if these are passed in and
+	 * already have an identifier this call does nothing) and arbitrarily nested
+	 * Lists of the same. In addition any ExternalReferenceSPI instances found
+	 * will be wrapped in a single item ReferenceSet and registered, and any
+	 * Throwables will be wrapped in an ErrorDocument and registered. Lists will
+	 * be converted to IdentifiedList&lt;T2Reference&gt; and registered if all
+	 * children can be (or were already) appropriately named.
+	 * <p>
+	 * This method is only valid on parameters of the following type :
+	 * <ol>
+	 * <li>{@link T2Reference} - returned immediately as itself, this is needed
+	 * because it means we can register lists of existing T2Reference</li>
+	 * <li>{@link ReferenceSet} - registered if not already registered,
+	 * otherwise returns existing T2Reference</li>
+	 * <li>{@link ErrorDocument} - same behaviour as ReferenceSet</li>
+	 * <li>{@link ExternalReferenceSPI} - wrapped in ReferenceSet, registered
+	 * and ID returned</li>
+	 * <li>Throwable - wrapped in {@link ErrorDocument} with no message,
+	 * registered and ID returned</li>
+	 * <li>List - all children are first registered, if this succeeds the list
+	 * is itself registered as an {@link IdentifiedList} of {@link T2Reference}
+	 * and its reference returned.</li>
+	 * </ol>
+	 * The exception to this is if the useConvertorSPI parameter is set to true
+	 * - in this case any objects which do not match the above allowed list will
+	 * be run through any available ValueToReferenceConvertorSPI instances in
+	 * turn until one succeeds or all fail, which may result in the creation of
+	 * ExternalReferenceSPI instances. As these can be registered such objects
+	 * will not cause an exception to be thrown.
+	 * 
+	 * @see ValueToReferenceConverterSPI
+	 * @param o
+	 *            the object to register with the reference system, must comply
+	 *            with and will be interpreted as shown in the type list above.
+	 * @param targetDepth
+	 *            the depth of the top level object supplied. This is needed
+	 *            when registering empty collections and error documents,
+	 *            whether as top level types or as members of a collection
+	 *            within the top level type. If registering a collection this is
+	 *            the collection depth, so a List of ReferenceSchemeSPI would be
+	 *            depth 1. Failing to specify this correctly will result in
+	 *            serious problems downstream so be careful! We can't catch all
+	 *            potential problems in this method (although some errors will
+	 *            be trapped).
+	 * @param useConverterSPI
+	 *            whether to attempt to use the ValueToReferenceConvertorSPI
+	 *            registry (if defined and available) to map arbitrary objects
+	 *            to ExternalReferenceSPI instances on the fly. The registry of
+	 *            converters is generally injected into the implementation of
+	 *            this service.
+	 * @param context
+	 *            ReferenceContext to use if required by component services,
+	 *            this is most likely to be used by the object to reference
+	 *            converters if engaged. <br/>
+	 *            If null the implementation should insert a new empty context
+	 *            and proceed.
+	 * @return a T2Reference to the registered object
+	 * @throws ReferenceServiceException
+	 *             if the object type (or, for collections, the recursive type
+	 *             of its contents) is not in the allowed list or if a problem
+	 *             occurs during registration. Also thrown if attempting to use
+	 *             the converter SPI without an attached registry.
+	 */
+	@Transactional(propagation = REQUIRED, readOnly = false)
+	T2Reference register(Object o, int targetDepth, boolean useConverterSPI,
+			ReferenceContext context) throws ReferenceServiceException;
+
+	/**
+	 * Given a string representation of a T2Reference create a new T2Reference
+	 * with the correct depth etc.
+	 * 
+	 * @param reference
+	 * @return a new T2Reference parsed from the original
+	 */
+	T2Reference referenceFromString(String reference);
+
+	@Transactional(propagation = SUPPORTS, readOnly = false)
+	boolean delete(T2Reference reference) throws ReferenceServiceException;
+
+	@Transactional(propagation = SUPPORTS, readOnly = false)
+	boolean delete(List<T2Reference> references)
+			throws ReferenceServiceException;
+
+	@Transactional(propagation = SUPPORTS, readOnly = false)
+	void deleteReferencesForWorkflowRun(String workflowRunId)
+			throws ReferenceServiceException;
+
+	/**
+	 * Returns the {@link ErrorDocumentService} this ReferenceService uses, use
+	 * this when you need functionality from that service explicitly.
+	 */
+	ErrorDocumentService getErrorDocumentService();
+
+	/**
+	 * Returns the {@link ReferenceSetService} this ReferenceService uses, use
+	 * this when you need functionality from that service explicitly.
+	 */
+	ReferenceSetService getReferenceSetService();
+
+	/**
+	 * Returns the {@link ListService} this ReferenceService uses, use this when
+	 * you need functionality from that service explicitly.
+	 */
+	ListService getListService();
+
+	/**
+	 * Initiates a traversal of the specified t2reference, traversing to
+	 * whatever level of depth is required such that all identifiers returned
+	 * within the iterator have the specified depth. The context (i.e. the index
+	 * path from the originally specified reference to each reference within the
+	 * iteration) is included through use of the ContextualizedT2Reference
+	 * wrapper class
+	 * 
+	 * @param source
+	 *            the T2Reference from which to traverse. In general this is the
+	 *            root of a collection structure.
+	 * @param desiredDepth
+	 *            the desired depth of all returned T2References, must be less
+	 *            than or equal to that of the source reference.
+	 * @throws ReferenceServiceException
+	 *             if unable to create the iterator for some reason. Note that
+	 *             implementations are free to lazily perform the iteration so
+	 *             this method may succeed but the iterator produced can fail
+	 *             when used. If the iterator fails it will do so by throwing
+	 *             one of the underlying sub-service exceptions.
+	 */
+	@Transactional(propagation = SUPPORTS, readOnly = true)
+	Iterator<ContextualizedT2Reference> traverseFrom(T2Reference source,
+			int desiredDepth);
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceServiceCacheProvider.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceServiceCacheProvider.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceServiceCacheProvider.java
new file mode 100644
index 0000000..56ebe4d
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceServiceCacheProvider.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+/**
+ * A simple interface to be implemented by data access object cache providers,
+ * intended to be used to inject cache implementations through AoP
+ * 
+ * @author Tom Oinn
+ */
+public interface ReferenceServiceCacheProvider {
+	/**
+	 * Called after an {@link Identified} has been written to the backing store,
+	 * either for the first time or after modification. In our model
+	 * {@link ReferenceSet} is the only {@link Identified} that is modifiable,
+	 * specifically only by the addition of {@link ExternalReferenceSPI}
+	 * instances to its reference set.
+	 * 
+	 * @param i
+	 *            the Identified written to the backing store
+	 */
+	void put(Identified i);
+
+	/**
+	 * Called before an attempt is made to retrieve an item from the backing
+	 * store
+	 * 
+	 * @param id
+	 *            the T2Reference of the item to retrieve
+	 * @return a cached item with matching {@link T2Reference}, or <tt>null</tt>
+	 *         if the cache does not contain that item
+	 */
+	Identified get(T2Reference id);
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceServiceException.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceServiceException.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceServiceException.java
new file mode 100644
index 0000000..25e1765
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceServiceException.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+/**
+ * Thrown by methods in the ReferenceService, used to wrap any underlying
+ * exceptions from lower layers.
+ * 
+ * @author Tom Oinn
+ */
+public class ReferenceServiceException extends RuntimeException {
+	private static final long serialVersionUID = -2607675495513408333L;
+
+	public ReferenceServiceException() {
+		//
+	}
+
+	public ReferenceServiceException(String message) {
+		super(message);
+	}
+
+	public ReferenceServiceException(Throwable cause) {
+		super(cause);
+	}
+
+	public ReferenceServiceException(String message, Throwable cause) {
+		super(message, cause);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceServiceResolutionCallback.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceServiceResolutionCallback.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceServiceResolutionCallback.java
new file mode 100644
index 0000000..3b67da0
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceServiceResolutionCallback.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+/**
+ * Used by the asynchronous form of the resolveIdentifier method in
+ * {@link ReferenceService}
+ * 
+ * @author Tom Oinn
+ */
+public interface ReferenceServiceResolutionCallback {
+	/**
+	 * Called when the resolution process has completed
+	 * 
+	 * @param result
+	 *            the Identified that corresponds to the {@link T2Reference}
+	 *            specified in the call to
+	 *            {@link ReferenceService#resolveIdentifierAsynch}
+	 */
+	void identifierResolved(Identified result);
+
+	/**
+	 * Called when the resolution process has failed
+	 * 
+	 * @param cause
+	 *            a ReferenceServiceException describing the failure
+	 */
+	void resolutionFailed(ReferenceServiceException cause);
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSet.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSet.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSet.java
new file mode 100644
index 0000000..5c82cee
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSet.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+import java.util.Set;
+
+/**
+ * A set of ExternalReferenceSPI instances, all of which point to the same (byte
+ * equivalent) data. The set is identified by a T2Reference. This interface is
+ * read-only, as are most of the interfaces in this package. Rather than
+ * modifying properties of the reference set directly the client code should use
+ * the reference manager functionality.
+ * <p>
+ * It is technically okay, but rather unhelpful, to have a ReferenceSet with no
+ * ExternalReferenceSPI implementations. In general this is a sign that
+ * something has gone wrong somewhere as the reference set will not be
+ * resolvable in any way, but it would still retain its unique identifier so
+ * there may be occasions where this is the desired behaviour.
+ * 
+ * @author Tom Oinn
+ */
+public interface ReferenceSet extends Identified {
+	/**
+	 * The reference set contains a set of ExternalReferenceSPI instances, all
+	 * of which point to byte equivalent data.
+	 * 
+	 * @return the set of references to external data
+	 */
+	Set<ExternalReferenceSPI> getExternalReferences();
+
+	/**
+	 * Get approximate size of the data pointed to by this ReferenceSet.
+	 */
+	Long getApproximateSizeInBytes();
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetAugmentationException.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetAugmentationException.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetAugmentationException.java
new file mode 100644
index 0000000..1922baa
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetAugmentationException.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+/**
+ * Thrown when the reference set augmentor is unable to provide at least one of
+ * the desired types for any reason.
+ * 
+ * @author Tom Oinn
+ */
+public class ReferenceSetAugmentationException extends RuntimeException {
+	private static final long serialVersionUID = -6156508424485682266L;
+
+	public ReferenceSetAugmentationException() {
+		//
+	}
+
+	public ReferenceSetAugmentationException(String message) {
+		super(message);
+	}
+
+	public ReferenceSetAugmentationException(Throwable cause) {
+		super(cause);
+	}
+
+	public ReferenceSetAugmentationException(String message, Throwable cause) {
+		super(message, cause);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetAugmentor.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetAugmentor.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetAugmentor.java
new file mode 100644
index 0000000..1dd2f92
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetAugmentor.java
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+import java.util.Set;
+
+/**
+ * Provides a framework to find and engage appropriate instances of
+ * {@link ExternalReferenceTranslatorSPI} and
+ * {@link ExternalReferenceBuilderSPI} to build external references from,
+ * respectively, other external references and from streams. These are then used
+ * to augment the contents of implementations of {@link ReferenceSet} with
+ * additional {@link ExternalReferenceSPI} implementations.
+ * <p>
+ * Methods in this interface throw the runtime exception
+ * {@link ReferenceSetAugmentationException} for all problems, other exceptions
+ * are wrapped in this type and re-thrown.
+ * 
+ * @author Tom Oinn
+ */
+public interface ReferenceSetAugmentor {
+	/**
+	 * Attempts to modify the supplied ReferenceSet such that it contains an
+	 * implementation of at least one of the ExternalReferenceSPI classes
+	 * specified. Uses the supplied context if required to build or translate
+	 * existing references within the reference set.
+	 * 
+	 * @param references
+	 *            reference set object to augment
+	 * @param targetReferenceTypes
+	 *            a set of Class objects, this method succeeds if it can create
+	 *            an instance of at least one of these pointing to the same data
+	 *            as the other external references in the supplied reference set
+	 * @param context
+	 *            a reference resolution context, potentially required for
+	 *            access to the existing references or for creation of the
+	 *            augmentations
+	 * @return a set of new ExternalReferenceSPI instances such that the union
+	 *         of this set with the pre-existing reference set satisfies the
+	 *         target reference constraint. It is the responsibility of the
+	 *         caller to re-integrate these references into the original
+	 *         ReferenceSet if so desired.
+	 * @throws ReferenceSetAugmentationException
+	 *             if a problem occurs either in configuration of the
+	 *             ReferenceSetAugmentor or in the augmentation process itself.
+	 *             Any other exception types are wrapped in this and re-thrown.
+	 */
+	Set<ExternalReferenceSPI> augmentReferenceSet(ReferenceSet references,
+			Set<Class<ExternalReferenceSPI>> targetReferenceTypes,
+			ReferenceContext context) throws ReferenceSetAugmentationException;
+
+	/**
+	 * As with {@link #augmentReferenceSet(ReferenceSet, Set, ReferenceContext)}
+	 * but called in an asynchronous fashion. Returns immediately and uses the
+	 * supplied instance of {@link ReferenceSetAugmentorCallback} to provide
+	 * either the augmented {@link ReferenceSet} or an exception indicating a
+	 * failure in the augmentation process.
+	 * 
+	 * @param callback
+	 *            callback object used to indicate failure or to return the
+	 *            modified reference set
+	 * @throws ReferenceSetAugmentationException
+	 *             if the ReferenceSetAugmentor is missing critical
+	 *             configuration. Exceptions that happen during augmentation or
+	 *             as a result of a failure to find an appropriate augmentation
+	 *             path are signalled by calls to the callback object, this
+	 *             method only throws the exception if it can't even try to do
+	 *             the augmentation for some reason.
+	 */
+	void augmentReferenceSetAsynch(ReferenceSet references,
+			Set<Class<ExternalReferenceSPI>> targetReferenceTypes,
+			ReferenceContext context, ReferenceSetAugmentorCallback callback)
+			throws ReferenceSetAugmentationException;
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetAugmentorCallback.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetAugmentorCallback.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetAugmentorCallback.java
new file mode 100644
index 0000000..8d03b45
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetAugmentorCallback.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+import java.util.Set;
+
+/**
+ * Callback interface used when augmenting a ReferenceSet in an asynchronous
+ * fashion through
+ * {@link ReferenceSetAugmentor#augmentReferenceSetAsynch(ReferenceSet, Set, ReferenceContext, ReferenceSetAugmentorCallback)
+ * augmentReferenceSetAsynch} in {@link ReferenceSetAugmentor}.
+ * 
+ * @author Tom Oinn
+ */
+public interface ReferenceSetAugmentorCallback {
+	/**
+	 * Called when the augmentation has succeeded
+	 * 
+	 * @param newReferences
+	 *            a set of ExternalReferenceSPI instances created during the
+	 *            augmentation process. It is the responsibility of the caller
+	 *            to re-integrate these back into the ReferenceSet used in the
+	 *            translation
+	 */
+	void augmentationCompleted(Set<ExternalReferenceSPI> newReferences);
+
+	/**
+	 * Called when the augmentation has failed for some reason
+	 * 
+	 * @param cause
+	 *            a {@link ReferenceSetAugmentationException} object describing
+	 *            the failure.
+	 */
+	void augmentationFailed(ReferenceSetAugmentationException cause);
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetDao.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetDao.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetDao.java
new file mode 100644
index 0000000..3c60e89
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetDao.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+import static org.springframework.transaction.annotation.Propagation.REQUIRED;
+import static org.springframework.transaction.annotation.Propagation.SUPPORTS;
+
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * Data Access Object interface for {@link ReferenceSet}. Used by the
+ * {@link ReferenceSetService} to store and retrieve implementations of
+ * reference set to and from the database. Client code should use the reference
+ * set service rather than using this Dao directly.
+ * <p>
+ * All methods throw DaoException, and nothing else. Where a deeper error is
+ * propagated it is wrapped in a DaoException and passed on to the caller.
+ * 
+ * @author Tom Oinn
+ */
+public interface ReferenceSetDao {
+	/**
+	 * Store the specified new reference set
+	 * 
+	 * @param rs
+	 *            a reference set, must not already exist in the database.
+	 * @throws DaoException
+	 *             if the entry already exists in the database or some other
+	 *             database related problem occurs
+	 */
+	@Transactional(propagation = REQUIRED, readOnly = false)
+	void store(ReferenceSet rs) throws DaoException;
+
+	/**
+	 * Update a pre-existing entry in the database
+	 * 
+	 * @param rs
+	 *            the reference set to update. This must already exist in the
+	 *            database
+	 * @throws DaoException
+	 */
+	@Transactional(propagation = REQUIRED, readOnly = false)
+	void update(ReferenceSet rs) throws DaoException;
+
+	/**
+	 * Fetch a reference set by id
+	 * 
+	 * @param ref
+	 *            the T2Reference to fetch
+	 * @return a retrieved ReferenceSet
+	 * @throws DaoException
+	 *             if the supplied reference is of the wrong type or if
+	 *             something goes wrong fetching the data or connecting to the
+	 *             database
+	 */
+	@Transactional(propagation = SUPPORTS, readOnly = true)
+	ReferenceSet get(T2Reference ref) throws DaoException;
+
+	@Transactional(propagation = SUPPORTS, readOnly = false)
+	boolean delete(ReferenceSet rs) throws DaoException;
+
+	@Transactional(propagation = SUPPORTS, readOnly = false)
+	void deleteReferenceSetsForWFRun(String workflowRunId) throws DaoException;
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetService.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetService.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetService.java
new file mode 100644
index 0000000..a574264
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetService.java
@@ -0,0 +1,181 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+import static org.springframework.transaction.annotation.Propagation.REQUIRED;
+import static org.springframework.transaction.annotation.Propagation.SUPPORTS;
+
+import java.util.Set;
+
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * Provides facilities to register sets of ExternalReferenceSPI implementations
+ * within the reference manager and to retrieve these sets by T2Reference either
+ * as stored or with translation support. In general applications should be
+ * using this interface (where only ReferenceSet functionality is required) or
+ * the support classes which in turn use this and the collection and error
+ * handling interfaces to present a unified view over the various components of
+ * the reference management system.
+ * 
+ * @author Tom Oinn
+ */
+@Transactional(propagation = SUPPORTS, readOnly = true)
+public interface ReferenceSetService {
+	/**
+	 * Register a set of {@link ExternalReferenceSPI} instances, all of which
+	 * should point to byte equivalent data, and return the newly created
+	 * {@link ReferenceSet}. This method blocks on the underlying store, but
+	 * guarantees that the returned value has been persisted.
+	 * <p>
+	 * The created references will be related with a workflow run id passed
+	 * through ReferenceContext so we can track all data referenced by a
+	 * specific run.
+	 * 
+	 * @param references
+	 *            a set of {@link ExternalReferenceSPI} implementations to
+	 *            register as a {@link ReferenceSet}
+	 * @return the registered {@link ReferenceSet}
+	 */
+	@Transactional(propagation = REQUIRED, readOnly = false)
+	ReferenceSet registerReferenceSet(Set<ExternalReferenceSPI> references,
+			ReferenceContext context) throws ReferenceSetServiceException;
+
+	/**
+	 * Get a previously registered {@link ReferenceSet} by {@link T2Reference}.
+	 * Note that this method blocks and may take some time to return in the case
+	 * of distributed reference managers; if this is likely to be an issue then
+	 * you should use the asynchronous form
+	 * {@link #getReferenceSetAsynch(T2Reference, ReferenceSetServiceCallback)
+	 * getReferenceSetAsynch} instead of this method.
+	 * 
+	 * @param id
+	 *            a {@link T2Reference} identifying a {@link ReferenceSet} to
+	 *            retrieve
+	 * @return the requested {@link ReferenceSet}
+	 */
+	ReferenceSet getReferenceSet(T2Reference id)
+			throws ReferenceSetServiceException;
+
+	/**
+	 * Functionality the same as {@link #getReferenceSet(T2Reference)
+	 * getReferenceSet} but in asynchronous mode, returning immediately and
+	 * using the supplied callback to communicate its results.
+	 * 
+	 * @param id
+	 *            a {@link T2Reference} identifying a {@link ReferenceSet} to
+	 *            retrieve
+	 * @param callback
+	 *            a {@link ReferenceSetServiceCallback} used to convey the
+	 *            results of the asynchronous call
+	 * @throws ReferenceSetServiceException
+	 *             if the reference set service is not correctly configured.
+	 *             Exceptions encountered when performing the asynchronous call
+	 *             are not returned here, for obvious reasons, and are instead
+	 *             messaged through the callback interface.
+	 */
+	void getReferenceSetAsynch(T2Reference id,
+			ReferenceSetServiceCallback callback)
+			throws ReferenceSetServiceException;
+
+	/**
+	 * Functionality the same as {@link #getReferenceSet(T2Reference)
+	 * getReferenceSet} but with the additional option to specify a set of
+	 * {@link ExternalReferenceSPI} classes. The reference set manager will
+	 * attempt to ensure that the returned {@link ReferenceSet} contains an
+	 * instance of at least one of the specified classes. This method blocks,
+	 * and may potentially incur both the remote lookup overhead of the simpler
+	 * version of this call and any translation logic. It is <em>strongly</em>
+	 * recommended that you do not use this version of the call and instead use
+	 * the asynchronous form
+	 * {@link #getReferenceSetWithAugmentationAsynch(T2Reference, Set, ReferenceContext, ReferenceSetServiceCallback)
+	 * getReferenceSetWithAugmentationAsynch} instead.
+	 * <p>
+	 * If the translation logic cannot provide at least one of the required
+	 * types this call will fail, even if the {@link ReferenceSet} requested is
+	 * otherwise available.
+	 * 
+	 * @param id
+	 *            a {@link T2Reference} identifying a {@link ReferenceSet} to
+	 *            retrieve
+	 * @param ensureTypes
+	 *            a set of {@link ExternalReferenceSPI} classes. The framework
+	 *            will attempt to ensure there is an instance of at least one of
+	 *            these classes in the returned {@link ReferenceSet}
+	 * @param context
+	 *            if translation of references is required the translation
+	 *            infrastructure will need information in this
+	 *            {@link ReferenceContext} parameter.
+	 *            <p>
+	 *            If null the implementation should insert a new empty context
+	 *            and proceed.
+	 * @return the requested {@link ReferenceSet}
+	 */
+	@Transactional(propagation = REQUIRED, readOnly = false)
+	ReferenceSet getReferenceSetWithAugmentation(T2Reference id,
+			Set<Class<ExternalReferenceSPI>> ensureTypes,
+			ReferenceContext context) throws ReferenceSetServiceException;
+
+	/**
+	 * Functionality as
+	 * {@link #getReferenceSetWithAugmentation(T2Reference, Set, ReferenceContext)
+	 * getReferenceSetWithAugmentation} but with the addition of a callback
+	 * interface to report the result or failure of the method.
+	 * 
+	 * @param id
+	 *            a {@link T2Reference} identifying a {@link ReferenceSet} to
+	 *            retrieve
+	 * @param ensureTypes
+	 *            a set of {@link ExternalReferenceSPI} classes. The framework
+	 *            will attempt to ensure there is an instance of at least one of
+	 *            these classes in the returned {@link ReferenceSet}
+	 * @param context
+	 *            if translation of references is required the translation
+	 *            infrastructure will need information in this
+	 *            {@link ReferenceContext} parameter.
+	 *            <p>
+	 *            If null the implementation should insert a new empty context
+	 *            and proceed.
+	 * @param callback
+	 *            a {@link ReferenceSetServiceCallback} used to convey the
+	 *            results of the asynchronous call *
+	 * @throws ReferenceSetServiceException
+	 *             if the reference set service is not correctly configured.
+	 *             Exceptions encountered when performing the asynchronous call
+	 *             are not returned here, for obvious reasons, and are instead
+	 *             messaged through the callback interface.
+	 */
+	@Transactional(propagation = REQUIRED, readOnly = false)
+	void getReferenceSetWithAugmentationAsynch(T2Reference id,
+			Set<Class<ExternalReferenceSPI>> ensureTypes,
+			ReferenceContext context, ReferenceSetServiceCallback callback)
+			throws ReferenceSetServiceException;
+
+	@Transactional(propagation = SUPPORTS, readOnly = false)
+	boolean delete(T2Reference reference) throws ReferenceServiceException;
+
+	/**
+	 * Delete all {@link ReferenceSet}S used by the specific workflow run.
+	 */
+	@Transactional(propagation = SUPPORTS, readOnly = false)
+	void deleteReferenceSetsForWorkflowRun(String workflowRunId)
+			throws ReferenceServiceException;
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetServiceCallback.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetServiceCallback.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetServiceCallback.java
new file mode 100644
index 0000000..a75eb1f
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetServiceCallback.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+/**
+ * Callback interface used by asynchronous methods in the
+ * {@link ReferenceSetService} interface
+ * 
+ * @author Tom Oinn
+ */
+public interface ReferenceSetServiceCallback {
+	/**
+	 * Called when the requested {@link ReferenceSet} has been successfully
+	 * retrieved.
+	 * 
+	 * @param references
+	 *            the ReferenceSet requested
+	 */
+	void referenceSetRetrieved(ReferenceSet references);
+
+	/**
+	 * Called if the retrieval failed for some reason
+	 * 
+	 * @param cause
+	 *            a ReferenceSetServiceException explaining the retrieval
+	 *            failure
+	 */
+	void referenceSetRetrievalFailed(ReferenceSetServiceException cause);
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetServiceException.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetServiceException.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetServiceException.java
new file mode 100644
index 0000000..7e8c507
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceSetServiceException.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+/**
+ * RuntimeException subclass thrown by the reference set service layer
+ * interfaces. All underlying exceptions are either handled by the service layer
+ * or wrapped in this exception (or a subclass) and rethrown.
+ * 
+ * @author Tom Oinn
+ */
+public class ReferenceSetServiceException extends RuntimeException {
+	private static final long serialVersionUID = -2762995062729638168L;
+
+	public ReferenceSetServiceException() {
+		//
+	}
+
+	public ReferenceSetServiceException(String message) {
+		super(message);
+	}
+
+	public ReferenceSetServiceException(Throwable cause) {
+		super(cause);
+	}
+
+	public ReferenceSetServiceException(String message, Throwable cause) {
+		super(message, cause);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferencedDataNature.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferencedDataNature.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferencedDataNature.java
new file mode 100644
index 0000000..a6861f1
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferencedDataNature.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+/**
+ * Where possible ExternalReferenceSPI implementations should be able to
+ * determine whether the data they refer to is textual or binary in nature. This
+ * enumeration contains values for textual, binary and unknown data natures.
+ * 
+ * @author Tom Oinn
+ */
+public enum ReferencedDataNature {
+	/**
+	 * The data is binary, no character encoding will be specified.
+	 */
+	BINARY,
+
+	/**
+	 * The data is textual, character encoding may be defined.
+	 */
+	TEXT,
+
+	/**
+	 * Unknown data nature.
+	 */
+	UNKNOWN;
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/StackTraceElementBean.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/StackTraceElementBean.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/StackTraceElementBean.java
new file mode 100644
index 0000000..8b560b1
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/StackTraceElementBean.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+/**
+ * Used by the {@link ErrorDocument} interface to represent a frame within a
+ * stack trace
+ * 
+ * @author Tom Oinn
+ * @see StackTraceElement
+ */
+public interface StackTraceElementBean {
+	/**
+	 * Returns the fully qualified name of the class containing the execution
+	 * point represented by this stack trace element.
+	 */
+	String getClassName();
+
+	/**
+	 * Returns the name of the source file containing the execution point
+	 * represented by this stack trace element.
+	 */
+	String getFileName();
+
+	/**
+	 * Returns the line number of the source line containing the execution point
+	 * represented by this stack trace element.
+	 */
+	int getLineNumber();
+
+	/**
+	 * Returns the name of the method containing the execution point represented
+	 * by this stack trace element.
+	 */
+	String getMethodName();
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/StreamToValueConverterSPI.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/StreamToValueConverterSPI.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/StreamToValueConverterSPI.java
new file mode 100644
index 0000000..dc3da5c
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/StreamToValueConverterSPI.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+import java.io.InputStream;
+
+/**
+ * SPI for objects that can render a POJO from an InputStream
+ * 
+ * @author Tom Oinn
+ */
+public interface StreamToValueConverterSPI<T> {
+	/**
+	 * The class of objects which this builder can construct from a stream
+	 */
+	Class<T> getPojoClass();
+
+	/**
+	 * Render the stream to the target object type
+	 * 
+	 * @param stream
+	 *            input stream of data to render to the object; the caller will
+	 *            close it
+	 * @param charset
+	 * @param dataNature
+	 * @return the newly created object
+	 */
+	T renderFrom(InputStream stream, ReferencedDataNature dataNature,
+			String charset);
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/T2Reference.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/T2Reference.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/T2Reference.java
new file mode 100644
index 0000000..4a9a725
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/T2Reference.java
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+import java.net.URI;
+
+/**
+ * The T2Reference is used within the workflow system to refer to any entity
+ * within the reference management system, whether reference set, list or error
+ * document. The reference carries certain properties which can be evaluated
+ * without resolution, these include a depth property and whether the reference
+ * either is or contains an error document at any point in its structure.
+ * 
+ * @author Tom Oinn
+ */
+public interface T2Reference {
+	/**
+	 * To determine the entity that this reference points to we use an
+	 * enumeration of possible entity types
+	 * 
+	 * @return the type of entity to which this reference refers.
+	 */
+	T2ReferenceType getReferenceType();
+
+	/**
+	 * All entities identified by a T2Reference have a conceptual depth. In the
+	 * case of lists the depth is the (uniform) depth of any item in the list
+	 * plus one, in the case of reference sets the depth is 0. Error documents
+	 * and empty lists may also have non zero depth; error documents in
+	 * particular have a depth corresponding to the depth of the list or
+	 * reference set that would have been created if there was no error.
+	 * 
+	 * @return the depth of the entity identified by this T2Reference
+	 */
+	int getDepth();
+
+	/**
+	 * Error documents always return true, as do any lists where at least one
+	 * immediate child of the list returns true when this property is evaluated.
+	 * As lists are immutable this property is actually set on list
+	 * registration. This is used to determine whether to allow POJO resolution
+	 * of the entity identified by this T2Reference - this is configurable by
+	 * the caller but there will be some cases where an attempt to render a
+	 * collection containing errors to a POJO should return an error and other
+	 * occasions when it should return a collection containing error objects.
+	 * <p>
+	 * ReferenceSet implementations always return false.
+	 * 
+	 * @return whether the entity identified by this T2Reference either is or
+	 *         contains an error document. Containment is transitive, so a list
+	 *         containing a list that contained an error would return true.
+	 */
+	boolean containsErrors();
+
+	/**
+	 * T2Reference instances retain a reference to the reference manager which
+	 * created them in the form of a namespace. This is an opaque string
+	 * matching the regular expression [a-zA-Z_0-9]+, and is immutable once
+	 * assigned (as are the other properties of this interface). The reference
+	 * manager infrastructure uses this namespace property primarily to
+	 * differentiate between cases where a reference cannot be resolved because
+	 * of a lack of connection to the appropriate remote reference manager and
+	 * those where the reference simply does not exist anywhere.
+	 * 
+	 * @return the namespace of this T2Reference as a string.
+	 */
+	String getNamespacePart();
+
+	/**
+	 * In addition to the namespace the T2Reference contains a local identifier.
+	 * This identifier is unique in the context of the namespace and is also
+	 * represented as a string matching the regular expression [a-z_A-Z0-9]+
+	 * 
+	 * @return the local part of this T2Reference as a string.
+	 */
+	String getLocalPart();
+
+	/**
+	 * All T2Reference instances can be represented as a URI.
+	 * 
+	 * @return representation of this T2Reference as a URI
+	 */
+	URI toUri();
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/T2ReferenceGenerator.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/T2ReferenceGenerator.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/T2ReferenceGenerator.java
new file mode 100644
index 0000000..dfaca7a
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/T2ReferenceGenerator.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+/**
+ * Provides new unique T2Reference instances. Used by and injected into the
+ * various service interface implementations when registering new reference
+ * sets, error documents and lists.
+ * 
+ * @author Tom Oinn
+ * @see T2Reference
+ */
+public interface T2ReferenceGenerator {
+	/**
+	 * All T2Reference objects will have this namespace
+	 * 
+	 * @return the namespace as a string
+	 */
+	String getNamespace();
+
+	/**
+	 * Create a new and otherwise unused T2Reference to a ReferenceSet. The
+	 * namespace of the reference will depend on the current workflow run read
+	 * from the ReferenceContext.
+	 * 
+	 * @return new T2Reference for a ReferenceSet, namespace and local parts
+	 *         will be initialized and the reference is ready to use when
+	 *         returned.
+	 */
+	T2Reference nextReferenceSetReference(ReferenceContext context);
+
+	/**
+	 * Create a new and otherwise unused T2Reference to an IdentifiedList. The
+	 * namespace of the reference will depend on the current workflow run read
+	 * from the ReferenceContext.
+	 * 
+	 * @param containsErrors
+	 *            whether the list this reference is generated for contains
+	 *            t2references with their containsErrors property set to true.
+	 *            Returns true if <em>any</em> reference in the list is or
+	 *            contains an error.
+	 * @param listDepth
+	 *            depth of the list to which this identifier will be applied
+	 * @return a new T2Reference for an IdentifiedList. Namespace, type and
+	 *         local parts will be initialized but depth and error content will
+	 *         still be at their default values of '0' and 'false' respectively,
+	 *         these will need to be re-set before the reference is viable.
+	 */
+	T2Reference nextListReference(boolean containsErrors, int listDepth,
+			ReferenceContext context);
+
+	/**
+	 * Create a new and otherwise unused T2Reference to an ErrorDocument. The
+	 * namespace of the reference will depend on the current workflow run read
+	 * from the ReferenceContext.
+	 * 
+	 * @param depth
+	 *            the depth of the error document to which this identifier will
+	 *            refer
+	 * @return a new T2Reference for an ErrorDocument
+	 */
+	T2Reference nextErrorDocumentReference(int depth, ReferenceContext context);
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/T2ReferenceType.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/T2ReferenceType.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/T2ReferenceType.java
new file mode 100644
index 0000000..b60333c
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/T2ReferenceType.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+/**
+ * The T2Reference interface is used to identify several different kinds of
+ * information, namely ReferenceSet, IdentifiedList and ErrorDocument. Because
+ * the top level reference service needs to determine which sub-service to
+ * delegate to when resolving references we carry this information in each
+ * T2Reference in the form of one of these enumerated types.
+ * 
+ * @author Tom Oinn
+ */
+public enum T2ReferenceType {
+	/**
+	 * A reference to a ReferenceSet
+	 */
+	ReferenceSet,
+
+	/**
+	 * A reference to an IdentifiedList of other T2References
+	 */
+	IdentifiedList,
+
+	/**
+	 * A reference to an ErrorDocument
+	 */
+	ErrorDocument;
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ValueCarryingExternalReference.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ValueCarryingExternalReference.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ValueCarryingExternalReference.java
new file mode 100644
index 0000000..a1ecc7d
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ValueCarryingExternalReference.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+/**
+ * Specialization of ExternalReferenceSPI for reference types which carry a
+ * value type internally. Such references can be de-referenced to the specified
+ * object type very cheaply. Note that this is not to be used to get an object
+ * property of a reference, the returned object must correspond to the value of
+ * the referenced data - this means that the HttpUrlReference does not use this
+ * to return a java.net.URL, but that the InlineStringReference does use it to
+ * return a java.lang.String
+ * 
+ * @author Tom Oinn
+ */
+public interface ValueCarryingExternalReference<T> extends ExternalReferenceSPI {
+	/**
+	 * Returns the type of the inlined value
+	 */
+	Class<T> getValueType();
+
+	/**
+	 * Returns the value
+	 */
+	T getValue();
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ValueToReferenceConversionException.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ValueToReferenceConversionException.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ValueToReferenceConversionException.java
new file mode 100644
index 0000000..3187184
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ValueToReferenceConversionException.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+/**
+ * Thrown by instances of ValueToReferenceConvertor when trying to convert an
+ * object to an instance of ExternalReferenceSPI if the conversion process fails
+ * for some reason.
+ * 
+ * @author Tom Oinn
+ */
+public class ValueToReferenceConversionException extends RuntimeException {
+	private static final long serialVersionUID = 3259959719223191820L;
+
+	public ValueToReferenceConversionException() {
+		//
+	}
+
+	public ValueToReferenceConversionException(String message) {
+		super(message);
+	}
+
+	public ValueToReferenceConversionException(Throwable cause) {
+		super(cause);
+	}
+
+	public ValueToReferenceConversionException(String message, Throwable cause) {
+		super(message, cause);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ValueToReferenceConverterSPI.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ValueToReferenceConverterSPI.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ValueToReferenceConverterSPI.java
new file mode 100644
index 0000000..04a4cfd
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ValueToReferenceConverterSPI.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+/**
+ * SPI for components that can convert an arbitrary object to an
+ * ExternalReferenceSPI representing the value of that object. Used by
+ * implementations of {@link ReferenceService#register(Object, int, boolean)} to
+ * map arbitrary objects to ExternalReferenceSPI instances if encountered during
+ * the registration process. This SPI is only used if the boolean
+ * useConverterSPI parameter is set to true on that method.
+ * 
+ * @author Tom Oinn
+ */
+public interface ValueToReferenceConverterSPI {
+	/**
+	 * Can this SPI implementation convert the specified object to an
+	 * ExternalReferenceSPI? This test should be as lightweight as possible, and
+	 * will usually be based on the Class of the object supplied.
+	 * 
+	 * @param context
+	 *            a ReferenceContext to use if required by the plugin, the
+	 *            ability to convert should be interpreted in the scope of this
+	 *            context. In general the context probably not used by most
+	 *            implementations but it's here if required.
+	 * 
+	 * @return whether this converter is applicable to the specified object
+	 */
+	boolean canConvert(Object o, ReferenceContext context);
+
+	/**
+	 * Construct and return a new ExternalReferenceSPI implementation which is
+	 * in some way equivalent to the supplied object. This is not intended to be
+	 * a two-way process necessarily, although the conversion should attempt to
+	 * be conservative (so not actually changing the data!).
+	 * 
+	 * @param context
+	 *            a ReferenceContext to use, if required, during construction of
+	 *            the new external reference
+	 * @return A new instance of ExternalReferenceSPI which references, as far
+	 *         as possible, the value represented by the specified object
+	 * @throws ValueToReferenceConversionException
+	 *             if any problem occurs during the conversion
+	 */
+	ExternalReferenceSPI convert(Object o, ReferenceContext context)
+			throws ValueToReferenceConversionException;
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/WorkflowRunIdEntity.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/WorkflowRunIdEntity.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/WorkflowRunIdEntity.java
new file mode 100644
index 0000000..e60bed9
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/WorkflowRunIdEntity.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+/**
+ * Entity that wraps workflow run id and can be passed through (
+ * {@link ReferenceContext} to be used by {@link T2ReferenceGenerator} to
+ * generate references that are specific for a workflow run.
+ * 
+ * @author Alex Nenadic
+ */
+public class WorkflowRunIdEntity {
+	private String workflowRunId;
+
+	public WorkflowRunIdEntity(String workflowRunId) {
+		this.setWorkflowRunId(workflowRunId);
+	}
+
+	public void setWorkflowRunId(String workflowRunId) {
+		this.workflowRunId = workflowRunId;
+	}
+
+	public String getWorkflowRunId() {
+		return workflowRunId;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/annotations/DeleteIdentifiedOperation.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/annotations/DeleteIdentifiedOperation.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/annotations/DeleteIdentifiedOperation.java
new file mode 100644
index 0000000..863a193
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/annotations/DeleteIdentifiedOperation.java
@@ -0,0 +1,18 @@
+package net.sf.taverna.t2.reference.annotations;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Applied to methods in Dao implementations which delete data in the backing
+ * store.
+ * 
+ * @author Stuart Owen
+ */
+@Retention(RUNTIME)
+@Target(METHOD)
+public @interface DeleteIdentifiedOperation {
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/annotations/GetIdentifiedOperation.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/annotations/GetIdentifiedOperation.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/annotations/GetIdentifiedOperation.java
new file mode 100644
index 0000000..bc23b20
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/annotations/GetIdentifiedOperation.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.annotations;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Applied to methods in Dao implementations which fetch data from the backing
+ * store by ID
+ * 
+ * @author Tom Oinn
+ */
+@Retention(RUNTIME)
+@Target(METHOD)
+public @interface GetIdentifiedOperation {
+}


[09/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/uml/database-schema.umlclass
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/uml/database-schema.umlclass b/taverna-provenanceconnector/src/main/uml/database-schema.umlclass
new file mode 100644
index 0000000..b5f575e
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/uml/database-schema.umlclass
@@ -0,0 +1,1880 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML" xmlns:uml2tools.notation="http://www.eclipse.org/mdt/uml2tools/gmf/notation/ext/2008" xmi:id="_stWF8E7WEd-4z_lD9gn2Tw" type="UMLClass" name="database-schema.umlclass" measurementUnit="Pixel">
+  <children xmi:type="notation:Shape" xmi:id="_uW6r0E7WEd-4z_lD9gn2Tw" type="2014" fontName="Sans">
+    <children xmi:type="notation:DecorationNode" xmi:id="_uXFq8E7WEd-4z_lD9gn2Tw" type="5020"/>
+    <children xmi:type="notation:DecorationNode" xmi:id="_uXFq8U7WEd-4z_lD9gn2Tw" type="5041"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_uXM_sE7WEd-4z_lD9gn2Tw" type="7032" collapsed="true">
+      <styles xmi:type="notation:SortingStyle" xmi:id="_uXM_sU7WEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_uXM_sk7WEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_uXM_s07WEd-4z_lD9gn2Tw"/>
+    </children>
+    <element xmi:type="uml:Package" href="database-schema.uml#_sneugE7WEd-4z_lD9gn2Tw"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_uW7S4E7WEd-4z_lD9gn2Tw"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_v_krsE7WEd-4z_lD9gn2Tw" type="2001" fontName="Sans">
+    <children xmi:type="notation:DecorationNode" xmi:id="_v_lSwE7WEd-4z_lD9gn2Tw" type="5003">
+      <styles xmi:type="notation:FontStyle" xmi:id="_wAhG4E7WEd-4z_lD9gn2Tw" bold="true"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_v_lSwU7WEd-4z_lD9gn2Tw" type="5019"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_v_l50E7WEd-4z_lD9gn2Tw" type="7001">
+      <children xmi:type="notation:Node" xmi:id="_EGxYkE7ZEd-4z_lD9gn2Tw" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_EGXv8E7ZEd-4z_lD9gn2Tw"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_EGxYkU7ZEd-4z_lD9gn2Tw"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_GHhIUE7ZEd-4z_lD9gn2Tw" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_GHJU4E7ZEd-4z_lD9gn2Tw"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_GHhIUU7ZEd-4z_lD9gn2Tw"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_HPuGgE7ZEd-4z_lD9gn2Tw" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_HPA74E7ZEd-4z_lD9gn2Tw"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_HPuGgU7ZEd-4z_lD9gn2Tw"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_JE6oAFESEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_JEjboFESEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_JE6oAVESEd-nO4bXYmJbIQ"/>
+      </children>
+      <styles xmi:type="notation:TitleStyle" xmi:id="_v_l50U7WEd-4z_lD9gn2Tw" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_v_l50k7WEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_v_l5007WEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_v_mg4E7WEd-4z_lD9gn2Tw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_v_o9IE7WEd-4z_lD9gn2Tw" type="7002">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_v_o9IU7WEd-4z_lD9gn2Tw" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_v_o9Ik7WEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_v_o9I07WEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_v_pkME7WEd-4z_lD9gn2Tw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_v_pkMU7WEd-4z_lD9gn2Tw" type="7003">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_v_pkMk7WEd-4z_lD9gn2Tw" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_v_pkM07WEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_v_pkNE7WEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_v_pkNU7WEd-4z_lD9gn2Tw"/>
+    </children>
+    <styles xmi:type="notation:CanonicalStyle" xmi:id="_v_krsU7WEd-4z_lD9gn2Tw"/>
+    <element xmi:type="uml:Class" href="database-schema.uml#_v8DdoE7WEd-4z_lD9gn2Tw"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_v_krsk7WEd-4z_lD9gn2Tw" x="60" y="385"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_yFYhoE7WEd-4z_lD9gn2Tw" type="2001" fontName="Sans">
+    <children xmi:type="notation:DecorationNode" xmi:id="_yFZIsE7WEd-4z_lD9gn2Tw" type="5003">
+      <styles xmi:type="notation:FontStyle" xmi:id="_yFeBME7WEd-4z_lD9gn2Tw" bold="true"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_yFZIsU7WEd-4z_lD9gn2Tw" type="5019"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_yFZIsk7WEd-4z_lD9gn2Tw" type="7001">
+      <children xmi:type="notation:Node" xmi:id="_FP1kUE7XEd-4z_lD9gn2Tw" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_FPXDME7XEd-4z_lD9gn2Tw"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_FP1kUU7XEd-4z_lD9gn2Tw"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_M5HC0E7XEd-4z_lD9gn2Tw" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_M4h0AE7XEd-4z_lD9gn2Tw"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_M5HC0U7XEd-4z_lD9gn2Tw"/>
+      </children>
+      <styles xmi:type="notation:TitleStyle" xmi:id="_yFZIs07WEd-4z_lD9gn2Tw" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_yFZItE7WEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_yFZItU7WEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_yFZItk7WEd-4z_lD9gn2Tw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_yFZIt07WEd-4z_lD9gn2Tw" type="7002">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_yFZvwE7WEd-4z_lD9gn2Tw" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_yFZvwU7WEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_yFZvwk7WEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_yFZvw07WEd-4z_lD9gn2Tw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_yFZvxE7WEd-4z_lD9gn2Tw" type="7003">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_yFZvxU7WEd-4z_lD9gn2Tw" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_yFZvxk7WEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_yFZvx07WEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_yFZvyE7WEd-4z_lD9gn2Tw"/>
+    </children>
+    <styles xmi:type="notation:CanonicalStyle" xmi:id="_yFYhoU7WEd-4z_lD9gn2Tw"/>
+    <element xmi:type="uml:Class" href="database-schema.uml#_yEqv8E7WEd-4z_lD9gn2Tw"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_yFYhok7WEd-4z_lD9gn2Tw" x="115" y="95"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_OKybME7ZEd-4z_lD9gn2Tw" type="2001" fontName="Sans">
+    <children xmi:type="notation:DecorationNode" xmi:id="_OKybM07ZEd-4z_lD9gn2Tw" type="5003">
+      <styles xmi:type="notation:FontStyle" xmi:id="_OK4h0E7ZEd-4z_lD9gn2Tw" bold="true"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_OKzCQE7ZEd-4z_lD9gn2Tw" type="5019"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_OKzCQU7ZEd-4z_lD9gn2Tw" type="7001">
+      <children xmi:type="notation:Node" xmi:id="_ReGmEE7ZEd-4z_lD9gn2Tw" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_RdvZsE7ZEd-4z_lD9gn2Tw"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_ReGmEU7ZEd-4z_lD9gn2Tw"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_WVo8wE7ZEd-4z_lD9gn2Tw" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_WVP7ME7ZEd-4z_lD9gn2Tw"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_WVo8wU7ZEd-4z_lD9gn2Tw"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_XcEZUE7ZEd-4z_lD9gn2Tw" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_XbvpME7ZEd-4z_lD9gn2Tw"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_XcEZUU7ZEd-4z_lD9gn2Tw"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_YkFKQE7ZEd-4z_lD9gn2Tw" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_YjvzEE7ZEd-4z_lD9gn2Tw"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_YkFKQU7ZEd-4z_lD9gn2Tw"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_ZZFfoE7ZEd-4z_lD9gn2Tw" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_ZYtFIE7ZEd-4z_lD9gn2Tw"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_ZZGGsE7ZEd-4z_lD9gn2Tw"/>
+      </children>
+      <styles xmi:type="notation:TitleStyle" xmi:id="_OKzCQk7ZEd-4z_lD9gn2Tw" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_OKzCQ07ZEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_OKzCRE7ZEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_OKzCRU7ZEd-4z_lD9gn2Tw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_OKzCRk7ZEd-4z_lD9gn2Tw" type="7002">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_OKzCR07ZEd-4z_lD9gn2Tw" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_OKzCSE7ZEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_OKzCSU7ZEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_OKzCSk7ZEd-4z_lD9gn2Tw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_OKzpUE7ZEd-4z_lD9gn2Tw" type="7003">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_OKzpUU7ZEd-4z_lD9gn2Tw" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_OKzpUk7ZEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_OKzpU07ZEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_OKzpVE7ZEd-4z_lD9gn2Tw"/>
+    </children>
+    <styles xmi:type="notation:CanonicalStyle" xmi:id="_OKybMU7ZEd-4z_lD9gn2Tw"/>
+    <element xmi:type="uml:Class" href="database-schema.uml#_OKWWUE7ZEd-4z_lD9gn2Tw"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_OKybMk7ZEd-4z_lD9gn2Tw" x="515" y="40"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_JsoYYE7aEd-4z_lD9gn2Tw" type="2001" fontName="Sans">
+    <children xmi:type="notation:DecorationNode" xmi:id="_Jso_cE7aEd-4z_lD9gn2Tw" type="5003">
+      <styles xmi:type="notation:FontStyle" xmi:id="_Jst38E7aEd-4z_lD9gn2Tw" bold="true"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_Jso_cU7aEd-4z_lD9gn2Tw" type="5019"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_Jso_ck7aEd-4z_lD9gn2Tw" type="7001">
+      <children xmi:type="notation:Node" xmi:id="_Wu-ocFELEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_WtxukFELEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_Wu-ocVELEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_ZOjpQFELEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_ZN-acFELEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_ZOjpQVELEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_Z4pvIFELEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_Z4GVgFELEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_Z4pvIVELEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_cchaEFELEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_cb-ngFELEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_cchaEVELEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_eRU_kFELEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_eQtUgFELEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_eRU_kVELEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_fjAp4FELEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_fij98FELEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_fjAp4VELEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_g2fD8FELEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_g184cFELEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_g2fD8VELEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_hYpV0FELEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_hYIYcFELEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_hYpV0VELEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_L2ulIFEOEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_L2VjkFEOEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_L2ulIVEOEd-nO4bXYmJbIQ"/>
+      </children>
+      <styles xmi:type="notation:TitleStyle" xmi:id="_Jso_c07aEd-4z_lD9gn2Tw" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_Jso_dE7aEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_Jso_dU7aEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_Jso_dk7aEd-4z_lD9gn2Tw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_Jso_d07aEd-4z_lD9gn2Tw" type="7002">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_Jso_eE7aEd-4z_lD9gn2Tw" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_Jso_eU7aEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_Jso_ek7aEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_Jso_e07aEd-4z_lD9gn2Tw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_JspmgE7aEd-4z_lD9gn2Tw" type="7003">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_JspmgU7aEd-4z_lD9gn2Tw" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_Jspmgk7aEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_Jspmg07aEd-4z_lD9gn2Tw"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_JspmhE7aEd-4z_lD9gn2Tw"/>
+    </children>
+    <styles xmi:type="notation:CanonicalStyle" xmi:id="_JsoYYU7aEd-4z_lD9gn2Tw"/>
+    <element xmi:type="uml:Class" href="database-schema.uml#_JrqIAE7aEd-4z_lD9gn2Tw"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_JsoYYk7aEd-4z_lD9gn2Tw" x="785" y="195"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_BGLCEFENEd-nO4bXYmJbIQ" type="2001" fontName="Sans">
+    <children xmi:type="notation:DecorationNode" xmi:id="_BGLpIFENEd-nO4bXYmJbIQ" type="5003">
+      <styles xmi:type="notation:FontStyle" xmi:id="_BGRIsFENEd-nO4bXYmJbIQ" bold="true"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_BGLpIVENEd-nO4bXYmJbIQ" type="5019"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_BGLpIlENEd-nO4bXYmJbIQ" type="7001">
+      <children xmi:type="notation:Node" xmi:id="_DitV8FENEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_DiWJkFENEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_DitV8VENEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_F_5xIFENEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_F_kZ8FENEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_F_5xIVENEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_On1a0FEOEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_OnfckFEOEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_On1a0VEOEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_P1lAUFEOEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_P1ObAFEOEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_P1lAUVEOEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_Rbz-UFEOEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_RbdZAFEOEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_Rbz-UVEOEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_StJDUFEOEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_Ssx28FEOEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_StJDUVEOEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_Yev1kFEOEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_YeNqEFEOEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_Yev1kVEOEd-nO4bXYmJbIQ"/>
+      </children>
+      <styles xmi:type="notation:TitleStyle" xmi:id="_BGLpI1ENEd-nO4bXYmJbIQ" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_BGLpJFENEd-nO4bXYmJbIQ"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_BGLpJVENEd-nO4bXYmJbIQ"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_BGMQMFENEd-nO4bXYmJbIQ"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_BGMQMVENEd-nO4bXYmJbIQ" type="7002">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_BGMQMlENEd-nO4bXYmJbIQ" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_BGMQM1ENEd-nO4bXYmJbIQ"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_BGMQNFENEd-nO4bXYmJbIQ"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_BGMQNVENEd-nO4bXYmJbIQ"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_BGMQNlENEd-nO4bXYmJbIQ" type="7003">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_BGMQN1ENEd-nO4bXYmJbIQ" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_BGMQOFENEd-nO4bXYmJbIQ"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_BGMQOVENEd-nO4bXYmJbIQ"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_BGMQOlENEd-nO4bXYmJbIQ"/>
+    </children>
+    <styles xmi:type="notation:CanonicalStyle" xmi:id="_BGLCEVENEd-nO4bXYmJbIQ"/>
+    <element xmi:type="uml:Class" href="database-schema.uml#_BFzOoFENEd-nO4bXYmJbIQ"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_BGLCElENEd-nO4bXYmJbIQ" x="380" y="200"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_VBVI8FENEd-nO4bXYmJbIQ" type="2001" fontName="Sans">
+    <children xmi:type="notation:DecorationNode" xmi:id="_VBVwAFENEd-nO4bXYmJbIQ" type="5003">
+      <styles xmi:type="notation:FontStyle" xmi:id="_VBZaYFENEd-nO4bXYmJbIQ" bold="true"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_VBVwAVENEd-nO4bXYmJbIQ" type="5019"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_VBVwAlENEd-nO4bXYmJbIQ" type="7001">
+      <children xmi:type="notation:Node" xmi:id="_Y0USYFENEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_Yz_iQFENEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_Y0USYVENEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_bahfoFENEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_baKTQFENEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_bahfoVENEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_rZ3RMFENEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_rZgr4FENEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_rZ3RMVENEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_yNfhIFENEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_yNKJ8FENEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_yNfhIVENEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_YQdQAFEQEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_YQGDoFEQEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_YQdQAVEQEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_ZjI_4FEQEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_ZiuJIFEQEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_ZjI_4VEQEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_a1q-wFEQEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_a1RWIFEQEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_a1q-wVEQEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_f2iQkFEQEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_f2J2EFEQEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_f2iQkVEQEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_kE6VgFEQEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_kEh7AFEQEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_kE6VgVEQEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_bVAkIFEmEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_bUoJoFEmEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_bVAkIVEmEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_OCUg4FE4Ed-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_OCA-4FE4Ed-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_OCUg4VE4Ed-nO4bXYmJbIQ"/>
+      </children>
+      <styles xmi:type="notation:TitleStyle" xmi:id="_VBVwA1ENEd-nO4bXYmJbIQ" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_VBVwBFENEd-nO4bXYmJbIQ"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_VBVwBVENEd-nO4bXYmJbIQ"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_VBVwBlENEd-nO4bXYmJbIQ"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_VBVwB1ENEd-nO4bXYmJbIQ" type="7002">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_VBVwCFENEd-nO4bXYmJbIQ" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_VBVwCVENEd-nO4bXYmJbIQ"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_VBVwClENEd-nO4bXYmJbIQ"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_VBVwC1ENEd-nO4bXYmJbIQ"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_VBWXEFENEd-nO4bXYmJbIQ" type="7003">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_VBWXEVENEd-nO4bXYmJbIQ" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_VBWXElENEd-nO4bXYmJbIQ"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_VBWXE1ENEd-nO4bXYmJbIQ"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_VBWXFFENEd-nO4bXYmJbIQ"/>
+    </children>
+    <styles xmi:type="notation:CanonicalStyle" xmi:id="_VBVI8VENEd-nO4bXYmJbIQ"/>
+    <element xmi:type="uml:Class" href="database-schema.uml#_VA7gUFENEd-nO4bXYmJbIQ"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_VBVI8lENEd-nO4bXYmJbIQ" x="365" y="420"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_9C6ykFENEd-nO4bXYmJbIQ" type="2001" fontName="Sans">
+    <children xmi:type="notation:DecorationNode" xmi:id="_9C6yk1ENEd-nO4bXYmJbIQ" type="5003">
+      <styles xmi:type="notation:FontStyle" xmi:id="_9C_EAFENEd-nO4bXYmJbIQ" bold="true"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_9C7ZoFENEd-nO4bXYmJbIQ" type="5019"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_9C7ZoVENEd-nO4bXYmJbIQ" type="7001">
+      <children xmi:type="notation:Node" xmi:id="__sWS8FENEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#__sA7wFENEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="__sWS8VENEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_AXoEkFEOEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_AXQ4MFEOEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_AXoEkVEOEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_Bh3DEFEOEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_BhWFsFEOEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_Bh3DEVEOEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_B8ABYFEOEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_B7qqMFEOEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_B8ABYVEOEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_YjPnIFEmEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_Yi3zsFEmEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_YjQOMFEmEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_dDopIFEmEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_dDQOoFEmEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_dDopIVEmEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_j0-aEFEmEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_j0l_kFEmEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_j0-aEVEmEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_cZEkAFE4Ed-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_cYxCAFE4Ed-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_cZEkAVE4Ed-nO4bXYmJbIQ"/>
+      </children>
+      <styles xmi:type="notation:TitleStyle" xmi:id="_9C7ZolENEd-nO4bXYmJbIQ" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_9C7Zo1ENEd-nO4bXYmJbIQ"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_9C7ZpFENEd-nO4bXYmJbIQ"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_9C7ZpVENEd-nO4bXYmJbIQ"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_9C7ZplENEd-nO4bXYmJbIQ" type="7002">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_9C7Zp1ENEd-nO4bXYmJbIQ" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_9C7ZqFENEd-nO4bXYmJbIQ"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_9C7ZqVENEd-nO4bXYmJbIQ"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_9C7ZqlENEd-nO4bXYmJbIQ"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_9C7Zq1ENEd-nO4bXYmJbIQ" type="7003">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_9C7ZrFENEd-nO4bXYmJbIQ" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_9C7ZrVENEd-nO4bXYmJbIQ"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_9C7ZrlENEd-nO4bXYmJbIQ"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_9C8AsFENEd-nO4bXYmJbIQ"/>
+    </children>
+    <styles xmi:type="notation:CanonicalStyle" xmi:id="_9C6ykVENEd-nO4bXYmJbIQ"/>
+    <element xmi:type="uml:Class" href="database-schema.uml#_9CkNQFENEd-nO4bXYmJbIQ"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_9C6yklENEd-nO4bXYmJbIQ" x="760" y="470"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_mzz2oFEOEd-nO4bXYmJbIQ" type="2001" fontName="Sans">
+    <children xmi:type="notation:DecorationNode" xmi:id="_mz0dsFEOEd-nO4bXYmJbIQ" type="5003">
+      <styles xmi:type="notation:FontStyle" xmi:id="_mz4IEFEOEd-nO4bXYmJbIQ" bold="true"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_mz0dsVEOEd-nO4bXYmJbIQ" type="5019"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_mz0dslEOEd-nO4bXYmJbIQ" type="7001">
+      <children xmi:type="notation:Node" xmi:id="_o6q1cFEOEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_o6U3MFEOEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_o6q1cVEOEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_pv3_IFEOEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_pvfkoFEOEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_pv3_IVEOEd-nO4bXYmJbIQ"/>
+      </children>
+      <children xmi:type="notation:Node" xmi:id="_ql9SkFEOEd-nO4bXYmJbIQ" type="3001">
+        <element xmi:type="uml:Property" href="database-schema.uml#_qllfIFEOEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Location" xmi:id="_ql9SkVEOEd-nO4bXYmJbIQ"/>
+      </children>
+      <styles xmi:type="notation:TitleStyle" xmi:id="_mz0ds1EOEd-nO4bXYmJbIQ" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_mz0dtFEOEd-nO4bXYmJbIQ"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_mz0dtVEOEd-nO4bXYmJbIQ"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_mz0dtlEOEd-nO4bXYmJbIQ"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_mz0dt1EOEd-nO4bXYmJbIQ" type="7002">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_mz0duFEOEd-nO4bXYmJbIQ" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_mz0duVEOEd-nO4bXYmJbIQ"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_mz0dulEOEd-nO4bXYmJbIQ"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_mz1EwFEOEd-nO4bXYmJbIQ"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_mz1EwVEOEd-nO4bXYmJbIQ" type="7003">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_mz1EwlEOEd-nO4bXYmJbIQ" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_mz1Ew1EOEd-nO4bXYmJbIQ"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_mz1ExFEOEd-nO4bXYmJbIQ"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_mz1ExVEOEd-nO4bXYmJbIQ"/>
+    </children>
+    <styles xmi:type="notation:CanonicalStyle" xmi:id="_mzz2oVEOEd-nO4bXYmJbIQ"/>
+    <element xmi:type="uml:Class" href="database-schema.uml#_mzS5QFEOEd-nO4bXYmJbIQ"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_mzz2olEOEd-nO4bXYmJbIQ" x="260" y="-50"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_eoUG8FExEd-nO4bXYmJbIQ" type="2001" fontName="Sans">
+    <children xmi:type="notation:DecorationNode" xmi:id="_GU5SAFQ0Ed-2MdC0gorhYw" type="5003">
+      <styles xmi:type="notation:FontStyle" xmi:id="_GVERIFQ0Ed-2MdC0gorhYw" bold="true"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_GU5SAVQ0Ed-2MdC0gorhYw" type="5019"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_GU5SAlQ0Ed-2MdC0gorhYw" type="7001">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_GU5SA1Q0Ed-2MdC0gorhYw" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_GU5SBFQ0Ed-2MdC0gorhYw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_GU5SBVQ0Ed-2MdC0gorhYw"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_GU5SBlQ0Ed-2MdC0gorhYw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_GU5SB1Q0Ed-2MdC0gorhYw" type="7002">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_GU5SCFQ0Ed-2MdC0gorhYw" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_GU5SCVQ0Ed-2MdC0gorhYw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_GU5SClQ0Ed-2MdC0gorhYw"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_GU5SC1Q0Ed-2MdC0gorhYw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_GU5SDFQ0Ed-2MdC0gorhYw" type="7003">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_GU5SDVQ0Ed-2MdC0gorhYw" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_GU5SDlQ0Ed-2MdC0gorhYw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_GU5SD1Q0Ed-2MdC0gorhYw"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_GU55EFQ0Ed-2MdC0gorhYw"/>
+    </children>
+    <styles xmi:type="notation:CanonicalStyle" xmi:id="_GU4q8FQ0Ed-2MdC0gorhYw"/>
+    <element xmi:type="uml:Class" href="database-schema.uml#_eoBMAFExEd-nO4bXYmJbIQ"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_eoUG8lExEd-nO4bXYmJbIQ" x="60" y="715"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_XUbXsFEzEd-nO4bXYmJbIQ" type="2001" fontName="Sans">
+    <children xmi:type="notation:DecorationNode" xmi:id="_q3MKQ1Q0Ed-2MdC0gorhYw" type="5003">
+      <styles xmi:type="notation:FontStyle" xmi:id="_q3VUMFQ0Ed-2MdC0gorhYw" bold="true"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_q3MKRFQ0Ed-2MdC0gorhYw" type="5019"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_q3MKRVQ0Ed-2MdC0gorhYw" type="7001">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_q3MKRlQ0Ed-2MdC0gorhYw" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_q3MKR1Q0Ed-2MdC0gorhYw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_q3MKSFQ0Ed-2MdC0gorhYw"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_q3MxUFQ0Ed-2MdC0gorhYw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_q3MxUVQ0Ed-2MdC0gorhYw" type="7002">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_q3MxUlQ0Ed-2MdC0gorhYw" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_q3MxU1Q0Ed-2MdC0gorhYw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_q3MxVFQ0Ed-2MdC0gorhYw"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_q3MxVVQ0Ed-2MdC0gorhYw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_q3MxVlQ0Ed-2MdC0gorhYw" type="7003">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_q3MxV1Q0Ed-2MdC0gorhYw" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_q3MxWFQ0Ed-2MdC0gorhYw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_q3MxWVQ0Ed-2MdC0gorhYw"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_q3MxWlQ0Ed-2MdC0gorhYw"/>
+    </children>
+    <styles xmi:type="notation:CanonicalStyle" xmi:id="_q3MKQVQ0Ed-2MdC0gorhYw"/>
+    <element xmi:type="uml:Class" href="database-schema.uml#_XUGAgFEzEd-nO4bXYmJbIQ"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_XUbXslEzEd-nO4bXYmJbIQ" x="805" y="725"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_9PCGsFEzEd-nO4bXYmJbIQ" type="2001" fontName="Sans">
+    <children xmi:type="notation:DecorationNode" xmi:id="_q3qrYFQ0Ed-2MdC0gorhYw" type="5003">
+      <styles xmi:type="notation:FontStyle" xmi:id="_q3vj4FQ0Ed-2MdC0gorhYw" bold="true"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_q3qrYVQ0Ed-2MdC0gorhYw" type="5019"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_q3qrYlQ0Ed-2MdC0gorhYw" type="7001">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_q3qrY1Q0Ed-2MdC0gorhYw" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_q3qrZFQ0Ed-2MdC0gorhYw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_q3qrZVQ0Ed-2MdC0gorhYw"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_q3qrZlQ0Ed-2MdC0gorhYw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_q3qrZ1Q0Ed-2MdC0gorhYw" type="7002">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_q3qraFQ0Ed-2MdC0gorhYw" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_q3qraVQ0Ed-2MdC0gorhYw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_q3qralQ0Ed-2MdC0gorhYw"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_q3rScFQ0Ed-2MdC0gorhYw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_q3rScVQ0Ed-2MdC0gorhYw" type="7003">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_q3rSclQ0Ed-2MdC0gorhYw" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_q3rSc1Q0Ed-2MdC0gorhYw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_q3rSdFQ0Ed-2MdC0gorhYw"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_q3rSdVQ0Ed-2MdC0gorhYw"/>
+    </children>
+    <styles xmi:type="notation:CanonicalStyle" xmi:id="_q3qEUVQ0Ed-2MdC0gorhYw"/>
+    <element xmi:type="uml:Class" href="database-schema.uml#_9Oi-gFEzEd-nO4bXYmJbIQ"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_9PCGslEzEd-nO4bXYmJbIQ" x="650" y="720"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_fiTqAFExEd-nO4bXYmJbIQ" type="2001" fontName="Sans">
+    <children xmi:type="notation:DecorationNode" xmi:id="_q37KE1Q0Ed-2MdC0gorhYw" type="5003">
+      <styles xmi:type="notation:FontStyle" xmi:id="_q4Ce0FQ0Ed-2MdC0gorhYw" bold="true"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_q37xIFQ0Ed-2MdC0gorhYw" type="5019"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_q37xIVQ0Ed-2MdC0gorhYw" type="7001">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_q37xIlQ0Ed-2MdC0gorhYw" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_q37xI1Q0Ed-2MdC0gorhYw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_q37xJFQ0Ed-2MdC0gorhYw"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_q37xJVQ0Ed-2MdC0gorhYw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_q37xJlQ0Ed-2MdC0gorhYw" type="7002">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_q37xJ1Q0Ed-2MdC0gorhYw" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_q37xKFQ0Ed-2MdC0gorhYw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_q37xKVQ0Ed-2MdC0gorhYw"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_q37xKlQ0Ed-2MdC0gorhYw"/>
+    </children>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_q37xK1Q0Ed-2MdC0gorhYw" type="7003">
+      <styles xmi:type="notation:TitleStyle" xmi:id="_q37xLFQ0Ed-2MdC0gorhYw" showTitle="true"/>
+      <styles xmi:type="notation:SortingStyle" xmi:id="_q37xLVQ0Ed-2MdC0gorhYw"/>
+      <styles xmi:type="notation:FilteringStyle" xmi:id="_q37xLlQ0Ed-2MdC0gorhYw"/>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_q38YMFQ0Ed-2MdC0gorhYw"/>
+    </children>
+    <styles xmi:type="notation:CanonicalStyle" xmi:id="_q37KEVQ0Ed-2MdC0gorhYw"/>
+    <element xmi:type="uml:Class" href="database-schema.uml#_fiAIAFExEd-nO4bXYmJbIQ"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_fiTqAlExEd-nO4bXYmJbIQ" x="365" y="720"/>
+  <children xmi:type="notation:Shape" xmi:id="_brGH4FExEd-nO4bXYmJbIQ" type="2016" fontName="Sans">
+    <children xmi:type="notation:DecorationNode" xmi:id="_brGH41ExEd-nO4bXYmJbIQ" type="5026"/>
+    <children xmi:type="notation:BasicCompartment" xmi:id="_brGH5FExEd-nO4bXYmJbIQ" type="7033">
+      <children xmi:type="notation:Shape" xmi:id="_eoUG8FExEd-nO4bXYmJbIQ" type="3033" fontName="Sans">
+        <children xmi:type="notation:DecorationNode" xmi:id="_eoUuAFExEd-nO4bXYmJbIQ" type="5021"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_eoUuAVExEd-nO4bXYmJbIQ" type="5022"/>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_eoUuAlExEd-nO4bXYmJbIQ" type="7035">
+          <children xmi:type="notation:Node" xmi:id="_4f6XEFExEd-nO4bXYmJbIQ" type="3001">
+            <element xmi:type="uml:Property" href="database-schema.uml#_4fjKsFExEd-nO4bXYmJbIQ"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_4f6XEVExEd-nO4bXYmJbIQ"/>
+          </children>
+          <children xmi:type="notation:Node" xmi:id="_63pqgFExEd-nO4bXYmJbIQ" type="3001">
+            <element xmi:type="uml:Property" href="database-schema.uml#_63SeIFExEd-nO4bXYmJbIQ"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_63pqgVExEd-nO4bXYmJbIQ"/>
+          </children>
+          <children xmi:type="notation:Node" xmi:id="_8w8HYFExEd-nO4bXYmJbIQ" type="3001">
+            <element xmi:type="uml:Property" href="database-schema.uml#_8whQoFExEd-nO4bXYmJbIQ"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_8w8HYVExEd-nO4bXYmJbIQ"/>
+          </children>
+          <children xmi:type="notation:Node" xmi:id="__E7jQFExEd-nO4bXYmJbIQ" type="3001">
+            <element xmi:type="uml:Property" href="database-schema.uml#__Ek98FExEd-nO4bXYmJbIQ"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="__E7jQVExEd-nO4bXYmJbIQ"/>
+          </children>
+          <children xmi:type="notation:Node" xmi:id="_FqZbYFEyEd-nO4bXYmJbIQ" type="3001">
+            <element xmi:type="uml:Property" href="database-schema.uml#_FqBn8FEyEd-nO4bXYmJbIQ"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_FqZbYVEyEd-nO4bXYmJbIQ"/>
+          </children>
+          <children xmi:type="notation:Node" xmi:id="_HMF3oFEyEd-nO4bXYmJbIQ" type="3001">
+            <element xmi:type="uml:Property" href="database-schema.uml#_HLwgcFEyEd-nO4bXYmJbIQ"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_HMF3oVEyEd-nO4bXYmJbIQ"/>
+          </children>
+          <children xmi:type="notation:Node" xmi:id="_JjRKYFEyEd-nO4bXYmJbIQ" type="3001">
+            <element xmi:type="uml:Property" href="database-schema.uml#_Ji5W8FEyEd-nO4bXYmJbIQ"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_JjRKYVEyEd-nO4bXYmJbIQ"/>
+          </children>
+          <children xmi:type="notation:Node" xmi:id="_LjR6UFEyEd-nO4bXYmJbIQ" type="3001">
+            <element xmi:type="uml:Property" href="database-schema.uml#_Li-_YFEyEd-nO4bXYmJbIQ"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_LjR6UVEyEd-nO4bXYmJbIQ"/>
+          </children>
+          <children xmi:type="notation:Node" xmi:id="_NFRRgFEyEd-nO4bXYmJbIQ" type="3001">
+            <element xmi:type="uml:Property" href="database-schema.uml#_NE76UFEyEd-nO4bXYmJbIQ"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_NFRRgVEyEd-nO4bXYmJbIQ"/>
+          </children>
+          <children xmi:type="notation:Node" xmi:id="_ODFkoFEyEd-nO4bXYmJbIQ" type="3001">
+            <element xmi:type="uml:Property" href="database-schema.uml#_OC0e4FEyEd-nO4bXYmJbIQ"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_ODGLsFEyEd-nO4bXYmJbIQ"/>
+          </children>
+          <styles xmi:type="notation:TitleStyle" xmi:id="_eoUuA1ExEd-nO4bXYmJbIQ" showTitle="true"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_eoUuBFExEd-nO4bXYmJbIQ"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_eoUuBVExEd-nO4bXYmJbIQ"/>
+          <styles xmi:type="notation:CanonicalStyle" xmi:id="_eoUuBlExEd-nO4bXYmJbIQ"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_eoUuB1ExEd-nO4bXYmJbIQ" type="7036">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_eoUuCFExEd-nO4bXYmJbIQ" showTitle="true"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_eoUuCVExEd-nO4bXYmJbIQ"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_eoUuClExEd-nO4bXYmJbIQ"/>
+          <styles xmi:type="notation:CanonicalStyle" xmi:id="_eoUuC1ExEd-nO4bXYmJbIQ"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_eoUuDFExEd-nO4bXYmJbIQ" type="7037">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_eoUuDVExEd-nO4bXYmJbIQ" showTitle="true"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_eoUuDlExEd-nO4bXYmJbIQ"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_eoUuD1ExEd-nO4bXYmJbIQ"/>
+          <styles xmi:type="notation:CanonicalStyle" xmi:id="_eoVVEFExEd-nO4bXYmJbIQ"/>
+        </children>
+        <styles xmi:type="notation:CanonicalStyle" xmi:id="_eoUG8VExEd-nO4bXYmJbIQ"/>
+        <element xmi:type="uml:Class" href="database-schema.uml#_eoBMAFExEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_eoUG8lExEd-nO4bXYmJbIQ" x="30" y="48"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_fiTqAFExEd-nO4bXYmJbIQ" type="3033" fontName="Sans">
+        <children xmi:type="notation:DecorationNode" xmi:id="_fiTqA1ExEd-nO4bXYmJbIQ" type="5021"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_fiUREFExEd-nO4bXYmJbIQ" type="5022"/>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_fiUREVExEd-nO4bXYmJbIQ" type="7035">
+          <children xmi:type="notation:Node" xmi:id="_If9d0FEzEd-nO4bXYmJbIQ" type="3001">
+            <element xmi:type="uml:Property" href="database-schema.uml#_IflqYFEzEd-nO4bXYmJbIQ"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_If9d0VEzEd-nO4bXYmJbIQ"/>
+          </children>
+          <children xmi:type="notation:Node" xmi:id="_LAVI0FEzEd-nO4bXYmJbIQ" type="3001">
+            <element xmi:type="uml:Property" href="database-schema.uml#_LAAYsFEzEd-nO4bXYmJbIQ"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_LAVI0VEzEd-nO4bXYmJbIQ"/>
+          </children>
+          <children xmi:type="notation:Node" xmi:id="_NT3RsFEzEd-nO4bXYmJbIQ" type="3001">
+            <element xmi:type="uml:Property" href="database-schema.uml#_NTjvsFEzEd-nO4bXYmJbIQ"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_NT3RsVEzEd-nO4bXYmJbIQ"/>
+          </children>
+          <children xmi:type="notation:Node" xmi:id="_OztT0FEzEd-nO4bXYmJbIQ" type="3001">
+            <element xmi:type="uml:Property" href="database-schema.uml#_OzX8oFEzEd-nO4bXYmJbIQ"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_OztT0VEzEd-nO4bXYmJbIQ"/>
+          </children>
+          <children xmi:type="notation:Node" xmi:id="_QBxpcFEzEd-nO4bXYmJbIQ" type="3001">
+            <element xmi:type="uml:Property" href="database-schema.uml#_QBf8oFEzEd-nO4bXYmJbIQ"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_QBxpcVEzEd-nO4bXYmJbIQ"/>
+          </children>
+          <children xmi:type="notation:Node" xmi:id="_QqZvsFEzEd-nO4bXYmJbIQ" type="3001">
+            <element xmi:type="uml:Property" href="database-schema.uml#_QqKfIFEzEd-nO4bXYmJbIQ"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_QqZvsVEzEd-nO4bXYmJbIQ"/>
+          </children>
+          <children xmi:type="notation:Node" xmi:id="_RfBqkFEzEd-nO4bXYmJbIQ" type="3001">
+            <element xmi:type="uml:Property" href="database-schema.uml#_ReuvoFEzEd-nO4bXYmJbIQ"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_RfBqkVEzEd-nO4bXYmJbIQ"/>
+          </children>
+          <children xmi:type="notation:Node" xmi:id="_S--aYFEzEd-nO4bXYmJbIQ" type="3001">
+            <element xmi:type="uml:Property" href="database-schema.uml#_S-tUoFEzEd-nO4bXYmJbIQ"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_S--aYVEzEd-nO4bXYmJbIQ"/>
+          </children>
+          <children xmi:type="notation:Node" xmi:id="_udxm8FE1Ed-nO4bXYmJbIQ" type="3001">
+            <element xmi:type="uml:Property" href="database-schema.uml#_udhIQFE1Ed-nO4bXYmJbIQ"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_udxm8VE1Ed-nO4bXYmJbIQ"/>
+          </children>
+          <children xmi:type="notation:Node" xmi:id="_hCi0EFE5Ed-nO4bXYmJbIQ" type="3001">
+            <element xmi:type="uml:Property" href="database-schema.uml#_hCNc4FE5Ed-nO4bXYmJbIQ"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_hCi0EVE5Ed-nO4bXYmJbIQ"/>
+          </children>
+          <styles xmi:type="notation:TitleStyle" xmi:id="_fiURElExEd-nO4bXYmJbIQ" showTitle="true"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_fiURE1ExEd-nO4bXYmJbIQ"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_fiURFFExEd-nO4bXYmJbIQ"/>
+          <styles xmi:type="notation:CanonicalStyle" xmi:id="_fiURFVExEd-nO4bXYmJbIQ"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_fiURFlExEd-nO4bXYmJbIQ" type="7036">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_fiURF1ExEd-nO4bXYmJbIQ" showTitle="true"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_fiURGFExEd-nO4bXYmJbIQ"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_fiURGVExEd-nO4bXYmJbIQ"/>
+          <styles xmi:type="notation:CanonicalStyle" xmi:id="_fiURGlExEd-nO4bXYmJbIQ"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_fiURG1ExEd-nO4bXYmJbIQ" type="7037">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_fiURHFExEd-nO4bXYmJbIQ" showTitle="true"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_fiURHVExEd-nO4bXYmJbIQ"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_fiURHlExEd-nO4bXYmJbIQ"/>
+          <styles xmi:type="notation:CanonicalStyle" xmi:id="_fiURH1ExEd-nO4bXYmJbIQ"/>
+        </children>
+        <styles xmi:type="notation:CanonicalStyle" xmi:id="_fiTqAVExEd-nO4bXYmJbIQ"/>
+        <element xmi:type="uml:Class" href="database-schema.uml#_fiAIAFExEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_fiTqAlExEd-nO4bXYmJbIQ" x="450" y="8"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_XUbXsFEzEd-nO4bXYmJbIQ" type="3033" fontName="Sans">
+        <children xmi:type="notation:DecorationNode" xmi:id="_XUbXs1EzEd-nO4bXYmJbIQ" type="5021"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_XUb-wFEzEd-nO4bXYmJbIQ" type="5022"/>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_XUb-wVEzEd-nO4bXYmJbIQ" type="7035">
+          <children xmi:type="notation:Node" xmi:id="_s-LuYFEzEd-nO4bXYmJbIQ" type="3001">
+            <element xmi:type="uml:Property" href="database-schema.uml#_s92-QFEzEd-nO4bXYmJbIQ"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_s-LuYVEzEd-nO4bXYmJbIQ"/>
+          </children>
+          <children xmi:type="notation:Node" xmi:id="_uN30oFEzEd-nO4bXYmJbIQ" type="3001">
+            <element xmi:type="uml:Property" href="database-schema.uml#_uNk5sFEzEd-nO4bXYmJbIQ"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_uN30oVEzEd-nO4bXYmJbIQ"/>
+          </children>
+          <children xmi:type="notation:Node" xmi:id="_vjIXYFEzEd-nO4bXYmJbIQ" type="3001">
+            <element xmi:type="uml:Property" href="database-schema.uml#_viznQFEzEd-nO4bXYmJbIQ"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_vjIXYVEzEd-nO4bXYmJbIQ"/>
+          </children>
+          <styles xmi:type="notation:TitleStyle" xmi:id="_XUb-wlEzEd-nO4bXYmJbIQ" showTitle="true"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_XUb-w1EzEd-nO4bXYmJbIQ"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_XUb-xFEzEd-nO4bXYmJbIQ"/>
+          <styles xmi:type="notation:CanonicalStyle" xmi:id="_XUb-xVEzEd-nO4bXYmJbIQ"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_XUb-xlEzEd-nO4bXYmJbIQ" type="7036">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_XUb-x1EzEd-nO4bXYmJbIQ" showTitle="true"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_XUb-yFEzEd-nO4bXYmJbIQ"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_XUb-yVEzEd-nO4bXYmJbIQ"/>
+          <styles xmi:type="notation:CanonicalStyle" xmi:id="_XUb-ylEzEd-nO4bXYmJbIQ"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_XUb-y1EzEd-nO4bXYmJbIQ" type="7037">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_XUb-zFEzEd-nO4bXYmJbIQ" showTitle="true"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_XUb-zVEzEd-nO4bXYmJbIQ"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_XUb-zlEzEd-nO4bXYmJbIQ"/>
+          <styles xmi:type="notation:CanonicalStyle" xmi:id="_XUb-z1EzEd-nO4bXYmJbIQ"/>
+        </children>
+        <styles xmi:type="notation:CanonicalStyle" xmi:id="_XUbXsVEzEd-nO4bXYmJbIQ"/>
+        <element xmi:type="uml:Class" href="database-schema.uml#_XUGAgFEzEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_XUbXslEzEd-nO4bXYmJbIQ" x="735" y="163"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_9PCGsFEzEd-nO4bXYmJbIQ" type="3033" fontName="Sans">
+        <children xmi:type="notation:DecorationNode" xmi:id="_flic0FE0Ed-nO4bXYmJbIQ" type="5021"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_flic0VE0Ed-nO4bXYmJbIQ" type="5022"/>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_flic0lE0Ed-nO4bXYmJbIQ" type="7035">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_flic01E0Ed-nO4bXYmJbIQ" showTitle="true"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_flic1FE0Ed-nO4bXYmJbIQ"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_flic1VE0Ed-nO4bXYmJbIQ"/>
+          <styles xmi:type="notation:CanonicalStyle" xmi:id="_flic1lE0Ed-nO4bXYmJbIQ"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_flic11E0Ed-nO4bXYmJbIQ" type="7036">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_flic2FE0Ed-nO4bXYmJbIQ" showTitle="true"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_flic2VE0Ed-nO4bXYmJbIQ"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_flic2lE0Ed-nO4bXYmJbIQ"/>
+          <styles xmi:type="notation:CanonicalStyle" xmi:id="_flic21E0Ed-nO4bXYmJbIQ"/>
+        </children>
+        <children xmi:type="notation:BasicCompartment" xmi:id="_fljD4FE0Ed-nO4bXYmJbIQ" type="7037">
+          <styles xmi:type="notation:TitleStyle" xmi:id="_fljD4VE0Ed-nO4bXYmJbIQ" showTitle="true"/>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_fljD4lE0Ed-nO4bXYmJbIQ"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_fljD41E0Ed-nO4bXYmJbIQ"/>
+          <styles xmi:type="notation:CanonicalStyle" xmi:id="_fljD5FE0Ed-nO4bXYmJbIQ"/>
+        </children>
+        <styles xmi:type="notation:CanonicalStyle" xmi:id="_flh1wVE0Ed-nO4bXYmJbIQ"/>
+        <element xmi:type="uml:Class" href="database-schema.uml#_9Oi-gFEzEd-nO4bXYmJbIQ"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_9PCGslEzEd-nO4bXYmJbIQ" x="735" y="8"/>
+      </children>
+      <styles xmi:type="notation:CanonicalStyle" xmi:id="_brGu8FExEd-nO4bXYmJbIQ"/>
+    </children>
+    <styles xmi:type="notation:HintedDiagramLinkStyle" xmi:id="_brGH4VExEd-nO4bXYmJbIQ"/>
+    <element xmi:type="uml:Package" href="database-schema.uml#_bqx-0FExEd-nO4bXYmJbIQ"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_brGH4lExEd-nO4bXYmJbIQ" x="35" y="710" width="876" height="366"/>
+  </children>
+  <styles xmi:type="notation:DiagramStyle" xmi:id="_stWF8U7WEd-4z_lD9gn2Tw"/>
+  <styles xmi:type="uml2tools.notation:U2TDiagramCanonicalStyle" xmi:id="_stWF8k7WEd-4z_lD9gn2Tw"/>
+  <styles xmi:type="notation:FilteringStyle" xmi:id="_stWF807WEd-4z_lD9gn2Tw"/>
+  <element xmi:type="uml:Package" href="database-schema.uml#_sneugE7WEd-4z_lD9gn2Tw"/>
+  <edges xmi:type="notation:Edge" xmi:id="_KODf4E7ZEd-4z_lD9gn2Tw" type="4005" source="_v_krsE7WEd-4z_lD9gn2Tw" target="_yFYhoE7WEd-4z_lD9gn2Tw">
+    <children xmi:type="notation:DecorationNode" xmi:id="_KOEG8E7ZEd-4z_lD9gn2Tw" type="6003">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_KOEG8U7ZEd-4z_lD9gn2Tw" y="20"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_KOEG8k7ZEd-4z_lD9gn2Tw" type="6004">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_KOEG807ZEd-4z_lD9gn2Tw" x="-13" y="-35"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_KOEuAE7ZEd-4z_lD9gn2Tw" visible="false" type="6005">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_KOEuAU7ZEd-4z_lD9gn2Tw" y="-15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_KOEuAk7ZEd-4z_lD9gn2Tw" type="6006">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_KOEuA07ZEd-4z_lD9gn2Tw" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_KOEuBE7ZEd-4z_lD9gn2Tw" type="6007">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_KOEuBU7ZEd-4z_lD9gn2Tw" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_KOFVEE7ZEd-4z_lD9gn2Tw" type="6008">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_KOFVEU7ZEd-4z_lD9gn2Tw" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_KOFVEk7ZEd-4z_lD9gn2Tw" type="6009">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_KOFVE07ZEd-4z_lD9gn2Tw" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_KOFVFE7ZEd-4z_lD9gn2Tw" type="6019">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_KOFVFU7ZEd-4z_lD9gn2Tw" y="40"/>
+    </children>
+    <styles xmi:type="notation:RoutingStyle" xmi:id="_KODf4U7ZEd-4z_lD9gn2Tw"/>
+    <styles xmi:type="notation:FontStyle" xmi:id="_KODf4k7ZEd-4z_lD9gn2Tw" fontName="Sans"/>
+    <element xmi:type="uml:Association" href="database-schema.uml#_KN69AE7ZEd-4z_lD9gn2Tw"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_KODf407ZEd-4z_lD9gn2Tw" points="[24, -2, -283, 18]$[338, -21, 31, -1]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_KOOfAE7ZEd-4z_lD9gn2Tw" id="(0.8016528925619835,0.5961538461538461)"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_KOOfAU7ZEd-4z_lD9gn2Tw" id="(0.7753623188405797,0.49166666666666664)"/>
+  </edges>
+  <edges xmi:type="notation:Edge" xmi:id="_aUmFoE7ZEd-4z_lD9gn2Tw" type="4005" source="_OKybME7ZEd-4z_lD9gn2Tw" target="_yFYhoE7WEd-4z_lD9gn2Tw">
+    <children xmi:type="notation:DecorationNode" xmi:id="_aUmFpE7ZEd-4z_lD9gn2Tw" visible="false" type="6003">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_aUmFpU7ZEd-4z_lD9gn2Tw" y="20"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_aUmssE7ZEd-4z_lD9gn2Tw" type="6004">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_aUmssU7ZEd-4z_lD9gn2Tw" x="20" y="11"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_aUmssk7ZEd-4z_lD9gn2Tw" visible="false" type="6005">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_aUmss07ZEd-4z_lD9gn2Tw" y="-15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_aUmstE7ZEd-4z_lD9gn2Tw" type="6006">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_aUmstU7ZEd-4z_lD9gn2Tw" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_aUmstk7ZEd-4z_lD9gn2Tw" type="6007">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_aUmst07ZEd-4z_lD9gn2Tw" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_aUmsuE7ZEd-4z_lD9gn2Tw" type="6008">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_aUnTwE7ZEd-4z_lD9gn2Tw" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_aUnTwU7ZEd-4z_lD9gn2Tw" type="6009">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_aUnTwk7ZEd-4z_lD9gn2Tw" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_aUnTw07ZEd-4z_lD9gn2Tw" type="6019">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_aUnTxE7ZEd-4z_lD9gn2Tw" y="40"/>
+    </children>
+    <styles xmi:type="notation:RoutingStyle" xmi:id="_aUmFoU7ZEd-4z_lD9gn2Tw"/>
+    <styles xmi:type="notation:FontStyle" xmi:id="_aUmFok7ZEd-4z_lD9gn2Tw" fontName="Sans"/>
+    <element xmi:type="uml:Association" href="database-schema.uml#_aUdiwE7ZEd-4z_lD9gn2Tw"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_aUmFo07ZEd-4z_lD9gn2Tw" points="[26, -68, -16, 115]$[111, -205, 69, -22]"/>
+  </edges>
+  <edges xmi:type="notation:Edge" xmi:id="__6JwUFELEd-nO4bXYmJbIQ" type="4005" source="_OKybME7ZEd-4z_lD9gn2Tw" target="_JsoYYE7aEd-4z_lD9gn2Tw">
+    <children xmi:type="notation:DecorationNode" xmi:id="__6K-cFELEd-nO4bXYmJbIQ" type="6003">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="__6K-cVELEd-nO4bXYmJbIQ" y="20"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="__6K-clELEd-nO4bXYmJbIQ" visible="false" type="6004">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="__6K-c1ELEd-nO4bXYmJbIQ" y="-15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="__6LlgFELEd-nO4bXYmJbIQ" type="6005">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="__6LlgVELEd-nO4bXYmJbIQ" x="-28" y="-31"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="__6LlglELEd-nO4bXYmJbIQ" type="6006">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="__6Llg1ELEd-nO4bXYmJbIQ" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="__6LlhFELEd-nO4bXYmJbIQ" type="6007">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="__6LlhVELEd-nO4bXYmJbIQ" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="__6LlhlELEd-nO4bXYmJbIQ" type="6008">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="__6MMkFELEd-nO4bXYmJbIQ" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="__6MMkVELEd-nO4bXYmJbIQ" type="6009">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="__6MMklELEd-nO4bXYmJbIQ" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="__6MMk1ELEd-nO4bXYmJbIQ" type="6019">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="__6MMlFELEd-nO4bXYmJbIQ" y="40"/>
+    </children>
+    <styles xmi:type="notation:RoutingStyle" xmi:id="__6JwUVELEd-nO4bXYmJbIQ"/>
+    <styles xmi:type="notation:FontStyle" xmi:id="__6KXYFELEd-nO4bXYmJbIQ" fontName="Sans"/>
+    <element xmi:type="uml:Association" href="database-schema.uml#__5-xMFELEd-nO4bXYmJbIQ"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="__6KXYVELEd-nO4bXYmJbIQ" points="[25, 5, -315, -79]$[281, 60, -59, -24]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="__6XLsFELEd-nO4bXYmJbIQ" id="(0.7983870967741935,0.4264705882352941)"/>
+  </edges>
+  <edges xmi:type="notation:Edge" xmi:id="_PszUQFENEd-nO4bXYmJbIQ" type="4005" source="_BGLCEFENEd-nO4bXYmJbIQ" target="_JsoYYE7aEd-4z_lD9gn2Tw">
+    <children xmi:type="notation:DecorationNode" xmi:id="_Psz7UFENEd-nO4bXYmJbIQ" type="6003">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_Psz7UVENEd-nO4bXYmJbIQ" y="20"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_Psz7UlENEd-nO4bXYmJbIQ" type="6004">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_Psz7U1ENEd-nO4bXYmJbIQ" x="7" y="57"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_Psz7VFENEd-nO4bXYmJbIQ" visible="false" type="6005">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_Psz7VVENEd-nO4bXYmJbIQ" y="-15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_Ps0iYFENEd-nO4bXYmJbIQ" type="6006">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_Ps0iYVENEd-nO4bXYmJbIQ" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_Ps0iYlENEd-nO4bXYmJbIQ" type="6007">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_Ps0iY1ENEd-nO4bXYmJbIQ" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_Ps0iZFENEd-nO4bXYmJbIQ" type="6008">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_Ps0iZVENEd-nO4bXYmJbIQ" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_Ps0iZlENEd-nO4bXYmJbIQ" type="6009">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_Ps0iZ1ENEd-nO4bXYmJbIQ" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_Ps1JcFENEd-nO4bXYmJbIQ" type="6019">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_Ps1JcVENEd-nO4bXYmJbIQ" y="40"/>
+    </children>
+    <styles xmi:type="notation:RoutingStyle" xmi:id="_PszUQVENEd-nO4bXYmJbIQ"/>
+    <styles xmi:type="notation:FontStyle" xmi:id="_PszUQlENEd-nO4bXYmJbIQ" fontName="Sans"/>
+    <element xmi:type="uml:Association" href="database-schema.uml#_PsnuEFENEd-nO4bXYmJbIQ"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_PszUQ1ENEd-nO4bXYmJbIQ" points="[64, -44, -133, 68]$[138, -128, -59, -16]"/>
+  </edges>
+  <edges xmi:type="notation:Edge" xmi:id="_Rgam8FENEd-nO4bXYmJbIQ" type="4005" source="_JsoYYE7aEd-4z_lD9gn2Tw" target="_BGLCEFENEd-nO4bXYmJbIQ">
+    <children xmi:type="notation:DecorationNode" xmi:id="_Rgam9FENEd-nO4bXYmJbIQ" type="6003">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_Rgam9VENEd-nO4bXYmJbIQ" y="20"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_RgbOAFENEd-nO4bXYmJbIQ" visible="false" type="6004">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_RgbOAVENEd-nO4bXYmJbIQ" y="-15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_RgbOAlENEd-nO4bXYmJbIQ" type="6005">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_RgbOA1ENEd-nO4bXYmJbIQ" x="-11" y="59"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_RgbOBFENEd-nO4bXYmJbIQ" type="6006">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_RgbOBVENEd-nO4bXYmJbIQ" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_RgbOBlENEd-nO4bXYmJbIQ" type="6007">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_RgbOB1ENEd-nO4bXYmJbIQ" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_Rgb1EFENEd-nO4bXYmJbIQ" type="6008">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_Rgb1EVENEd-nO4bXYmJbIQ" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_Rgb1ElENEd-nO4bXYmJbIQ" type="6009">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_Rgb1E1ENEd-nO4bXYmJbIQ" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_Rgb1FFENEd-nO4bXYmJbIQ" type="6019">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_Rgb1FVENEd-nO4bXYmJbIQ" y="40"/>
+    </children>
+    <styles xmi:type="notation:RoutingStyle" xmi:id="_Rgam8VENEd-nO4bXYmJbIQ"/>
+    <styles xmi:type="notation:FontStyle" xmi:id="_Rgam8lENEd-nO4bXYmJbIQ" fontName="Sans"/>
+    <element xmi:type="uml:Association" href="database-schema.uml#_RgRdAFENEd-nO4bXYmJbIQ"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Rgam81ENEd-nO4bXYmJbIQ" points="[-53, 17, 187, -64]$[-209, 99, 31, 18]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Rgk_AFENEd-nO4bXYmJbIQ" id="(0.4491525423728814,0.7554347826086957)"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Rgk_AVENEd-nO4bXYmJbIQ" id="(0.7686567164179104,0.7386363636363636)"/>
+  </edges>
+  <edges xmi:type="notation:Edge" xmi:id="_nKfGsFENEd-nO4bXYmJbIQ" type="4005" source="_VBVI8FENEd-nO4bXYmJbIQ" target="_v_krsE7WEd-4z_lD9gn2Tw">
+    <children xmi:type="notation:DecorationNode" xmi:id="_nKftwFENEd-nO4bXYmJbIQ" type="6003">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_nKftwVENEd-nO4bXYmJbIQ" y="20"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_nKftwlENEd-nO4bXYmJbIQ" type="6004">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_nKftw1ENEd-nO4bXYmJbIQ" x="23" y="-27"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_nKftxFENEd-nO4bXYmJbIQ" visible="false" type="6005">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_nKftxVENEd-nO4bXYmJbIQ" y="-15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_nKgU0FENEd-nO4bXYmJbIQ" type="6006">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_nKgU0VENEd-nO4bXYmJbIQ" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_nKgU0lENEd-nO4bXYmJbIQ" type="6007">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_nKgU01ENEd-nO4bXYmJbIQ" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_nKgU1FENEd-nO4bXYmJbIQ" type="6008">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_nKg74FENEd-nO4bXYmJbIQ" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_nKg74VENEd-nO4bXYmJbIQ" type="6009">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_nKg74lENEd-nO4bXYmJbIQ" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_nKg741ENEd-nO4bXYmJbIQ" type="6019">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_nKg75FENEd-nO4bXYmJbIQ" y="40"/>
+    </children>
+    <styles xmi:type="notation:RoutingStyle" xmi:id="_nKfGsVENEd-nO4bXYmJbIQ"/>
+    <styles xmi:type="notation:FontStyle" xmi:id="_nKfGslENEd-nO4bXYmJbIQ" fontName="Sans"/>
+    <element xmi:type="uml:Association" href="database-schema.uml#_nKV8wFENEd-nO4bXYmJbIQ"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_nKfGs1ENEd-nO4bXYmJbIQ" points="[-60, -10, 185, 52]$[-280, -10, -35, 52]"/>
+  </edges>
+  <edges xmi:type="notation:Edge" xmi:id="_Zz2nUFEOEd-nO4bXYmJbIQ" type="4005" source="_BGLCEFENEd-nO4bXYmJbIQ" target="_yFYhoE7WEd-4z_lD9gn2Tw">
+    <children xmi:type="notation:DecorationNode" xmi:id="_Zz3OYVEOEd-nO4bXYmJbIQ" type="6003">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_Zz3OYlEOEd-nO4bXYmJbIQ" y="20"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_Zz31cFEOEd-nO4bXYmJbIQ" type="6004">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_Zz31cVEOEd-nO4bXYmJbIQ" x="15" y="-26"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_Zz31clEOEd-nO4bXYmJbIQ" visible="false" type="6005">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_Zz4cgFEOEd-nO4bXYmJbIQ" y="-15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_Zz4cgVEOEd-nO4bXYmJbIQ" type="6006">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_Zz4cglEOEd-nO4bXYmJbIQ" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_Zz4cg1EOEd-nO4bXYmJbIQ" type="6007">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_Zz4chFEOEd-nO4bXYmJbIQ" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_Zz4chVEOEd-nO4bXYmJbIQ" type="6008">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_Zz4chlEOEd-nO4bXYmJbIQ" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_Zz5DkFEOEd-nO4bXYmJbIQ" type="6009">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_Zz5DkVEOEd-nO4bXYmJbIQ" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_Zz5DklEOEd-nO4bXYmJbIQ" type="6019">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_Zz5Dk1EOEd-nO4bXYmJbIQ" y="40"/>
+    </children>
+    <styles xmi:type="notation:RoutingStyle" xmi:id="_Zz2nUVEOEd-nO4bXYmJbIQ"/>
+    <styles xmi:type="notation:FontStyle" xmi:id="_Zz2nUlEOEd-nO4bXYmJbIQ" fontName="Sans"/>
+    <element xmi:type="uml:Association" href="database-schema.uml#_ZzvSkFEOEd-nO4bXYmJbIQ"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Zz3OYFEOEd-nO4bXYmJbIQ" points="[-95, -16, 681, 118]$[-736, -74, 40, 60]"/>
+  </edges>
+  <edges xmi:type="notation:Edge" xmi:id="_u7S7IFEOEd-nO4bXYmJbIQ" type="4005" source="_mzz2oFEOEd-nO4bXYmJbIQ" target="_OKybME7ZEd-4z_lD9gn2Tw">
+    <children xmi:type="notation:DecorationNode" xmi:id="_u7TiMFEOEd-nO4bXYmJbIQ" type="6003">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_u7TiMVEOEd-nO4bXYmJbIQ" y="20"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_u7TiMlEOEd-nO4bXYmJbIQ" type="6004">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_u7UJQFEOEd-nO4bXYmJbIQ" x="18" y="-26"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_u7UJQVEOEd-nO4bXYmJbIQ" visible="false" type="6005">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_u7UJQlEOEd-nO4bXYmJbIQ" y="-15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_u7UJQ1EOEd-nO4bXYmJbIQ" type="6006">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_u7UJRFEOEd-nO4bXYmJbIQ" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_u7UJRVEOEd-nO4bXYmJbIQ" type="6007">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_u7UJRlEOEd-nO4bXYmJbIQ" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_u7UwUFEOEd-nO4bXYmJbIQ" type="6008">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_u7UwUVEOEd-nO4bXYmJbIQ" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_u7UwUlEOEd-nO4bXYmJbIQ" type="6009">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_u7UwU1EOEd-nO4bXYmJbIQ" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_u7UwVFEOEd-nO4bXYmJbIQ" type="6019">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_u7UwVVEOEd-nO4bXYmJbIQ" y="40"/>
+    </children>
+    <styles xmi:type="notation:RoutingStyle" xmi:id="_u7S7IVEOEd-nO4bXYmJbIQ"/>
+    <styles xmi:type="notation:FontStyle" xmi:id="_u7S7IlEOEd-nO4bXYmJbIQ" fontName="Sans"/>
+    <element xmi:type="uml:Association" href="database-schema.uml#_u7KYQFEOEd-nO4bXYmJbIQ"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_u7S7I1EOEd-nO4bXYmJbIQ" points="[71, 20, -115, -56]$[147, 8, -39, -68]"/>
+  </edges>
+  <edges xmi:type="notation:Edge" xmi:id="_vWbX8FEOEd-nO4bXYmJbIQ" type="4005" source="_mzz2oFEOEd-nO4bXYmJbIQ" target="_yFYhoE7WEd-4z_lD9gn2Tw">
+    <children xmi:type="notation:DecorationNode" xmi:id="_vWb_AFEOEd-nO4bXYmJbIQ" type="6003">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_vWb_AVEOEd-nO4bXYmJbIQ" y="20"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_vWb_AlEOEd-nO4bXYmJbIQ" type="6004">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_vWb_A1EOEd-nO4bXYmJbIQ" x="-26" y="-38"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_vWb_BFEOEd-nO4bXYmJbIQ" visible="false" type="6005">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_vWcmEFEOEd-nO4bXYmJbIQ" y="-15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_vWcmEVEOEd-nO4bXYmJbIQ" type="6006">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_vWcmElEOEd-nO4bXYmJbIQ" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_vWcmE1EOEd-nO4bXYmJbIQ" type="6007">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_vWcmFFEOEd-nO4bXYmJbIQ" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_vWcmFVEOEd-nO4bXYmJbIQ" type="6008">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_vWcmFlEOEd-nO4bXYmJbIQ" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_vWdNIFEOEd-nO4bXYmJbIQ" type="6009">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_vWdNIVEOEd-nO4bXYmJbIQ" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_vWdNIlEOEd-nO4bXYmJbIQ" type="6019">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_vWdNI1EOEd-nO4bXYmJbIQ" y="40"/>
+    </children>
+    <styles xmi:type="notation:RoutingStyle" xmi:id="_vWbX8VEOEd-nO4bXYmJbIQ"/>
+    <styles xmi:type="notation:FontStyle" xmi:id="_vWbX8lEOEd-nO4bXYmJbIQ" fontName="Sans"/>
+    <element xmi:type="uml:Association" href="database-schema.uml#_vWUqQFEOEd-nO4bXYmJbIQ"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_vWbX81EOEd-nO4bXYmJbIQ" points="[-60, 52, 92, -81]$[-164, 151, -12, 18]"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_vWlI8FEOEd-nO4bXYmJbIQ" id="(0.34,0.7954545454545454)"/>
+  </edges>
+  <edges xmi:type="notation:Edge" xmi:id="_-k7icFEOEd-nO4bXYmJbIQ" type="4005" source="_mzz2oFEOEd-nO4bXYmJbIQ" target="_yFYhoE7WEd-4z_lD9gn2Tw">
+    <children xmi:type="notation:DecorationNode" xmi:id="_-k8JgFEOEd-nO4bXYmJbIQ" type="6003">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_-k8JgVEOEd-nO4bXYmJbIQ" y="20"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_-k8JglEOEd-nO4bXYmJbIQ" type="6004">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_-k8Jg1EOEd-nO4bXYmJbIQ" x="32" y="57"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_-k8JhFEOEd-nO4bXYmJbIQ" visible="false" type="6005">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_-k8JhVEOEd-nO4bXYmJbIQ" y="-15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_-k8wkFEOEd-nO4bXYmJbIQ" type="6006">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_-k8wkVEOEd-nO4bXYmJbIQ" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_-k8wklEOEd-nO4bXYmJbIQ" type="6007">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_-k8wk1EOEd-nO4bXYmJbIQ" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_-k8wlFEOEd-nO4bXYmJbIQ" type="6008">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_-k8wlVEOEd-nO4bXYmJbIQ" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_-k8wllEOEd-nO4bXYmJbIQ" type="6009">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_-k8wl1EOEd-nO4bXYmJbIQ" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_-k9XoFEOEd-nO4bXYmJbIQ" type="6019">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_-k9XoVEOEd-nO4bXYmJbIQ" y="40"/>
+    </children>
+    <styles xmi:type="notation:RoutingStyle" xmi:id="_-k7icVEOEd-nO4bXYmJbIQ"/>
+    <styles xmi:type="notation:FontStyle" xmi:id="_-k7iclEOEd-nO4bXYmJbIQ" fontName="Sans"/>
+    <element xmi:type="uml:Association" href="database-schema.uml#_-kyYgFEOEd-nO4bXYmJbIQ"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_-k7ic1EOEd-nO4bXYmJbIQ" points="[-7, 10, 91, -139]$[-122, 147, -24, -2]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_-lEFUFEOEd-nO4bXYmJbIQ" id="(0.04929577464788732,0.41346153846153844)"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_-lEsYFEOEd-nO4bXYmJbIQ" id="(0.24,0.4772727272727273)"/>
+  </edges>
+  <edges xmi:type="notation:Edge" xmi:id="_CSyUQFEPEd-nO4bXYmJbIQ" type="4005" source="_9C6ykFENEd-nO4bXYmJbIQ" target="_JsoYYE7aEd-4z_lD9gn2Tw">
+    <children xmi:type="notation:DecorationNode" xmi:id="_CSyURFEPEd-nO4bXYmJbIQ" type="6003">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_CSy7UFEPEd-nO4bXYmJbIQ" y="20"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_CSy7UVEPEd-nO4bXYmJbIQ" type="6004">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_CSy7UlEPEd-nO4bXYmJbIQ" x="-6" y="-27"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_CSy7U1EPEd-nO4bXYmJbIQ" visible="false" type="6005">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_CSy7VFEPEd-nO4bXYmJbIQ" y="-15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_CSziYFEPEd-nO4bXYmJbIQ" type="6006">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_CSziYVEPEd-nO4bXYmJbIQ" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_CSziYlEPEd-nO4bXYmJbIQ" type="6007">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_CSziY1EPEd-nO4bXYmJbIQ" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_CSziZFEPEd-nO4bXYmJbIQ" type="6008">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_CSziZVEPEd-nO4bXYmJbIQ" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_CSziZlEPEd-nO4bXYmJbIQ" type="6009">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_CSziZ1EPEd-nO4bXYmJbIQ" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_CS0JcFEPEd-nO4bXYmJbIQ" type="6019">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_CS0JcVEPEd-nO4bXYmJbIQ" y="40"/>
+    </children>
+    <styles xmi:type="notation:RoutingStyle" xmi:id="_CSyUQVEPEd-nO4bXYmJbIQ"/>
+    <styles xmi:type="notation:FontStyle" xmi:id="_CSyUQlEPEd-nO4bXYmJbIQ" fontName="Sans"/>
+    <element xmi:type="uml:Association" href="database-schema.uml#_CSqYcFEPEd-nO4bXYmJbIQ"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_CSyUQ1EPEd-nO4bXYmJbIQ" points="[38, -60, -118, 185]$[97, -157, -59, 88]"/>
+  </edges>
+  <edges xmi:type="notation:Edge" xmi:id="_G9rWEFEPEd-nO4bXYmJbIQ" type="4005" source="_9C6ykFENEd-nO4bXYmJbIQ" target="_v_krsE7WEd-4z_lD9gn2Tw">
+    <children xmi:type="notation:DecorationNode" xmi:id="_G9r9IFEPEd-nO4bXYmJbIQ" type="6003">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_G9r9IVEPEd-nO4bXYmJbIQ" y="20"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_G9r9IlEPEd-nO4bXYmJbIQ" type="6004">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_G9r9I1EPEd-nO4bXYmJbIQ" x="-41" y="-17"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_G9r9JFEPEd-nO4bXYmJbIQ" visible="false" type="6005">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_G9r9JVEPEd-nO4bXYmJbIQ" y="-15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_G9skMFEPEd-nO4bXYmJbIQ" type="6006">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_G9skMVEPEd-nO4bXYmJbIQ" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_G9skMlEPEd-nO4bXYmJbIQ" type="6007">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_G9skM1EPEd-nO4bXYmJbIQ" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_G9skNFEPEd-nO4bXYmJbIQ" type="6008">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_G9skNVEPEd-nO4bXYmJbIQ" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_G9tLQFEPEd-nO4bXYmJbIQ" type="6009">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_G9tLQVEPEd-nO4bXYmJbIQ" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_G9tLQlEPEd-nO4bXYmJbIQ" type="6019">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_G9tLQ1EPEd-nO4bXYmJbIQ" y="40"/>
+    </children>
+    <styles xmi:type="notation:RoutingStyle" xmi:id="_G9rWEVEPEd-nO4bXYmJbIQ"/>
+    <styles xmi:type="notation:FontStyle" xmi:id="_G9rWElEPEd-nO4bXYmJbIQ" fontName="Sans"/>
+    <element xmi:type="uml:Association" href="database-schema.uml#_G9lPcFEPEd-nO4bXYmJbIQ"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_G9rWE1EPEd-nO4bXYmJbIQ" points="[0, 25, 576, 169]$[0, 60, 576, 204]$[-576, 60, 0, 204]$[-576, -81, 0, 63]"/>
+    <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_G9z48FEPEd-nO4bXYmJbIQ" id="(0.6377952755905512,0.7916666666666666)"/>
+    <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_G90gAFEPEd-nO4bXYmJbIQ" id="(0.8677685950413223,0.3942307692307692)"/>
+  </edges>
+  <edges xmi:type="notation:Edge" xmi:id="_vXLT8FEQEd-nO4bXYmJbIQ" type="4005" source="_VBVI8FENEd-nO4bXYmJbIQ" target="_9C6ykFENEd-nO4bXYmJbIQ">
+    <children xmi:type="notation:DecorationNode" xmi:id="_vXL7AFEQEd-nO4bXYmJbIQ" type="6003">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_vXL7AVEQEd-nO4bXYmJbIQ" y="20"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_vXL7AlEQEd-nO4bXYmJbIQ" type="6004">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_vXL7A1EQEd-nO4bXYmJbIQ" x="38" y="-15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_vXMiEFEQEd-nO4bXYmJbIQ" visible="false" type="6005">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_vXMiEVEQEd-nO4bXYmJbIQ" y="-15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_vXMiElEQEd-nO4bXYmJbIQ" type="6006">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_vXMiE1EQEd-nO4bXYmJbIQ" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_vXMiFFEQEd-nO4bXYmJbIQ" type="6007">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_vXMiFVEQEd-nO4bXYmJbIQ" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_vXMiFlEQEd-nO4bXYmJbIQ" type="6008">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_vXMiF1EQEd-nO4bXYmJbIQ" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_vXNJIFEQEd-nO4bXYmJbIQ" type="6009">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_vXNJIVEQEd-nO4bXYmJbIQ" y="15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_vXNJIlEQEd-nO4bXYmJbIQ" type="6019">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_vXNJI1EQEd-nO4bXYmJbIQ" y="40"/>
+    </children>
+    <styles xmi:type="notation:RoutingStyle" xmi:id="_vXLT8VEQEd-nO4bXYmJbIQ"/>
+    <styles xmi:type="notation:FontStyle" xmi:id="_vXLT8lEQEd-nO4bXYmJbIQ" fontName="Sans"/>
+    <element xmi:type="uml:Association" href="database-schema.uml#_vXCKAFEQEd-nO4bXYmJbIQ"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_vXLT81EQEd-nO4bXYmJbIQ" points="[69, 1, -245, -9]$[246, -40, -68, -50]"/>
+  </edges>
+  <edges xmi:type="notation:Edge" xmi:id="_vzxT4FEREd-nO4bXYmJbIQ" type="4005" source="_VBVI8FENEd-nO4bXYmJbIQ" target="_JsoYYE7aEd-4z_lD9gn2Tw">
+    <children xmi:type="notation:DecorationNode" xmi:id="_vzxT5FEREd-nO4bXYmJbIQ" type="6003">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_vzxT5VEREd-nO4bXYmJbIQ" y="20"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_vzx68FEREd-nO4bXYmJbIQ" type="6004">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_vzx68VEREd-nO4bXYmJbIQ" x="-13" y="-12"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_vzx68lEREd-nO4bXYmJbIQ" visible="false" type="6005">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_vzx681EREd-nO4bXYmJbIQ" y="-15"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_vzx69FEREd-nO4bXYmJbIQ" type="6006">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_vzx69VER

<TRUNCATED>

[39/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/resources/t2flow/apiconsumer.t2flow
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/resources/t2flow/apiconsumer.t2flow b/taverna-integration-tests/src/test/resources/t2flow/apiconsumer.t2flow
new file mode 100644
index 0000000..66ef4ac
--- /dev/null
+++ b/taverna-integration-tests/src/test/resources/t2flow/apiconsumer.t2flow
@@ -0,0 +1,178 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3.0"><dataflow id="8bf2b5e5-a3e0-4fbd-bfd2-aefc7b2a6b8a" role="top"><name>Workflow4</name><inputPorts><port><name>in</name><depth>0</depth><granularDepth>0</granularDepth><annotations /></port></inputPorts><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>String</name><inputPorts><port><name>string</name><depth>0</depth></port></inputPorts><outputPorts><port><name>object</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>apiconsumer-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.apiconsumer.ApiConsumerActivity</class><inputMap><map from="string" to="string" /></inputMap><outputMap><map from="object" to="object" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.apic
 onsumer.ApiConsumerActivityConfigurationBean xmlns="">
+  <inputs />
+  <outputs />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <apiConsumerName>No name</apiConsumerName>
+  <apiConsumerDescription>No description</apiConsumerDescription>
+  <description />
+  <className>java.lang.String</className>
+  <methodName>String</methodName>
+  <parameterNames>
+    <string>string</string>
+  </parameterNames>
+  <parameterDimensions>
+    <int>0</int>
+  </parameterDimensions>
+  <parameterTypes>
+    <string>java.lang.String</string>
+  </parameterTypes>
+  <returnType>java.lang.String</returnType>
+  <returnDimension>0</returnDimension>
+  <isMethodStatic>false</isMethodStatic>
+  <isMethodConstructor>true</isMethodConstructor>
+</net.sf.taverna.t2.activities.apiconsumer.ApiConsumerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="string" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>toUpperCase</name><inputPorts><port><name>object</name><depth>0</depth></port></inputPorts><outputPorts><port><name>result</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>apiconsumer-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.apiconsumer.ApiConsumerActivity</cl
 ass><inputMap><map from="object" to="object" /></inputMap><outputMap><map from="result" to="result" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.apiconsumer.ApiConsumerActivityConfigurationBean xmlns="">
+  <inputs />
+  <outputs />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <apiConsumerName>No name</apiConsumerName>
+  <apiConsumerDescription>No description</apiConsumerDescription>
+  <description />
+  <className>java.lang.String</className>
+  <methodName>toUpperCase</methodName>
+  <parameterNames />
+  <parameterDimensions />
+  <parameterTypes />
+  <returnType>java.lang.String</returnType>
+  <returnDimension>0</returnDimension>
+  <isMethodStatic>false</isMethodStatic>
+  <isMethodConstructor>false</isMethodConstructor>
+</net.sf.taverna.t2.activities.apiconsumer.ApiConsumerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="object" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>String</processor><port>string</port></sink><source type="dataflow"><port>in</port></source></datalink><datalink><sink type="processor"><processor>toUpperCase</processor><port>object</port></sink><source type="processor"><processor>String</processor><port>object</port></source></datalink><datalink><sink type="dataflow"><port>out</port></sink><source type="proc
 essor"><processor>toUpperCase</processor><port>result</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>483d65c6-98c1-4b94-b628-d5bcbf351e97</identification>
+      </annotationBean>
+      <date>2011-05-16 13:07:03.385 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>d460e60a-43bb-47fc-a9f4-89e15274b100</identification>
+      </annotationBean>
+      <date>2011-11-02 12:43:09.911 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>0d977496-aa5d-4274-9827-85400d5f13a2</identification>
+      </annotationBean>
+      <date>2011-05-16 13:06:33.69 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>8bf2b5e5-a3e0-4fbd-bfd2-aefc7b2a6b8a</identification>
+      </annotationBean>
+      <date>2011-11-02 12:46:41.313 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>58f30a52-57df-46ce-b1bb-b9533984f8dd</identification>
+      </annotationBean>
+      <date>2011-11-02 12:29:15.575 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>c2693c41-1373-48cf-afbe-d8bbe0ea9e35</identification>
+      </annotationBean>
+      <date>2011-11-02 12:31:01.678 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>1ce7f3a0-71f4-4794-8bbd-dbb6de42442d</identification>
+      </annotationBean>
+      <date>2011-05-16 12:57:01.975 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>4c2b6995-eecb-47a7-b72c-63cfb96b6852</identification>
+      </annotationBean>
+      <date>2011-11-02 12:43:51.355 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>225db881-4e07-4cdb-920c-343dc1536edc</identification>
+      </annotationBean>
+      <date>2011-05-16 13:10:54.588 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>404e203c-ce51-4a9f-907c-1dab7f2eaaa2</identification>
+      </annotationBean>
+      <date>2011-05-16 12:44:02.533 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>0b6881f1-aa8d-483e-a7bb-7ad38b1da778</identification>
+      </annotationBean>
+      <date>2011-05-16 12:26:38.721 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/resources/t2flow/beanshell.t2flow
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/resources/t2flow/beanshell.t2flow b/taverna-integration-tests/src/test/resources/t2flow/beanshell.t2flow
new file mode 100644
index 0000000..8c5968c
--- /dev/null
+++ b/taverna-integration-tests/src/test/resources/t2flow/beanshell.t2flow
@@ -0,0 +1,137 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.2.0"><dataflow id="78cb1427-d57f-42c2-a385-1d20c1580f3b" role="top"><name>Workflow13</name><inputPorts><port><name>in</name><depth>0</depth><granularDepth>0</granularDepth><annotations /></port></inputPorts><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>Echo</name><inputPorts><port><name>in</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>beanshell-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.beanshell.BeanshellActivity</class><inputMap><map from="in" to="in" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfi
 gurationBean xmlns="">
+  <script>out=in;</script>
+  <dependencies />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>0</granularDepth>
+      <name>out</name>
+      <depth>0</depth>
+      <mimeTypes />
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>ListGenerator</name><inputPorts><port><name>in</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>1</depth><granularDepth>1</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>beanshell-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.beanshell.BeanshellActivity</class><inputMap><
 map from="in" to="in" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean xmlns="">
+  <script>out = new ArrayList();
+
+for (int i = 0; i &lt; 1000; i++) {
+  out.add(in + ":" + i);
+}</script>
+  <dependencies />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>1</granularDepth>
+      <name>out</name>
+      <depth>1</depth>
+      <mimeTypes />
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>Echo</processor><port>in</port></sink><source type="processor"><processor>ListGenerator</processor><port>out</port></source></datalink><datalink><sink type="processor"><processor>ListGenerator</processor><port>in</port></sink><source type="dataflow"><port>in</port></source></datalink><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><
 processor>Echo</processor><port>out</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>13c70169-dfaa-4ea6-b6ab-3551dae7fa84</identification>
+      </annotationBean>
+      <date>2010-08-19 12:28:57.881 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>7ef10e93-7376-41a9-9255-552149094142</identification>
+      </annotationBean>
+      <date>2010-08-31 13:06:57.536 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>3b7c0b9c-572d-466b-af6d-0fb40699e8a5</identification>
+      </annotationBean>
+      <date>2010-08-31 12:50:40.306 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>eb6a550d-f34e-4de9-b0fc-1b3df8ab36c4</identification>
+      </annotationBean>
+      <date>2010-08-31 14:32:44.634 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>78cb1427-d57f-42c2-a385-1d20c1580f3b</identification>
+      </annotationBean>
+      <date>2010-08-31 14:36:00.297 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>ad638364-a6e0-4852-abca-9f609c9553d2</identification>
+      </annotationBean>
+      <date>2010-08-19 13:43:43.797 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/resources/t2flow/biomart.t2flow
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/resources/t2flow/biomart.t2flow b/taverna-integration-tests/src/test/resources/t2flow/biomart.t2flow
new file mode 100644
index 0000000..f82f340
--- /dev/null
+++ b/taverna-integration-tests/src/test/resources/t2flow/biomart.t2flow
@@ -0,0 +1,30 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3.0"><dataflow id="4a959e22-8166-4e8b-ae94-6e85c8807e35" role="top"><name>Workflow1</name><inputPorts /><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>btaurus_gene_ensembl</name><inputPorts /><outputPorts><port><name>btaurus_gene_ensembl.ensembl_gene_id</name><depth>1</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>biomart-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.biomart.BiomartActivity</class><inputMap /><outputMap><map from="btaurus_gene_ensembl.ensembl_gene_id" to="btaurus_gene_ensembl.ensembl_gene_id" /></outputMap><configBean encoding="jdomxml"><MartQuery xmlns=""><MartService location="http://www.biomart.org/biomart/martservice" /><MartDataset displayName="Bos taurus genes (UMD3.1)" nam
 e="btaurus_gene_ensembl" type="TableSet" initialBatchSize="200" maximumBatchSize="50000" visible="false" interface="default" modified="2011-09-07 22:16:01"><MartURLLocation database="ensembl_mart_64" default="1" displayName="ENSEMBL GENES 64 (SANGER UK)" host="www.biomart.org" includeDatasets="" martUser="" name="ensembl" path="/biomart/martservice" port="80" serverVirtualSchema="default" virtualSchema="default" visible="1" redirect="0" /></MartDataset><Query virtualSchemaName="default" count="0" uniqueRows="1" softwareVersion="0.6" requestId="taverna"><Dataset name="btaurus_gene_ensembl"><Attribute name="ensembl_gene_id" /><Filter name="chromosome_name" value="1" /><Filter name="with_affy_bovine" excluded="0" /><Filter name="go_evidence_code" value="IDA" /></Dataset></Query></MartQuery></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><cla
 ss>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>btaurus_gene_ensembl</processor><port>btaurus_gene_ensembl.ensembl_gene_id</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>4a959e22-8166-4e8b-ae94-6e85c8807e35</identification>
+      </annotationBean>
+      <date>2011-10-27 14:33:16.228 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>5859741c-a0ba-4dae-8b81-1dd7c928562f</identification>
+      </annotationBean>
+      <date>2011-10-27 14:32:47.106 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/resources/t2flow/dataflow.t2flow
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/resources/t2flow/dataflow.t2flow b/taverna-integration-tests/src/test/resources/t2flow/dataflow.t2flow
new file mode 100644
index 0000000..c9366c2
--- /dev/null
+++ b/taverna-integration-tests/src/test/resources/t2flow/dataflow.t2flow
@@ -0,0 +1,217 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3.0"><dataflow id="ac4ce40a-57b9-486c-bb4c-eb8609c6cc48" role="top"><name>Workflow1</name><inputPorts><port><name>in</name><depth>0</depth><granularDepth>0</granularDepth><annotations /></port></inputPorts><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>Nested_workflow</name><inputPorts><port><name>in</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>dataflow-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.dataflow.DataflowActivity</class><inputMap><map from="in" to="in" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="dataflow"><dataflow ref="c6b258ac-3588-4828-b71c-207bad8b63c4" /
 ></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>echo</name><inputPorts><port><name>in</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>beanshell-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.beanshell.BeanshellActivity</class><inputMap><map from=
 "in" to="in" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>in</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>out</name>
+      <depth>0</depth>
+      <mimeTypes />
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>out = in;</script>
+  <dependencies />
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>echo_2</name><inputPorts><port><name>in</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>beanshell-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.beanshell.BeanshellActivity</class><inputMap><map fro
 m="in" to="in" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>in</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>out</name>
+      <depth>0</depth>
+      <mimeTypes />
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>out = in;</script>
+  <dependencies />
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>Nested_workflow</processor><port>in</port></sink><source type="processor"><processor>echo</processor><port>out</port></source></datalink><datalink><sink type="processor"><processor>echo</processor><port>in</port></sink><source type="dataflow"><port>in</port></source></datalink><datalink><sink type="processor"><processor>echo_2</processor><port>in</port></sink><sou
 rce type="processor"><processor>Nested_workflow</processor><port>out</port></source></datalink><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>echo_2</processor><port>out</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>437a237a-03a0-489f-97c6-fd5acc5db18e</identification>
+      </annotationBean>
+      <date>2011-11-09 10:59:10.221 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>ae7626c8-13a4-4560-9496-59a8cc0693be</identification>
+      </annotationBean>
+      <date>2011-02-16 11:57:10.514 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>96d450ff-aaf8-473b-91a1-4acce7371c3b</identification>
+      </annotationBean>
+      <date>2011-02-16 11:55:55.618 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>ac4ce40a-57b9-486c-bb4c-eb8609c6cc48</identification>
+      </annotationBean>
+      <date>2011-11-09 11:02:29.60 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>9f957cde-a7ad-4453-a09f-7231c8c8c4f3</identification>
+      </annotationBean>
+      <date>2011-02-16 11:52:40.88 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>f847ed6f-2834-4861-a8af-73ab737c6a91</identification>
+      </annotationBean>
+      <date>2011-11-09 11:00:41.783 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow><dataflow id="c6b258ac-3588-4828-b71c-207bad8b63c4" role="nested"><name>Workflow4</name><inputPorts><port><name>in</name><depth>0</depth><granularDepth>0</granularDepth><annotations /></port></inputPorts><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>echo</name><inputPorts><port><name>in</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>beanshell-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.beanshell.BeanshellActivity</class><inputMap><map from="in" to="in" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivit
 yConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>in</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>out</name>
+      <depth>0</depth>
+      <mimeTypes />
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>out = "nested dataflow : " + in;</script>
+  <dependencies />
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>echo</processor><port>in</port></sink><source type="dataflow"><port>in</port></source></datalink><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>echo</processor><port>out</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>f8dd3fb7-7051-4242-a3af-d82056934cf6</identification>
+      </annotationBean>
+      <date>2011-02-16 11:55:01.559 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>0a0b6f17-8ebf-4017-ad4c-0719a9d44806</identification>
+      </annotationBean>
+      <date>2011-11-09 11:00:37.241 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>c6b258ac-3588-4828-b71c-207bad8b63c4</identification>
+      </annotationBean>
+      <date>2011-11-09 11:02:26.99 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>eaa8b2a0-e71b-4d6a-b8ad-c299a8ad6e18</identification>
+      </annotationBean>
+      <date>2011-02-16 11:53:12.59 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/resources/t2flow/in-out.t2flow
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/resources/t2flow/in-out.t2flow b/taverna-integration-tests/src/test/resources/t2flow/in-out.t2flow
new file mode 100644
index 0000000..5d82fce
--- /dev/null
+++ b/taverna-integration-tests/src/test/resources/t2flow/in-out.t2flow
@@ -0,0 +1,12 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.4.0"><dataflow id="81a77b8f-91e7-4141-bb2b-f9e3a723e026" role="top"><name>Workflow169</name><inputPorts><port><name>in</name><depth>0</depth><granularDepth>0</granularDepth><annotations /></port></inputPorts><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors /><conditions /><datalinks><datalink><sink type="dataflow"><port>out</port></sink><source type="dataflow"><port>in</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>81a77b8f-91e7-4141-bb2b-f9e3a723e026</identification>
+      </annotationBean>
+      <date>2012-10-30 13:53:00.147 UTC</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/resources/t2flow/input.txt
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/resources/t2flow/input.txt b/taverna-integration-tests/src/test/resources/t2flow/input.txt
new file mode 100644
index 0000000..aa3bc42
--- /dev/null
+++ b/taverna-integration-tests/src/test/resources/t2flow/input.txt
@@ -0,0 +1 @@
+test input value
\ No newline at end of file


[44/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-database-configuration-impl/src/main/java/uk/org/taverna/configuration/database/impl/DatabaseConfigurationImpl.java
----------------------------------------------------------------------
diff --git a/taverna-database-configuration-impl/src/main/java/uk/org/taverna/configuration/database/impl/DatabaseConfigurationImpl.java b/taverna-database-configuration-impl/src/main/java/uk/org/taverna/configuration/database/impl/DatabaseConfigurationImpl.java
new file mode 100644
index 0000000..de73269
--- /dev/null
+++ b/taverna-database-configuration-impl/src/main/java/uk/org/taverna/configuration/database/impl/DatabaseConfigurationImpl.java
@@ -0,0 +1,252 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.configuration.database.impl;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import uk.org.taverna.configuration.database.DatabaseConfiguration;
+import uk.org.taverna.configuration.AbstractConfigurable;
+import uk.org.taverna.configuration.ConfigurationManager;
+
+/**
+ * Configuration for the reference service and provenance.
+ *
+ * @author David Withers
+ * @author Stuart Owen
+ */
+
+public class DatabaseConfigurationImpl extends AbstractConfigurable implements DatabaseConfiguration {
+
+	private Map<String, String> defaultPropertyMap;
+
+	private boolean autoSave = true;
+
+	public DatabaseConfigurationImpl(ConfigurationManager configurationManager) {
+		super(configurationManager);
+	}
+
+	@Override
+	public boolean isAutoSave() {
+		return autoSave;
+	}
+
+	@Override
+	public void enableAutoSave() {
+		autoSave = true;
+	}
+
+	@Override
+	public void disableAutoSave() {
+		autoSave = false;
+	}
+
+	@Override
+	protected void store() {
+		if (autoSave) {
+			super.store();
+		}
+	}
+
+	@Override
+	public boolean isInMemory() {
+		return getProperty(IN_MEMORY).equalsIgnoreCase("true");
+	}
+
+	@Override
+	public void setInMemory(boolean value) {
+		setProperty(IN_MEMORY, String.valueOf(value));
+	}
+
+	@Override
+	public boolean isExposeDatanature() {
+		return getProperty(EXPOSE_DATANATURE).equalsIgnoreCase("true");
+	}
+
+	@Override
+	public void setExposeDatanature(boolean exposeDatanature) {
+		setProperty(EXPOSE_DATANATURE, String.valueOf(exposeDatanature));
+	}
+
+	@Override
+	public String getDatabaseContext() {
+		if (getProperty(IN_MEMORY).equalsIgnoreCase("true")) {
+			return IN_MEMORY_CONTEXT;
+		} else {
+			return HIBERNATE_CONTEXT;
+		}
+	}
+
+	@Override
+	public void setPort(int port) {
+		setPort(String.valueOf(port));
+	}
+
+	@Override
+	public void setPort(String port) {
+		setProperty(PORT, port);
+	}
+
+	@Override
+	public void setDriverClassName(String driverClassName) {
+		setProperty(DRIVER_CLASS_NAME, driverClassName);
+	}
+
+	@Override
+	public String getDriverClassName() {
+		return getProperty(DRIVER_CLASS_NAME);
+	}
+
+	@Override
+	public boolean isProvenanceEnabled() {
+		return getProperty(ENABLE_PROVENANCE).equalsIgnoreCase("true");
+	}
+
+	@Override
+	public void setProvenanceEnabled(boolean value) {
+		setProperty(ENABLE_PROVENANCE, String.valueOf(value));
+	}
+
+	@Override
+	public void setStartInternalDerbyServer(boolean value) {
+		setProperty(START_INTERNAL_DERBY, String.valueOf(value));
+	}
+
+	@Override
+	public boolean getStartInternalDerbyServer() {
+		return getProperty(START_INTERNAL_DERBY).equalsIgnoreCase("true");
+	}
+
+	@Override
+	public int getPort() {
+		return Integer.valueOf(getProperty(PORT));
+	}
+
+	@Override
+	public void setCurrentPort(int port) {
+		setProperty(CURRENT_PORT, String.valueOf(port));
+	}
+
+	@Override
+	public int getCurrentPort() {
+		return Integer.valueOf(getProperty(CURRENT_PORT));
+	}
+
+	@Override
+	public int getPoolMaxActive() {
+		return Integer.valueOf(getProperty(POOL_MAX_ACTIVE));
+	}
+
+	@Override
+	public int getPoolMinIdle() {
+		return Integer.valueOf(getProperty(POOL_MIN_IDLE));
+	}
+
+	@Override
+	public int getPoolMaxIdle() {
+		return Integer.valueOf(getProperty(POOL_MAX_IDLE));
+	}
+
+	@Override
+	public String getCategory() {
+		return "general";
+	}
+
+	@Override
+	public Map<String, String> getDefaultPropertyMap() {
+
+		if (defaultPropertyMap == null) {
+			defaultPropertyMap = new HashMap<String, String>();
+			defaultPropertyMap.put(IN_MEMORY, "true");
+			defaultPropertyMap.put(ENABLE_PROVENANCE, "true");
+			defaultPropertyMap.put(PORT, "1527");
+			// defaultPropertyMap.put(DRIVER_CLASS_NAME,
+			// "org.apache.derby.jdbc.ClientDriver");
+			defaultPropertyMap.put(DRIVER_CLASS_NAME,
+					"org.apache.derby.jdbc.EmbeddedDriver");
+			defaultPropertyMap.put(HIBERNATE_DIALECT,
+					"org.hibernate.dialect.DerbyDialect");
+			defaultPropertyMap.put(POOL_MAX_ACTIVE, "50");
+			defaultPropertyMap.put(POOL_MAX_IDLE, "50");
+			defaultPropertyMap.put(POOL_MIN_IDLE, "10");
+			defaultPropertyMap.put(USERNAME, "");
+			defaultPropertyMap.put(PASSWORD, "");
+			defaultPropertyMap.put(JDBC_URI,
+					"jdbc:derby:t2-database;create=true;upgrade=true");
+			defaultPropertyMap.put(START_INTERNAL_DERBY, "false");
+
+			defaultPropertyMap.put(CONNECTOR_TYPE, CONNECTOR_DERBY);
+			defaultPropertyMap.put(EXPOSE_DATANATURE, "false");
+		}
+		return defaultPropertyMap;
+	}
+
+	@Override
+	public String getHibernateDialect() {
+		return getProperty(HIBERNATE_DIALECT);
+	}
+
+	@Override
+	public String getDisplayName() {
+		return "Data and provenance";
+	}
+
+	@Override
+	public String getFilePrefix() {
+		return "DataAndProvenance";
+	}
+
+	@Override
+	public String getUUID() {
+		return "6BD3F5C1-C68D-4893-8D9B-2F46FA1DDB19";
+	}
+
+	@Override
+	public String getConnectorType() {
+		return getProperty(CONNECTOR_TYPE);
+	}
+
+	@Override
+	public String getJDBCUri() {
+		if (CONNECTOR_DERBY.equals(getConnectorType())
+				&& getStartInternalDerbyServer()) {
+			return "jdbc:derby://localhost:" + getCurrentPort()
+					+ "/t2-database;create=true;upgrade=true";
+		} else {
+			return getProperty(JDBC_URI);
+		}
+	}
+
+	@Override
+	public void setJDBCUri(String uri) {
+		setProperty(JDBC_URI, uri);
+	}
+
+	@Override
+	public String getUsername() {
+		return getProperty(USERNAME);
+	}
+
+	@Override
+	public String getPassword() {
+		return getProperty(PASSWORD);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-database-configuration-impl/src/main/java/uk/org/taverna/configuration/database/impl/DatabaseManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-database-configuration-impl/src/main/java/uk/org/taverna/configuration/database/impl/DatabaseManagerImpl.java b/taverna-database-configuration-impl/src/main/java/uk/org/taverna/configuration/database/impl/DatabaseManagerImpl.java
new file mode 100644
index 0000000..8a10d24
--- /dev/null
+++ b/taverna-database-configuration-impl/src/main/java/uk/org/taverna/configuration/database/impl/DatabaseManagerImpl.java
@@ -0,0 +1,155 @@
+package uk.org.taverna.configuration.database.impl;
+
+import java.io.File;
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import javax.sql.DataSource;
+
+import org.apache.commons.dbcp.BasicDataSource;
+import org.apache.derby.drda.NetworkServerControl;
+import org.apache.log4j.Logger;
+
+import uk.org.taverna.configuration.database.DatabaseConfiguration;
+import uk.org.taverna.configuration.database.DatabaseManager;
+import uk.org.taverna.configuration.app.ApplicationConfiguration;
+
+/**
+ * A set of utility methods related to basic data management.
+ *
+ * @author Stuart Owen
+ * @author Stian Soiland-Reyes
+ *
+ */
+public class DatabaseManagerImpl implements DatabaseManager {
+
+	private final static Logger logger = Logger.getLogger(DatabaseManagerImpl.class);
+
+	private  NetworkServerControl server;
+
+	private BasicDataSource dataSource;
+
+	private DatabaseConfiguration databaseConfiguration;
+
+	private ApplicationConfiguration applicationConfiguration;
+
+	public DatabaseManagerImpl(ApplicationConfiguration applicationConfiguration, DatabaseConfiguration databaseConfiguration) throws SQLException {
+		this.applicationConfiguration = applicationConfiguration;
+		this.databaseConfiguration = databaseConfiguration;
+		getConnection();
+	}
+
+	@Override
+	public Connection getConnection() throws SQLException {
+		return getDataSource().getConnection();
+	}
+
+	@Override
+	public DataSource getDataSource() {
+		if (dataSource == null) {
+			setupDataSource();
+		}
+		return dataSource;
+	}
+
+	@Override
+	public synchronized void startDerbyNetworkServer() {
+		setDerbyPaths();
+
+        System.setProperty("derby.drda.host","localhost");
+        System.setProperty("derby.drda.minThreads","5");
+        System.setProperty("derby.drda.maxThreads",String.valueOf(databaseConfiguration.getPoolMaxActive()));
+        int port = databaseConfiguration.getPort();
+        int maxPort = port+50;
+
+        try {
+        	System.setProperty("derby.drda.portNumber",String.valueOf(port));
+            if (server==null) server = new NetworkServerControl();
+            while(port<maxPort) { //loop to find another available port on which Derby isn't already running
+            	if (!isRunning()) break;
+            	logger.info("Derby connection port: "+port+" is currently not available for Taverna, trying next value");
+            	port++;
+            	System.setProperty("derby.drda.portNumber",String.valueOf(port));
+            	server = new NetworkServerControl();
+            }
+            server.start(null);
+            databaseConfiguration.setCurrentPort(port);
+        } catch (Exception ex) {
+            logger.error("Error starting up Derby network server",ex);
+        }
+    }
+
+	@Override
+	public void stopDerbyNetworkServer() {
+		try {
+			server.shutdown();
+		} catch (Exception e) {
+			logger.error("Error shutting down Derby network server",e);
+		}
+	}
+
+	@Override
+	public boolean isRunning() {
+		if (server==null) {
+			return false;
+		}
+		else {
+			try {
+				server.ping();
+				return true;
+			} catch (Exception e) {
+				return false;
+			}
+		}
+	}
+
+	private void setupDataSource() {
+		setDerbyPaths();
+
+		dataSource = new BasicDataSource();
+		dataSource.setDriverClassName(databaseConfiguration.getDriverClassName());
+
+		System.setProperty("hibernate.dialect", databaseConfiguration.getHibernateDialect());
+
+		dataSource.setDefaultTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
+		dataSource.setMaxActive(databaseConfiguration.getPoolMaxActive());
+		dataSource.setMinIdle(databaseConfiguration.getPoolMinIdle());
+		dataSource.setMaxIdle(databaseConfiguration.getPoolMaxIdle());
+		dataSource.setDefaultAutoCommit(true);
+		dataSource.setInitialSize(databaseConfiguration.getPoolMinIdle());
+		//Derby blows up if the username of password is empty (even an empty string thats not null).
+		if (databaseConfiguration.getUsername()!=null && databaseConfiguration.getUsername().length()>=1) dataSource.setUsername(databaseConfiguration.getUsername());
+		if (databaseConfiguration.getPassword()!=null && databaseConfiguration.getPassword().length()>=1) dataSource.setPassword(databaseConfiguration.getPassword());
+
+		dataSource.setUrl(databaseConfiguration.getJDBCUri());
+    }
+
+	private void setDerbyPaths() {
+		if (databaseConfiguration.getConnectorType() == DatabaseConfiguration.CONNECTOR_DERBY) {
+			String homeDir = applicationConfiguration.getApplicationHomeDir().getAbsolutePath();
+			System.setProperty("derby.system.home",homeDir);
+			File logFile = new File(applicationConfiguration.getLogDir(), "derby.log");
+			System.setProperty("derby.stream.error.file", logFile.getAbsolutePath());
+		}
+
+	}
+
+	/**
+	 * Sets the databaseConfiguration.
+	 *
+	 * @param databaseConfiguration the new value of databaseConfiguration
+	 */
+	public void setDatabaseConfiguration(DatabaseConfiguration databaseConfiguration) {
+		this.databaseConfiguration = databaseConfiguration;
+	}
+
+	/**
+	 * Sets the applicationConfiguration.
+	 *
+	 * @param applicationConfiguration the new value of applicationConfiguration
+	 */
+	public void setApplicationConfiguration(ApplicationConfiguration applicationConfiguration) {
+		this.applicationConfiguration = applicationConfiguration;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-database-configuration-impl/src/main/resources/META-INF/spring/database-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-database-configuration-impl/src/main/resources/META-INF/spring/database-context-osgi.xml b/taverna-database-configuration-impl/src/main/resources/META-INF/spring/database-context-osgi.xml
new file mode 100644
index 0000000..2eae538
--- /dev/null
+++ b/taverna-database-configuration-impl/src/main/resources/META-INF/spring/database-context-osgi.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+                                 http://www.springframework.org/schema/beans/spring-beans.xsd
+                                 http://www.springframework.org/schema/osgi
+                                 http://www.springframework.org/schema/osgi/spring-osgi.xsd">
+
+	<service ref="databaseConfiguration" interface="uk.org.taverna.configuration.database.DatabaseConfiguration" />
+	<service ref="databaseManager" interface="uk.org.taverna.configuration.database.DatabaseManager" />
+
+	<reference id="configurationManager" interface="uk.org.taverna.configuration.ConfigurationManager" />
+	<reference id="applicationConfiguration" interface="uk.org.taverna.configuration.app.ApplicationConfiguration" />
+
+	<!-- <reference id="dataSourceFactory" interface="org.osgi.service.jdbc.DataSourceFactory"
+		filter="(osgi.jdbc.driver.class=org.apache.derby.jdbc.EmbeddedDriver)" /> -->
+
+</beans:beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-database-configuration-impl/src/main/resources/META-INF/spring/database-context.xml
----------------------------------------------------------------------
diff --git a/taverna-database-configuration-impl/src/main/resources/META-INF/spring/database-context.xml b/taverna-database-configuration-impl/src/main/resources/META-INF/spring/database-context.xml
new file mode 100644
index 0000000..f397933
--- /dev/null
+++ b/taverna-database-configuration-impl/src/main/resources/META-INF/spring/database-context.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+                           http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+	<bean id="databaseConfiguration"
+		class="uk.org.taverna.configuration.database.impl.DatabaseConfigurationImpl">
+		<constructor-arg name="configurationManager" ref="configurationManager" />
+	</bean>
+
+	<bean id="databaseManager"
+		class="uk.org.taverna.configuration.database.impl.DatabaseManagerImpl">
+		<constructor-arg name="applicationConfiguration" ref="applicationConfiguration" />
+		<constructor-arg name="databaseConfiguration">
+			<ref local="databaseConfiguration" />
+		</constructor-arg>
+	</bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-dataflow-activity/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-dataflow-activity/pom.xml b/taverna-dataflow-activity/pom.xml
new file mode 100644
index 0000000..05c7e1d
--- /dev/null
+++ b/taverna-dataflow-activity/pom.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.taverna.engine</groupId>
+		<artifactId>taverna-engine</artifactId>
+		<version>3.1.0-incubating-SNAPSHOT</version>
+	</parent>
+	<artifactId>taverna-dataflow-activity</artifactId>
+	<packaging>bundle</packaging>
+	<name>Apache Taverna Dataflow Activity</name>
+	<dependencies>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-workflowmodel-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-reference-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-databind</artifactId>
+			<version>2.2.2</version>
+		</dependency>
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+			<version>${log4j.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-activity-test-utils</artifactId>
+			<version>${project.parent.version}</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-dataflow-activity/src/main/java/net/sf/taverna/t2/activities/dataflow/DataflowActivity.java
----------------------------------------------------------------------
diff --git a/taverna-dataflow-activity/src/main/java/net/sf/taverna/t2/activities/dataflow/DataflowActivity.java b/taverna-dataflow-activity/src/main/java/net/sf/taverna/t2/activities/dataflow/DataflowActivity.java
new file mode 100644
index 0000000..7ec8e22
--- /dev/null
+++ b/taverna-dataflow-activity/src/main/java/net/sf/taverna/t2/activities/dataflow/DataflowActivity.java
@@ -0,0 +1,168 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.activities.dataflow;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import net.sf.taverna.t2.facade.FacadeListener;
+import net.sf.taverna.t2.facade.ResultListener;
+import net.sf.taverna.t2.facade.WorkflowInstanceFacade;
+import net.sf.taverna.t2.facade.WorkflowInstanceFacade.State;
+import net.sf.taverna.t2.invocation.TokenOrderException;
+import net.sf.taverna.t2.invocation.WorkflowDataToken;
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.workflowmodel.Dataflow;
+import net.sf.taverna.t2.workflowmodel.InvalidDataflowException;
+import net.sf.taverna.t2.workflowmodel.processor.activity.AbstractAsynchronousActivity;
+import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityConfigurationException;
+import net.sf.taverna.t2.workflowmodel.processor.activity.AsynchronousActivityCallback;
+import net.sf.taverna.t2.workflowmodel.processor.activity.NestedDataflow;
+
+import org.apache.log4j.Logger;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+/**
+ * An Activity providing nested Dataflow functionality.
+ *
+ * @author David Withers
+ */
+public class DataflowActivity extends AbstractAsynchronousActivity<JsonNode> implements NestedDataflow {
+
+	public static final String URI = "http://ns.taverna.org.uk/2010/activity/nested-workflow";
+
+	@SuppressWarnings("unused")
+	private static final Logger logger = Logger.getLogger(DataflowActivity.class);
+
+	private Dataflow dataflow;
+
+	private JsonNode json;
+
+	@Override
+	public void configure(JsonNode json) throws ActivityConfigurationException {
+		this.json = json;
+//		dataflow.checkValidity();
+//		buildInputPorts();
+//		buildOutputPorts();
+	}
+
+	@Override
+	public JsonNode getConfiguration() {
+		return json;
+	}
+
+	@Override
+	public void executeAsynch(final Map<String, T2Reference> data,
+			final AsynchronousActivityCallback callback) {
+		callback.requestRun(new Runnable() {
+			
+			Map<String, T2Reference> outputData = new HashMap<String, T2Reference>();
+
+			public void run() {
+
+				final WorkflowInstanceFacade facade;
+				try {
+					facade = getEdits().createWorkflowInstanceFacade(dataflow, callback.getContext(),
+							callback.getParentProcessIdentifier());
+				} catch (InvalidDataflowException ex) {
+					callback.fail("Invalid workflow", ex);
+					return;
+				}
+
+				final ResultListener rl = new ResultListener() {
+
+
+					public void resultTokenProduced(WorkflowDataToken dataToken, String port) {
+						if (dataToken.getIndex().length == 0) {
+							outputData.put(port, dataToken.getData());
+						}
+					}
+				};
+				
+				final FacadeListener fl = new FacadeListener() {
+
+					@Override
+					public void workflowFailed(WorkflowInstanceFacade facade,
+							String message, Throwable t) {
+						callback.fail(message, t);
+					}
+
+					@Override
+					public void stateChange(WorkflowInstanceFacade facade,
+							State oldState, State newState) {
+						if (newState == State.completed) {
+							facade.removeResultListener(rl);
+							facade.removeFacadeListener(this);
+							callback.receiveResult(outputData, new int[]{});
+						}
+					}
+					
+				};
+				
+				facade.addResultListener(rl);
+				facade.addFacadeListener(fl);
+
+				facade.fire();
+
+				for (Map.Entry<String, T2Reference> entry : data.entrySet()) {
+					try {
+						WorkflowDataToken token = new WorkflowDataToken(callback
+								.getParentProcessIdentifier(), new int[] {}, entry.getValue(),
+								callback.getContext());
+						facade.pushData(token, entry.getKey());
+					} catch (TokenOrderException e) {
+						callback.fail("Failed to push data into facade", e);
+					}
+				}
+
+			}
+
+		});
+	}
+
+//	private void buildInputPorts() throws ActivityConfigurationException {
+//		inputPorts.clear();
+//		for (DataflowInputPort dataflowInputPort : dataflow.getInputPorts()) {
+//			addInput(dataflowInputPort.getName(), dataflowInputPort.getDepth(), true,
+//					new ArrayList<Class<? extends ExternalReferenceSPI>>(), null);
+//		}
+//	}
+
+//	private void buildOutputPorts() throws ActivityConfigurationException {
+//		outputPorts.clear();
+//		// granular depth same as depth - no streaming of results
+//		for (DataflowOutputPort dataflowOutputPort : dataflow.getOutputPorts()) {
+//			addOutput(dataflowOutputPort.getName(), dataflowOutputPort.getDepth(),
+//					dataflowOutputPort.getDepth());
+//		}
+//	}
+
+	public Dataflow getNestedDataflow() {
+		return dataflow;
+	}
+
+	@Override
+	public void setNestedDataflow(Dataflow dataflow) {
+		this.dataflow = dataflow;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-dataflow-activity/src/main/java/net/sf/taverna/t2/activities/dataflow/DataflowActivityFactory.java
----------------------------------------------------------------------
diff --git a/taverna-dataflow-activity/src/main/java/net/sf/taverna/t2/activities/dataflow/DataflowActivityFactory.java b/taverna-dataflow-activity/src/main/java/net/sf/taverna/t2/activities/dataflow/DataflowActivityFactory.java
new file mode 100644
index 0000000..1529e00
--- /dev/null
+++ b/taverna-dataflow-activity/src/main/java/net/sf/taverna/t2/activities/dataflow/DataflowActivityFactory.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.activities.dataflow;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.HashSet;
+import java.util.Set;
+
+import net.sf.taverna.t2.workflowmodel.Edits;
+import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityFactory;
+import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityInputPort;
+import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityOutputPort;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+/**
+ * An {@link ActivityFactory} for creating <code>DataflowActivity</code>.
+ *
+ * @author David Withers
+ */
+public class DataflowActivityFactory implements ActivityFactory {
+
+	private Edits edits;
+
+	@Override
+	public DataflowActivity createActivity() {
+		DataflowActivity activity = new DataflowActivity();
+		activity.setEdits(edits);
+		return activity;
+	}
+
+	@Override
+	public URI getActivityType() {
+		return URI.create(DataflowActivity.URI);
+	}
+
+	@Override
+	public JsonNode getActivityConfigurationSchema() {
+		ObjectMapper objectMapper = new ObjectMapper();
+		try {
+			return objectMapper.readTree(getClass().getResource("/schema.json"));
+		} catch (IOException e) {
+			return objectMapper.createObjectNode();
+		}
+	}
+
+	@Override
+	public Set<ActivityInputPort> getInputPorts(JsonNode configuration) {
+		return new HashSet<>();
+	}
+
+	@Override
+	public Set<ActivityOutputPort> getOutputPorts(JsonNode configuration) {
+		return new HashSet<>();
+	}
+
+	public void setEdits(Edits edits) {
+		this.edits = edits;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-dataflow-activity/src/main/java/net/sf/taverna/t2/activities/dataflow/DataflowActivityHealthChecker.java
----------------------------------------------------------------------
diff --git a/taverna-dataflow-activity/src/main/java/net/sf/taverna/t2/activities/dataflow/DataflowActivityHealthChecker.java b/taverna-dataflow-activity/src/main/java/net/sf/taverna/t2/activities/dataflow/DataflowActivityHealthChecker.java
new file mode 100644
index 0000000..86cf595
--- /dev/null
+++ b/taverna-dataflow-activity/src/main/java/net/sf/taverna/t2/activities/dataflow/DataflowActivityHealthChecker.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.activities.dataflow;
+
+import java.util.List;
+
+import net.sf.taverna.t2.visit.VisitReport;
+import net.sf.taverna.t2.workflowmodel.health.HealthChecker;
+
+public class DataflowActivityHealthChecker implements HealthChecker<DataflowActivity> {
+
+	public boolean canVisit(Object subject) {
+		return false;
+	}
+
+	public VisitReport visit(DataflowActivity activity, List<Object> ancestors) {
+		return null;
+	}
+
+	public boolean isTimeConsuming() {
+		return true;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-dataflow-activity/src/main/resources/META-INF/services/net.sf.taverna.t2.workflowmodel.health.HealthChecker
----------------------------------------------------------------------
diff --git a/taverna-dataflow-activity/src/main/resources/META-INF/services/net.sf.taverna.t2.workflowmodel.health.HealthChecker b/taverna-dataflow-activity/src/main/resources/META-INF/services/net.sf.taverna.t2.workflowmodel.health.HealthChecker
new file mode 100644
index 0000000..1254008
--- /dev/null
+++ b/taverna-dataflow-activity/src/main/resources/META-INF/services/net.sf.taverna.t2.workflowmodel.health.HealthChecker
@@ -0,0 +1 @@
+net.sf.taverna.t2.activities.dataflow.DataflowActivityHealthChecker
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-dataflow-activity/src/main/resources/META-INF/spring/dataflow-activity-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-dataflow-activity/src/main/resources/META-INF/spring/dataflow-activity-context-osgi.xml b/taverna-dataflow-activity/src/main/resources/META-INF/spring/dataflow-activity-context-osgi.xml
new file mode 100644
index 0000000..480b7e7
--- /dev/null
+++ b/taverna-dataflow-activity/src/main/resources/META-INF/spring/dataflow-activity-context-osgi.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans:beans xmlns="http://www.springframework.org/schema/osgi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:beans="http://www.springframework.org/schema/beans"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+                                 http://www.springframework.org/schema/beans/spring-beans.xsd
+                                 http://www.springframework.org/schema/osgi
+                                 http://www.springframework.org/schema/osgi/spring-osgi.xsd">
+
+	<service ref="dataflowActivityHealthChecker" interface="net.sf.taverna.t2.workflowmodel.health.HealthChecker" />
+
+	<service ref="dataflowActivityFactory" interface="net.sf.taverna.t2.workflowmodel.processor.activity.ActivityFactory" />
+
+	<reference id="edits" interface="net.sf.taverna.t2.workflowmodel.Edits" />
+
+</beans:beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-dataflow-activity/src/main/resources/META-INF/spring/dataflow-activity-context.xml
----------------------------------------------------------------------
diff --git a/taverna-dataflow-activity/src/main/resources/META-INF/spring/dataflow-activity-context.xml b/taverna-dataflow-activity/src/main/resources/META-INF/spring/dataflow-activity-context.xml
new file mode 100644
index 0000000..b689bf9
--- /dev/null
+++ b/taverna-dataflow-activity/src/main/resources/META-INF/spring/dataflow-activity-context.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+                           http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+	<bean id="dataflowActivityHealthChecker" class="net.sf.taverna.t2.activities.dataflow.DataflowActivityHealthChecker" />
+
+	<bean id="dataflowActivityFactory" class="net.sf.taverna.t2.activities.dataflow.DataflowActivityFactory" >
+		<property name="edits" ref="edits" />
+	</bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-dataflow-activity/src/main/resources/schema.json
----------------------------------------------------------------------
diff --git a/taverna-dataflow-activity/src/main/resources/schema.json b/taverna-dataflow-activity/src/main/resources/schema.json
new file mode 100644
index 0000000..3d8de20
--- /dev/null
+++ b/taverna-dataflow-activity/src/main/resources/schema.json
@@ -0,0 +1,19 @@
+{
+    "$schema": "http://json-schema.org/draft-03/schema#",
+    "id": "http://ns.taverna.org.uk/2010/activity/dataflow.schema.json",
+    "title": "Dataflow activity configuration",
+    "type": "object",
+    "properties": {
+        "@context": {
+            "description": "JSON-LD context for interpreting the configuration as RDF",
+            "required": true,
+            "enum": ["http://ns.taverna.org.uk/2010/activity/dataflow.context.json"]
+        },
+        "nestedWorkflow": {
+            "title": "Nested Workflow",
+            "description": "Name of the nested workflow",
+            "type": "string",
+            "required": true
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-dataflow-activity/src/test/java/net/sf/taverna/t2/activities/dataflow/DataflowActivityFactoryTest.java
----------------------------------------------------------------------
diff --git a/taverna-dataflow-activity/src/test/java/net/sf/taverna/t2/activities/dataflow/DataflowActivityFactoryTest.java b/taverna-dataflow-activity/src/test/java/net/sf/taverna/t2/activities/dataflow/DataflowActivityFactoryTest.java
new file mode 100644
index 0000000..5942109
--- /dev/null
+++ b/taverna-dataflow-activity/src/test/java/net/sf/taverna/t2/activities/dataflow/DataflowActivityFactoryTest.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.activities.dataflow;
+
+import java.net.URI;
+import net.sf.taverna.t2.workflowmodel.impl.EditsImpl;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * 
+ * @author David Withers
+ */
+public class DataflowActivityFactoryTest {
+
+	private DataflowActivityFactory factory;
+	
+	/**
+	 * @throws java.lang.Exception
+	 */
+	@Before
+	public void setUp() throws Exception {
+		factory = new DataflowActivityFactory();
+                factory.setEdits(new EditsImpl());
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.activities.beanshell.BeanshellActivityFactory#createActivity()}.
+	 */
+	@Test
+	public void testCreateActivity() {
+		DataflowActivity createActivity = factory.createActivity();
+		assertNotNull(createActivity);
+	}
+
+	/**
+	 * Test method for {@link net.sf.taverna.t2.activities.beanshell.BeanshellActivityFactory#getActivityType()}.
+	 */
+	@Test
+	public void testGetActivityURI() {
+		assertEquals(URI.create(DataflowActivity.URI), factory.getActivityType());
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-dataflow-activity/src/test/java/net/sf/taverna/t2/activities/dataflow/DataflowActivityTest.java
----------------------------------------------------------------------
diff --git a/taverna-dataflow-activity/src/test/java/net/sf/taverna/t2/activities/dataflow/DataflowActivityTest.java b/taverna-dataflow-activity/src/test/java/net/sf/taverna/t2/activities/dataflow/DataflowActivityTest.java
new file mode 100644
index 0000000..7cd7c97
--- /dev/null
+++ b/taverna-dataflow-activity/src/test/java/net/sf/taverna/t2/activities/dataflow/DataflowActivityTest.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.activities.dataflow;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import net.sf.taverna.t2.activities.testutils.ActivityInvoker;
+import net.sf.taverna.t2.workflowmodel.Dataflow;
+import net.sf.taverna.t2.workflowmodel.Datalink;
+import net.sf.taverna.t2.workflowmodel.Edits;
+import net.sf.taverna.t2.workflowmodel.impl.EditsImpl;
+import net.sf.taverna.t2.workflowmodel.processor.activity.impl.ActivityInputPortImpl;
+import net.sf.taverna.t2.workflowmodel.processor.activity.impl.ActivityOutputPortImpl;
+
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Dataflow Activity Tests
+ *
+ * @author David Withers
+ */
+public class DataflowActivityTest {
+
+	private Dataflow dataflow;
+
+	private DataflowActivity activity;
+
+	@Before
+	public void setUp() throws Exception {
+		activity = new DataflowActivity();
+		Edits edits = new EditsImpl();
+		activity.setEdits(edits);
+		dataflow = edits.createDataflow();
+		edits.getCreateDataflowInputPortEdit(dataflow, "input", 0, 0).doEdit();
+		edits.getCreateDataflowOutputPortEdit(dataflow, "output").doEdit();
+		Datalink datalink = edits.createDatalink(dataflow.getInputPorts().get(0)
+				.getInternalOutputPort(), dataflow.getOutputPorts().get(0).getInternalInputPort());
+		edits.getConnectDatalinkEdit(datalink).doEdit();
+	}
+
+	@Test
+	public void testConfigureDataflowActivityConfigurationBean() throws Exception {
+		activity.setNestedDataflow(dataflow);
+		assertEquals(dataflow, activity.getNestedDataflow());
+
+		Edits edits = new EditsImpl();
+		dataflow = edits.createDataflow();
+		edits.getAddActivityInputPortEdit(activity, new ActivityInputPortImpl("input", 0)).doEdit();
+		edits.getAddActivityOutputPortEdit(activity, new ActivityOutputPortImpl("output", 0, 0))
+				.doEdit();
+
+		assertEquals(1, activity.getInputPorts().size());
+		assertEquals("input", activity.getInputPorts().iterator().next().getName());
+		assertEquals(1, activity.getOutputPorts().size());
+		assertEquals("output", activity.getOutputPorts().iterator().next().getName());
+
+		Map<String, Object> inputs = new HashMap<String, Object>();
+		inputs.put("input", "aString");
+		Map<String, Class<?>> expectedOutputs = new HashMap<String, Class<?>>();
+		expectedOutputs.put("output", String.class);
+
+		Map<String, Object> outputs = ActivityInvoker.invokeAsyncActivity(activity, inputs,
+				expectedOutputs);
+		assertTrue("there should be an output named output", outputs.containsKey("output"));
+		assertEquals("output should have the value aString", "aString", outputs.get("output"));
+	}
+
+	@Test
+	public void testGetConfiguration() {
+		assertNull("freshly created activity should not contain configuration",
+				activity.getConfiguration());
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-execution-api/pom.xml b/taverna-execution-api/pom.xml
new file mode 100644
index 0000000..1349766
--- /dev/null
+++ b/taverna-execution-api/pom.xml
@@ -0,0 +1,45 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.taverna.engine</groupId>
+		<artifactId>taverna-engine</artifactId>
+		<version>3.1.0-incubating-SNAPSHOT</version>
+	</parent>
+	<artifactId>taverna-execution-api</artifactId>
+	<packaging>bundle</packaging>
+	<name>Apache Taverna Platform Execution Service API</name>
+	<description>A Service for executing Taverna workflows</description>
+	<dependencies>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-capability-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-report-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.language</groupId>
+			<artifactId>taverna-scufl2-api</artifactId>
+			<version>${taverna.language.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.language</groupId>
+			<artifactId>taverna-databundle</artifactId>
+			<version>${taverna.language.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.language</groupId>
+			<artifactId>taverna-robundle</artifactId>
+			<version>${taverna.language.version}</version>
+		</dependency>
+	</dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecution.java
----------------------------------------------------------------------
diff --git a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecution.java b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecution.java
new file mode 100644
index 0000000..c3802ce
--- /dev/null
+++ b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecution.java
@@ -0,0 +1,139 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.api;
+
+import java.util.UUID;
+
+import org.purl.wf4ever.robundle.Bundle;
+
+import uk.org.taverna.platform.report.ActivityReport;
+import uk.org.taverna.platform.report.ProcessorReport;
+import uk.org.taverna.platform.report.WorkflowReport;
+import uk.org.taverna.scufl2.api.activity.Activity;
+import uk.org.taverna.scufl2.api.common.Scufl2Tools;
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+import uk.org.taverna.scufl2.api.core.Processor;
+import uk.org.taverna.scufl2.api.core.Workflow;
+import uk.org.taverna.scufl2.api.profiles.ProcessorBinding;
+import uk.org.taverna.scufl2.api.profiles.Profile;
+
+/**
+ * Abstract implementation of an {@link Execution}.
+ *
+ * @author David Withers
+ */
+public abstract class AbstractExecution implements Execution {
+
+	private final String ID;
+	private final WorkflowBundle workflowBundle;
+	private final Bundle dataBundle;
+	private final Workflow workflow;
+	private final Profile profile;
+	private final WorkflowReport workflowReport;
+
+	private final Scufl2Tools scufl2Tools = new Scufl2Tools();
+
+	/**
+	 * Constructs an abstract implementation of an Execution.
+	 *
+	 * @param workflowBundle
+	 *            the <code>WorkflowBundle</code> containing the <code>Workflow</code>s required for
+	 *            execution
+	 * @param workflow
+	 *            the <code>Workflow</code> to execute
+	 * @param profile
+	 *            the <code>Profile</code> to use when executing the <code>Workflow</code>
+	 * @param dataBundle
+	 *            the <code>Bundle</code> containing the data values for the <code>Workflow</code>
+	 * @throws InvalidWorkflowException
+	 *             if the specified workflow is invalid
+	 */
+	public AbstractExecution(WorkflowBundle workflowBundle, Workflow workflow, Profile profile,
+			Bundle dataBundle) {
+		this.workflowBundle = workflowBundle;
+		this.workflow = workflow;
+		this.profile = profile;
+		this.dataBundle = dataBundle;
+		ID = UUID.randomUUID().toString();
+		workflowReport = generateWorkflowReport(workflow);
+	}
+
+	protected abstract WorkflowReport createWorkflowReport(Workflow workflow);
+
+	protected abstract ProcessorReport createProcessorReport(Processor processor);
+
+	protected abstract ActivityReport createActivityReport(Activity activity);
+
+	public WorkflowReport generateWorkflowReport(Workflow workflow) {
+		WorkflowReport workflowReport = createWorkflowReport(workflow);
+		for (Processor processor : workflow.getProcessors()) {
+			ProcessorReport processorReport = createProcessorReport(processor);
+			processorReport.setParentReport(workflowReport);
+			workflowReport.addProcessorReport(processorReport);
+			for (ProcessorBinding processorBinding : scufl2Tools.processorBindingsForProcessor(
+					processor, profile)) {
+				Activity boundActivity = processorBinding.getBoundActivity();
+				ActivityReport activityReport = createActivityReport(boundActivity);
+				activityReport.setParentReport(processorReport);
+				if (scufl2Tools.containsNestedWorkflow(processor, profile)) {
+					Workflow nestedWorkflow = scufl2Tools.nestedWorkflowForProcessor(processor,
+							profile);
+					WorkflowReport nestedWorkflowReport = generateWorkflowReport(nestedWorkflow);
+					nestedWorkflowReport.setParentReport(activityReport);
+					activityReport.setNestedWorkflowReport(nestedWorkflowReport);
+				}
+				processorReport.addActivityReport(activityReport);
+			}
+		}
+		return workflowReport;
+	}
+
+	@Override
+	public String getID() {
+		return ID;
+	}
+
+	@Override
+	public WorkflowBundle getWorkflowBundle() {
+		return workflowBundle;
+	}
+
+	@Override
+	public Bundle getDataBundle() {
+		return dataBundle;
+	}
+
+	@Override
+	public Workflow getWorkflow() {
+		return workflow;
+	}
+
+	@Override
+	public Profile getProfile() {
+		return profile;
+	}
+
+	@Override
+	public WorkflowReport getWorkflowReport() {
+		return workflowReport;
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecutionEnvironment.java
----------------------------------------------------------------------
diff --git a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecutionEnvironment.java b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecutionEnvironment.java
new file mode 100644
index 0000000..a6475e5
--- /dev/null
+++ b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecutionEnvironment.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (C) 2011 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.api;
+
+import java.net.URI;
+
+/**
+ * A common super type for concrete implementations of <code>ExecutionEnvironment</code>s.
+ *
+ * @author David Withers
+ */
+public abstract class AbstractExecutionEnvironment implements ExecutionEnvironment {
+	private final String ID;
+	private final String name;
+	private final String description;
+	private final ExecutionService executionService;
+
+	public AbstractExecutionEnvironment(String ID, String name, String description,
+			ExecutionService executionService) {
+		this.ID = ID;
+		this.name = name;
+		this.description = description;
+		this.executionService = executionService;
+	}
+
+	@Override
+	public String getID() {
+		return ID;
+	}
+
+	@Override
+	public String getName() {
+		return name;
+	}
+
+	@Override
+	public String getDescription() {
+		return description;
+	}
+
+	@Override
+	public ExecutionService getExecutionService() {
+		return executionService;
+	}
+
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder();
+		sb.append(ID + "\n");
+		sb.append(name + "\n");
+		sb.append(description + "\n");
+		sb.append("Activities : \n");
+		for (URI uri : getActivityTypes())
+			sb.append("  " + uri + "\n");
+		sb.append("Dispatch Layers : \n");
+		for (URI uri : getDispatchLayerTypes())
+			sb.append("  " + uri + "\n");
+		return sb.toString();
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecutionService.java
----------------------------------------------------------------------
diff --git a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecutionService.java b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecutionService.java
new file mode 100755
index 0000000..f9357df
--- /dev/null
+++ b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecutionService.java
@@ -0,0 +1,139 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.api;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.purl.wf4ever.robundle.Bundle;
+
+import uk.org.taverna.platform.report.WorkflowReport;
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+import uk.org.taverna.scufl2.api.core.Workflow;
+import uk.org.taverna.scufl2.api.profiles.Profile;
+
+/**
+ * A common super type for concrete implementations of <code>ExecutionService</code>s.
+ *
+ * @author David Withers
+ */
+public abstract class AbstractExecutionService implements ExecutionService {
+	private final String ID;
+	private final String name;
+	private final String description;
+	private final Map<String, Execution> executionMap;
+
+	public AbstractExecutionService(String ID, String name, String description) {
+		this.ID = ID;
+		this.name = name;
+		this.description = description;
+		executionMap = Collections.synchronizedMap(new HashMap<String, Execution>());
+	}
+
+	@Override
+	public String getID() {
+		return ID;
+	}
+
+	@Override
+	public String getName() {
+		return name;
+	}
+
+	@Override
+	public String getDescription() {
+		return description;
+	}
+
+	@Override
+	public String createExecution(ExecutionEnvironment executionEnvironment,
+			WorkflowBundle workflowBundle, Workflow workflow, Profile profile,
+			Bundle dataBundle) throws InvalidWorkflowException {
+		Execution execution = createExecutionImpl(workflowBundle, workflow, profile, dataBundle);
+		executionMap.put(execution.getID(), execution);
+		return execution.getID();
+	}
+
+	/**
+	 * Creates an implementation of an Execution.
+	 *
+	 * To be implemented by concrete implementations of <code>ExecutionService</code>.
+	 *
+	 * @param workflowBundle
+	 *            the <code>WorkflowBundle</code> containing the <code>Workflow</code>s required for
+	 *            execution
+	 * @param workflow
+	 *            the <code>Workflow</code> to execute
+	 * @param profile
+	 *            the <code>Profile</code> to use when executing the <code>Workflow</code>
+	 * @param dataBundle
+	 *            the <code>Bundle</code> containing the data values for the <code>Workflow</code>
+	 * @return a new Execution implementation
+	 * @throws InvalidWorkflowException
+	 *             if the specified workflow is invalid
+	 */
+	protected abstract Execution createExecutionImpl(
+			WorkflowBundle workflowBundle, Workflow workflow, Profile profile,
+			Bundle dataBundle) throws InvalidWorkflowException;
+
+	@Override
+	public WorkflowReport getWorkflowReport(String executionID)
+			throws InvalidExecutionIdException {
+		return getExecution(executionID).getWorkflowReport();
+	}
+
+	@Override
+	public void delete(String executionID) throws InvalidExecutionIdException {
+		getExecution(executionID).delete();
+		executionMap.remove(executionID);
+	}
+
+	@Override
+	public void start(String executionID) throws InvalidExecutionIdException {
+		getExecution(executionID).start();
+	}
+
+	@Override
+	public void pause(String executionID) throws InvalidExecutionIdException {
+		getExecution(executionID).pause();
+	}
+
+	@Override
+	public void resume(String executionID) throws InvalidExecutionIdException {
+		getExecution(executionID).resume();
+	}
+
+	@Override
+	public void cancel(String executionID) throws InvalidExecutionIdException {
+		getExecution(executionID).cancel();
+	}
+
+	protected Execution getExecution(String executionID)
+			throws InvalidExecutionIdException {
+		Execution execution = executionMap.get(executionID);
+		if (execution == null)
+			throw new InvalidExecutionIdException("Execution ID " + executionID
+					+ " is not valid");
+		return execution;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/Execution.java
----------------------------------------------------------------------
diff --git a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/Execution.java b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/Execution.java
new file mode 100644
index 0000000..28a982d
--- /dev/null
+++ b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/Execution.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.api;
+
+import org.purl.wf4ever.robundle.Bundle;
+
+import uk.org.taverna.platform.report.WorkflowReport;
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+import uk.org.taverna.scufl2.api.core.Workflow;
+import uk.org.taverna.scufl2.api.profiles.Profile;
+
+/**
+ * Interface for a single execution of a Taverna workflow.
+ *
+ * @author David Withers
+ */
+public interface Execution {
+
+	/**
+	 * Returns the identifier for this execution.
+	 *
+	 * @return the identifier for this execution
+	 */
+	public abstract String getID();
+
+	/**
+	 * Returns the <code>WorkflowBundle</code> containing the <code>Workflow</code>s required for execution.
+	 *
+	 * @return the <code>WorkflowBundle</code> containing the <code>Workflow</code>s required for execution
+	 */
+	public abstract WorkflowBundle getWorkflowBundle();
+
+	/**
+	 * Returns the <code>Bundle</code> containing the data values for the <code>Workflow</code>.
+	 *
+	 * @return the <code>Bundle</code> containing the data values for the <code>Workflow</code>
+	 */
+	public abstract Bundle getDataBundle();
+
+	/**
+	 * Returns the <code>Workflow</code> to execute.
+	 *
+	 * @return the <code>Workflow</code> to execute
+	 */
+	public abstract Workflow getWorkflow();
+
+	/**
+	 * Returns the <code>Profile</code> to use when executing the <code>Workflow</code>.
+	 *
+	 * @return the <code>Profile</code> to use when executing the <code>Workflow</code>
+	 */
+	public abstract Profile getProfile();
+
+	/**
+	 * Returns the <code>WorkflowReport</code> for the execution.
+	 *
+	 * @return the <code>WorkflowReport</code> for the execution
+	 */
+	public abstract WorkflowReport getWorkflowReport();
+
+	/**
+	 * Deletes the execution.
+	 */
+	public abstract void delete();
+
+	/**
+	 * Starts the execution.
+	 */
+	public abstract void start();
+
+	/**
+	 * Pauses the execution.
+	 */
+	public abstract void pause();
+
+	/**
+	 * Resumes a paused execution.
+	 */
+	public abstract void resume();
+
+	/**
+	 * Cancels the execution.
+	 */
+	public abstract void cancel();
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionEnvironment.java
----------------------------------------------------------------------
diff --git a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionEnvironment.java b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionEnvironment.java
new file mode 100644
index 0000000..0408308
--- /dev/null
+++ b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionEnvironment.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (C) 2011 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.api;
+
+import java.net.URI;
+import java.util.Set;
+
+import uk.org.taverna.platform.capability.api.ActivityConfigurationException;
+import uk.org.taverna.platform.capability.api.ActivityNotFoundException;
+import uk.org.taverna.platform.capability.api.DispatchLayerConfigurationException;
+import uk.org.taverna.platform.capability.api.DispatchLayerNotFoundException;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+/**
+ * The ExecutionEnvironment specifies the capabilities of a workflow execution environment.
+ *
+ * @author David Withers
+ */
+public interface ExecutionEnvironment {
+
+	/**
+	 * Returns the identifier for this ExecutionEnvironment.
+	 *
+	 * @return the identifier for this ExecutionEnvironment
+	 */
+	public String getID();
+
+	/**
+	 * Returns the name of this ExecutionEnvironment.
+	 *
+	 * @return the name of this ExecutionEnvironment
+	 */
+	public String getName();
+
+	/**
+	 * Returns a description of this ExecutionEnvironment.
+	 *
+	 * @return a description of this ExecutionEnvironment
+	 */
+	public String getDescription();
+
+	/**
+	 * Returns the ExecutionService that provides this ExecutionEnvironment.
+	 *
+	 * @return the ExecutionService that provides this ExecutionEnvironment
+	 */
+	public ExecutionService getExecutionService();
+
+	/**
+	 * Returns the activity types available in this ExecutionEnvironment.
+	 *
+	 * @return the activity types available in this ExecutionEnvironment
+	 */
+	public Set<URI> getActivityTypes();
+
+	/**
+	 * Returns true iff an activity exists for the specified URI in this ExecutionEnvironment.
+	 *
+	 * @param uri
+	 *            the activity URI to check
+	 * @return true if an activity exists for the specified URI in this ExecutionEnvironment
+	 */
+	public boolean activityExists(URI uri);
+
+	/**
+	 * Returns a JSON Schema for the configuration required by an activity.
+	 *
+	 * @param uri
+	 *            a URI that identifies an activity
+	 * @return a JSON Schema for the configuration required by an activity
+	 * @throws ActivityNotFoundException
+	 *             if an activity cannot be found for the specified URI
+	 * @throws ActivityConfigurationException
+	 *             if the ConfigurationDefinition cannot be created
+	 */
+	public JsonNode getActivityConfigurationSchema(URI uri)
+			throws ActivityNotFoundException, ActivityConfigurationException;
+
+	/**
+	 * Returns the dispatch layer types available in this ExecutionEnvironment.
+	 *
+	 * @return the dispatch layer types available in this ExecutionEnvironment
+	 */
+	public Set<URI> getDispatchLayerTypes();
+
+	/**
+	 * Returns true iff a dispatch layer exists for the specified URI in this ExecutionEnvironment.
+	 *
+	 * @param uri
+	 *            the dispatch layer URI to check
+	 * @return true if a dispatch layer exists for the specified URI in this ExecutionEnvironment
+	 */
+	public boolean dispatchLayerExists(URI uri);
+
+	/**
+	 * Returns a JSON Schema for the configuration required by a dispatch layer.
+	 *
+	 * @param uri
+	 *            a URI that identifies a dispatch layer
+	 * @return
+	 * @return a JSON Schema for the configuration required by a dispatch layer
+	 * @throws DispatchLayerNotFoundException
+	 *             if a dispatch layer cannot be found for the specified URI
+	 * @throws DispatchLayerConfigurationException
+	 *             if the ConfigurationDefinition cannot be created
+	 */
+	public JsonNode getDispatchLayerConfigurationSchema(URI uri)
+			throws DispatchLayerNotFoundException, DispatchLayerConfigurationException;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionEnvironmentService.java
----------------------------------------------------------------------
diff --git a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionEnvironmentService.java b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionEnvironmentService.java
new file mode 100644
index 0000000..5559069
--- /dev/null
+++ b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionEnvironmentService.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (C) 2011 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.api;
+
+import java.util.Set;
+
+import uk.org.taverna.scufl2.api.profiles.Profile;
+
+/**
+ * Service for finding <code>ExecutionEnvironment</code>s.
+ *
+ * @author David Withers
+ */
+public interface ExecutionEnvironmentService {
+
+	/**
+	 * Returns the available <code>ExecutionEnvironment</code>s.
+	 *
+	 * @return the available <code>ExecutionEnvironment</code>s
+	 */
+	public Set<ExecutionEnvironment> getExecutionEnvironments();
+
+	/**
+	 * Returns the <code>ExecutionEnvironment</code>s that can execute the specified
+	 * <code>Profile</code>.
+	 *
+	 * @param profile
+	 *            the <code>Profile</code> to find <code>ExecutionEnvironment</code>s for
+	 * @return the <code>ExecutionEnvironment</code>s that can execute a workflow with the specified
+	 *         <code>Profile</code>
+	 */
+	public Set<ExecutionEnvironment> getExecutionEnvironments(Profile profile);
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionService.java
----------------------------------------------------------------------
diff --git a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionService.java b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionService.java
new file mode 100755
index 0000000..2ae7067
--- /dev/null
+++ b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionService.java
@@ -0,0 +1,149 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.api;
+
+import java.util.Set;
+
+import org.purl.wf4ever.robundle.Bundle;
+
+import uk.org.taverna.platform.report.WorkflowReport;
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+import uk.org.taverna.scufl2.api.core.Workflow;
+import uk.org.taverna.scufl2.api.profiles.Profile;
+
+/**
+ * Service for executing Taverna workflows. There may be several <code>ExecutionService</code>s
+ * available that offer different execution environments, e.g. one <code>ExecutionService</code> may
+ * execute workflows on a remote server while another executes workflows on the local machine.
+ *
+ * @author David Withers
+ */
+public interface ExecutionService {
+
+	/**
+	 * Returns the identifier for this ExecutionService.
+	 *
+	 * @return the identifier for this ExecutionService
+	 */
+	public String getID();
+
+	/**
+	 * Returns the name of this ExecutionService.
+	 *
+	 * @return the name of this ExecutionService
+	 */
+	public String getName();
+
+	/**
+	 * Returns a description of this ExecutionService.
+	 *
+	 * @return a description of this ExecutionService
+	 */
+	public String getDescription();
+
+	/**
+	 * Returns the ExecutionEnvironments available for this ExecutionService.
+	 *
+	 * @return the ExecutionEnvironments available for this ExecutionService
+	 */
+	public Set<ExecutionEnvironment> getExecutionEnvironments();
+
+	/**
+	 * Creates a workflow execution and returns its ID.
+	 *
+	 * @param executionEnvironment
+	 *            the {@link ExecutionEnvironment} used to execute the
+	 *            <code>Workflow</code>
+	 * @param workflowBundle
+	 *            the <code>WorkflowBundle</code> containing the workflows required for execution
+	 * @param workflow
+	 *            the workflow to execute
+	 * @param profile
+	 *            the profile to use when executing the workflow
+	 * @param dataBundle
+	 *            the <code>Bundle</code> containing the data values for the <code>Workflow</code>
+	 * @return the ID of the created workflow execution
+	 * @throws InvalidWorkflowException
+	 */
+	public String createExecution(ExecutionEnvironment executionEnvironment, WorkflowBundle workflowBundle, Workflow workflow, Profile profile,
+			Bundle dataBundle)
+			throws InvalidWorkflowException;
+
+	/**
+	 * Returns the workflow report for the specified execution.
+	 *
+	 * @param executionID
+	 *            the ID of the execution
+	 * @return the workflow report for this execution
+	 */
+	public WorkflowReport getWorkflowReport(String executionID) throws InvalidExecutionIdException;
+
+	/**
+	 * Deletes the execution of a workflow.
+	 *
+	 * @param executionID
+	 *            the ID of the execution to delete
+	 * @throws InvalidExecutionIdException
+	 *             if the execution ID is not valid
+	 */
+	public void delete(String executionID) throws InvalidExecutionIdException;
+
+	/**
+	 * Starts the execution of a workflow.
+	 *
+	 * @param executionID
+	 *            the ID of the execution to start
+	 * @throws InvalidExecutionIdException
+	 *             if the execution ID is not valid
+	 */
+	public void start(String executionID) throws InvalidExecutionIdException;
+
+	/**
+	 * Pauses the execution of a workflow.
+	 *
+	 * @param executionID
+	 *            the ID of the execution to pause
+	 * @throws InvalidExecutionIdException
+	 *             if the execution ID is not valid
+	 */
+	public void pause(String executionID) throws InvalidExecutionIdException;
+
+	/**
+	 * Resumes the execution of a paused workflow.
+	 *
+	 * @param executionID
+	 *            the ID of the execution to resume
+	 * @throws InvalidExecutionIdException
+	 *             if the execution ID is not valid
+	 */
+	public void resume(String executionID) throws InvalidExecutionIdException;
+
+	/**
+	 * Cancels the execution of a workflow.
+	 *
+	 * @param executionID
+	 *            the ID of the execution to cancel
+	 * @throws InvalidExecutionIdException
+	 *             if the execution ID is not valid
+	 */
+	public void cancel(String executionID) throws InvalidExecutionIdException;
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/InvalidExecutionIdException.java
----------------------------------------------------------------------
diff --git a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/InvalidExecutionIdException.java b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/InvalidExecutionIdException.java
new file mode 100644
index 0000000..9cb8ef2
--- /dev/null
+++ b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/InvalidExecutionIdException.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.api;
+
+/**
+ * Thrown when an executionID is not valid for an ExecutionService.
+ * 
+ * @author David Withers
+ */
+public class InvalidExecutionIdException extends Exception {
+
+	private static final long serialVersionUID = 4086661335641172903L;
+
+	public InvalidExecutionIdException() {
+    	super();
+    }
+
+    public InvalidExecutionIdException(String message) {
+    	super(message);
+    }
+
+    public InvalidExecutionIdException(String message, Throwable cause) {
+    	super(message, cause);
+    }
+
+    public InvalidExecutionIdException(Throwable cause) {
+    	super(cause);
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/InvalidWorkflowException.java
----------------------------------------------------------------------
diff --git a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/InvalidWorkflowException.java b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/InvalidWorkflowException.java
new file mode 100644
index 0000000..b0cc3fa
--- /dev/null
+++ b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/InvalidWorkflowException.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.api;
+
+/**
+ * Thrown when a Workflow fails to validate.
+ * 
+ * @author David Withers
+ */
+public class InvalidWorkflowException extends Exception {
+
+	private static final long serialVersionUID = 7491175798204912590L;
+
+	public InvalidWorkflowException() {
+		super();
+	}
+
+	public InvalidWorkflowException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+	public InvalidWorkflowException(String message) {
+		super(message);
+	}
+
+	public InvalidWorkflowException(Throwable cause) {
+		super(cause);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/WorkflowCompiler.java
----------------------------------------------------------------------
diff --git a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/WorkflowCompiler.java b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/WorkflowCompiler.java
new file mode 100644
index 0000000..70b8fcd
--- /dev/null
+++ b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/WorkflowCompiler.java
@@ -0,0 +1,36 @@
+package uk.org.taverna.platform.execution.api;
+
+import net.sf.taverna.t2.workflowmodel.Dataflow;
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+import uk.org.taverna.scufl2.api.core.Workflow;
+
+/**
+ * A workflow compilation service converts a workflow (in a
+ * {@link WorkflowBundle}) into a dataflow. Most code should ignore this.
+ * 
+ * @author Donal Fellows
+ */
+public interface WorkflowCompiler {
+	/**
+	 * Convert a workflow into a dataflow. May cache.
+	 * 
+	 * @param workflow
+	 *            the workflow to convert; must not be <tt>null</tt>
+	 * @return the dataflow, which should not be modified.
+	 * @throws InvalidWorkflowException
+	 *             If the compilation fails.
+	 */
+	Dataflow getDataflow(Workflow workflow) throws InvalidWorkflowException;
+	
+	/**
+	 * Convert a workflow bundle into a dataflow. May cache. Only the the
+	 * primary workflow is guaranteed to be converted.
+	 * 
+	 * @param bundle
+	 *            the workflow bundle to convert; must not be <tt>null</tt>
+	 * @return the dataflow, which should not be modified.
+	 * @throws InvalidWorkflowException
+	 *             If the compilation fails.
+	 */
+	Dataflow getDataflow(WorkflowBundle bundle) throws InvalidWorkflowException;
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-api/src/test/java/uk/org/taverna/platform/execution/api/AbstractExecutionTest.java
----------------------------------------------------------------------
diff --git a/taverna-execution-api/src/test/java/uk/org/taverna/platform/execution/api/AbstractExecutionTest.java b/taverna-execution-api/src/test/java/uk/org/taverna/platform/execution/api/AbstractExecutionTest.java
new file mode 100644
index 0000000..635527e
--- /dev/null
+++ b/taverna-execution-api/src/test/java/uk/org/taverna/platform/execution/api/AbstractExecutionTest.java
@@ -0,0 +1,128 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.api;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.purl.wf4ever.robundle.Bundle;
+
+import uk.org.taverna.databundle.DataBundles;
+import uk.org.taverna.platform.report.ActivityReport;
+import uk.org.taverna.platform.report.ProcessorReport;
+import uk.org.taverna.platform.report.WorkflowReport;
+import uk.org.taverna.scufl2.api.activity.Activity;
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+import uk.org.taverna.scufl2.api.core.Processor;
+import uk.org.taverna.scufl2.api.core.Workflow;
+import uk.org.taverna.scufl2.api.profiles.Profile;
+
+/**
+ * @author David Withers
+ */
+@Ignore
+public class AbstractExecutionTest {
+	private WorkflowBundle workflowBundle;
+	private Execution execution;
+	private Workflow workflow;
+	private Profile profile;
+	private Bundle dataBundle;
+
+	/**
+	 * @throws java.lang.Exception
+	 */
+	@Before
+	public void setUp() throws Exception {
+		workflowBundle = new WorkflowBundle();
+		workflow = new Workflow();
+		profile = new Profile();
+		dataBundle = DataBundles.createBundle();
+		execution = new AbstractExecution(workflowBundle, workflow, profile, dataBundle) {
+			@Override
+			public void start() {}
+			@Override
+			public void resume() {}
+			@Override
+			public void pause() {}
+			@Override
+			public void cancel() {}
+			@Override
+			public void delete() {}
+			@Override
+			protected WorkflowReport createWorkflowReport(Workflow workflow) {
+				return new WorkflowReport(workflow) {
+				};
+			}
+			@Override
+			public ProcessorReport createProcessorReport(Processor processor) {
+				return null;
+			}
+			@Override
+			public ActivityReport createActivityReport(Activity activity) {
+				return null;
+			}
+		};
+	}
+
+	/**
+	 * Test method for {@link uk.org.taverna.platform.execution.api.AbstractExecution#getID()}.
+	 */
+	@Test
+	public void testGetID() {
+		assertNotNull(execution.getID());
+		assertEquals(execution.getID(), execution.getID());
+	}
+
+	/**
+	 * Test method for {@link uk.org.taverna.platform.execution.api.AbstractExecution#getWorkflowBundle()}.
+	 */
+	@Test
+	public void testGetWorkflowBundle() {
+		assertEquals(workflowBundle, execution.getWorkflowBundle());
+	}
+
+	/**
+	 * Test method for {@link uk.org.taverna.platform.execution.api.AbstractExecution#getWorkflow()}.
+	 */
+	@Test
+	public void testGetWorkflow() {
+		assertEquals(workflow, execution.getWorkflow());
+	}
+
+	/**
+	 * Test method for {@link uk.org.taverna.platform.execution.api.AbstractExecution#getInputs()}.
+	 */
+	@Test
+	public void testGetInputs() {
+		assertEquals(dataBundle, execution.getDataBundle());
+	}
+
+	/**
+	 * Test method for {@link uk.org.taverna.platform.execution.api.AbstractExecution#getWorkflowReport()}.
+	 */
+	@Test
+	public void testGetWorkflowReport() {
+		assertNotNull(execution.getWorkflowReport());
+	}
+}


[28/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/t2flow/soaplab.t2flow
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/t2flow/soaplab.t2flow b/taverna-platform-integration-tests/src/test/resources/t2flow/soaplab.t2flow
new file mode 100644
index 0000000..f1ef82b
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/t2flow/soaplab.t2flow
@@ -0,0 +1,84 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.2.0"><dataflow id="db8053e3-1837-42cc-ba27-5fd0a83f119e" role="top"><name>Retrieve_sequence_in_EMBL_format</name><inputPorts /><outputPorts><port><name>sequence</name><annotations /></port></outputPorts><processors><processor><name>sequence_feature</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>true</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>sequence_id</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" to="value" /></outputMap><configBean encoding="xstream"><net.s
 f.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>embl:x52524</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>sequence_format</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" to="value" /></outputMap><configBean encoding="xstream"><n
 et.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>embl</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>seqret</name><inputPorts><port><name>sequence_usa</name><depth>0</depth></port><port><name>feature</name><depth>0</depth></port><port><name>osformat_outseq</name><depth>0</depth></port></inputPorts><outputPorts><port><name>outseq</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>soaplab-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2
 .activities.soaplab.SoaplabActivity</class><inputMap><map from="osformat_outseq" to="osformat_outseq" /><map from="feature" to="feature" /><map from="sequence_usa" to="sequence_usa" /></inputMap><outputMap><map from="outseq" to="outseq" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.soaplab.SoaplabActivityConfigurationBean xmlns="">
+  <endpoint>http://www.ebi.ac.uk/soaplab/services/edit.seqret</endpoint>
+  <pollingInterval>0</pollingInterval>
+  <pollingBackoff>1.0</pollingBackoff>
+  <pollingIntervalMax>0</pollingIntervalMax>
+</net.sf.taverna.t2.activities.soaplab.SoaplabActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="sequence_usa" depth="0" /><port name="feature" depth="0" /><port name="osformat_outseq" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>seqret</processor><port>sequence_usa</port></sink><source type="processor"><processor>sequence_id</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>seqret</processor><port>feature</port></sink><source type="processor"><processor>sequence_f
 eature</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>seqret</processor><port>osformat_outseq</port></sink><source type="processor"><processor>sequence_format</processor><port>value</port></source></datalink><datalink><sink type="dataflow"><port>sequence</port></sink><source type="processor"><processor>seqret</processor><port>outseq</port></source></datalink></datalinks><annotations><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.DescriptiveTitle">
+        <text>Retrieve sequence in EMBL format</text>
+      </annotationBean>
+      <date>2009-12-15 20:21:29.202 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.Author">
+        <text>Franck Tanoh</text>
+      </annotationBean>
+      <date>2009-12-15 20:21:20.965 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>db8053e3-1837-42cc-ba27-5fd0a83f119e</identification>
+      </annotationBean>
+      <date>2010-07-04 17:49:51.364 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.FreeTextDescription">
+        <text>This workflow retrieves a sequence associated with its features in embl format</text>
+      </annotationBean>
+      <date>2009-12-15 20:21:39.30 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/t2flow/spreadsheetimport.t2flow
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/t2flow/spreadsheetimport.t2flow b/taverna-platform-integration-tests/src/test/resources/t2flow/spreadsheetimport.t2flow
new file mode 100644
index 0000000..7360186
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/t2flow/spreadsheetimport.t2flow
@@ -0,0 +1,646 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3.0"><dataflow id="fa4ef38e-fa3f-4662-97e5-59c3b51aa322" role="top"><name>Spreadsheet_Import_Example</name><inputPorts /><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>SpreadsheetImport</name><inputPorts><port><name>fileurl</name><depth>0</depth></port></inputPorts><outputPorts><port><name>other</name><depth>1</depth><granularDepth>1</granularDepth></port><port><name>other_industry</name><depth>1</depth><granularDepth>1</granularDepth></port><port><name>year</name><depth>1</depth><granularDepth>1</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>spreadsheet-import-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.spreadsheet.SpreadsheetImportActivity</class><inputMap><map from="fileurl" to="fileurl" /></inputMap><outputMap><ma
 p from="other" to="other" /><map from="year" to="year" /><map from="other_industry" to="other_industry" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.spreadsheet.SpreadsheetImportConfiguration xmlns="">
+  <columnRange>
+    <start>1</start>
+    <end>6</end>
+    <excludes />
+  </columnRange>
+  <rowRange>
+    <start>7</start>
+    <end>41</end>
+    <excludes />
+  </rowRange>
+  <emptyCellValue />
+  <columnNames>
+    <entry>
+      <string>D</string>
+      <string>other</string>
+    </entry>
+    <entry>
+      <string>E</string>
+      <string>fish_farming</string>
+    </entry>
+    <entry>
+      <string>F</string>
+      <string>other_industry</string>
+    </entry>
+    <entry>
+      <string>G</string>
+      <string>public_water_supply</string>
+    </entry>
+    <entry>
+      <string>A</string>
+      <string>over</string>
+    </entry>
+    <entry>
+      <string>B</string>
+      <string>year</string>
+    </entry>
+    <entry>
+      <string>C</string>
+      <string>electricity</string>
+    </entry>
+    <entry>
+      <string>L</string>
+      <string>2001</string>
+    </entry>
+    <entry>
+      <string>N</string>
+      <string>2002</string>
+    </entry>
+    <entry>
+      <string>H</string>
+      <string>1999</string>
+    </entry>
+    <entry>
+      <string>J</string>
+      <string>2000</string>
+    </entry>
+    <entry>
+      <string>T</string>
+      <string>2005</string>
+    </entry>
+    <entry>
+      <string>V</string>
+      <string>2006</string>
+    </entry>
+    <entry>
+      <string>P</string>
+      <string>2003</string>
+    </entry>
+    <entry>
+      <string>R</string>
+      <string>2004</string>
+    </entry>
+    <entry>
+      <string>X</string>
+      <string>2007</string>
+    </entry>
+    <entry>
+      <string>Z</string>
+      <string>2008</string>
+    </entry>
+  </columnNames>
+  <allRows>false</allRows>
+  <excludeFirstRow>false</excludeFirstRow>
+  <ignoreBlankRows>false</ignoreBlankRows>
+  <emptyCellPolicy>EMPTY_STRING</emptyCellPolicy>
+  <outputFormat>PORT_PER_COLUMN</outputFormat>
+  <csvDelimiter>,</csvDelimiter>
+</net.sf.taverna.t2.activities.spreadsheet.SpreadsheetImportConfiguration></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="fileurl" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>url_value</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" to="val
 ue" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>http://www.myexperiment.org/files/410/download/WaterUse.xlsx</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>SpreadsheetImport</processor><port>fileurl</port></sink><source type="processor"><processor>url_value</processor><port>value</port></source></datalink><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>SpreadsheetImport</processor><port>year</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChai
 nImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>41265789-c464-4ee2-b145-95ece9388305</identification>
+      </annotationBean>
+      <date>2010-07-07 22:34:29.364 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>b4363407-ef56-4cf3-998f-8e780a8dc816</identification>
+      </annotationBean>
+      <date>2010-07-07 16:41:31.230 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>486a5356-0f3e-424d-b14e-249295875f2d</identification>
+      </annotationBean>
+      <date>2010-07-13 12:31:34.664 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.Author">
+        <text>David Withers</text>
+      </annotationBean>
+      <date>2010-07-13 11:09:24.988 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>cf60043b-e08a-49d7-a150-711f413d3d18</identification>
+      </annotationBean>
+      <date>2010-07-07 22:52:10.583 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>812e7abc-4866-43dc-b9d4-44370a399e4e</identification>
+      </annotationBean>
+      <date>2010-07-07 17:23:44.739 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>cca71cbe-6d97-4896-90c2-d91016f12882</identification>
+      </annotationBean>
+      <date>2010-07-07 22:45:31.148 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>e28f14b3-e4ae-4d0b-893d-3a8400625069</identification>
+      </annotationBean>
+      <date>2010-07-07 16:10:13.994 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>e263e793-b394-4a57-855e-13e69b8780c2</identification>
+      </annotationBean>
+      <date>2010-07-07 17:00:11.782 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>14724df6-fee6-4b24-8fbc-eeeeb3dc4e61</identification>
+      </annotationBean>
+      <date>2010-07-07 16:38:21.137 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>6622310c-9440-45a1-a051-729487b00b46</identification>
+      </annotationBean>
+      <date>2010-07-13 12:32:33.863 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>d8b96d03-8431-4cc0-b032-51e0c32092d3</identification>
+      </annotationBean>
+      <date>2010-07-07 17:27:09.166 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>cee35c36-afaf-4093-bcc5-eaac292207f5</identification>
+      </annotationBean>
+      <date>2010-07-07 16:02:30.469 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>64b51b72-af09-4842-b034-293dee7a03ff</identification>
+      </annotationBean>
+      <date>2010-07-07 22:40:56.858 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>4462bd43-bcec-4aaf-83e5-64e111668a64</identification>
+      </annotationBean>
+      <date>2010-07-07 23:00:20.619 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>58b3ac31-cfb3-418a-85ae-1990b2883c35</identification>
+      </annotationBean>
+      <date>2010-07-07 22:57:04.585 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>980d729b-1ec7-492c-9dfd-ccb19f9e81a7</identification>
+      </annotationBean>
+      <date>2010-07-07 22:59:09.755 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>6d9b5609-37c3-4fb1-9eea-e6b70209427e</identification>
+      </annotationBean>
+      <date>2010-07-07 14:05:03.421 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>9a2e5f63-ee29-42f3-810e-dc54fa9dfe3c</identification>
+      </annotationBean>
+      <date>2010-07-07 16:59:16.81 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>fa4ef38e-fa3f-4662-97e5-59c3b51aa322</identification>
+      </annotationBean>
+      <date>2011-11-02 15:41:32.280 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>6f16e5e6-7e90-44af-9e7a-f63785e5408e</identification>
+      </annotationBean>
+      <date>2010-07-07 22:53:58.943 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>d533c230-a40d-4f9b-9ad4-f4389d4a6f1f</identification>
+      </annotationBean>
+      <date>2010-07-07 16:00:00.482 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>7d1166bd-dfa5-4675-918c-a880314302cb</identification>
+      </annotationBean>
+      <date>2010-07-07 16:04:08.606 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>23eec6e0-9a32-461c-bd90-ba03bdc49d41</identification>
+      </annotationBean>
+      <date>2010-07-07 17:25:28.613 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>464013e1-0699-4e1a-bac7-047576261b33</identification>
+      </annotationBean>
+      <date>2010-07-07 23:07:59.655 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>8af7971d-f944-4f27-b62a-437be1b99d3c</identification>
+      </annotationBean>
+      <date>2010-07-07 16:07:29.140 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>a5bbe32f-ad20-4411-bc0e-d8f693e95493</identification>
+      </annotationBean>
+      <date>2010-07-07 22:55:54.366 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>30c2f2c6-dbd5-4e7a-9620-f6e8526fb9bc</identification>
+      </annotationBean>
+      <date>2010-07-07 23:04:59.33 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>9c2e4b9c-5f25-4416-8653-cd9198a9271e</identification>
+      </annotationBean>
+      <date>2010-07-13 11:19:30.143 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>c0753ab7-cd9d-400e-b483-048dcbaad5f9</identification>
+      </annotationBean>
+      <date>2010-07-07 16:36:44.391 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>99e82825-40e1-4fa9-8cf4-5348a8ff7b82</identification>
+      </annotationBean>
+      <date>2010-07-07 22:38:24.439 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>2c1532f6-0ba4-48ea-9bf4-3fd3e39c6289</identification>
+      </annotationBean>
+      <date>2010-07-07 14:00:56.585 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>92d8fa84-2553-4de1-bff5-7d2a9b53c58d</identification>
+      </annotationBean>
+      <date>2010-07-07 17:31:19.499 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>f0fe1955-23d6-41b7-b1af-b36d641429b4</identification>
+      </annotationBean>
+      <date>2010-07-07 17:24:52.98 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>47de0484-f703-40ab-b1f7-b0826495a00d</identification>
+      </annotationBean>
+      <date>2010-07-07 23:09:23.782 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>7ca4b117-111d-4605-826e-868d7d159b52</identification>
+      </annotationBean>
+      <date>2010-07-13 11:16:32.697 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>99c992df-d200-4cda-a973-c60be723e784</identification>
+      </annotationBean>
+      <date>2010-07-07 17:14:16.5 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>58a4da02-d1f0-41ce-9ace-8a62b49b62d7</identification>
+      </annotationBean>
+      <date>2010-07-13 11:22:26.72 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>a752e401-77c5-42ef-9bf8-a60aa8af73f5</identification>
+      </annotationBean>
+      <date>2010-07-07 22:50:42.557 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.DescriptiveTitle">
+        <text>Spreadsheet Import Example</text>
+      </annotationBean>
+      <date>2010-07-13 11:22:34.496 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>dfa2cd09-f53d-47f4-91cd-207ec2dc2c34</identification>
+      </annotationBean>
+      <date>2010-07-07 16:51:22.4 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>31ac21d6-7c10-48ff-b9b2-82cac03f55c9</identification>
+      </annotationBean>
+      <date>2010-07-07 22:43:05.458 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>70c23010-0b47-424e-a1ce-73c040c3d3c6</identification>
+      </annotationBean>
+      <date>2010-07-07 16:43:47.690 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.FreeTextDescription">
+        <text>Example using the SpreadsheetImport service to import data from an Excel spreadsheet.
+The workflow imports the file spreadsheet file WaterUse.xlsx and generates a graph from the date.
+The source data is from http://data.gov.uk/</text>
+      </annotationBean>
+      <date>2010-07-13 11:16:31.908 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>27965b7c-1a89-46ac-8c9b-a4c6bf9144f0</identification>
+      </annotationBean>
+      <date>2010-07-13 11:22:36.27 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>6c2a0ecf-5d91-4722-adf6-607c912ed54c</identification>
+      </annotationBean>
+      <date>2010-07-07 16:54:20.460 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>808e3725-2a08-4907-9706-fb7f0f08f62f</identification>
+      </annotationBean>
+      <date>2010-07-13 11:20:05.749 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>6e069c36-8d88-4017-96cf-c1fa87007777</identification>
+      </annotationBean>
+      <date>2010-07-07 16:20:48.694 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>73ce4e99-6b83-45d0-8605-896d6d48b7f0</identification>
+      </annotationBean>
+      <date>2010-07-07 17:01:14.713 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/t2flow/stringconstant.t2flow
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/t2flow/stringconstant.t2flow b/taverna-platform-integration-tests/src/test/resources/t2flow/stringconstant.t2flow
new file mode 100644
index 0000000..41266d0
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/t2flow/stringconstant.t2flow
@@ -0,0 +1,32 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.2.0"><dataflow id="48c5c70e-ffde-4ff0-8508-015577ab263c" role="top"><name>Workflow1</name><inputPorts /><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>String_constant</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>Test Value</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>String_constant</processor><port>value</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>48c5c70e-ffde-4ff0-8508-015577ab263c</identification>
+      </annotationBean>
+      <date>2010-12-14 11:57:31.126 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>186f09f7-d9a7-4ae2-bf84-8ee83f41f4e3</identification>
+      </annotationBean>
+      <date>2010-12-14 11:56:50.253 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/t2flow/tool.t2flow
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/t2flow/tool.t2flow b/taverna-platform-integration-tests/src/test/resources/t2flow/tool.t2flow
new file mode 100644
index 0000000..d77a851
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/t2flow/tool.t2flow
@@ -0,0 +1,158 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3.0"><dataflow id="82a5216a-8b82-41db-a114-ece396f9b85c" role="top"><name>Workflow4</name><inputPorts /><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>Tool</name><inputPorts><port><name>in1</name><depth>0</depth></port><port><name>in2</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>external-tool-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.externaltool.ExternalToolActivity</class><inputMap><map from="in2" to="in2" /><map from="in1" to="in1" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.externaltool.ExternalToolActivityConfigurationBean
  xmlns="">
+  <mechanismType>789663B8-DA91-428A-9F7D-B3F3DA185FD4</mechanismType>
+  <mechanismName>default local</mechanismName>
+  <mechanismXML>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&#xD;
+&lt;localInvocation&gt;&lt;shellPrefix&gt;/bin/sh -c&lt;/shellPrefix&gt;&lt;linkCommand&gt;/bin/ln -s %%PATH_TO_ORIGINAL%% %%TARGET_NAME%%&lt;/linkCommand&gt;&lt;/localInvocation&gt;&#xD;
+</mechanismXML>
+  <externaltoolid>607ceaee-59ba-4cbb-a650-84e51d8498e3</externaltoolid>
+  <useCaseDescription>
+    <usecaseid />
+    <description />
+    <command>cat in1 &gt; out; echo %%in2%% &gt;&gt; out
+ </command>
+    <preparingTimeoutInSeconds>1200</preparingTimeoutInSeconds>
+    <executionTimeoutInSeconds>1800</executionTimeoutInSeconds>
+    <tags>
+      <string>in2</string>
+    </tags>
+    <REs />
+    <queue__preferred />
+    <queue__deny />
+    <static__inputs>
+      <de.uni__luebeck.inb.knowarc.usecases.ScriptInputStatic>
+        <tag>hi</tag>
+        <file>true</file>
+        <tempFile>false</tempFile>
+        <binary>false</binary>
+        <charsetName>MacRoman</charsetName>
+        <forceCopy>false</forceCopy>
+        <content class="string">hi</content>
+      </de.uni__luebeck.inb.knowarc.usecases.ScriptInputStatic>
+      <de.uni__luebeck.inb.knowarc.usecases.ScriptInputStatic>
+        <tag>google</tag>
+        <file>true</file>
+        <tempFile>false</tempFile>
+        <binary>false</binary>
+        <charsetName>MacRoman</charsetName>
+        <forceCopy>false</forceCopy>
+        <url>http://www.google.com/</url>
+      </de.uni__luebeck.inb.knowarc.usecases.ScriptInputStatic>
+    </static__inputs>
+    <inputs>
+      <entry>
+        <string>in2</string>
+        <de.uni__luebeck.inb.knowarc.usecases.ScriptInputUser>
+          <tag>in2</tag>
+          <file>false</file>
+          <tempFile>false</tempFile>
+          <binary>false</binary>
+          <charsetName>MacRoman</charsetName>
+          <forceCopy>false</forceCopy>
+          <list>false</list>
+          <concatenate>false</concatenate>
+          <mime />
+        </de.uni__luebeck.inb.knowarc.usecases.ScriptInputUser>
+      </entry>
+      <entry>
+        <string>in1</string>
+        <de.uni__luebeck.inb.knowarc.usecases.ScriptInputUser>
+          <tag>in1</tag>
+          <file>true</file>
+          <tempFile>false</tempFile>
+          <binary>false</binary>
+          <charsetName>MacRoman</charsetName>
+          <forceCopy>false</forceCopy>
+          <list>false</list>
+          <concatenate>false</concatenate>
+          <mime />
+        </de.uni__luebeck.inb.knowarc.usecases.ScriptInputUser>
+      </entry>
+    </inputs>
+    <outputs>
+      <entry>
+        <string>out</string>
+        <de.uni__luebeck.inb.knowarc.usecases.ScriptOutput>
+          <path>out</path>
+          <binary>false</binary>
+          <mime />
+        </de.uni__luebeck.inb.knowarc.usecases.ScriptOutput>
+      </entry>
+    </outputs>
+    <includeStdIn>false</includeStdIn>
+    <includeStdOut>true</includeStdOut>
+    <includeStdErr>true</includeStdErr>
+    <validReturnCodes>
+      <int>0</int>
+    </validReturnCodes>
+  </useCaseDescription>
+  <edited>false</edited>
+</net.sf.taverna.t2.activities.externaltool.ExternalToolActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in1" depth="0" /><port name="in2" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>in_value</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><
 map from="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>Hello</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>in2_value</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.
 taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>World</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>Tool</processor><port>in1</port></sink><source type="processor"><processor>in_value</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>Tool</processor><port>in2</port></sink><source type="processor"><processor>in2_value</processor><port>value</port></source></datalink><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>Tool</processor>
 <port>out</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>6090defe-8eba-4775-8dd6-ab48813d23ab</identification>
+      </annotationBean>
+      <date>2011-10-27 18:50:36.777 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>8312a5c9-b291-4a20-a468-0cdd8888115b</identification>
+      </annotationBean>
+      <date>2011-10-27 18:46:58.794 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>82a5216a-8b82-41db-a114-ece396f9b85c</identification>
+      </annotationBean>
+      <date>2011-11-10 17:19:20.269 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>436555c3-0df8-4e5c-93f3-313124bf045c</identification>
+      </annotationBean>
+      <date>2011-10-27 18:52:22.981 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file


[23/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/prov-aq.rdf
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/prov-aq.rdf b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/prov-aq.rdf
new file mode 100644
index 0000000..e9b35cf
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/prov-aq.rdf
@@ -0,0 +1,342 @@
+<?xml version="1.0"?>
+
+
+<!DOCTYPE rdf:RDF [
+    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
+    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
+    <!ENTITY xml "http://www.w3.org/XML/1998/namespace" >
+    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
+    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
+]>
+
+
+<rdf:RDF xmlns="http://www.w3.org/ns/prov#"
+     xml:base="http://www.w3.org/ns/prov"
+     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+     xmlns:owl="http://www.w3.org/2002/07/owl#"
+     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
+     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+     xmlns:xml="http://www.w3.org/XML/1998/namespace">
+    <owl:Ontology rdf:about="http://www.w3.org/ns/prov-aq#">
+        <rdfs:label xml:lang="en">PROV Access and Query Ontology</rdfs:label>
+        <rdfs:comment rdf:datatype="&xsd;string">0.2</rdfs:comment>
+        <rdfs:comment xml:lang="en">This document is published by the Provenance Working Group (http://www.w3.org/2011/prov/wiki/Main_Page). 
+
+If you wish to make comments regarding this document, please send them to public-prov-comments@w3.org (subscribe public-prov-comments-request@w3.org, archives http://lists.w3.org/Archives/Public/public-prov-comments/). All feedback is welcome.</rdfs:comment>
+        <owl:versionIRI rdf:resource="http://www.w3.org/TR/2013/NOTE-prov-aq-20130430/"/>
+        <rdfs:seeAlso rdf:resource="http://www.w3.org/TR/prov-aq/"/>
+        <rdfs:seeAlso rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:Ontology>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Annotation properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#unqualifiedForm">
+        <rdfs:comment xml:lang="en">Classes and properties used to qualify relationships are annotated with prov:unqualifiedForm to indicate the property used to assert an unqualified provenance relation.</rdfs:comment>
+        <rdfs:subPropertyOf rdf:resource="&rdfs;seeAlso"/>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#aq">
+        <rdfs:subPropertyOf rdf:resource="&rdfs;seeAlso"/>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#sharesDefinitionWith">
+        <rdfs:subPropertyOf rdf:resource="&rdfs;seeAlso"/>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#definition">
+        <rdfs:comment xml:lang="en">A definition quoted from PROV-DM or PROV-CONSTRAINTS that describes the concept expressed with this OWL term.</rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#editorialNote">
+        <rdfs:comment xml:lang="en">A note by the OWL development team about how this term expresses the PROV-DM concept, or how it should be used in context of semantic web or linked data.</rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="&rdfs;label">
+        <rdfs:comment xml:lang="en"></rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#inverse">
+        <rdfs:comment xml:lang="en">PROV-O does not define all property inverses. The directionalities defined in PROV-O should be given preference over those not defined. However, if users wish to name the inverse of a PROV-O property, the local name given by prov:inverse should be used.</rdfs:comment>
+        <rdfs:seeAlso rdf:resource="http://www.w3.org/TR/prov-o/#names-of-inverse-properties"/>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="&rdfs;comment">
+        <rdfs:comment xml:lang="en"></rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#constraints">
+        <rdfs:comment xml:lang="en">A reference to the principal section of the PROV-CONSTRAINTS document that describes this concept.</rdfs:comment>
+        <rdfs:subPropertyOf rdf:resource="&rdfs;seeAlso"/>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="&owl;versionInfo"/>
+    <owl:AnnotationProperty rdf:about="&rdfs;seeAlso">
+        <rdfs:comment xml:lang="en"></rdfs:comment>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#dm">
+        <rdfs:comment xml:lang="en">A reference to the principal section of the PROV-DM document that describes this concept.</rdfs:comment>
+        <rdfs:subPropertyOf rdf:resource="&rdfs;seeAlso"/>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#category">
+        <rdfs:comment xml:lang="en">Classify prov-o terms into three categories, including &apos;starting-point&apos;, &apos;qualifed&apos;, and &apos;extended&apos;. This classification is used by the prov-o html document to gently introduce prov-o terms to its users. </rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="&rdfs;isDefinedBy"/>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#editorsDefinition">
+        <rdfs:comment xml:lang="en">When the prov-o term does not have a definition drawn from prov-dm, and the prov-o editor provides one.</rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+        <rdfs:subPropertyOf rdf:resource="http://www.w3.org/ns/prov#definition"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#component">
+        <rdfs:comment xml:lang="en">Classify prov-o terms into six components according to prov-dm, including &apos;agents-responsibility&apos;, &apos;alternate&apos;, &apos;annotations&apos;, &apos;collections&apos;, &apos;derivations&apos;, and &apos;entities-activities&apos;. This classification is used so that readers of prov-o specification can find its correspondence with the prov-dm specification.</rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#qualifiedForm">
+        <rdfs:comment xml:lang="en">This annotation property links a subproperty of prov:wasInfluencedBy with the subclass of prov:Influence and the qualifying property that are used to qualify it. 
+
+Example annotation:
+
+    prov:wasGeneratedBy prov:qualifiedForm prov:qualifiedGeneration, prov:Generation .
+
+Then this unqualified assertion:
+
+    :entity1 prov:wasGeneratedBy :activity1 .
+
+can be qualified by adding:
+
+   :entity1 prov:qualifiedGeneration :entity1Gen .
+   :entity1Gen 
+       a prov:Generation, prov:Influence;
+       prov:activity :activity1;
+       :customValue 1337 .
+
+Note how the value of the unqualified influence (prov:wasGeneratedBy :activity1) is mirrored as the value of the prov:activity (or prov:entity, or prov:agent) property on the influence class.</rdfs:comment>
+        <rdfs:subPropertyOf rdf:resource="&rdfs;seeAlso"/>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:AnnotationProperty>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#todo"/>
+    <owl:AnnotationProperty rdf:about="http://www.w3.org/ns/prov#n">
+        <rdfs:comment xml:lang="en">A reference to the principal section of the PROV-M document that describes this concept.</rdfs:comment>
+        <rdfs:subPropertyOf rdf:resource="&rdfs;seeAlso"/>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:AnnotationProperty>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Datatypes
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Object Properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://www.w3.org/2002/07/owl#topObjectProperty -->
+
+    <owl:ObjectProperty rdf:about="&owl;topObjectProperty"/>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#describesService -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#describesService">
+        <rdfs:label>describesService</rdfs:label>
+        <aq rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/NOTE-prov-aq-20130430/rovenance-query-service-description</aq>
+        <inverse>serviceDescribedBy</inverse>
+        <category>access-and-query</category>
+        <rdfs:comment xml:lang="en">relates a generic provenance query service resource (type prov:ServiceDescription) to a specific query service description (e.g. a prov:DirectQueryService or a sd:Service).</rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#hadUsage -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#hadUsage">
+        <rdfs:label>hadUsage</rdfs:label>
+        <category>qualified</category>
+        <rdfs:comment xml:lang="en">The _optional_ Usage involved in an Entity&apos;s Derivation.</rdfs:comment>
+        <inverse>wasUsedInDerivation</inverse>
+        <component>derivations</component>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+        <sharesDefinitionWith rdf:resource="http://www.w3.org/ns/prov#Usage"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#has_anchor -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#has_anchor">
+        <rdfs:label>has_anchor</rdfs:label>
+        <aq rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/NOTE-prov-aq-20130430/#resource-represented-as-html</aq>
+        <category>access-and-query</category>
+        <rdfs:comment xml:lang="en">Indicates anchor URI for a potentially dynamic resource instance.</rdfs:comment>
+        <inverse>anchorOf</inverse>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#has_provenance -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#has_provenance">
+        <rdfs:label>has_provenance</rdfs:label>
+        <aq rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/NOTE-prov-aq-20130430/#resource-represented-as-html</aq>
+        <inverse>provenanceOf</inverse>
+        <rdfs:comment xml:lang="en">Indicates a provenance-URI for a resource; the resource identified by this property presents a provenance record about its subject or anchor resource.</rdfs:comment>
+        <category>access-and-query</category>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#has_query_service -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#has_query_service">
+        <rdfs:label>hasProvenanceService</rdfs:label>
+        <aq rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/NOTE-prov-aq-20130430/</aq>
+        <category>access-and-query</category>
+        <inverse>provenanceQueryServiceOf</inverse>
+        <rdfs:comment xml:lang="en">Indicates a provenance query service that can access provenance related to its subject or anchor resource.</rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#pingback -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#pingback">
+        <rdfs:label>provenance pingback</rdfs:label>
+        <aq rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/NOTE-prov-aq-20130430/#provenance-pingback</aq>
+        <rdfs:comment xml:lang="en">Relates a resource to a provenance pingback service that may receive additional provenance links about the resource.</rdfs:comment>
+        <category>access-and-query</category>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#specializationOf -->
+
+    <owl:ObjectProperty rdf:about="http://www.w3.org/ns/prov#specializationOf">
+        <rdfs:label>specializationOf</rdfs:label>
+        <constraints rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2012/WD-prov-dm-20120703/prov-constraints.html#prov-dm-constraints-fig</constraints>
+        <dm rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2012/WD-prov-dm-20120703/prov-dm.html#term-specialization</dm>
+        <n rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2012/WD-prov-dm-20120703/prov-n.html#expression-specialization</n>
+        <component>alternate</component>
+        <category>expanded</category>
+        <inverse>generalizationOf</inverse>
+        <definition xml:lang="en">An entity that is a specialization of another shares all aspects of the latter, and additionally presents more specific aspects of the same thing as the latter. In particular, the lifetime of the entity being specialized contains that of any specialization. Examples of aspects include a time period, an abstraction, and a context associated with the entity.</definition>
+        <rdfs:subPropertyOf rdf:resource="&owl;topObjectProperty"/>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+        <rdfs:seeAlso rdf:resource="http://www.w3.org/ns/prov#alternateOf"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Data properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://www.w3.org/ns/prov#provenanceUriTemplate -->
+
+    <owl:DatatypeProperty rdf:about="http://www.w3.org/ns/prov#provenanceUriTemplate">
+        <rdfs:label>provenanceUriTemplate</rdfs:label>
+        <aq rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/NOTE-prov-aq-20130430/</aq>
+        <category>access-and-query</category>
+        <rdfs:comment xml:lang="en">Relates a provenance service to a URI template string for constructing provenance-URIs.</rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Classes
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://www.w3.org/2002/07/owl#Thing -->
+
+    <owl:Class rdf:about="&owl;Thing"/>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#DirectQueryService -->
+
+    <owl:Class rdf:about="http://www.w3.org/ns/prov#DirectQueryService">
+        <rdfs:label>ProvenanceService</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://www.w3.org/ns/prov#SoftwareAgent"/>
+        <aq rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/NOTE-prov-aq-20130430/#provenance-query-service-discovery</aq>
+        <category>access-and-query</category>
+        <rdfs:comment>Type for a generic provenance query service. Mainly for use in RDF provenance query service descriptions, to facilitate discovery in linked data environments.</rdfs:comment>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:Class>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#ServiceDescription -->
+
+    <owl:Class rdf:about="http://www.w3.org/ns/prov#ServiceDescription">
+        <rdfs:label>ServiceDescription</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://www.w3.org/ns/prov#SoftwareAgent"/>
+        <aq rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2013/NOTE-prov-aq-20130430/#provenance-query-service-discovery</aq>
+        <rdfs:comment>Type for a generic provenance query service. Mainly for use in RDF provenance query service descriptions, to facilitate discovery in linked data environments.</rdfs:comment>
+        <category>access-and-query</category>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:Class>
+    
+
+
+    <!-- http://www.w3.org/ns/prov#SoftwareAgent -->
+
+    <owl:Class rdf:about="http://www.w3.org/ns/prov#SoftwareAgent">
+        <rdfs:label>SoftwareAgent</rdfs:label>
+        <rdfs:subClassOf rdf:resource="&owl;Thing"/>
+        <dm rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2012/WD-prov-dm-20120703/prov-dm.html#term-agent</dm>
+        <n rdf:datatype="&xsd;anyURI">http://www.w3.org/TR/2012/WD-prov-dm-20120703/prov-n.html#expression-types</n>
+        <component>agents-responsibility</component>
+        <definition xml:lang="en">A software agent is running software.</definition>
+        <category>expanded</category>
+        <rdfs:isDefinedBy rdf:resource="http://www.w3.org/ns/prov#"/>
+    </owl:Class>
+</rdf:RDF>
+
+
+
+<!-- Generated by the OWL API (version 3.2.5.1928) http://owlapi.sourceforge.net -->
+

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/prov-dictionary.ttl
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/prov-dictionary.ttl b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/prov-dictionary.ttl
new file mode 100644
index 0000000..832eab1
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/prov-dictionary.ttl
@@ -0,0 +1,246 @@
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix : <http://www.w3.org/ns/prov#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+
+<http://www.w3.org/ns/prov-dictionary#>
+    a owl:Ontology ;
+    rdfs:comment """This document is published by the Provenance Working Group (http://www.w3.org/2011/prov/wiki/Main_Page). 
+
+If you wish to make comments regarding this document, please send them to public-prov-comments@w3.org (subscribe public-prov-comments-request@w3.org, archives http://lists.w3.org/Archives/Public/public-prov-comments/). All feedback is welcome."""@en ;
+    rdfs:label "W3C PROVenance Interchange Ontology (PROV-O) Dictionary Extension"@en ;
+    rdfs:seeAlso <http://www.w3.org/TR/prov-dictionary/>, <http://www.w3.org/ns/prov> .
+	
+<http://www.w3.org/ns/prov#>
+    a owl:Ontology .
+
+:Dictionary
+	a owl:Class ;
+	rdfs:isDefinedBy <http://www.w3.org/ns/prov#> ;
+	rdfs:label "Dictionary" ;
+	:definition "A dictionary is an entity that provides a structure to some constituents, which are themselves entities. These constituents are said to be member of the dictionary." ;
+	rdfs:comment "This concept allows for the provenance of the dictionary, but also of its constituents to be expressed. Such a notion of dictionary corresponds to a wide variety of concrete data structures, such as a maps or associative arrays." ;
+	rdfs:comment "A given dictionary forms a given structure for its members. A different structure (obtained either by insertion or removal of members) constitutes a different dictionary." ;
+	:category "collections" ;
+	:component "collections" ;
+	:dm "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#dictionary-conceptual-definition"^^xsd:anyURI ;
+	:n "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#expression-dictionary"^^xsd:anyURI ;
+	:constraints "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#dictionary-constraints"^^xsd:anyURI .
+	
+:EmptyDictionary
+	a owl:Class ;
+	rdfs:isDefinedBy <http://www.w3.org/ns/prov#> ;
+	rdfs:label "Empty Dictionary" ;
+	:definition "An empty dictionary (i.e. has no members)." ;
+	rdfs:subClassOf :EmptyCollection ;
+	rdfs:subClassOf :Dictionary ;
+	:category "collections" ;
+	:component "collections" ;
+	:dm "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#dictionary-conceptual-definition"^^xsd:anyURI ;
+	:n "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#expression-dictionary"^^xsd:anyURI ;
+	:constraints "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#dictionary-constraints"^^xsd:anyURI .
+	
+:KeyEntityPair
+	a owl:Class ;
+	rdfs:isDefinedBy <http://www.w3.org/ns/prov#> ;
+	rdfs:label "Key-Entity Pair" ;
+	:definition "A key-entity pair. Part of a prov:Dictionary through prov:hadDictionaryMember. The key is any RDF Literal, the value is a prov:Entity." ;
+	rdfs:subClassOf 
+		[ a owl:Restriction ;
+		  owl:onProperty :pairKey ;
+		  owl:cardinality "1"^^xsd:int
+		] ;
+	rdfs:subClassOf 
+		[ a owl:Restriction ;
+		  owl:onProperty :pairEntity ;
+		  owl:cardinality "1"^^xsd:int
+		] ;
+	:category "collections" ;
+	:component "collections" ;
+	:dm "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#term-dictionary-membership"^^xsd:anyURI ;
+	:n "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#expression-dictionary-membership"^^xsd:anyURI ;
+	:constraints "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#dictionary-constraints"^^xsd:anyURI .
+	
+:Insertion
+	a owl:Class ;
+	rdfs:isDefinedBy <http://www.w3.org/ns/prov#> ;
+	rdfs:label "Insertion" ;
+	:definition "Insertion is a derivation that transforms a dictionary into another, by insertion of one or more key-entity pairs." ;
+	rdfs:subClassOf :Derivation ;
+	rdfs:subClassOf 
+		[ a owl:Restriction ;
+		  owl:onProperty :dictionary ;
+		  owl:cardinality "1"^^xsd:int
+		] ;
+	rdfs:subClassOf 
+		[ a owl:Restriction ;
+		  owl:onProperty :insertedKeyEntityPair ;
+		  owl:minCardinality "1"^^xsd:int
+		] ;
+	:category "collections" ;
+	:component "collections" ;
+	:dm "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#term-dictionary-insertion"^^xsd:anyURI ;
+	:n "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#expression-dictionary-insertion"^^xsd:anyURI ;
+	:constraints "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#dictionary-constraints"^^xsd:anyURI ;
+	:unqualifiedForm :derivedByInsertionFrom .
+	
+:Removal
+	a owl:Class ;
+	rdfs:isDefinedBy <http://www.w3.org/ns/prov#> ;
+	rdfs:label "Removal" ;
+	:definition "Removal is a derivation that transforms a dictionary into another, by removing one or more key-entity pairs." ;
+	rdfs:subClassOf :Derivation ;
+	rdfs:subClassOf 
+		[ a owl:Restriction ;
+		  owl:onProperty :dictionary ;
+		  owl:cardinality "1"^^xsd:int
+		] ;
+	rdfs:subClassOf 
+		[ a owl:Restriction ;
+		  owl:onProperty :removedKey ;
+		  owl:minCardinality "1"^^xsd:int
+		] ;
+	:category "collections" ;
+	:component "collections" ;
+	:dm "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#term-dictionary-removal"^^xsd:anyURI ;
+	:n "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#expression-dictionary-removal"^^xsd:anyURI ;
+	:constraints "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#dictionary-constraints"^^xsd:anyURI ;
+	:unqualifiedForm :derivedByRemovalFrom .
+	
+:dictionary
+	a owl:ObjectProperty ;
+	rdfs:isDefinedBy <http://www.w3.org/ns/prov#> ;
+	rdfs:label "dictionary" ;
+	:definition "The property used by a prov:Insertion and prov:Removal to cite the prov:Dictionary that was prov:derivedByInsertionFrom or prov:derivedByRemovalFrom another dictionary." ;
+	rdfs:subPropertyOf :entity ;
+	rdfs:domain :Insertion, :Removal ;
+	rdfs:range :Dictionary ;
+	:category "collections" ;
+	:component "collections" ;
+	:dm "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#term-dictionary-insertion"^^xsd:anyURI ;
+	:dm "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#term-dictionary-removal"^^xsd:anyURI ;
+	:n "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#expression-dictionary-insertion"^^xsd:anyURI ;
+	:n "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#expression-dictionary-removal"^^xsd:anyURI ;
+	:constraints "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#dictionary-constraints"^^xsd:anyURI .
+	
+:derivedByInsertionFrom
+	a owl:ObjectProperty ;
+	rdfs:isDefinedBy <http://www.w3.org/ns/prov#> ;
+	rdfs:label "derivedByInsertionFrom" ;
+	:definition "The dictionary was derived from the other by insertion. prov:qualifiedInsertion shows details of the insertion, in particular the inserted key-entity pairs." ;
+	rdfs:subPropertyOf :wasDerivedFrom ;
+	rdfs:domain :Dictionary ;
+	rdfs:range :Dictionary ;
+	:category "collections" ;
+	:component "collections" ;
+	:dm "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#term-dictionary-insertion"^^xsd:anyURI ;
+	:n "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#expression-dictionary-insertion"^^xsd:anyURI ;
+	:constraints "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#dictionary-constraints"^^xsd:anyURI .
+	
+:derivedByRemovalFrom
+	a owl:ObjectProperty ;
+	rdfs:isDefinedBy <http://www.w3.org/ns/prov#> ;
+	rdfs:label "derivedByRemovalFrom" ;
+	:definition "The dictionary was derived from the other by removal. prov:qualifiedRemoval shows details of the removal, in particular the removed key-entity pairs." ;
+	rdfs:subPropertyOf :wasDerivedFrom ;
+	rdfs:domain :Dictionary ;
+	rdfs:range :Dictionary ;
+	:category "collections" ;
+	:component "collections" ;
+	:dm "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#term-dictionary-removal"^^xsd:anyURI ;
+	:n "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#expression-dictionary-removal"^^xsd:anyURI ;
+	:constraints "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#dictionary-constraints"^^xsd:anyURI .
+	
+:insertedKeyEntityPair
+	a owl:ObjectProperty ;
+	rdfs:isDefinedBy <http://www.w3.org/ns/prov#> ;
+	rdfs:label "insertedKeyEntityPair" ;
+	:definition "An object property to refer to the prov:KeyEntityPair inserted into a prov:Dictionary." ;
+	rdfs:domain :Insertion ;
+	rdfs:range :KeyEntityPair ;
+	:category "collections" ;
+	:component "collections" ;
+	:dm "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#term-dictionary-insertion"^^xsd:anyURI ;
+	:n "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#expression-dictionary-insertion"^^xsd:anyURI ;
+	:constraints "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#dictionary-constraints"^^xsd:anyURI .
+	
+:hadDictionaryMember
+	a owl:ObjectProperty ;
+	rdfs:isDefinedBy <http://www.w3.org/ns/prov#> ;
+	rdfs:label "hadDictionaryMember" ;
+	:definition "Describes the key-entity pair that was member of a prov:Dictionary. A dictionary can have multiple members." ;
+	rdfs:domain :Dictionary ;
+	rdfs:range :KeyEntityPair ;
+	:category "collections" ;
+	:component "collections" ;
+	:dm "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#term-dictionary-membership"^^xsd:anyURI ;
+	:n "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#expression-dictionary-membership"^^xsd:anyURI ;
+	:constraints "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#dictionary-constraints"^^xsd:anyURI .
+	
+:pairKey
+	a owl:DatatypeProperty, owl:FunctionalProperty ;
+	rdfs:isDefinedBy <http://www.w3.org/ns/prov#> ;
+	rdfs:label "pairKey" ;
+	:definition "The key of a KeyEntityPair, which is an element of a prov:Dictionary." ;
+	rdfs:domain :KeyEntityPair ;
+	rdfs:range rdfs:Literal ;
+	:category "collections" ;
+	:component "collections" ;
+	:dm "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#term-dictionary-membership"^^xsd:anyURI ;
+	:n "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#expression-dictionary-membership"^^xsd:anyURI ;
+	:constraints "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#dictionary-constraints"^^xsd:anyURI .
+	
+:pairEntity
+	a owl:ObjectProperty, owl:FunctionalProperty ;
+	rdfs:isDefinedBy <http://www.w3.org/ns/prov#> ;
+	rdfs:label "pairKey" ;
+	:definition "The value of a KeyEntityPair." ;
+	rdfs:domain :KeyEntityPair ;
+	rdfs:range :Entity ;
+	:category "collections" ;
+	:component "collections" ;
+	:dm "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#term-dictionary-membership"^^xsd:anyURI ;
+	:n "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#expression-dictionary-membership"^^xsd:anyURI ;
+	:constraints "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#dictionary-constraints"^^xsd:anyURI .
+	
+:qualifiedInsertion
+	a owl:ObjectProperty ;
+	rdfs:isDefinedBy <http://www.w3.org/ns/prov#> ;
+	rdfs:label "qualifiedInsertion" ;
+	:definition "The dictionary was derived from the other by insertion. prov:qualifiedInsertion shows details of the insertion, in particular the inserted key-entity pairs." ;
+	rdfs:subPropertyOf :qualifiedDerivation ;
+	rdfs:domain :Dictionary ;
+	rdfs:range :Insertion ;
+	:category "collections" ;
+	:component "collections" ;
+	:dm "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#term-dictionary-insertion"^^xsd:anyURI ;
+	:n "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#expression-dictionary-insertion"^^xsd:anyURI ;
+	:constraints "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#dictionary-constraints"^^xsd:anyURI .
+	
+:qualifiedRemoval
+	a owl:ObjectProperty ;
+	rdfs:isDefinedBy <http://www.w3.org/ns/prov#> ;
+	rdfs:label "qualifiedRemoval" ;
+	:definition "The dictionary was derived from the other by removal. prov:qualifiedRemoval shows details of the removal, in particular the removed keys." ;
+	rdfs:subPropertyOf :qualifiedDerivation ;
+	rdfs:domain :Dictionary ;
+	rdfs:range :Removal ;
+	:category "collections" ;
+	:component "collections" ;
+	:dm "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#term-dictionary-removal"^^xsd:anyURI ;
+	:n "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#expression-dictionary-removal"^^xsd:anyURI ;
+	:constraints "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#dictionary-constraints"^^xsd:anyURI .
+	
+:removedKey
+	a owl:DatatypeProperty ;
+	rdfs:isDefinedBy <http://www.w3.org/ns/prov#> ;
+	rdfs:label "removedKey" ;
+	:definition "The key removed in a Removal." ;
+	rdfs:domain :Removal ;
+	rdfs:range rdfs:Literal ;
+	:category "collections" ;
+	:component "collections" ;
+	:dm "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#term-dictionary-removal"^^xsd:anyURI ;
+	:n "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#expression-dictionary-removal"^^xsd:anyURI ;
+	:constraints "http://www.w3.org/TR/2013/NOTE-prov-dictionary-20130430/#dictionary-constraints"^^xsd:anyURI .
\ No newline at end of file


[12/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/ProvenanceWriter.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/ProvenanceWriter.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/ProvenanceWriter.java
new file mode 100644
index 0000000..23ad705
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/ProvenanceWriter.java
@@ -0,0 +1,676 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.provenance.lineageservice;
+
+import static net.sf.taverna.t2.provenance.connector.AbstractProvenanceConnector.DataflowInvocationTable.DataflowInvocation;
+
+import java.sql.Blob;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.UUID;
+
+import net.sf.taverna.t2.provenance.connector.AbstractProvenanceConnector.ActivityTable;
+import net.sf.taverna.t2.provenance.connector.AbstractProvenanceConnector.DataBindingTable;
+import net.sf.taverna.t2.provenance.connector.AbstractProvenanceConnector.DataflowInvocationTable;
+import net.sf.taverna.t2.provenance.connector.AbstractProvenanceConnector.ProcessorEnactmentTable;
+import net.sf.taverna.t2.provenance.connector.AbstractProvenanceConnector.ServiceInvocationTable;
+import net.sf.taverna.t2.provenance.lineageservice.utils.NestedListNode;
+import net.sf.taverna.t2.provenance.lineageservice.utils.Port;
+import net.sf.taverna.t2.provenance.lineageservice.utils.PortBinding;
+import net.sf.taverna.t2.provenance.lineageservice.utils.ProvenanceProcessor;
+
+import org.apache.log4j.Logger;
+
+import uk.org.taverna.configuration.database.DatabaseManager;
+
+/**
+ * Handles all the writing out of provenance items to the database layer. Uses
+ * standard SQL so all specific instances of this class can extend this writer
+ * to handle all of the db writes
+ * 
+ * @author Paolo Missier
+ * @author Ian Dunlop
+ * @author Stuart Owen
+ * 
+ */
+public class ProvenanceWriter {
+
+	protected static Logger logger = Logger.getLogger(ProvenanceWriter.class);
+	protected int cnt; // counts number of calls to PortBinding
+	protected ProvenanceQuery pq = null;
+	private final DatabaseManager databaseManager;
+
+	public ProvenanceWriter(DatabaseManager databaseManager) {
+		this.databaseManager = databaseManager;
+	}
+
+	public Connection getConnection() throws SQLException {
+		return databaseManager.getConnection();
+	}
+
+	public void closeCurrentModel() {
+
+	}
+
+	/**
+	 * add each Port as a row into the Port DB table <strong>note: no static
+	 * port type available as part of the dataflow...</strong>
+	 * 
+	 * @param ports
+	 * @param wfId
+	 * @throws SQLException
+	 */
+	public void addPorts(List<Port> ports, String wfId) throws SQLException {
+		String sql = "INSERT INTO Port "
+				+ "(portName, processorName, isInputPort, depth, workflowId, portId, processorId)"
+				+ "  VALUES(?,?,?,?,?,?,?)";
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql)) {
+			for (Port v : ports) {
+				ps.setString(1, v.getPortName());
+				ps.setString(2, v.getProcessorName());
+				ps.setBoolean(3, v.isInputPort());
+				int depth = v.getDepth() >= 0 ? v.getDepth() : 0;
+				ps.setInt(4, depth);
+				ps.setString(5, wfId);
+				ps.setString(6, v.getIdentifier());
+				ps.setString(7, v.getProcessorId());
+
+				try {
+					ps.executeUpdate();
+				} catch (Exception e) {
+					logger.warn("Could not insert var " + v.getPortName(), e);
+				}
+			}
+		}
+	}
+
+	@SuppressWarnings("static-access")
+	public void addDataflowInvocation(
+			net.sf.taverna.t2.provenance.lineageservice.utils.DataflowInvocation invocation)
+			throws SQLException {
+		String sql = "INSERT INTO " + DataflowInvocation.DataflowInvocation
+				+ "(" + DataflowInvocation.dataflowInvocationId + ","
+				+ DataflowInvocation.workflowId + ","
+				+ DataflowInvocation.invocationStarted + ","
+				+ DataflowInvocation.invocationEnded + ","
+				+ DataflowInvocation.inputsDataBinding + ","
+				+ DataflowInvocation.outputsDataBinding + ","
+				+ DataflowInvocation.parentProcessorEnactmentId + ","
+				+ DataflowInvocation.workflowRunId + ","
+				+ DataflowInvocation.completed + ") "
+				+ " VALUES(?,?,?,?,?,?,?,?,?)";
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql);) {
+			ps.setString(1, invocation.getDataflowInvocationId());
+			ps.setString(2, invocation.getWorkflowId());
+			ps.setTimestamp(3, invocation.getInvocationStarted());
+			ps.setTimestamp(4, invocation.getInvocationEnded());
+			ps.setString(5, invocation.getInputsDataBindingId());
+			ps.setString(6, invocation.getOutputsDataBindingId());
+			ps.setString(7, invocation.getParentProcessorEnactmentId());
+			ps.setString(8, invocation.getWorkflowRunId());
+			ps.setBoolean(9, invocation.getCompleted());
+
+			ps.executeUpdate();
+		}
+	}
+
+	/**
+	 * inserts one row into the ARC DB table
+	 * 
+	 * @param sourcePort
+	 * @param destinationPort
+	 * @param workflowId
+	 */
+	public void addDataLink(Port sourcePort, Port destinationPort,
+			String workflowId) throws SQLException {
+		String sql = "INSERT INTO Datalink (workflowId, sourceProcessorName, "
+				+ " sourcePortName, destinationProcessorName, destinationPortName,"
+				+ " sourcePortId, destinationPortId) "
+				+ "VALUES(?,?,?,?,?,?,?)";
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql)) {
+			ps.setString(1, workflowId);
+			ps.setString(2, sourcePort.getProcessorName());
+			ps.setString(3, sourcePort.getPortName());
+			ps.setString(4, destinationPort.getProcessorName());
+			ps.setString(5, destinationPort.getPortName());
+			ps.setString(6, sourcePort.getIdentifier());
+			ps.setString(7, destinationPort.getIdentifier());
+
+			ps.executeUpdate();
+		}
+	}
+
+	public void addDataBinding(
+			net.sf.taverna.t2.provenance.lineageservice.utils.DataBinding dataBinding)
+			throws SQLException {
+		String sql = "INSERT INTO " + DataBindingTable.DataBinding + "("
+				+ DataBindingTable.dataBindingId + ","
+				+ DataBindingTable.portId + "," + DataBindingTable.t2Reference
+				+ "," + DataBindingTable.workflowRunId + ") VALUES(?,?,?,?)";
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql)) {
+			ps.setString(1, dataBinding.getDataBindingId());
+			ps.setString(2, dataBinding.getPort().getIdentifier());
+			ps.setString(3, dataBinding.getT2Reference());
+			ps.setString(4, dataBinding.getWorkflowRunId());
+			ps.executeUpdate();
+			if (logger.isDebugEnabled())
+				logger.debug("adding DataBinding:\n " + dataBinding);
+		}
+	}
+
+	public void addWFId(String wfId) throws SQLException {
+		String sql = "INSERT INTO Workflow (workflowId) VALUES (?)";
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql)) {
+			ps.setString(1, wfId);
+			ps.executeUpdate();
+		}
+	}
+
+	public void addWFId(String wfId, String parentWorkflowId,
+			String externalName, Blob dataflow) throws SQLException {
+		String sql = "INSERT INTO Workflow (workflowId, parentWorkflowId, externalName, dataflow) "
+				+ "VALUES (?, ?, ?, ?)";
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql)) {
+			ps.setString(1, wfId);
+			ps.setString(2, parentWorkflowId);
+			ps.setString(3, externalName);
+			ps.setBlob(4, dataflow);
+
+			ps.executeUpdate();
+		}
+	}
+
+	public void addWorkflowRun(String wfId, String workflowRunId)
+			throws SQLException {
+		String sql = "INSERT INTO WorkflowRun (workflowRunId, workflowId) VALUES (?,?)";
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql)) {
+			ps.setString(1, workflowRunId);
+			ps.setString(2, wfId);
+
+			ps.executeUpdate();
+		}
+	}
+
+	/**
+	 * insert new processor into the provenance DB
+	 * 
+	 * @param name
+	 * @throws SQLException
+	 */
+	public ProvenanceProcessor addProcessor(String name, String wfID,
+			boolean isTopLevel) throws SQLException {
+		ProvenanceProcessor provProc = new ProvenanceProcessor();
+		provProc.setIdentifier(UUID.randomUUID().toString());
+		provProc.setProcessorName(name);
+		provProc.setWorkflowId(wfID);
+		provProc.setTopLevelProcessor(isTopLevel);
+		// pType is unknown
+		addProcessor(provProc);
+		return provProc;
+	}
+
+	/**
+	 * add a processor to the static portion of the DB with given name, type and
+	 * workflowId scope
+	 * 
+	 * @param name
+	 * @param type
+	 * @param workflowId
+	 * @throws SQLException
+	 */
+	public void addProcessor(ProvenanceProcessor provProc) throws SQLException {
+		String sql = "INSERT INTO Processor (processorName, firstActivityClass, workflowId, isTopLevel, processorId) "
+				+ "VALUES (?,?,?,?,?)";
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql);) {
+			ps.setString(1, provProc.getProcessorName());
+			ps.setString(2, provProc.getFirstActivityClassName());
+			ps.setString(3, provProc.getWorkflowId());
+			ps.setBoolean(4, provProc.isTopLevelProcessor());
+			ps.setString(5, provProc.getIdentifier());
+
+			ps.executeUpdate();
+		}
+	}
+
+	public void addProcessorEnactment(
+			net.sf.taverna.t2.provenance.lineageservice.utils.ProcessorEnactment enactment)
+			throws SQLException {
+		String sql = "INSERT INTO "
+				+ ProcessorEnactmentTable.ProcessorEnactment + "("
+				+ ProcessorEnactmentTable.processEnactmentId + ","
+				+ ProcessorEnactmentTable.workflowRunId + ","
+				+ ProcessorEnactmentTable.processorId + ","
+				+ ProcessorEnactmentTable.processIdentifier + ","
+				+ ProcessorEnactmentTable.iteration + ","
+				+ ProcessorEnactmentTable.parentProcessorEnactmentId + ","
+				+ ProcessorEnactmentTable.enactmentStarted + ","
+				+ ProcessorEnactmentTable.enactmentEnded + ","
+				+ ProcessorEnactmentTable.initialInputsDataBindingId + ","
+				+ ProcessorEnactmentTable.finalOutputsDataBindingId
+				+ ") VALUES(?,?,?,?,?,?,?,?,?,?)";
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql)) {
+			ps.setString(1, enactment.getProcessEnactmentId());
+			ps.setString(2, enactment.getWorkflowRunId());
+			ps.setString(3, enactment.getProcessorId());
+			ps.setString(4, enactment.getProcessIdentifier());
+			ps.setString(5, enactment.getIteration());
+			ps.setString(6, enactment.getParentProcessorEnactmentId());
+			ps.setTimestamp(7, enactment.getEnactmentStarted());
+			ps.setTimestamp(8, enactment.getEnactmentEnded());
+			ps.setString(9, enactment.getInitialInputsDataBindingId());
+			ps.setString(10, enactment.getFinalOutputsDataBindingId());
+			ps.executeUpdate();
+
+			if (logger.isDebugEnabled())
+				logger.debug("adding ProcessorEnactment binding:\n "
+						+ enactment);
+		}
+	}
+
+	public String addCollection(String processorId, String collId,
+			String parentCollectionId, String iteration, String portName,
+			String dataflowId) throws SQLException {
+		String newParentCollectionId = null;
+		String sql = "INSERT INTO Collection (processorNameRef, workflowRunId, portName, iteration, parentCollIdRef, collId) "
+				+ "VALUES(?, ?, ?, ?, ?, ?)";
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql)) {
+			if (parentCollectionId == null)
+				// this is a top-level list
+				parentCollectionId = "TOP";
+
+			newParentCollectionId = collId;
+
+			ps.setString(1, processorId);
+			ps.setString(2, dataflowId);
+			ps.setString(3, portName);
+			ps.setString(4, iteration);
+			ps.setString(5, parentCollectionId);
+			ps.setString(6, collId);
+
+			ps.executeUpdate();
+		}
+
+		return newParentCollectionId;
+	}
+
+	public void addData(String dataRef, String wfInstanceId, Object data)
+			throws SQLException {
+		String sql = "INSERT INTO Data (dataReference,wfInstanceID,data) VALUES (?,?,?)";
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql);) {
+			ps.setString(1, dataRef);
+			ps.setString(2, wfInstanceId);
+			ps.setString(3, (String) data);
+
+			ps.executeUpdate();
+
+			cnt++;
+
+			logger.debug("addData executed on data value from char: "
+					+ data);
+		} catch (SQLException e) {
+			// the same ID will come in several times -- duplications are
+			// expected, don't panic
+		}
+	}
+
+	/**
+	 * OBSOLETE
+	 * <p/>
+	 * adds (dataRef, data) pairs to the Data table (only for string data)
+	 */
+	public void addData(String dataRef, String wfInstanceId, byte[] data)
+			throws SQLException {
+		String sql = "INSERT INTO Data (dataReference,wfInstanceID,data) VALUES (?,?,?)";
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql)) {
+			ps.setString(1, dataRef);
+			ps.setString(2, wfInstanceId);
+			ps.setBytes(3, data);
+
+			ps.executeUpdate();
+
+			cnt++;
+
+			logger.debug("addData executed on data value from char: " + data);
+
+		} catch (SQLException e) {
+			// the same ID will come in several times -- duplications are
+			// expected, don't panic
+		}
+	}
+
+	public void addPortBinding(PortBinding vb) throws SQLException {
+		logger.debug("START addVarBinding proc " + vb.getProcessorName()
+				+ " port " + vb.getPortName());
+		String sql = "INSERT INTO PortBinding (workflowId, processorNameRef, workflowRunId, portName, valueType, value, ref, collIdRef, iteration,positionInColl) "
+				+ "VALUES(?,?,?,?,?,?,?,?,?,?)";
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql)) {
+			ps.setString(1, vb.getWorkflowId());
+			ps.setString(2, vb.getProcessorName());
+			ps.setString(3, vb.getWorkflowRunId());
+			ps.setString(4, vb.getPortName());
+			ps.setString(5, vb.getValueType());
+			ps.setString(6, vb.getValue());
+			ps.setString(7, vb.getReference());
+			ps.setString(8, vb.getCollIDRef());
+			ps.setString(9, vb.getIteration());
+			ps.setInt(10, vb.getPositionInColl());
+
+			logger.debug("addVarBinding query: \n" + ps.toString());
+			ps.executeUpdate();
+			logger.debug("insert done");
+
+			logger.debug("COMPLETE addVarBinding proc " + vb.getProcessorName()
+					+ " port " + vb.getPortName());
+
+			cnt++; // who uses this?
+		}
+	}
+
+	/**
+	 * persists var v back to DB
+	 * 
+	 * @param v
+	 * @throws SQLException
+	 */
+	public void updatePort(Port v) throws SQLException {
+		String sql = "UPDATE Port SET isInputPort=?, depth=?,"
+				+ "resolvedDepth=?, iterationStrategyOrder=? "
+				+ "WHERE portId=?";
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql)) {
+			ps.setInt(1, v.isInputPort() ? 1 : 0);
+			ps.setInt(2, v.getDepth());
+			if (v.isResolvedDepthSet()) {
+				ps.setInt(3, v.getResolvedDepth());
+			} else {
+				ps.setString(3, null);
+			}
+			ps.setInt(4, v.getIterationStrategyOrder());
+			ps.setString(5, v.getIdentifier());
+			ps.execute();
+		}
+	}
+
+	public void updateProcessorEnactment(
+			net.sf.taverna.t2.provenance.lineageservice.utils.ProcessorEnactment enactment) {
+		String sql = "UPDATE " + ProcessorEnactmentTable.ProcessorEnactment
+				+ " SET " + ProcessorEnactmentTable.finalOutputsDataBindingId
+				+ "=?, " + ProcessorEnactmentTable.enactmentEnded + "=?"
+				+ " WHERE " + ProcessorEnactmentTable.processEnactmentId + "=?";
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql)) {
+			ps.setString(1, enactment.getFinalOutputsDataBindingId());
+			ps.setTimestamp(2, enactment.getEnactmentEnded());
+			ps.setString(3, enactment.getProcessEnactmentId());
+
+			ps.executeUpdate();
+		} catch (SQLException e) {
+			logger.warn("****  insert failed for query ", e);
+		}
+	}
+
+	public void updatePortBinding(PortBinding vb) {
+		String sql = "UPDATE PortBinding SET valueType = ?, value = ?, ref = ?, collIdRef = ?, positionInColl = ? "
+				+ "WHERE portName = ? AND workflowRunId = ? AND processorNameRef = ? AND iteration = ?"				;
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql)) {
+			// Update values
+			ps.setString(1, vb.getValueType());
+			ps.setString(2, vb.getValue());
+			ps.setString(3, vb.getReference());
+			ps.setString(4, vb.getCollIDRef());
+			ps.setInt(5, vb.getPositionInColl());
+			// Where clauses
+			ps.setString(6, vb.getPortName());
+			ps.setString(7, vb.getWorkflowRunId());
+			ps.setString(8, vb.getProcessorName());
+			ps.setString(9, vb.getIteration());
+
+			ps.executeUpdate();
+
+			cnt++;
+
+		} catch (SQLException e) {
+			logger.warn("****  insert failed for query ", e);
+		}
+	}
+
+	public void replaceCollectionRecord(NestedListNode nln, String prevPName,
+			String prevPortName) {
+		String sql = "DELETE FROM Collection WHERE collId = ? AND workflowRunId = ?"
+				+ " AND portName = ? AND processorNameRef = ? AND iteration = ?";
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql)) {
+			ps.setString(1, nln.getCollectionT2Reference());
+			ps.setString(2, nln.getWorkflowRunId());
+			ps.setString(3, prevPortName);
+			ps.setString(4, prevPName);
+			ps.setString(5, nln.getIteration());
+
+			ps.executeUpdate();
+		} catch (SQLException e) {
+			logger.warn("Error replacing collection record", e);
+		}
+
+		try {
+			addCollection(prevPName, nln.getCollectionT2Reference(),
+					nln.getParentCollIdRef(), nln.getIteration(), prevPortName,
+					nln.getWorkflowRunId());
+		} catch (SQLException e) {
+			logger.warn("Collection insert failed", e);
+		}
+	}
+
+	/**
+	 * deletes DB contents for the static structures -- called prior to each run
+	 * 
+	 * @throws SQLException
+	 */
+	public void clearDBStatic() throws SQLException {
+		try (Connection connection = getConnection();
+				Statement stmt = connection.createStatement()) {
+			stmt.executeUpdate("DELETE FROM Workflow");
+			stmt.executeUpdate("DELETE FROM Processor");
+			stmt.executeUpdate("DELETE FROM Datalink");
+			stmt.executeUpdate("DELETE FROM Port");
+			stmt.executeUpdate("DELETE FROM " + ActivityTable.Activity);
+			logger.info("DB cleared STATIC");
+		} catch (SQLException e) {
+			logger.warn("Could not clear static database", e);
+		}
+	}
+
+	/**
+	 * deletes DB contents for the static structures -- called prior to each run
+	 * 
+	 * @throws SQLException
+	 */
+	public void clearDBStatic(String wfID) throws SQLException {
+		try (Connection connection = getConnection()) {
+			try (PreparedStatement ps = connection
+					.prepareStatement("DELETE FROM Workflow WHERE workflowId = ?")) {
+				ps.setString(1, wfID);
+				ps.executeUpdate();
+			}
+			try (PreparedStatement ps = connection
+					.prepareStatement("DELETE FROM Processor WHERE workflowId = ?")) {
+				ps.setString(1, wfID);
+				ps.executeUpdate();
+			}
+			try (PreparedStatement ps = connection
+					.prepareStatement("DELETE FROM Datalink WHERE workflowId = ?")) {
+				ps.setString(1, wfID);
+				ps.executeUpdate();
+			}
+			try (PreparedStatement ps = connection
+					.prepareStatement("DELETE FROM Port WHERE workflowId = ?")) {
+				ps.setString(1, wfID);
+				ps.executeUpdate();
+			}
+			try (PreparedStatement ps = connection
+					.prepareStatement("DELETE FROM " + ActivityTable.Activity
+							+ " WHERE " + ActivityTable.workflowId + "=?")) {
+				ps.setString(1, wfID);
+				ps.executeUpdate();
+			}
+		}
+		logger.info("DB cleared STATICfor wfID " + wfID);
+	}
+
+	public Set<String> clearDBDynamic() throws SQLException {
+		return clearDBDynamic(null);
+	}
+
+	private void delete(Connection connection, Object table, String runID) throws SQLException {
+		if (runID != null) {
+			try (PreparedStatement ps = connection
+					.prepareStatement("DELETE FROM " + table
+							+ " WHERE workflowRunId = ?")) {
+				ps.setString(1, runID);
+				ps.executeUpdate();
+			}
+		} else
+			try (PreparedStatement ps = connection
+					.prepareStatement("DELETE FROM " + table)) {
+				ps.executeUpdate();
+			}
+	}
+	/**
+	 * deletes DB contents for all runs -- for testing purposes
+	 * 
+	 * @throws SQLException
+	 */
+	public Set<String> clearDBDynamic(String runID) throws SQLException {
+		Set<String> refsToRemove = collectValueReferences(runID);
+		// collect all relevant refs from PortBinding and Collection
+
+		try (Connection connection = getConnection()) {
+			delete(connection, "WorkflowRun", runID);
+			delete(connection, "PortBinding", runID);
+			delete(connection, "Collection", runID);
+			delete(connection, DataflowInvocationTable.DataflowInvocation, runID);
+			delete(connection, ServiceInvocationTable.ServiceInvocation, runID);
+			delete(connection, ProcessorEnactmentTable.ProcessorEnactment, runID);
+			delete(connection, DataBindingTable.DataBinding, runID);
+		}
+		logger.info("DB cleared DYNAMIC");
+		return refsToRemove;
+	}
+
+	private Set<String> collectValueReferences(String runID)
+			throws SQLException {
+		Set<String> refs = new HashSet<>();
+		try (Connection connection = getConnection()) {
+			String sql = "SELECT value FROM PortBinding";
+			if (runID != null)
+				sql += " WHERE workflowRunId = ?";
+			try (PreparedStatement ps = connection.prepareStatement(sql)) {
+				if (runID != null)
+					ps.setString(1, runID);
+				ResultSet rs = ps.executeQuery();
+				while (rs.next())
+					refs.add(rs.getString("value"));
+			}
+
+			sql = "SELECT collId FROM Collection";
+			if (runID != null)
+				sql += " WHERE workflowRunId = ?";
+			try (PreparedStatement ps = connection.prepareStatement(sql)) {
+				if (runID != null)
+					ps.setString(1, runID);
+				ResultSet rs = ps.executeQuery();
+				while (rs.next())
+					refs.add(rs.getString("collId"));
+			}
+		} catch (SQLException e) {
+			logger.error("Problem collecting value references for: " + runID
+					+ " : " + e);
+		}
+		return refs;
+	}
+
+	public void clearDD() {
+		try (Connection connection = getConnection();
+				Statement stmt = connection.createStatement()) {
+			stmt.executeUpdate("DELETE FROM DD");
+		} catch (SQLException e) {
+			logger.warn("Error execting delete query for provenance records", e);
+		}
+	}
+
+	/**
+	 * used to support the implementation of
+	 * 
+	 * @param pname
+	 * @param vFrom
+	 * @param valFrom
+	 * @param vTo
+	 * @param valTo
+	 * @param iteration
+	 * @param workflowRunId
+	 */
+	public void writeDDRecord(String pFrom, String vFrom, String valFrom,
+			String pTo, String vTo, String valTo, String iteration,
+			String workflowRunId) {
+		String sql = "INSERT INTO DD (PFrom,VFrom,valFrom,PTo,VTo,valTo,iteration,workflowRun) VALUES "
+				+ "(?,?,?,?,?,?,?)";
+		try (Connection connection = getConnection();
+				PreparedStatement ps = connection.prepareStatement(sql)) {
+			ps.setString(1, pFrom);
+			ps.setString(2, vFrom);
+			ps.setString(3, valFrom);
+			ps.setString(4, pTo);
+			ps.setString(5, vTo);
+			ps.setString(6, iteration);
+			ps.setString(7, workflowRunId);
+			ps.executeUpdate();
+		} catch (SQLException e) {
+			logger.warn("Error inserting record into DD", e);
+		}
+	}
+
+	public void setQuery(ProvenanceQuery query) {
+		this.pq = query;
+	}
+
+	public ProvenanceQuery getQuery() {
+		return this.pq;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/URIGenerator.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/URIGenerator.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/URIGenerator.java
new file mode 100644
index 0000000..94a0b8a
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/URIGenerator.java
@@ -0,0 +1,58 @@
+package net.sf.taverna.t2.provenance.lineageservice;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+public class URIGenerator {
+
+	public String makeT2ReferenceURI(String collId) {
+		// collId is of the form t2:list//<UUID>
+		// map to a proper URI
+		
+		String[] tokens = collId.split("//");
+		String type = tokens[0].split(":")[1];
+		String namespace = tokens[1].split("/")[0].split("\\?")[0];
+		String dataId = tokens[1].split("\\?")[1];
+		return "http://ns.taverna.org.uk/2011/data/" + namespace + "/" + type + "/" + dataId;
+	}
+
+	public String makeWFInstanceURI(String workflowRunId) {
+		return "http://ns.taverna.org.uk/2011/run/" + workflowRunId + "/";
+	}
+
+	public String makeWorkflowURI(String wfId) {
+		return "http://ns.taverna.org.uk/2010/workflow/" + wfId + "/";
+	}
+
+	public String makePortURI(String wfId, String pName, String vName,
+			boolean inputPort) {		
+		return makeProcessorURI(pName, wfId) + (inputPort ? "in/" : "out/")
+				+ escape(vName);
+	}
+
+	public String escape(String part) {
+		try {
+			return new URI(null, null, part.replace("/", "%47"), null)
+					.getRawPath();
+		} catch (URISyntaxException e) {
+			throw new RuntimeException("Can't escape URI part " + part, e);
+		}
+	}
+	
+	public String makeProcessorURI(String pName, String wfId) {
+		return makeWorkflowURI(wfId) + "processor/" + escape(pName) + "/";
+	}
+
+	public String makeIteration(String workflowRunId, String workflowId,
+			String processorName, String iteration) {
+		String iterationUri = iteration.replace(',', '-').replace('[', ' ')
+				.replace(']', ' ').trim();
+
+		return makeWFInstanceURI(workflowRunId) + "workflow/" + workflowId
+				+ "/processor/" + processorName + "/iteration/" + iterationUri;
+	}
+
+	public URI makeRunUri(String workflowRunId) {
+		return URI.create(makeWFInstanceURI(workflowRunId));
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/WorkflowDataProcessor.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/WorkflowDataProcessor.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/WorkflowDataProcessor.java
new file mode 100644
index 0000000..25369fd
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/WorkflowDataProcessor.java
@@ -0,0 +1,453 @@
+/**
+ * 
+ */
+package net.sf.taverna.t2.provenance.lineageservice;
+
+import static net.sf.taverna.t2.provenance.lineageservice.utils.ProvenanceUtils.iterationToString;
+import static net.sf.taverna.t2.provenance.lineageservice.utils.ProvenanceUtils.parentProcess;
+
+import java.sql.SQLException;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
+
+import net.sf.taverna.t2.facade.WorkflowInstanceFacade.State;
+import net.sf.taverna.t2.provenance.item.DataflowRunComplete;
+import net.sf.taverna.t2.provenance.item.ProvenanceItem;
+import net.sf.taverna.t2.provenance.item.WorkflowDataProvenanceItem;
+import net.sf.taverna.t2.provenance.lineageservice.utils.DataBinding;
+import net.sf.taverna.t2.provenance.lineageservice.utils.DataflowInvocation;
+import net.sf.taverna.t2.provenance.lineageservice.utils.Port;
+import net.sf.taverna.t2.provenance.lineageservice.utils.PortBinding;
+import net.sf.taverna.t2.provenance.lineageservice.utils.ProcessorEnactment;
+
+import org.apache.log4j.Logger;
+
+/**
+ * @author paolo
+ * this class manages the outputs from a workflow, as they come along through WorkflowData events
+ */
+public class WorkflowDataProcessor {
+	private static Logger logger = Logger.getLogger(WorkflowDataProcessor.class);
+
+	// set of trees (impl as lists), one for each portName
+	// PM portName not enough must use the WFID as context as well, because the same output portName 
+	// may occur in multiple nested workflows 
+	Map<String, List<WorkflowDataNode>> workflowDataTrees = new HashMap<>();  
+
+	protected Map<String, Timestamp> workflowStarted = new ConcurrentHashMap<>(); 
+
+	ProvenanceQuery pq=null;
+	ProvenanceWriter pw = null;
+
+	protected Map<String, ProcessorEnactment> invocationProcessToProcessEnactment = new ConcurrentHashMap<>();
+
+	/**
+	 * adds the input ProvenanceItem event to the tree structure corresponding
+	 * to the portName found in the item. Repeated invocations of this method
+	 * incrementally reconstruct the tree structure for each of the workflow
+	 * outputs
+	 * 
+	 * @param root
+	 */
+	public void addWorkflowDataItem(ProvenanceItem provenanceItem) {
+		WorkflowDataProvenanceItem workflowDataItem = (WorkflowDataProvenanceItem) provenanceItem;
+		
+		WorkflowDataNode wdn = new WorkflowDataNode();
+		wdn.setProcessId(provenanceItem.getProcessId());
+		wdn.setPortName(workflowDataItem.getPortName());
+		wdn.setInputPort(workflowDataItem.isInputPort());
+		wdn.setValue(workflowDataItem.getData().toString());
+		int[] index = workflowDataItem.getIndex();
+		String iterationToString = iterationToString(index);
+		wdn.setIndex(iterationToString);
+		wdn.setWorkflowID(workflowDataItem.getWorkflowId());
+
+		if (wdn.getValue().contains("list"))
+			wdn.setList(true);  // HACK
+		else
+			wdn.setList(false);
+
+		// position this wdn into the tree associated to its portName
+		List<WorkflowDataNode> aTree = workflowDataTrees.get(wdn.getPortName());
+
+		if (aTree == null)  { // first item in the tree
+			aTree = new ArrayList<WorkflowDataNode>();
+			workflowDataTrees.put(wdn.getPortName(), aTree);
+		} else
+			// update parent pointers
+			for (WorkflowDataNode aNode: aTree)
+				if (isParent(wdn.getIndex(), aNode.getIndex())) {
+					aNode.setParent(wdn);
+
+					// set position in collection as the last index in the vector
+					aNode.setRelativePosition(getPosition(aNode));
+				}
+		aTree.add(wdn);
+	}
+
+	/**
+	 * writes records to PortBinding or Collection by traversing the trees<br/>
+	 * expect this to be invoked after workflow completion
+	 * 
+	 * @param workflowId
+	 *            the external name of the dataflow (not the UUID)
+	 * @param workflowRunId
+	 *            the runID
+	 */
+	public void processTrees(DataflowRunComplete completeEvent,
+			String workflowRunId) {
+		String workflowId = completeEvent.getWorkflowId();
+		logger.debug("processing output trees");
+
+		// i:inputPortName -> t2Ref
+		Map<String, String> workflowPortData = new HashMap<>();
+		
+		for (Map.Entry<String, List<WorkflowDataNode>> entry : workflowDataTrees
+				.entrySet()) {
+			String portName = entry.getKey();
+			List<WorkflowDataNode> tree = entry.getValue();
+
+			PortBinding vb = null;
+
+			logger.debug("storing tree for var "+portName+" in workflow with ID "+workflowId+" and instance "+workflowRunId);
+			for (WorkflowDataNode node:tree) {
+				try {
+					if (!node.getWorkflowID().equals(workflowId))
+						continue;
+
+					if (node.getIndex().equals("[]")) {
+						// Store top-level workflow inputs/outputs
+						if (! node.getProcessId().equals(completeEvent.getProcessId()))
+							//logger.warn("Unexpected process ID " + node.getProcessId() + " expected " + completeEvent.getProcessId());
+							continue;
+						String portKey = (node.isInputPort() ? "/i:" : "/o:") + node.getPortName();
+						workflowPortData.put(portKey, node.getValue());
+					}
+					
+					if (node.isList) {
+						logger.debug("creating collection entry for "
+								+ node.value + " with index " + node.index);
+
+						if (node.getParent() != null) {
+							logger.debug(" and parent " + node.parent.index);
+							// write a collection record to DB
+							getPw().addCollection(workflowId, node.getValue(),
+									node.getParent().getValue(),
+									node.getIndex(), portName, workflowRunId);
+						} else
+							getPw().addCollection(workflowId, node.getValue(),
+									null, node.getIndex(), portName,
+									workflowRunId);
+					} else {
+						logger.debug("creating PortBinding for " + node.value
+								+ " with index " + node.index);
+
+						vb = new PortBinding();
+
+						vb.setWorkflowId(workflowId);
+						vb.setWorkflowRunId(workflowRunId);
+
+						vb.setProcessorName(pq.getWorkflow(workflowId)
+								.getExternalName());
+
+						// vb.setValueType(); // TODO not sure what to set this to
+						vb.setPortName(portName);
+						vb.setIteration(node.getIndex());
+						vb.setValue(node.getValue());
+
+						if (node.getParent() != null) {
+							logger.debug(" in collection "
+									+ node.getParent().value + " with index "
+									+ node.getParent().getIndex());
+
+							vb.setCollIDRef(node.getParent().getValue());
+							vb.setPositionInColl(node.getRelativePosition());
+						} else
+							vb.setPositionInColl(1); // default
+						
+						try {
+							getPw().addPortBinding(vb);
+						} catch (SQLException e) {
+							logger.debug("Problem processing trees for workflow: "
+									+ workflowId
+									+ " instance: "
+									+ workflowRunId
+									+ " : updating instead of inserting");
+							getPw().updatePortBinding(vb);
+						}
+					}
+				} catch (SQLException e) {
+					logger.debug(
+							"Database problem processing trees for workflow: "
+									+ workflowId + " instance: "
+									+ workflowRunId + " : " + workflowId, e);
+				}
+			}
+		}
+
+		List<Port> ports = getPq().getPortsForDataflow(workflowId);
+		String processId = completeEvent.getProcessId();
+		
+		DataflowInvocation invocation = new DataflowInvocation();
+		invocation.setDataflowInvocationId(UUID.randomUUID().toString());
+		invocation.setWorkflowId(workflowId);
+		invocation.setWorkflowRunId(workflowRunId);
+		
+		String parentProcessId = parentProcess(processId, 1);
+		if (parentProcessId != null) {
+			ProcessorEnactment procAct = invocationProcessToProcessEnactment
+					.get(parentProcessId);
+			if (procAct != null)
+				invocation.setParentProcessorEnactmentId(procAct
+						.getProcessEnactmentId());
+		}
+
+		invocation.setInvocationStarted(workflowStarted.get(completeEvent
+				.getParentId()));
+		invocation.setInvocationEnded(completeEvent.getInvocationEnded());
+		invocation.setCompleted(completeEvent.getState()
+				.equals(State.completed));
+
+		// Register data
+		String inputsDataBindingId = UUID.randomUUID().toString();
+		String outputsDataBindingId = UUID.randomUUID().toString();
+		for (Port port : ports) {
+			String portKey = (port.isInputPort() ? "/i:" : "/o:")
+					+ port.getPortName();
+			String t2Reference = workflowPortData.get(portKey);
+			if (t2Reference == null) {
+				logger.warn("No workflow port data for " + portKey);
+				continue;
+			}
+			DataBinding dataBinding = new DataBinding();
+			dataBinding
+					.setDataBindingId(port.isInputPort() ? inputsDataBindingId
+							: outputsDataBindingId);
+			dataBinding.setPort(port);
+			dataBinding.setT2Reference(t2Reference);
+			dataBinding.setWorkflowRunId(workflowRunId);
+			try {
+				pw.addDataBinding(dataBinding);
+			} catch (SQLException e) {
+				logger.warn("Could not add databinding for " + portKey, e);
+			}
+		}
+
+		invocation.setInputsDataBindingId(inputsDataBindingId);
+		invocation.setOutputsDataBindingId(outputsDataBindingId);
+		try {
+			pw.addDataflowInvocation(invocation);
+		} catch (SQLException e) {
+			logger.warn("Could not store dataflow invocation for " + processId,
+					e);
+		}
+	}
+
+
+	/**
+	 * @param node
+	 * @return the last digit in the index 
+	 */
+	private int getPosition(WorkflowDataNode node) {
+		String[] vector = node.getIndex()
+				.substring(1, node.getIndex().length() - 1).split(",");
+		//TODO need some logic  here to avoid trying to parse "" as integer, this is my try
+
+		if ((vector[vector.length-1]).equals(""))
+			return 1;
+		return Integer.parseInt(vector[vector.length - 1]) + 1;
+	}
+
+	private boolean isParent(String index1, String index2) {
+		// strip first and last '[' ']'
+		String index11 = index1.substring(1, index1.length() - 1);
+		String index22 = index2.substring(1, index2.length() - 1);
+
+		String[] tokens1 = index11.split(",");
+		String[] tokens2 = index22.split(",");
+
+		// [] cannot be parent of [x1,x2,...] with >= 2 elements
+		if (index11.equals("") && tokens2.length > 1)
+			return false;
+
+		// [] is parent of any [x]
+		if (index11.equals("") && tokens2.length == 1)
+			return true;
+
+		// [x1,x2, ...,xk] cannot be parent of [x1,x2,...xh] when k < h-1 
+		// because [x1,x2,...xh] is more than one level deeper than [x1,x2, ...,xk] 
+		if (tokens1.length != tokens2.length - 1)
+			return false;
+
+		return index22.startsWith(index11);
+	}
+
+	static class WorkflowDataNode {
+		private String portName;
+		private String value;
+		private String index;
+		private String workflowID;
+		private int relativePosition;
+		private boolean isList;
+		private WorkflowDataNode parent;
+		private String processId;
+		private boolean isInputPort;
+
+		public String getProcessId() {
+			return processId;
+		}
+
+		/**
+		 * @return the value
+		 */
+		public String getValue() {
+			return value;
+		}
+
+		public void setProcessId(String processId) {
+			this.processId = processId;
+
+		}
+
+		/**
+		 * @param value
+		 *            the value to set
+		 */
+		public void setValue(String value) {
+			this.value = value;
+		}
+
+		/**
+		 * @return the index
+		 */
+		public String getIndex() {
+			return index;
+		}
+
+		/**
+		 * @param index
+		 *            the index to set
+		 */
+		public void setIndex(String index) {
+			this.index = index;
+		}
+
+		/**
+		 * @return the portName
+		 */
+		public String getPortName() {
+			return portName;
+		}
+
+		/**
+		 * @param portName
+		 *            the portName to set
+		 */
+		public void setPortName(String portName) {
+			this.portName = portName;
+		}
+
+		/**
+		 * @return the isList
+		 */
+		public boolean isList() {
+			return isList;
+		}
+
+		/**
+		 * @param isList
+		 *            the isList to set
+		 */
+		public void setList(boolean isList) {
+			this.isList = isList;
+		}
+
+		/**
+		 * @return the parent
+		 */
+		public WorkflowDataNode getParent() {
+			return parent;
+		}
+
+		/**
+		 * @param parent
+		 *            the parent to set
+		 */
+		public void setParent(WorkflowDataNode parent) {
+			this.parent = parent;
+		}
+
+		/**
+		 * @return the relativePosition
+		 */
+		public int getRelativePosition() {
+			return relativePosition;
+		}
+
+		/**
+		 * @param relativePosition
+		 *            the relativePosition to set
+		 */
+		public void setRelativePosition(int relativePosition) {
+			this.relativePosition = relativePosition;
+		}
+
+		/**
+		 * @return the workflowID
+		 */
+		public String getWorkflowID() {
+			return workflowID;
+		}
+
+		/**
+		 * @param workflowID
+		 *            the workflowID to set
+		 */
+		public void setWorkflowID(String workflowID) {
+			this.workflowID = workflowID;
+		}
+
+		public void setInputPort(boolean isInputPort) {
+			this.isInputPort = isInputPort;
+		}
+
+		public boolean isInputPort() {
+			return isInputPort;
+		}
+	}
+
+	/**
+	 * @return the pq
+	 */
+	public ProvenanceQuery getPq() {
+		return pq;
+	}
+
+	/**
+	 * @param pq
+	 *            the pq to set
+	 */
+	public void setPq(ProvenanceQuery pq) {
+		this.pq = pq;
+	}
+
+	/**
+	 * @return the pw
+	 */
+	public ProvenanceWriter getPw() {
+		return pw;
+	}
+
+	/**
+	 * @param pw
+	 *            the pw to set
+	 */
+	public void setPw(ProvenanceWriter pw) {
+		this.pw = pw;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/ActivityType.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/ActivityType.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/ActivityType.java
new file mode 100644
index 0000000..b5f8644
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/ActivityType.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.provenance.lineageservice.types;
+
+import net.sf.taverna.t2.provenance.lineageservice.types.ProvenanceEventType;
+
+/**
+ * 
+ * @author Paolo Missier
+ * 
+ */
+public class ActivityType implements ProvenanceEventType {
+	private IterationType[] iteration;
+
+	private String id; // attribute
+
+	public ActivityType() {
+	}
+
+	public ActivityType(IterationType[] iteration, String id) {
+		this.iteration = iteration;
+		this.id = id;
+	}
+
+	/**
+	 * Gets the iteration value for this ActivityType.
+	 * 
+	 * @return iteration
+	 */
+	public IterationType[] getIteration() {
+		return iteration;
+	}
+
+	/**
+	 * Sets the iteration value for this ActivityType.
+	 * 
+	 * @param iteration
+	 */
+	public void setIteration(IterationType[] iteration) {
+		this.iteration = iteration;
+	}
+
+	public IterationType getIteration(int i) {
+		return this.iteration[i];
+	}
+
+	public void setIteration(int i, IterationType _value) {
+		this.iteration[i] = _value;
+	}
+
+	/**
+	 * Gets the id value for this ActivityType.
+	 * 
+	 * @return id
+	 */
+	public java.lang.String getId() {
+		return id;
+	}
+
+	/**
+	 * Sets the id value for this ActivityType.
+	 * 
+	 * @param id
+	 */
+	public void setId(java.lang.String id) {
+		this.id = id;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/DataDocumentType.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/DataDocumentType.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/DataDocumentType.java
new file mode 100644
index 0000000..27fa322
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/DataDocumentType.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.provenance.lineageservice.types;
+
+/**
+ * 
+ * @author Paolo Missier
+ * 
+ */
+public class DataDocumentType implements ProvenanceEventType {
+	private String reference;
+	private String id; // attribute
+
+	public DataDocumentType() {
+	}
+
+	public DataDocumentType(String reference, String id) {
+		this.reference = reference;
+		this.id = id;
+	}
+
+	/**
+	 * Gets the reference value for this DataDocumentType.
+	 * 
+	 * @return reference
+	 */
+	public String getReference() {
+		return reference;
+	}
+
+	/**
+	 * Sets the reference value for this DataDocumentType.
+	 * 
+	 * @param reference
+	 */
+	public void setReference(String reference) {
+		this.reference = reference;
+	}
+
+	/**
+	 * Gets the id value for this DataDocumentType.
+	 * 
+	 * @return id
+	 */
+	public String getId() {
+		return id;
+	}
+
+	/**
+	 * Sets the id value for this DataDocumentType.
+	 * 
+	 * @param id
+	 */
+	public void setId(String id) {
+		this.id = id;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/IterationType.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/IterationType.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/IterationType.java
new file mode 100644
index 0000000..be5389b
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/IterationType.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.provenance.lineageservice.types;
+
+/**
+ * 
+ * @author Paolo Missier
+ * 
+ */
+public class IterationType implements ProvenanceEventType {
+	private PortsSequenceType inputdata;
+	private PortsSequenceType outputdata;
+	private String id; // attribute
+
+	public IterationType() {
+	}
+
+	public IterationType(PortsSequenceType inputdata,
+			PortsSequenceType outputdata, String id) {
+		this.inputdata = inputdata;
+		this.outputdata = outputdata;
+		this.id = id;
+	}
+
+	/**
+	 * Gets the inputdata value for this IterationType.
+	 * 
+	 * @return inputdata
+	 */
+	public PortsSequenceType getInputdata() {
+		return inputdata;
+	}
+
+	/**
+	 * Sets the inputdata value for this IterationType.
+	 * 
+	 * @param inputdata
+	 */
+	public void setInputdata(PortsSequenceType inputdata) {
+		this.inputdata = inputdata;
+	}
+
+	/**
+	 * Gets the outputdata value for this IterationType.
+	 * 
+	 * @return outputdata
+	 */
+	public PortsSequenceType getOutputdata() {
+		return outputdata;
+	}
+
+	/**
+	 * Sets the outputdata value for this IterationType.
+	 * 
+	 * @param outputdata
+	 */
+	public void setOutputdata(PortsSequenceType outputdata) {
+		this.outputdata = outputdata;
+	}
+
+	/**
+	 * Gets the id value for this IterationType.
+	 * 
+	 * @return id
+	 */
+	public String getId() {
+		return id;
+	}
+
+	/**
+	 * Sets the id value for this IterationType.
+	 * 
+	 * @param id
+	 */
+	public void setId(String id) {
+		this.id = id;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/LiteralType.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/LiteralType.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/LiteralType.java
new file mode 100644
index 0000000..2b87758
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/LiteralType.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.provenance.lineageservice.types;
+
+/**
+ * 
+ * @author Paolo Missier
+ * 
+ */
+public class LiteralType implements ProvenanceEventType {
+	private String id; // attribute
+
+	public LiteralType() {
+	}
+
+	public LiteralType(String id) {
+		this.id = id;
+	}
+
+	/**
+	 * Gets the id value for this LiteralType.
+	 * 
+	 * @return id
+	 */
+	public String getId() {
+		return id;
+	}
+
+	/**
+	 * Sets the id value for this LiteralType.
+	 * 
+	 * @param id
+	 */
+	public void setId(String id) {
+		this.id = id;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/PortType.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/PortType.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/PortType.java
new file mode 100644
index 0000000..6978ac9
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/PortType.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.provenance.lineageservice.types;
+
+/**
+ * 
+ * @author Paolo Missier
+ * 
+ */
+public class PortType implements ProvenanceEventType {
+	private DataDocumentType dataDocument;
+	private LiteralType literal;
+	private String name; // attribute
+
+	public PortType() {
+	}
+
+	public PortType(DataDocumentType dataDocument, LiteralType literal,
+			String name) {
+		this.dataDocument = dataDocument;
+		this.literal = literal;
+		this.name = name;
+	}
+
+	/**
+	 * Gets the dataDocument value for this PortType.
+	 * 
+	 * @return dataDocument
+	 */
+	public DataDocumentType getDataDocument() {
+		return dataDocument;
+	}
+
+	/**
+	 * Sets the dataDocument value for this PortType.
+	 * 
+	 * @param dataDocument
+	 */
+	public void setDataDocument(DataDocumentType dataDocument) {
+		this.dataDocument = dataDocument;
+	}
+
+	/**
+	 * Gets the literal value for this PortType.
+	 * 
+	 * @return literal
+	 */
+	public LiteralType getLiteral() {
+		return literal;
+	}
+
+	/**
+	 * Sets the literal value for this PortType.
+	 * 
+	 * @param literal
+	 */
+	public void setLiteral(LiteralType literal) {
+		this.literal = literal;
+	}
+
+	/**
+	 * Gets the name value for this PortType.
+	 * 
+	 * @return name
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * Sets the name value for this PortType.
+	 * 
+	 * @param name
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/PortsSequenceType.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/PortsSequenceType.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/PortsSequenceType.java
new file mode 100644
index 0000000..5eddde8
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/PortsSequenceType.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.provenance.lineageservice.types;
+
+/**
+ * 
+ * @author Paolo Missier
+ * 
+ */
+public class PortsSequenceType implements ProvenanceEventType {
+	private PortType[] port;
+
+	public PortsSequenceType() {
+	}
+
+	public PortsSequenceType(PortType[] port) {
+		this.port = port;
+	}
+
+	/**
+	 * Gets the port value for this PortsSequenceType.
+	 * 
+	 * @return port
+	 */
+	public PortType[] getPort() {
+		return port;
+	}
+
+	/**
+	 * Sets the port value for this PortsSequenceType.
+	 * 
+	 * @param port
+	 */
+	public void setPort(PortType[] port) {
+		this.port = port;
+	}
+
+	public PortType getPort(int i) {
+		return this.port[i];
+	}
+
+	public void setPort(int i, PortType _value) {
+		this.port[i] = _value;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/ProcessType.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/ProcessType.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/ProcessType.java
new file mode 100644
index 0000000..163bc93
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/ProcessType.java
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.provenance.lineageservice.types;
+
+/**
+ * 
+ * @author Paolo Missier
+ * 
+ */
+public class ProcessType implements ProvenanceEventType {
+	private ProcessorType[] processor;
+	private String dataflowID; // attribute
+	private String facadeID; // attribute
+
+	public ProcessType() {
+	}
+
+	public ProcessType(ProcessorType[] processor, String dataflowID,
+			String facadeID) {
+		this.processor = processor;
+		this.dataflowID = dataflowID;
+		this.facadeID = facadeID;
+	}
+
+	/**
+	 * Gets the processor value for this ProcessType.
+	 * 
+	 * @return processor
+	 */
+	public ProcessorType[] getProcessor() {
+		return processor;
+	}
+
+	/**
+	 * Sets the processor value for this ProcessType.
+	 * 
+	 * @param processor
+	 */
+	public void setProcessor(ProcessorType[] processor) {
+		this.processor = processor;
+	}
+
+	public ProcessorType getProcessor(int i) {
+		return this.processor[i];
+	}
+
+	public void setProcessor(int i, ProcessorType _value) {
+		this.processor[i] = _value;
+	}
+
+	/**
+	 * Gets the dataflowID value for this ProcessType.
+	 * 
+	 * @return dataflowID
+	 */
+	public String getDataflowID() {
+		return dataflowID;
+	}
+
+	/**
+	 * Sets the dataflowID value for this ProcessType.
+	 * 
+	 * @param dataflowID
+	 */
+	public void setDataflowID(String dataflowID) {
+		this.dataflowID = dataflowID;
+	}
+
+	/**
+	 * Gets the facadeID value for this ProcessType.
+	 * 
+	 * @return facadeID
+	 */
+	public String getFacadeID() {
+		return facadeID;
+	}
+
+	/**
+	 * Sets the facadeID value for this ProcessType.
+	 * 
+	 * @param facadeID
+	 */
+	public void setFacadeID(String facadeID) {
+		this.facadeID = facadeID;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/ProcessorType.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/ProcessorType.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/ProcessorType.java
new file mode 100644
index 0000000..53285df
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/ProcessorType.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.provenance.lineageservice.types;
+
+/**
+ * 
+ * @author Paolo Missier
+ * 
+ */
+public class ProcessorType implements ProvenanceEventType {
+	private ActivityType[] activity;
+	private String id; // attribute
+
+	public ProcessorType() {
+	}
+
+	public ProcessorType(ActivityType[] activity, String id) {
+		this.activity = activity;
+		this.id = id;
+	}
+
+	/**
+	 * Gets the activity value for this ProcessorType.
+	 * 
+	 * @return activity
+	 */
+	public ActivityType[] getActivity() {
+		return activity;
+	}
+
+	/**
+	 * Sets the activity value for this ProcessorType.
+	 * 
+	 * @param activity
+	 */
+	public void setActivity(ActivityType[] activity) {
+		this.activity = activity;
+	}
+
+	public ActivityType getActivity(int i) {
+		return this.activity[i];
+	}
+
+	public void setActivity(int i, ActivityType _value) {
+		this.activity[i] = _value;
+	}
+
+	/**
+	 * Gets the id value for this ProcessorType.
+	 * 
+	 * @return id
+	 */
+	public String getId() {
+		return id;
+	}
+
+	/**
+	 * Sets the id value for this ProcessorType.
+	 * 
+	 * @param id
+	 */
+	public void setId(String id) {
+		this.id = id;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/ProvenanceEventType.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/ProvenanceEventType.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/ProvenanceEventType.java
new file mode 100644
index 0000000..6ebe680
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/types/ProvenanceEventType.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.provenance.lineageservice.types;
+
+/**
+ * Used by an implementation of Provenance to identify the item type
+ * 
+ * @author Paolo Missier
+ */
+public interface ProvenanceEventType {
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/Activity.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/Activity.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/Activity.java
new file mode 100644
index 0000000..819fce8
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/Activity.java
@@ -0,0 +1,63 @@
+package net.sf.taverna.t2.provenance.lineageservice.utils;
+
+public class Activity {
+	private String activityId;
+
+	@Override
+	public int hashCode() {
+		return 31 + ((activityId == null) ? 0 : activityId.hashCode());
+	}
+
+	@Override
+	public String toString() {
+		StringBuilder builder = new StringBuilder();
+		builder.append("Activity [activityDefinition=");
+		builder.append(activityDefinition);
+		builder.append("]");
+		return builder.toString();
+	}
+
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		Activity other = (Activity) obj;
+		if (activityId == null) {
+			if (other.activityId != null)
+				return false;
+		} else if (!activityId.equals(other.activityId))
+			return false;
+		return true;
+	}
+
+	private String activityDefinition;
+	private Workflow workflow;
+
+	public String getActivityId() {
+		return activityId;
+	}
+
+	public void setActivityId(String activityId) {
+		this.activityId = activityId;
+	}
+
+	public String getActivityDefinition() {
+		return activityDefinition;
+	}
+
+	public void setActivityDefinition(String activityDefinition) {
+		this.activityDefinition = activityDefinition;
+	}
+
+	public Workflow getWorkflow() {
+		return workflow;
+	}
+
+	public void setWorkflow(Workflow workflow) {
+		this.workflow = workflow;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/Collection.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/Collection.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/Collection.java
new file mode 100644
index 0000000..56340db
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/Collection.java
@@ -0,0 +1,68 @@
+package net.sf.taverna.t2.provenance.lineageservice.utils;
+
+public class Collection {
+	private String identifier;
+	private String parentIdentifier;
+	private String workflowRunIdentifier;
+	private String processorName;
+	private String portName;
+	private String iteration;
+	private String collId;
+
+	public String getIdentifier() {
+		return identifier;
+	}
+
+	public void setIdentifier(String identifier) {
+		this.identifier = identifier;
+	}
+
+	public String getParentIdentifier() {
+		return parentIdentifier;
+	}
+
+	public void setParentIdentifier(String parentIdentifier) {
+		this.parentIdentifier = parentIdentifier;
+	}
+
+	public String getWorkflowRunIdentifier() {
+		return workflowRunIdentifier;
+	}
+
+	public void setWorkflowRunIdentifier(String workflowRunIdentifier) {
+		this.workflowRunIdentifier = workflowRunIdentifier;
+	}
+
+	public String getProcessorName() {
+		return processorName;
+	}
+
+	public void setProcessorName(String processorName) {
+		this.processorName = processorName;
+	}
+
+	public String getPortName() {
+		return portName;
+	}
+
+	public void setPortName(String portName) {
+		this.portName = portName;
+	}
+
+	public String getIteration() {
+		return iteration;
+	}
+
+	public void setIteration(String iteration) {
+		this.iteration = iteration;
+	}
+
+	public void setCollId(String collId) {
+		this.collId = collId;
+	}
+
+	public String getCollId() {
+		return collId;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/DDRecord.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/DDRecord.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/DDRecord.java
new file mode 100644
index 0000000..ec762c0
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/DDRecord.java
@@ -0,0 +1,149 @@
+/**
+ * 
+ */
+package net.sf.taverna.t2.provenance.lineageservice.utils;
+
+/**
+ * a simple bean to hold a database record from the DD table
+ * 
+ * @author paolo
+ * 
+ */
+public class DDRecord {
+
+	private String PFrom;
+	private String PTo;
+	private String vTo;
+	private String valTo;
+	private String vFrom;
+	private String valFrom;
+	private String iteration;
+	public boolean isInput;
+
+	@Override
+	public String toString() {
+		return new String("proc: " + PFrom + " vFrom: " + vFrom + " valFrom: "
+				+ valFrom + "PTo: " + PTo + " vTo: " + vTo + " valTo: " + valTo);
+	}
+
+	/**
+	 * @return the vTo
+	 */
+	public String getVTo() {
+		return vTo;
+	}
+
+	/**
+	 * @param to
+	 *            the vTo to set
+	 */
+	public void setVTo(String to) {
+		vTo = to;
+	}
+
+	/**
+	 * @return the valTo
+	 */
+	public String getValTo() {
+		return valTo;
+	}
+
+	/**
+	 * @param valTo
+	 *            the valTo to set
+	 */
+	public void setValTo(String valTo) {
+		this.valTo = valTo;
+	}
+
+	/**
+	 * @return the vFrom
+	 */
+	public String getVFrom() {
+		return vFrom;
+	}
+
+	/**
+	 * @param from
+	 *            the vFrom to set
+	 */
+	public void setVFrom(String from) {
+		vFrom = from;
+	}
+
+	/**
+	 * @return the valFrom
+	 */
+	public String getValFrom() {
+		return valFrom;
+	}
+
+	/**
+	 * @param valFrom
+	 *            the valFrom to set
+	 */
+	public void setValFrom(String valFrom) {
+		this.valFrom = valFrom;
+	}
+
+	/**
+	 * @return the isInput
+	 */
+	public boolean isInput() {
+		return isInput;
+	}
+
+	/**
+	 * @param isInput
+	 *            the isInput to set
+	 */
+	public void setInput(boolean isInput) {
+		this.isInput = isInput;
+	}
+
+	/**
+	 * @return the pFrom
+	 */
+	public String getPFrom() {
+		return PFrom;
+	}
+
+	/**
+	 * @param from
+	 *            the pFrom to set
+	 */
+	public void setPFrom(String from) {
+		PFrom = from;
+	}
+
+	/**
+	 * @return the pTo
+	 */
+	public String getPTo() {
+		return PTo;
+	}
+
+	/**
+	 * @param to
+	 *            the pTo to set
+	 */
+	public void setPTo(String to) {
+		PTo = to;
+	}
+
+	/**
+	 * @return the iteration
+	 */
+	public String getIteration() {
+		return iteration;
+	}
+
+	/**
+	 * @param iteration
+	 *            the iteration to set
+	 */
+	public void setIteration(String iteration) {
+		this.iteration = iteration;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/DataBinding.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/DataBinding.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/DataBinding.java
new file mode 100644
index 0000000..3b4f123
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/DataBinding.java
@@ -0,0 +1,82 @@
+package net.sf.taverna.t2.provenance.lineageservice.utils;
+
+public class DataBinding {
+	private String dataBindingId;
+	private Port port;
+	private String t2Reference;
+	private String workflowRunId;
+
+	public String getDataBindingId() {
+		return dataBindingId;
+	}
+
+	public void setDataBindingId(String dataBindingId) {
+		this.dataBindingId = dataBindingId;
+	}
+
+	public Port getPort() {
+		return port;
+	}
+
+	public void setPort(Port port) {
+		this.port = port;
+	}
+
+	@Override
+	public int hashCode() {
+		int result = 31 + ((dataBindingId == null) ? 0 : dataBindingId
+				.hashCode());
+		return 31 * result + ((port == null) ? 0 : port.hashCode());
+	}
+
+	@Override
+	public String toString() {
+		StringBuilder builder = new StringBuilder();
+		builder.append("DataBinding [dataBindingId=");
+		builder.append(dataBindingId);
+		builder.append(", port=");
+		builder.append(port);
+		builder.append(", t2Reference=");
+		builder.append(t2Reference);
+		builder.append("]");
+		return builder.toString();
+	}
+
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		DataBinding other = (DataBinding) obj;
+		if (dataBindingId == null) {
+			if (other.dataBindingId != null)
+				return false;
+		} else if (!dataBindingId.equals(other.dataBindingId))
+			return false;
+		if (port == null) {
+			if (other.port != null)
+				return false;
+		} else if (!port.equals(other.port))
+			return false;
+		return true;
+	}
+
+	public String getT2Reference() {
+		return t2Reference;
+	}
+
+	public void setT2Reference(String t2Reference) {
+		this.t2Reference = t2Reference;
+	}
+
+	public String getWorkflowRunId() {
+		return workflowRunId;
+	}
+
+	public void setWorkflowRunId(String workflowRunId) {
+		this.workflowRunId = workflowRunId;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/DataLink.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/DataLink.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/DataLink.java
new file mode 100644
index 0000000..db2e42a
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/DataLink.java
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.provenance.lineageservice.utils;
+
+/**
+ * @author paolo
+ * 
+ */
+
+public class DataLink {
+	private String workflowId;
+	private String sourcePortId;
+	private String sourceProcessorName;
+	private String sourcePortName;
+	private String destinationPortId;
+	private String destinationProcessorName;
+	private String destinationPortName;
+
+	/**
+	 * @return the workflowId
+	 */
+	public String getWorkflowId() {
+		return workflowId;
+	}
+
+	/**
+	 * @param workflowId
+	 *            the workflowId to set
+	 */
+	public void setWorkflowId(String workflowRunId) {
+		this.workflowId = workflowRunId;
+	}
+
+	public String getSourcePortId() {
+		return sourcePortId;
+	}
+
+	public void setSourcePortId(String sourcePortId) {
+		this.sourcePortId = sourcePortId;
+	}
+
+	/**
+	 * @return the sourceProcessorName
+	 */
+	public String getSourceProcessorName() {
+		return sourceProcessorName;
+	}
+
+	/**
+	 * @param sourceProcessorName
+	 *            the sourceProcessorName to set
+	 */
+	public void setSourceProcessorName(String sourceProcessorName) {
+		this.sourceProcessorName = sourceProcessorName;
+	}
+
+	/**
+	 * @return the sourcePortName
+	 */
+	public String getSourcePortName() {
+		return sourcePortName;
+	}
+
+	/**
+	 * @param sourcePortName
+	 *            the sourcePortName to set
+	 */
+	public void setSourcePortName(String sourcePortName) {
+		this.sourcePortName = sourcePortName;
+	}
+
+	public String getDestinationPortId() {
+		return destinationPortId;
+	}
+
+	public void setDestinationPortId(String destinationPortId) {
+		this.destinationPortId = destinationPortId;
+	}
+
+	/**
+	 * @return the sourceprocessorNameRef
+	 */
+	public String getDestinationProcessorName() {
+		return destinationProcessorName;
+	}
+
+	/**
+	 * @param sourceprocessorNameRef
+	 *            the sourceprocessorNameRef to set
+	 */
+	public void setDestinationProcessorName(String destinationProcessorName) {
+		this.destinationProcessorName = destinationProcessorName;
+	}
+
+	/**
+	 * @return the destinationPortName
+	 */
+	public String getDestinationPortName() {
+		return destinationPortName;
+	}
+
+	/**
+	 * @param destinationPortName
+	 *            the destinationPortName to set
+	 */
+	public void setDestinationPortName(String destinationPortName) {
+		this.destinationPortName = destinationPortName;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/DataValueExtractor.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/DataValueExtractor.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/DataValueExtractor.java
new file mode 100644
index 0000000..8480197
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/DataValueExtractor.java
@@ -0,0 +1,23 @@
+/**
+ * 
+ */
+package net.sf.taverna.t2.provenance.lineageservice.utils;
+
+/**
+ * @author paolo
+ * 
+ */
+public interface DataValueExtractor {
+
+	/**
+	 * extracts a printable string from a more complex object. This is not the
+	 * same as toString() as it is applied to an object, rather than being a
+	 * method on the object itself
+	 * 
+	 * @param complexContent
+	 *            should really be a byte array FIXME
+	 * @return
+	 */
+	public String extractString(Object complexContent);
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/DataflowInvocation.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/DataflowInvocation.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/DataflowInvocation.java
new file mode 100644
index 0000000..f838f79
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/DataflowInvocation.java
@@ -0,0 +1,118 @@
+package net.sf.taverna.t2.provenance.lineageservice.utils;
+
+import java.sql.Timestamp;
+
+public class DataflowInvocation {
+	private String dataflowInvocationId;
+	private String workflowId;
+	private String workflowRunId;
+	private String parentProcessorEnactmentId;
+	private String inputsDataBindingId;
+	private String outputsDataBindingId;
+	private Timestamp invocationEnded;
+	private Timestamp invocationStarted;
+	private boolean completed;
+
+	@Override
+	public int hashCode() {
+		return 31 + ((dataflowInvocationId == null) ? 0 : dataflowInvocationId
+				.hashCode());
+	}
+
+	@Override
+	public String toString() {
+		return "DataflowInvocation [dataflowInvocationId="
+				+ dataflowInvocationId + ", parentProcessorEnactmentId="
+				+ parentProcessorEnactmentId + ", workflowRunId="
+				+ workflowRunId + "]";
+	}
+
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		DataflowInvocation other = (DataflowInvocation) obj;
+		if (dataflowInvocationId == null) {
+			if (other.dataflowInvocationId != null)
+				return false;
+		} else if (!dataflowInvocationId.equals(other.dataflowInvocationId))
+			return false;
+		return true;
+	}
+
+	public String getDataflowInvocationId() {
+		return dataflowInvocationId;
+	}
+
+	public void setDataflowInvocationId(String dataflowInvocationId) {
+		this.dataflowInvocationId = dataflowInvocationId;
+	}
+
+	public String getWorkflowId() {
+		return workflowId;
+	}
+
+	public void setWorkflowId(String workflowId) {
+		this.workflowId = workflowId;
+	}
+
+	public String getWorkflowRunId() {
+		return workflowRunId;
+	}
+
+	public void setWorkflowRunId(String workflowRunId) {
+		this.workflowRunId = workflowRunId;
+	}
+
+	public String getParentProcessorEnactmentId() {
+		return parentProcessorEnactmentId;
+	}
+
+	public void setParentProcessorEnactmentId(String parentProcessorEnactmentId) {
+		this.parentProcessorEnactmentId = parentProcessorEnactmentId;
+	}
+
+	public String getInputsDataBindingId() {
+		return inputsDataBindingId;
+	}
+
+	public void setInputsDataBindingId(String inputsDataBindingId) {
+		this.inputsDataBindingId = inputsDataBindingId;
+	}
+
+	public String getOutputsDataBindingId() {
+		return outputsDataBindingId;
+	}
+
+	public void setOutputsDataBindingId(String outputsDataBindingId) {
+		this.outputsDataBindingId = outputsDataBindingId;
+	}
+
+	public Timestamp getInvocationEnded() {
+		return invocationEnded;
+	}
+
+	public void setInvocationEnded(Timestamp invocationEnded) {
+		this.invocationEnded = invocationEnded;
+	}
+
+	public Timestamp getInvocationStarted() {
+		return invocationStarted;
+	}
+
+	public void setInvocationStarted(Timestamp invocationStarted) {
+		this.invocationStarted = invocationStarted;
+	}
+
+	public void setCompleted(boolean completed) {
+		this.completed = completed;
+	}
+
+	public boolean getCompleted() {
+		return completed;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/NestedListNode.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/NestedListNode.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/NestedListNode.java
new file mode 100644
index 0000000..c17a11d
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/NestedListNode.java
@@ -0,0 +1,107 @@
+/**
+ * 
+ */
+package net.sf.taverna.t2.provenance.lineageservice.utils;
+
+/**
+ * @author paolo
+ * 
+ */
+public class NestedListNode {
+	private String collectionT2Reference;
+	private String parentCollectionT2Reference;
+	private String workflowRunId;
+	private String processorName;
+	private String portName;
+	private String iteration;
+
+	/**
+	 * @return the collectionT2Reference
+	 */
+	public String getCollectionT2Reference() {
+		return collectionT2Reference;
+	}
+
+	/**
+	 * @param collectionT2Reference
+	 *            the collectionT2Reference to set
+	 */
+	public void setCollectionT2Reference(String collectionT2Reference) {
+		this.collectionT2Reference = collectionT2Reference;
+	}
+
+	/**
+	 * @return the parentCollIdRef
+	 */
+	public String getParentCollIdRef() {
+		return parentCollectionT2Reference;
+	}
+
+	/**
+	 * @param parentCollIdRef
+	 *            the parentCollIdRef to set
+	 */
+	public void setParentCollIdRef(String parentCollIdRef) {
+		this.parentCollectionT2Reference = parentCollIdRef;
+	}
+
+	/**
+	 * @return the workflowRunId
+	 */
+	public String getWorkflowRunId() {
+		return workflowRunId;
+	}
+
+	/**
+	 * @param workflowRunId
+	 *            the workflowRunId to set
+	 */
+	public void setWorkflowRunId(String workflowRunId) {
+		this.workflowRunId = workflowRunId;
+	}
+
+	/**
+	 * @return the processorNameRef
+	 */
+	public String getProcessorName() {
+		return processorName;
+	}
+
+	/**
+	 * @param nameRef
+	 *            the processorNameRef to set
+	 */
+	public void setProcessorName(String nameRef) {
+		processorName = nameRef;
+	}
+
+	/**
+	 * @return the portName
+	 */
+	public String getPortName() {
+		return portName;
+	}
+
+	/**
+	 * @param portName
+	 *            the portName to set
+	 */
+	public void setPortName(String portName) {
+		this.portName = portName;
+	}
+
+	/**
+	 * @return the iteration
+	 */
+	public String getIteration() {
+		return iteration;
+	}
+
+	/**
+	 * @param iteration
+	 *            the iteration to set
+	 */
+	public void setIteration(String iteration) {
+		this.iteration = iteration;
+	}
+}


[51/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
Revert "temporarily empty repository"

This reverts commit 3ecb12916215fa3efdcd9380f55f700d0eb67e95.


Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/commit/246a16e2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/tree/246a16e2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/diff/246a16e2

Branch: refs/heads/master
Commit: 246a16e2528a4167627dd2b6f2f8d3395f172a44
Parents: 3ecb129
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sat Feb 21 22:39:40 2015 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sat Feb 21 22:39:40 2015 +0000

----------------------------------------------------------------------
 .gitignore                                      |   24 +
 .travis.yml                                     |    1 +
 README.md                                       |    3 +
 pom.xml                                         |   87 +
 taverna-activity-archetype/pom.xml              |   30 +
 .../META-INF/maven/archetype-metadata.xml       |   58 +
 .../__rootArtifactId__-activity-ui/pom.xml      |   47 +
 .../__classPrefix__ConfigurationPanel.java      |   87 +
 .../config/__classPrefix__ConfigureAction.java  |   49 +
 .../__classPrefix__ConfigureMenuAction.java     |   67 +
 .../__classPrefix__ServiceDesc.java             |  106 +
 .../__classPrefix__ServiceIcon.java             |   40 +
 .../__classPrefix__ServiceProvider.java         |   75 +
 ...classPrefix__ActivityContextViewFactory.java |   62 +
 .../ui/view/__classPrefix__ContextualView.java  |   91 +
 .../resources/META-INF/spring/context-osgi.xml  |   26 +
 .../main/resources/META-INF/spring/context.xml  |   31 +
 .../src/main/resources/exampleIcon.png          |  Bin 0 -> 3654 bytes
 .../__rootArtifactId__-activity/pom.xml         |   51 +
 .../src/main/java/__classPrefix__Activity.java  |  135 +
 .../java/__classPrefix__ActivityFactory.java    |   97 +
 .../__classPrefix__ActivityHealthChecker.java   |   66 +
 .../resources/META-INF/spring/context-osgi.xml  |   17 +
 .../main/resources/META-INF/spring/context.xml  |   12 +
 .../src/main/resources/schema.json              |   25 +
 .../__classPrefix__ActivityFactoryTest.java     |  103 +
 .../test/java/__classPrefix__ActivityTest.java  |   76 +
 .../__rootArtifactId__-plugin/pom.xml           |   26 +
 .../main/resources/archetype-resources/pom.xml  |  192 ++
 taverna-activity-test-utils/pom.xml             |   33 +
 .../activities/testutils/ActivityInvoker.java   |  250 ++
 .../t2/activities/testutils/DummyCallback.java  |  106 +
 .../activities/testutils/LocationConstants.java |   31 +
 .../context-parts/componentservices.xml         |  101 +
 .../resources/context-parts/dao_hibernate.xml   |  102 +
 .../dao_hibernate_transactional.xml             |  120 +
 .../resources/context-parts/dao_inmemory.xml    |   30 +
 .../context-parts/hibernateprops_derby.xml      |   63 +
 .../resources/context-parts/raven_local.xml     |   48 +
 .../context-parts/referenceservice.xml          |   58 +
 .../resources/inMemoryActivityTestsContext.xml  |   29 +
 taverna-capability-api/pom.xml                  |   28 +
 .../api/ActivityConfigurationException.java     |   46 +
 .../api/ActivityNotFoundException.java          |   46 +
 .../capability/api/ActivityService.java         |  126 +
 .../capability/api/ConfigurationException.java  |   48 +
 .../DispatchLayerConfigurationException.java    |   46 +
 .../api/DispatchLayerNotFoundException.java     |   46 +
 .../capability/api/DispatchLayerService.java    |   90 +
 taverna-capability-impl/pom.xml                 |   59 +
 .../activity/impl/ActivityServiceImpl.java      |  140 +
 .../dispatch/impl/DispatchLayerServiceImpl.java |  112 +
 .../spring/taverna-capability-context-osgi.xml  |   17 +
 .../spring/taverna-capability-context.xml       |   14 +
 taverna-credential-manager-impl/pom.xml         |   89 +
 .../impl/CredentialManagerAuthenticator.java    |  112 +
 .../impl/CredentialManagerImpl.java             | 2657 ++++++++++++++++++
 .../impl/DefaultMasterPasswordProvider.java     |   51 +
 .../impl/DistinguishedNameParserImpl.java       |  177 ++
 .../impl/ParsedDistinguishedNameImpl.java       |  265 ++
 .../credential-manager-impl-context-osgi.xml    |   31 +
 .../spring/credential-manager-impl-context.xml  |   25 +
 .../AddTrustExternalCARoot.crt                  |   25 +
 .../trusted-certificates/TERENASSLCA.crt        |   27 +
 .../UTNAddTrustServer_CA.crt                    |   25 +
 .../heater.cs.man.ac.uk-not-needed.pem          |   26 +
 .../www.biocatalogue.org-revoked.pem            |   26 +
 .../www.biodiversitycatalogue.org-revoked.pem   |   29 +
 .../impl/CredentialManagerImplIT.java           |  339 +++
 .../impl/CredentialManagerImplTest.java         |  872 ++++++
 .../DummyJavaTruststorePasswordProvider.java    |   39 +
 .../impl/DummyMasterPasswordProvider.java       |   50 +
 ...DummyServiceUsernameAndPasswordProvider.java |   50 +
 .../impl/HTTPAuthenticatorIT.java               |  535 ++++
 ...catorServiceUsernameAndPasswordProvider.java |   73 +
 .../HTTPSConnectionAndTrustConfirmationIT.java  |  336 +++
 .../impl/PossibleURILookupsTest.java            |  254 ++
 .../TrustAlwaysTrustConfirmationProvider.java   |   36 +
 .../TrustNeverTrustConfimationProvider.java     |   36 +
 .../src/test/resources/html/test.html           |    5 +
 .../security/google-trusted-certificate.pem     |   29 +
 .../src/test/resources/security/t2keystore.ubr  |  Bin 0 -> 1888 bytes
 .../test/resources/security/t2truststore.ubr    |  Bin 0 -> 199408 bytes
 .../security/test-private-key-cert.p12          |  Bin 0 -> 1902 bytes
 .../security/tomcat_heater_certificate.pem      |   20 +
 taverna-credential-manager/pom.xml              |   58 +
 .../security/credentialmanager/CMException.java |   61 +
 .../CMNotInitialisedException.java              |   45 +
 .../credentialmanager/CredentialManager.java    |  415 +++
 .../DistinguishedNameParser.java                |   61 +
 .../JavaTruststorePasswordProvider.java         |   73 +
 .../credentialmanager/KeystoreChangedEvent.java |   39 +
 .../MasterPasswordProvider.java                 |  112 +
 .../ParsedDistinguishedName.java                |   74 +
 .../ServiceUsernameAndPasswordProvider.java     |   64 +
 .../TrustConfirmationProvider.java              |   56 +
 .../credentialmanager/UsernamePassword.java     |   90 +
 ...rity.credentialmanager.CredentialProviderSPI |    1 +
 .../src/test/resources/html/test.html           |    5 +
 .../src/test/resources/realm.properties         |    1 +
 taverna-database-configuration-api/.project     |   24 +
 taverna-database-configuration-api/pom.xml      |   18 +
 .../database/DatabaseConfiguration.java         |  124 +
 .../configuration/database/DatabaseManager.java |   45 +
 taverna-database-configuration-impl/.project    |   24 +
 taverna-database-configuration-impl/pom.xml     |   78 +
 .../impl/DatabaseConfigurationImpl.java         |  252 ++
 .../database/impl/DatabaseManagerImpl.java      |  155 +
 .../META-INF/spring/database-context-osgi.xml   |   18 +
 .../META-INF/spring/database-context.xml        |   20 +
 taverna-dataflow-activity/pom.xml               |   48 +
 .../activities/dataflow/DataflowActivity.java   |  168 ++
 .../dataflow/DataflowActivityFactory.java       |   81 +
 .../dataflow/DataflowActivityHealthChecker.java |   42 +
 ...averna.t2.workflowmodel.health.HealthChecker |    1 +
 .../spring/dataflow-activity-context-osgi.xml   |   15 +
 .../spring/dataflow-activity-context.xml        |   12 +
 .../src/main/resources/schema.json              |   19 +
 .../dataflow/DataflowActivityFactoryTest.java   |   65 +
 .../dataflow/DataflowActivityTest.java          |   98 +
 taverna-execution-api/pom.xml                   |   45 +
 .../execution/api/AbstractExecution.java        |  139 +
 .../api/AbstractExecutionEnvironment.java       |   79 +
 .../execution/api/AbstractExecutionService.java |  139 +
 .../platform/execution/api/Execution.java       |  104 +
 .../execution/api/ExecutionEnvironment.java     |  129 +
 .../api/ExecutionEnvironmentService.java        |   52 +
 .../execution/api/ExecutionService.java         |  149 +
 .../api/InvalidExecutionIdException.java        |   48 +
 .../execution/api/InvalidWorkflowException.java |   48 +
 .../execution/api/WorkflowCompiler.java         |   36 +
 .../execution/api/AbstractExecutionTest.java    |  128 +
 taverna-execution-hadoop/pom.xml                |   33 +
 .../main/java/org/pingel/util/CrossProduct.java |  159 ++
 .../impl/hadoop/CrossProductInputFormat.java    |  108 +
 .../impl/hadoop/CrossProductInputSplit.java     |   88 +
 .../impl/hadoop/CrossProductRecordReader.java   |  112 +
 .../execution/impl/hadoop/CrossProductTest.java |  116 +
 .../execution/impl/hadoop/DotProductTest.java   |  106 +
 .../impl/hadoop/TavernaInputFormat.java         |   52 +
 .../impl/hadoop/TavernaInputSplit.java          |   69 +
 .../execution/impl/hadoop/TavernaMapper.java    |   75 +
 .../impl/hadoop/TavernaRecordReader.java        |  106 +
 .../execution/impl/hadoop/TavernaReducer.java   |   24 +
 .../platform/execution/impl/hadoop/Test.java    |   69 +
 .../impl/hadoop/TextArrayWritable.java          |   31 +
 taverna-execution-impl/pom.xml                  |   42 +
 .../impl/ExecutionEnvironmentServiceImpl.java   |  354 +++
 .../META-INF/spring/execution-context-osgi.xml  |   13 +
 .../META-INF/spring/execution-context.xml       |   10 +
 taverna-execution-local/pom.xml                 |   90 +
 .../execution/impl/local/LocalExecution.java    |  243 ++
 .../impl/local/LocalExecutionEnvironment.java   |   86 +
 .../impl/local/LocalExecutionMonitor.java       |  548 ++++
 .../impl/local/LocalExecutionService.java       |  149 +
 .../impl/local/LocalProcessorReport.java        |  141 +
 .../execution/impl/local/StaticProperty.java    |   66 +
 .../impl/local/T2ReferenceConverter.java        |   41 +
 .../impl/local/WorkflowToDataflowMapper.java    |  527 ++++
 .../spring/execution-local-context-osgi.xml     |   23 +
 .../META-INF/spring/execution-local-context.xml |   13 +
 .../impl/local/LocalExecutionTest.java          |  166 ++
 .../src/test/resources/log4j.properties         |    1 +
 .../src/test/resources/t2flow/beanshell.t2flow  |  137 +
 .../src/test/resources/t2flow/in-out.t2flow     |   23 +
 taverna-execution-remote/pom.xml                |   48 +
 .../execution/impl/remote/RemoteExecution.java  |   96 +
 .../impl/remote/RemoteExecutionService.java     |   60 +
 .../spring/execution-remote-context-osgi.xml    |   12 +
 .../spring/execution-remote-context.xml         |    8 +
 taverna-integration-tests/pom.xml               |   92 +
 .../uk/org/taverna/platform/ActivityIT.java     |   84 +
 .../uk/org/taverna/platform/PlatformIT.java     |  151 +
 .../java/uk/org/taverna/platform/RunIT.java     |  954 +++++++
 .../t2flow/FetchTodaysXkcdComic.t2flow          |  343 +++
 .../src/test/resources/t2flow/GBSeqTest.t2flow  |  518 ++++
 .../test/resources/t2flow/apiconsumer.t2flow    |  178 ++
 .../src/test/resources/t2flow/beanshell.t2flow  |  137 +
 .../src/test/resources/t2flow/biomart.t2flow    |   30 +
 .../src/test/resources/t2flow/dataflow.t2flow   |  217 ++
 .../src/test/resources/t2flow/in-out.t2flow     |   12 +
 .../src/test/resources/t2flow/input.txt         |    1 +
 .../src/test/resources/t2flow/iteration.t2flow  |  474 ++++
 .../test/resources/t2flow/localworker.t2flow    |   67 +
 .../src/test/resources/t2flow/rest.t2flow       |  154 +
 .../secure-basic-authentication-https.t2flow    |   74 +
 .../t2flow/secure-basic-authentication.t2flow   |   74 +
 .../secure-digest-authentication-https.t2flow   |  107 +
 .../t2flow/secure-digest-authentication.t2flow  |  129 +
 .../resources/t2flow/secure-ws-https.t2flow     |  180 ++
 .../src/test/resources/t2flow/secure-ws.t2flow  |  180 ++
 .../src/test/resources/t2flow/soaplab.t2flow    |   95 +
 .../resources/t2flow/spreadsheetimport.t2flow   |  646 +++++
 .../test/resources/t2flow/stringconstant.t2flow |   32 +
 .../src/test/resources/t2flow/tool.t2flow       |  158 ++
 .../test/resources/t2flow/wsdl-secure.t2flow    |  131 +
 .../src/test/resources/t2flow/wsdl.t2flow       |   22 +
 .../test/resources/t2flow/xmlSplitter.t2flow    |  339 +++
 .../src/test/resources/t2flow/xpath.t2flow      |  127 +
 taverna-observer/pom.xml                        |   26 +
 .../taverna/t2/lang/observer/MultiCaster.java   |   93 +
 .../sf/taverna/t2/lang/observer/Observable.java |   56 +
 .../sf/taverna/t2/lang/observer/Observer.java   |   44 +
 .../t2/lang/observer/SwingAwareObserver.java    |   51 +
 .../taverna/t2/lang/observer/package-info.java  |   73 +
 .../taverna/t2/lang/observer/ObserverTest.java  |  133 +
 taverna-platform-integration-tests/pom.xml      |  635 +++++
 .../uk/org/taverna/platform/ActivityIT.java     |   72 +
 .../org/taverna/platform/CommandLineToolIT.java |   91 +
 .../uk/org/taverna/platform/ExecutionIT.java    |  134 +
 .../org/taverna/platform/LocalExecutionIT.java  |  120 +
 .../org/taverna/platform/OSGIFrameworkIT.java   |   93 +
 .../uk/org/taverna/platform/PlatformIT.java     |  378 +++
 .../java/uk/org/taverna/platform/RunIT.java     | 1005 +++++++
 .../uk/org/taverna/platform/RunParallelIT.java  |   95 +
 .../uk/org/taverna/platform/RunWorkflowsIT.java |  135 +
 .../src/test/resources/log4j.properties         |   11 +
 .../security/tomcat_heater_certificate.pem      |   20 +
 .../t2flow/FetchTodaysXkcdComic.t2flow          |  343 +++
 .../src/test/resources/t2flow/GBSeqTest.t2flow  |  518 ++++
 .../test/resources/t2flow/apiconsumer.t2flow    |  178 ++
 .../src/test/resources/t2flow/beanshell.t2flow  |  137 +
 .../src/test/resources/t2flow/biomart.t2flow    |   30 +
 .../src/test/resources/t2flow/dataflow.t2flow   |  217 ++
 .../src/test/resources/t2flow/in-out.t2flow     |   23 +
 .../src/test/resources/t2flow/input.txt         |    1 +
 .../src/test/resources/t2flow/iteration.t2flow  |  474 ++++
 .../test/resources/t2flow/localworker.t2flow    |   67 +
 .../src/test/resources/t2flow/rest.t2flow       |  154 +
 .../secure-basic-authentication-https.t2flow    |   74 +
 .../t2flow/secure-basic-authentication.t2flow   |   74 +
 .../secure-digest-authentication-https.t2flow   |  107 +
 .../t2flow/secure-digest-authentication.t2flow  |  129 +
 .../resources/t2flow/secure-ws-https.t2flow     |  180 ++
 .../src/test/resources/t2flow/secure-ws.t2flow  |  180 ++
 .../src/test/resources/t2flow/soaplab.t2flow    |   84 +
 .../resources/t2flow/spreadsheetimport.t2flow   |  646 +++++
 .../test/resources/t2flow/stringconstant.t2flow |   32 +
 .../src/test/resources/t2flow/tool.t2flow       |  158 ++
 .../test/resources/t2flow/wsdl-secure.t2flow    |  131 +
 .../src/test/resources/t2flow/wsdl.t2flow       |   22 +
 .../test/resources/t2flow/xmlSplitter.t2flow    |  339 +++
 .../src/test/resources/t2flow/xpath.t2flow      |  127 +
 taverna-prov-owl-bindings/.gitignore            |    5 +
 taverna-prov-owl-bindings/pom.xml               |   35 +
 .../purl/wf4ever/provtaverna/owl/ProvModel.java |  402 +++
 .../provtaverna/owl/TavernaProvModel.java       |  112 +
 .../wf4ever/provtaverna/owl/WfprovModel.java    |  202 ++
 .../src/main/resources/location-mapping.n3      |   36 +
 .../org/purl/wf4ever/provtaverna/owl/.gitignore |    1 +
 .../wf4ever/provtaverna/owl/annotation-core.owl |  399 +++
 .../purl/wf4ever/provtaverna/owl/annotation.owl |   89 +
 .../purl/wf4ever/provtaverna/owl/content.owl    |  161 ++
 .../org/purl/wf4ever/provtaverna/owl/dcam.owl   |   28 +
 .../purl/wf4ever/provtaverna/owl/dcterms_od.owl |  584 ++++
 .../org/purl/wf4ever/provtaverna/owl/foaf.rdf   |  606 ++++
 .../purl/wf4ever/provtaverna/owl/ore-owl.owl    |  145 +
 .../org/purl/wf4ever/provtaverna/owl/pav.rdf    |  552 ++++
 .../purl/wf4ever/provtaverna/owl/prov-aq.rdf    |  342 +++
 .../wf4ever/provtaverna/owl/prov-dictionary.ttl |  246 ++
 .../org/purl/wf4ever/provtaverna/owl/prov-o.rdf | 1788 ++++++++++++
 .../org/purl/wf4ever/provtaverna/owl/ro.owl     |  203 ++
 .../org/purl/wf4ever/provtaverna/owl/roevo.owl  |  481 ++++
 .../org/purl/wf4ever/provtaverna/owl/scufl2.rdf | 1567 +++++++++++
 .../wf4ever/provtaverna/owl/skos-owl1-dl.rdf    |  465 +++
 .../wf4ever/provtaverna/owl/taverna-prov.owl    |  333 +++
 .../wf4ever/provtaverna/owl/taverna-prov.ttl    |  277 ++
 .../org/purl/wf4ever/provtaverna/owl/terms.rdf  |  116 +
 .../purl/wf4ever/provtaverna/owl/wf4ever.owl    |  130 +
 .../org/purl/wf4ever/provtaverna/owl/wfdesc.owl |  192 ++
 .../org/purl/wf4ever/provtaverna/owl/wfprov.owl |  212 ++
 .../wf4ever/provtaverna/owl/TestProvModel.java  |   38 +
 .../provtaverna/owl/TestTavernaProvModel.java   |   55 +
 .../provtaverna/owl/TestWfprovModel.java        |   24 +
 .../src/test/resources/handmade.ttl             |  158 ++
 taverna-prov/README.md                          |  564 ++++
 taverna-prov/example/helloanyone.bundle.zip     |  Bin 0 -> 12938 bytes
 .../a2f03983-8836-4c36-bfb2-d713d9a1928f.ttl    |    5 +
 .../.ro/annotations/workflow.wfdesc.ttl         |   66 +
 .../helloanyone.bundle/.ro/manifest.json        |   68 +
 .../example/helloanyone.bundle/inputs/name.txt  |    1 +
 .../3a/3a82e39d-a537-40cf-91a0-2c89d4a2e62b.txt |    1 +
 .../example/helloanyone.bundle/mimetype         |    1 +
 .../helloanyone.bundle/outputs/greeting.txt     |    1 +
 .../helloanyone.bundle/workflow.wfbundle        |  Bin 0 -> 9162 bytes
 .../helloanyone.bundle/workflowrun.prov.ttl     |  270 ++
 taverna-prov/example/helloanyone.t2flow         |  177 ++
 taverna-prov/example/test.sparql                |   25 +
 taverna-prov/pom.xml                            |   81 +
 .../export/SafeFileOutputStream.java            |  119 +
 .../purl/wf4ever/provtaverna/export/Saver.java  |  388 +++
 .../provtaverna/export/W3ProvenanceExport.java  | 1008 +++++++
 taverna-provenanceconnector/javadoc.xml         |    6 +
 taverna-provenanceconnector/pom.xml             |  106 +
 .../sf/taverna/t2/provenance/Provenance.java    |  316 +++
 .../provenance/ProvenanceConnectorFactory.java  |    8 +
 .../taverna/t2/provenance/api/NativeAnswer.java |   66 +
 .../t2/provenance/api/ProvenanceAccess.java     |  725 +++++
 .../provenance/api/ProvenanceConnectorType.java |   16 +
 .../net/sf/taverna/t2/provenance/api/Query.java |  105 +
 .../taverna/t2/provenance/api/QueryAnswer.java  |   47 +
 .../connector/AbstractProvenanceConnector.java  |  646 +++++
 .../t2/provenance/connector/ProvenanceSQL.java  |    5 +
 .../lineageservice/AnnotationsLoader.java       |   86 +
 .../provenance/lineageservice/Dependencies.java |  127 +
 .../lineageservice/EventProcessor.java          | 1547 ++++++++++
 .../LineageQueryResultRecord.java               |  243 ++
 .../lineageservice/LineageSQLQuery.java         |   82 +
 .../provenance/lineageservice/Provenance.java   |  199 ++
 .../lineageservice/ProvenanceAnalysis.java      | 1200 ++++++++
 .../lineageservice/ProvenanceQuery.java         | 2069 ++++++++++++++
 .../lineageservice/ProvenanceWriter.java        |  676 +++++
 .../provenance/lineageservice/URIGenerator.java |   58 +
 .../lineageservice/WorkflowDataProcessor.java   |  453 +++
 .../lineageservice/types/ActivityType.java      |   87 +
 .../lineageservice/types/DataDocumentType.java  |   75 +
 .../lineageservice/types/IterationType.java     |   96 +
 .../lineageservice/types/LiteralType.java       |   55 +
 .../lineageservice/types/PortType.java          |   96 +
 .../lineageservice/types/PortsSequenceType.java |   64 +
 .../lineageservice/types/ProcessType.java       |  105 +
 .../lineageservice/types/ProcessorType.java     |   83 +
 .../types/ProvenanceEventType.java              |   30 +
 .../lineageservice/utils/Activity.java          |   63 +
 .../lineageservice/utils/Collection.java        |   68 +
 .../lineageservice/utils/DDRecord.java          |  149 +
 .../lineageservice/utils/DataBinding.java       |   82 +
 .../lineageservice/utils/DataLink.java          |  127 +
 .../utils/DataValueExtractor.java               |   23 +
 .../utils/DataflowInvocation.java               |  118 +
 .../lineageservice/utils/NestedListNode.java    |  107 +
 .../provenance/lineageservice/utils/Port.java   |  198 ++
 .../lineageservice/utils/PortBinding.java       |  258 ++
 .../lineageservice/utils/ProcessorBinding.java  |  127 +
 .../utils/ProcessorEnactment.java               |  151 +
 .../utils/ProvenanceProcessor.java              |  115 +
 .../lineageservice/utils/ProvenanceUtils.java   |  128 +
 .../lineageservice/utils/QueryPort.java         |  119 +
 .../lineageservice/utils/ServiceInvocation.java |  161 ++
 .../lineageservice/utils/Workflow.java          |   37 +
 .../lineageservice/utils/WorkflowRun.java       |   72 +
 .../lineageservice/utils/WorkflowTree.java      |   73 +
 .../taverna/t2/provenance/opm/OPMImporter.java  |  541 ++++
 .../taverna/t2/provenance/opm/OPMManager.java   |  414 +++
 .../spring/provenance-connector-context.xml     |   18 +
 .../src/main/resources/janus.owl                |    1 +
 .../src/main/uml/database-schema.uml            |  309 ++
 .../src/main/uml/database-schema.umlclass       | 1880 +++++++++++++
 taverna-reference-api/pom.xml                   |   40 +
 .../t2/reference/AbstractExternalReference.java |   89 +
 .../t2/reference/ContextualizedT2Reference.java |   47 +
 .../sf/taverna/t2/reference/DaoException.java   |   47 +
 .../t2/reference/DereferenceException.java      |   48 +
 .../sf/taverna/t2/reference/ErrorDocument.java  |   56 +
 .../taverna/t2/reference/ErrorDocumentDao.java  |   64 +
 .../t2/reference/ErrorDocumentService.java      |  152 +
 .../reference/ErrorDocumentServiceCallback.java |   47 +
 .../ErrorDocumentServiceException.java          |   48 +
 .../reference/ExternalReferenceBuilderSPI.java  |   90 +
 .../ExternalReferenceConstructionException.java |   50 +
 .../t2/reference/ExternalReferenceSPI.java      |  132 +
 .../ExternalReferenceTranslatorSPI.java         |   96 +
 .../ExternalReferenceValidationException.java   |   50 +
 .../net/sf/taverna/t2/reference/Identified.java |   36 +
 .../sf/taverna/t2/reference/IdentifiedList.java |   46 +
 .../net/sf/taverna/t2/reference/ListDao.java    |   67 +
 .../sf/taverna/t2/reference/ListService.java    |  144 +
 .../t2/reference/ListServiceCallback.java       |   47 +
 .../t2/reference/ListServiceException.java      |   48 +
 .../taverna/t2/reference/ReferenceContext.java  |   66 +
 .../taverna/t2/reference/ReferenceService.java  |  294 ++
 .../ReferenceServiceCacheProvider.java          |   52 +
 .../t2/reference/ReferenceServiceException.java |   47 +
 .../ReferenceServiceResolutionCallback.java     |   47 +
 .../sf/taverna/t2/reference/ReferenceSet.java   |   53 +
 .../ReferenceSetAugmentationException.java      |   47 +
 .../t2/reference/ReferenceSetAugmentor.java     |   92 +
 .../ReferenceSetAugmentorCallback.java          |   53 +
 .../taverna/t2/reference/ReferenceSetDao.java   |   82 +
 .../t2/reference/ReferenceSetService.java       |  181 ++
 .../reference/ReferenceSetServiceCallback.java  |   47 +
 .../reference/ReferenceSetServiceException.java |   48 +
 .../t2/reference/ReferencedDataNature.java      |   45 +
 .../t2/reference/StackTraceElementBean.java     |   54 +
 .../t2/reference/StreamToValueConverterSPI.java |   48 +
 .../sf/taverna/t2/reference/T2Reference.java    |  102 +
 .../t2/reference/T2ReferenceGenerator.java      |   81 +
 .../taverna/t2/reference/T2ReferenceType.java   |   47 +
 .../ValueCarryingExternalReference.java         |   44 +
 .../ValueToReferenceConversionException.java    |   48 +
 .../reference/ValueToReferenceConverterSPI.java |   65 +
 .../t2/reference/WorkflowRunIdEntity.java       |   44 +
 .../annotations/DeleteIdentifiedOperation.java  |   18 +
 .../annotations/GetIdentifiedOperation.java     |   38 +
 .../annotations/PutIdentifiedOperation.java     |   38 +
 .../t2/reference/annotations/package.html       |    4 +
 .../reference/h3/HibernateComponentClass.java   |   38 +
 .../t2/reference/h3/HibernateMappedEntity.java  |   39 +
 .../net/sf/taverna/t2/reference/h3/package.html |    8 +
 .../net/sf/taverna/t2/reference/package.html    |   43 +
 .../reference/AbstractExternalReference.hbm.xml |   15 +
 taverna-reference-impl/.gitignore               |    1 +
 taverna-reference-impl/pom.xml                  |  134 +
 .../platform/spring/jdbc/TemporaryJDBC.java     |   75 +
 .../taverna/platform/spring/jdbc/package.html   |    6 +
 .../t2/reference/impl/AbstractEntityImpl.java   |   66 +
 .../impl/AbstractErrorDocumentServiceImpl.java  |  119 +
 .../reference/impl/AbstractListServiceImpl.java |  100 +
 .../impl/AbstractReferenceServiceImpl.java      |  171 ++
 .../impl/AbstractReferenceSetServiceImpl.java   |  160 ++
 .../t2/reference/impl/AbstractServiceImpl.java  |   44 +
 .../impl/AbstractT2ReferenceGenerator.java      |  111 +
 .../taverna/t2/reference/impl/CacheAspect.java  |  127 +
 .../impl/ContextualizedT2ReferenceImpl.java     |   61 +
 .../reference/impl/EmptyReferenceContext.java   |   46 +
 .../t2/reference/impl/ErrorDocumentImpl.java    |  120 +
 .../impl/ErrorDocumentServiceImpl.java          |  163 ++
 .../impl/HibernateErrorDocumentDao.java         |  154 +
 .../t2/reference/impl/HibernateListDao.java     |  151 +
 .../impl/HibernateReferenceSetDao.java          |  197 ++
 .../t2/reference/impl/IdentifiedArrayList.java  |  252 ++
 .../impl/InMemoryErrorDocumentDao.java          |   69 +
 .../t2/reference/impl/InMemoryListDao.java      |   69 +
 .../reference/impl/InMemoryReferenceSetDao.java |   72 +
 .../t2/reference/impl/ListServiceImpl.java      |  136 +
 .../t2/reference/impl/ReferenceServiceImpl.java |  731 +++++
 .../impl/ReferenceSetAugmentorImpl.java         |  462 +++
 .../t2/reference/impl/ReferenceSetImpl.java     |  123 +
 .../reference/impl/ReferenceSetServiceImpl.java |  153 +
 .../reference/impl/SimpleCacheProviderImpl.java |   57 +
 .../impl/SimpleT2ReferenceGenerator.java        |   63 +
 .../impl/StackTraceElementBeanImpl.java         |   77 +
 .../t2/reference/impl/T2ReferenceImpl.java      |  288 ++
 .../t2/reference/impl/T2ReferenceListImpl.java  |   75 +
 .../TransactionalHibernateErrorDocumentDao.java |  155 +
 .../impl/TransactionalHibernateListDao.java     |  154 +
 .../TransactionalHibernateReferenceSetDao.java  |  198 ++
 .../t2/reference/impl/TranslationPath.java      |  266 ++
 .../impl/UUIDT2ReferenceGenerator.java          |   56 +
 .../t2/reference/impl/WriteQueueAspect.java     |  142 +
 .../sf/taverna/t2/reference/impl/package.html   |    5 +
 ...erna.t2.reference.h3.HibernateComponentClass |    2 +
 ...averna.t2.reference.h3.HibernateMappedEntity |    3 +
 .../src/main/resources/META-INF/spring.handlers |    1 +
 .../src/main/resources/META-INF/spring.schemas  |    1 +
 .../spring/hibernate-reference-impl-context.xml |  117 +
 .../spring/in-memory-reference-impl-context.xml |   46 +
 .../spring/reference-impl-context-osgi.xml      |   25 +
 .../META-INF/spring/reference-impl-context.xml  |   15 +
 .../src/main/resources/artifact-support.xsd     |   57 +
 .../t2/reference/impl/ErrorDocumentImpl.hbm.xml |   45 +
 .../t2/reference/impl/ReferenceSetImpl.hbm.xml  |   32 +
 .../reference/impl/T2ReferenceListImpl.hbm.xml  |   37 +
 .../platform/spring/jdbc/TemporaryJDBCTest.java |   60 +
 .../t2/reference/impl/AppContextSetup.java      |   31 +
 .../t2/reference/impl/DatabaseSetupTest.java    |  140 +
 .../t2/reference/impl/ErrorDocumentDaoTest.java |  151 +
 .../impl/ErrorDocumentServiceTest.java          |   88 +
 .../taverna/t2/reference/impl/ListDaoTest.java  |  121 +
 .../t2/reference/impl/ListServiceTest.java      |   91 +
 .../t2/reference/impl/ReferenceContextImpl.java |   30 +
 .../t2/reference/impl/ReferenceSetDaoTest.java  |  105 +
 .../reference/impl/ReferenceSetServiceTest.java |   92 +
 .../t2/reference/impl/TranslationPathTest.java  |   46 +
 .../src/test/resources/log4j.xml                |   44 +
 .../resources/vanillaHibernateAppContext.xml    |  120 +
 .../vanillaHibernateTransactionalAppContext.xml |  118 +
 .../resources/vanillaInMemoryAppContext.xml     |   29 +
 taverna-reference-testhelpers/pom.xml           |   38 +
 .../taverna/t2referencetest/BlueReference.java  |  129 +
 .../t2referencetest/DummyReferenceSet.java      |   32 +
 .../taverna/t2referencetest/GreenBuilder.java   |  107 +
 .../taverna/t2referencetest/GreenReference.java |  129 +
 .../sf/taverna/t2referencetest/GreenToRed.java  |   65 +
 .../taverna/t2referencetest/RedReference.java   |  129 +
 .../t2referencetest/YellowReference.java        |  130 +
 ...rna.t2.reference.ExternalReferenceBuilderSPI |    2 +
 ...sf.taverna.t2.reference.ExternalReferenceSPI |    5 +
 ....t2.reference.ExternalReferenceTranslatorSPI |    2 +
 .../reference-testhelpers-context-osgi.xml      |   18 +
 .../spring/reference-testhelpers-context.xml    |   16 +
 .../t2referencetest/BlueReference.hbm.xml       |   16 +
 .../t2referencetest/GreenReference.hbm.xml      |   16 +
 .../t2referencetest/RedReference.hbm.xml        |   16 +
 .../t2referencetest/YellowReference.hbm.xml     |   16 +
 taverna-reference-types/README.md               |    5 +
 taverna-reference-types/pom.xml                 |   77 +
 .../impl/external/file/FileReference.java       |  210 ++
 .../impl/external/file/FileToFileReference.java |   61 +
 .../reference/impl/external/file/package.html   |    4 +
 .../impl/external/http/HttpReference.java       |  217 ++
 .../impl/external/http/UrlToHttpReference.java  |   62 +
 .../reference/impl/external/http/package.html   |    3 +
 .../object/BooleanToStringReference.java        |   53 +
 .../object/ByteArrayToByteArrayReference.java   |   53 +
 .../object/CharacterToStringReference.java      |   53 +
 .../object/InlineByteArrayReference.java        |   93 +
 .../object/InlineByteArrayReferenceBuilder.java |   67 +
 .../InlineByteToInlineStringTranslator.java     |   51 +
 .../external/object/InlineStringReference.java  |  133 +
 .../object/InlineStringReferenceBuilder.java    |   76 +
 .../InlineStringToInlineByteTranslator.java     |   40 +
 .../object/NumberToStringReference.java         |   52 +
 .../object/StreamToBooleanConverter.java        |   29 +
 .../object/StreamToByteArrayConverter.java      |   62 +
 .../object/StreamToDoubleConverter.java         |   29 +
 .../object/StreamToIntegerConverter.java        |   29 +
 .../object/StreamToStringConverter.java         |   80 +
 .../StreamToVMObjectReferenceConverter.java     |   56 +
 .../object/StringToStringReference.java         |   52 +
 .../impl/external/object/VMObjectReference.java |  111 +
 .../reference/impl/external/object/package.html |    4 +
 ...rna.t2.reference.ExternalReferenceBuilderSPI |    3 +
 ...sf.taverna.t2.reference.ExternalReferenceSPI |    6 +
 ....t2.reference.ExternalReferenceTranslatorSPI |    3 +
 ...verna.t2.reference.StreamToValueConverterSPI |    7 +
 ...na.t2.reference.ValueToReferenceConverterSPI |    8 +
 .../reference-core-extensions-context-osgi.xml  |   33 +
 .../reference-core-extensions-context.xml       |   31 +
 .../impl/external/file/FileReference.hbm.xml    |   18 +
 .../impl/external/http/HttpReference.hbm.xml    |   16 +
 .../object/InlineByteArrayReference.hbm.xml     |   16 +
 .../object/InlineStringReference.hbm.xml        |   16 +
 .../external/object/VMObjectReference.hbm.xml   |   16 +
 .../external/object/ByteArrayToStringTest.java  |   91 +
 taverna-report-api/pom.xml                      |   39 +
 .../taverna/platform/report/ActivityReport.java |   49 +
 .../org/taverna/platform/report/Invocation.java |  306 ++
 .../platform/report/ProcessorReport.java        |  164 ++
 .../taverna/platform/report/ReportListener.java |   32 +
 .../uk/org/taverna/platform/report/State.java   |   30 +
 .../taverna/platform/report/StatusReport.java   |  373 +++
 .../taverna/platform/report/WorkflowReport.java |  170 ++
 .../platform/report/StatusReportTest.java       |  245 ++
 taverna-run-api/pom.xml                         |   46 +
 .../platform/run/api/InvalidRunIdException.java |   46 +
 .../taverna/platform/run/api/RunProfile.java    |  196 ++
 .../platform/run/api/RunProfileException.java   |   47 +
 .../taverna/platform/run/api/RunService.java    |  235 ++
 .../platform/run/api/RunStateException.java     |   47 +
 .../platform/run/api/RunProfileTest.java        |  233 ++
 taverna-run-impl/pom.xml                        |   73 +
 .../uk/org/taverna/platform/run/impl/Run.java   |  279 ++
 .../platform/run/impl/RunServiceImpl.java       |  268 ++
 .../platform/run/impl/WorkflowReportJSON.java   |  328 +++
 .../META-INF/spring/run-context-osgi.xml        |   18 +
 .../resources/META-INF/spring/run-context.xml   |   13 +
 .../platform/run/impl/DummyWorkflowReport.java  |  131 +
 .../org/taverna/platform/run/impl/RunTest.java  |   69 +
 .../run/impl/WorkflowReportJSONTest.java        |  288 ++
 .../src/test/resources/hello_anyone.wfbundle    |  Bin 0 -> 10087 bytes
 .../src/test/resources/workflowrun.bundle.zip   |  Bin 0 -> 9167 bytes
 .../src/test/resources/workflowrun.json         |  113 +
 taverna-services-api/.project                   |   24 +
 taverna-services-api/pom.xml                    |   18 +
 .../services/ActivityTypeNotFoundException.java |   47 +
 .../services/InvalidConfigurationException.java |   47 +
 .../commons/services/ServiceRegistry.java       |   89 +
 taverna-services-impl/.project                  |   24 +
 taverna-services-impl/pom.xml                   |   41 +
 .../services/impl/ServiceRegistryImpl.java      |   92 +
 .../spring/taverna-services-context-osgi.xml    |   13 +
 .../spring/taverna-services-context.xml         |   10 +
 taverna-stringconstant-activity/pom.xml         |   43 +
 .../stringconstant/StringConstantActivity.java  |  119 +
 .../StringConstantActivityFactory.java          |   81 +
 .../StringConstantActivityHealthChecker.java    |   58 +
 .../StringConstantConfigurationBean.java        |   45 +
 .../t2/activities/stringconstant/package.html   |    3 +
 ...averna.t2.workflowmodel.health.HealthChecker |    1 +
 .../stringconstant-activity-context-osgi.xml    |   15 +
 .../spring/stringconstant-activity-context.xml  |   12 +
 .../src/main/resources/schema.json              |   19 +
 .../StringConstantActivityFactoryTest.java      |   64 +
 .../StringConstantActivityTest.java             |   68 +
 .../MobyCentralCurationUseCasAggregated.uxf     |   58 +
 .../docs/MobyCentralCurationUseCase.uxf         |   50 +
 .../docs/annotationmodel.uxf                    |  101 +
 taverna-workflowmodel-api/pom.xml               |   52 +
 .../t2/annotation/AbstractAnnotatedThing.java   |  164 ++
 .../net/sf/taverna/t2/annotation/Annotated.java |   79 +
 .../t2/annotation/AnnotationAssertion.java      |   52 +
 .../t2/annotation/AnnotationBeanSPI.java        |   32 +
 .../taverna/t2/annotation/AnnotationChain.java  |   51 +
 .../t2/annotation/AnnotationPerspective.java    |   62 +
 .../taverna/t2/annotation/AnnotationRole.java   |   51 +
 .../t2/annotation/AnnotationSourceSPI.java      |   35 +
 .../net/sf/taverna/t2/annotation/AppliesTo.java |   53 +
 .../sf/taverna/t2/annotation/Curateable.java    |   72 +
 .../sf/taverna/t2/annotation/CurationEvent.java |   52 +
 .../t2/annotation/CurationEventBeanSPI.java     |   35 +
 .../t2/annotation/CurationEventType.java        |   43 +
 .../sf/taverna/t2/annotation/HierarchyRole.java |   40 +
 .../t2/annotation/HierarchyTraversal.java       |   74 +
 .../net/sf/taverna/t2/annotation/Person.java    |   36 +
 .../AbstractNumericRangeAssertion.java          |   64 +
 .../AbstractNumericValueAssertion.java          |   54 +
 .../AbstractTextualValueAssertion.java          |   53 +
 .../t2/annotation/annotationbeans/Author.java   |   44 +
 .../annotationbeans/DescriptiveTitle.java       |   42 +
 .../annotationbeans/DocumentationUrl.java       |   58 +
 .../annotationbeans/ExampleValue.java           |   43 +
 .../annotationbeans/FreeTextDescription.java    |   48 +
 .../annotationbeans/HostInstitution.java        |   45 +
 .../IdentificationAssertion.java                |   38 +
 .../t2/annotation/annotationbeans/MimeType.java |   60 +
 .../t2/annotation/annotationbeans/Optional.java |   44 +
 .../annotationbeans/SemanticAnnotation.java     |   51 +
 .../net/sf/taverna/t2/annotation/package.html   |   17 +
 .../sf/taverna/t2/facade/FacadeListener.java    |   49 +
 .../sf/taverna/t2/facade/ResultListener.java    |   43 +
 .../t2/facade/WorkflowInstanceFacade.java       |  237 ++
 .../t2/facade/WorkflowRunCancellation.java      |   29 +
 .../java/net/sf/taverna/t2/facade/package.html  |   24 +
 .../sf/taverna/t2/invocation/Completion.java    |  107 +
 .../net/sf/taverna/t2/invocation/Event.java     |  168 ++
 .../t2/invocation/InvocationContext.java        |   44 +
 .../t2/invocation/IterationInternalEvent.java   |  103 +
 .../invocation/ProcessIdentifierException.java  |   48 +
 .../t2/invocation/TokenOrderException.java      |   49 +
 .../net/sf/taverna/t2/invocation/TreeCache.java |  200 ++
 .../t2/invocation/WorkflowDataToken.java        |   91 +
 .../net/sf/taverna/t2/invocation/package.html   |    6 +
 .../sf/taverna/t2/monitor/MonitorManager.java   |  378 +++
 .../net/sf/taverna/t2/monitor/MonitorNode.java  |   76 +
 .../taverna/t2/monitor/MonitorableProperty.java |   55 +
 .../t2/monitor/NoSuchPropertyException.java     |   50 +
 .../taverna/t2/monitor/SteerableProperty.java   |   37 +
 .../java/net/sf/taverna/t2/monitor/package.html |   36 +
 .../provenance/item/AbstractProvenanceItem.java |   77 +
 .../provenance/item/ActivityProvenanceItem.java |   62 +
 .../t2/provenance/item/DataProvenanceItem.java  |   63 +
 .../t2/provenance/item/DataflowRunComplete.java |   61 +
 .../t2/provenance/item/ErrorProvenanceItem.java |   71 +
 .../item/InputDataProvenanceItem.java           |   49 +
 .../item/InvocationStartedProvenanceItem.java   |   41 +
 .../item/IterationProvenanceItem.java           |  108 +
 .../item/OutputDataProvenanceItem.java          |   49 +
 .../provenance/item/ProcessProvenanceItem.java  |   89 +
 .../item/ProcessorProvenanceItem.java           |   57 +
 .../t2/provenance/item/ProvenanceItem.java      |  103 +
 .../item/WorkflowDataProvenanceItem.java        |  101 +
 .../provenance/item/WorkflowProvenanceItem.java |  101 +
 .../provenance/reporter/ProvenanceReporter.java |   72 +
 .../provenance/vocabulary/SharedVocabulary.java |   34 +
 .../sf/taverna/t2/utility/TreeModelAdapter.java |  174 ++
 .../sf/taverna/t2/utility/TypedTreeModel.java   |  117 +
 .../taverna/t2/utility/TypedTreeModelEvent.java |  151 +
 .../t2/utility/TypedTreeModelListener.java      |   82 +
 .../java/net/sf/taverna/t2/utility/package.html |    5 +
 .../sf/taverna/t2/visit/DataflowCollation.java  |   32 +
 .../sf/taverna/t2/visit/HierarchyTraverser.java |  343 +++
 .../java/net/sf/taverna/t2/visit/VisitKind.java |   16 +
 .../net/sf/taverna/t2/visit/VisitReport.java    |  346 +++
 .../java/net/sf/taverna/t2/visit/Visitor.java   |   44 +
 .../t2/workflowmodel/AbstractOutputPort.java    |   43 +
 .../taverna/t2/workflowmodel/AbstractPort.java  |   54 +
 .../taverna/t2/workflowmodel/CompoundEdit.java  |  115 +
 .../sf/taverna/t2/workflowmodel/Condition.java  |   52 +
 .../taverna/t2/workflowmodel/Configurable.java  |   56 +
 .../workflowmodel/ConfigurationException.java   |   62 +
 .../t2/workflowmodel/ControlBoundary.java       |   47 +
 .../sf/taverna/t2/workflowmodel/Dataflow.java   |  173 ++
 .../t2/workflowmodel/DataflowInputPort.java     |   52 +
 .../t2/workflowmodel/DataflowOutputPort.java    |   61 +
 .../taverna/t2/workflowmodel/DataflowPort.java  |   34 +
 .../workflowmodel/DataflowValidationReport.java |   99 +
 .../sf/taverna/t2/workflowmodel/Datalink.java   |   56 +
 .../net/sf/taverna/t2/workflowmodel/Edit.java   |   65 +
 .../taverna/t2/workflowmodel/EditException.java |   43 +
 .../net/sf/taverna/t2/workflowmodel/Edits.java  |  832 ++++++
 .../EventForwardingOutputPort.java              |   46 +
 .../workflowmodel/EventHandlingInputPort.java   |   41 +
 .../t2/workflowmodel/FailureTransmitter.java    |   34 +
 .../t2/workflowmodel/FilteringInputPort.java    |   52 +
 .../sf/taverna/t2/workflowmodel/InputPort.java  |   30 +
 .../workflowmodel/InvalidDataflowException.java |   63 +
 .../net/sf/taverna/t2/workflowmodel/Merge.java  |   63 +
 .../t2/workflowmodel/MergeInputPort.java        |   52 +
 .../t2/workflowmodel/MergeOutputPort.java       |   35 +
 .../sf/taverna/t2/workflowmodel/MergePort.java  |   35 +
 .../t2/workflowmodel/NamedWorkflowEntity.java   |   45 +
 .../t2/workflowmodel/NamingException.java       |   47 +
 .../taverna/t2/workflowmodel/OrderedPair.java   |   85 +
 .../sf/taverna/t2/workflowmodel/OutputPort.java |   46 +
 .../net/sf/taverna/t2/workflowmodel/Port.java   |   35 +
 .../sf/taverna/t2/workflowmodel/Processor.java  |  150 +
 .../workflowmodel/ProcessorFinishedEvent.java   |   34 +
 .../t2/workflowmodel/ProcessorInputPort.java    |   30 +
 .../t2/workflowmodel/ProcessorOutputPort.java   |   31 +
 .../taverna/t2/workflowmodel/ProcessorPort.java |   32 +
 .../t2/workflowmodel/RunDeletionListener.java   |   15 +
 .../t2/workflowmodel/TokenProcessingEntity.java |   57 +
 .../taverna/t2/workflowmodel/WorkflowItem.java  |   28 +
 .../WorkflowStructureException.java             |   36 +
 .../health/DisabledActivityHealthChecker.java   |   48 +
 .../t2/workflowmodel/health/HealthCheck.java    |   68 +
 .../t2/workflowmodel/health/HealthChecker.java  |   37 +
 .../health/RemoteHealthChecker.java             |  220 ++
 .../UnrecognizedActivityHealthChecker.java      |   48 +
 .../t2/workflowmodel/health/package.html        |    6 +
 .../sf/taverna/t2/workflowmodel/package.html    |    3 +
 .../processor/activity/AbstractActivity.java    |  264 ++
 .../activity/AbstractAsynchronousActivity.java  |   81 +
 .../processor/activity/Activity.java            |   93 +
 .../activity/ActivityAndBeanWrapper.java        |   62 +
 .../ActivityConfigurationException.java         |   62 +
 .../processor/activity/ActivityFactory.java     |   89 +
 .../processor/activity/ActivityInputPort.java   |   78 +
 .../processor/activity/ActivityOutputPort.java  |   32 +
 .../processor/activity/ActivityPort.java        |   34 +
 .../activity/AsynchronousActivity.java          |   50 +
 .../activity/AsynchronousActivityCallback.java  |  137 +
 .../processor/activity/DisabledActivity.java    |  191 ++
 .../workflowmodel/processor/activity/Job.java   |  130 +
 .../activity/LockedNestedDataflow.java          |   11 +
 .../MonitorableAsynchronousActivity.java        |   56 +
 .../processor/activity/NestedDataflow.java      |   36 +
 .../activity/NestedDataflowSource.java          |   18 +
 .../activity/NonExecutableActivity.java         |   80 +
 .../processor/activity/SupersededActivity.java  |   16 +
 .../activity/UnrecognizedActivity.java          |   41 +
 .../config/ActivityInputPortDefinitionBean.java |   67 +
 .../ActivityOutputPortDefinitionBean.java       |   49 +
 .../config/ActivityPortDefinitionBean.java      |  104 +
 .../config/ActivityPortsDefinitionBean.java     |   82 +
 .../processor/activity/config/package.html      |    7 +
 .../processor/activity/package.html             |   10 +
 .../processor/config/ConfigurationBean.java     |   12 +
 .../processor/config/ConfigurationProperty.java |   27 +
 .../dispatch/AbstractDispatchLayer.java         |  103 +
 .../dispatch/AbstractErrorHandlerLayer.java     |  283 ++
 .../processor/dispatch/DispatchLayer.java       |   97 +
 .../dispatch/DispatchLayerFactory.java          |   62 +
 .../processor/dispatch/DispatchStack.java       |  100 +
 .../processor/dispatch/NotifiableLayer.java     |   40 +
 .../PropertyContributingDispatchLayer.java      |   64 +
 .../description/DispatchLayerErrorReaction.java |   44 +
 .../DispatchLayerJobQueueReaction.java          |   45 +
 .../description/DispatchLayerJobReaction.java   |   44 +
 .../DispatchLayerResultCompletionReaction.java  |   44 +
 .../DispatchLayerResultReaction.java            |   44 +
 .../description/DispatchLayerStateEffect.java   |   84 +
 .../description/DispatchMessageType.java        |   61 +
 .../dispatch/description/ReactionTo.java        |   40 +
 .../description/SupportsStreamedResult.java     |   41 +
 .../processor/dispatch/description/package.html |    3 +
 .../dispatch/events/AbstractDispatchEvent.java  |   45 +
 .../events/DispatchCompletionEvent.java         |   70 +
 .../dispatch/events/DispatchErrorEvent.java     |  119 +
 .../dispatch/events/DispatchErrorType.java      |   54 +
 .../dispatch/events/DispatchJobEvent.java       |  106 +
 .../dispatch/events/DispatchJobQueueEvent.java  |   95 +
 .../dispatch/events/DispatchResultEvent.java    |  108 +
 .../processor/dispatch/package.html             |   19 +
 .../AbstractIterationStrategyNode.java          |  225 ++
 ...onHandlingAbstractIterationStrategyNode.java |  136 +
 .../processor/iteration/CrossProduct.java       |  164 ++
 .../processor/iteration/DotProduct.java         |  123 +
 .../processor/iteration/IterationStrategy.java  |   54 +
 .../iteration/IterationStrategyNode.java        |  121 +
 .../iteration/IterationStrategyStack.java       |   65 +
 .../IterationTypeMismatchException.java         |   49 +
 .../MissingIterationInputException.java         |   50 +
 .../processor/iteration/NamedInputPortNode.java |  116 +
 .../processor/iteration/PrefixDotProduct.java   |  111 +
 .../processor/iteration/TerminalNode.java       |   39 +
 .../processor/iteration/package.html            |    4 +
 .../serialization/DeserializationException.java |   33 +
 .../serialization/SerializationException.java   |   33 +
 .../t2/workflowmodel/utils/AnnotationTools.java |  151 +
 .../utils/NamedWorkflowEntityComparator.java    |   39 +
 .../t2/workflowmodel/utils/PortComparator.java  |   37 +
 .../taverna/t2/workflowmodel/utils/Tools.java   |  795 ++++++
 .../services/net.sf.taverna.t2.visit.VisitKind  |    1 +
 ...averna.t2.workflowmodel.health.HealthChecker |    2 +
 .../spring/workflowmodel-api-context-osgi.xml   |   25 +
 .../spring/workflowmodel-api-context.xml        |   23 +
 .../taverna/t2/monitor/TestMonitorManager.java  |  173 ++
 .../t2/workflowmodel/health/DummyVisitKind.java |   26 +
 .../health/FloatHealthChecker.java              |   45 +
 .../health/FloatHealthChecker2.java             |   44 +
 .../workflowmodel/health/HealthReportTest.java  |   88 +
 .../health/StringHealthChecker.java             |   45 +
 .../iteration/TestIterationStrategyNodes.java   |  212 ++
 ...averna.t2.workflowmodel.health.HealthChecker |    3 +
 .../.gitignore                                  |    1 +
 taverna-workflowmodel-core-extensions/pom.xml   |   30 +
 .../layers/CoreDispatchLayerFactory.java        |  103 +
 .../processor/dispatch/layers/ErrorBounce.java  |  324 +++
 .../processor/dispatch/layers/Failover.java     |  111 +
 .../dispatch/layers/IntermediateProvenance.java |  508 ++++
 .../processor/dispatch/layers/Invoke.java       |  369 +++
 .../processor/dispatch/layers/Loop.java         |  424 +++
 .../dispatch/layers/LoopConfiguration.java      |   75 +
 .../processor/dispatch/layers/Parallelize.java  |  463 +++
 .../dispatch/layers/ParallelizeConfig.java      |   50 +
 .../processor/dispatch/layers/Retry.java        |  180 ++
 .../processor/dispatch/layers/RetryConfig.java  |   97 +
 .../processor/dispatch/layers/Stop.java         |  163 ++
 .../processor/dispatch/layers/package.html      |    4 +
 ...rkflowmodel-core-extensions-context-osgi.xml |   11 +
 .../workflowmodel-core-extensions-context.xml   |    9 +
 .../processor/dispatch/layers/TestRetry.java    |  110 +
 taverna-workflowmodel-impl/pom.xml              |   71 +
 .../impl/AnnotationAssertionImpl.java           |  135 +
 .../t2/annotation/impl/AnnotationChainImpl.java |   50 +
 .../t2/annotation/impl/DisputeEvent.java        |   74 +
 .../t2/annotation/impl/DisputeEventDetails.java |   28 +
 .../taverna/t2/annotation/impl/PersonImpl.java  |   32 +
 .../taverna/t2/annotation/impl/URISource.java   |   46 +
 .../facade/impl/WorkflowInstanceFacadeImpl.java |  631 +++++
 .../invocation/impl/InvocationContextImpl.java  |   72 +
 .../t2/monitor/impl/MonitorTreeModel.java       |  423 +++
 .../impl/AbstractActivityEdit.java              |   69 +
 .../impl/AbstractAnnotationEdit.java            |   70 +
 .../impl/AbstractBinaryProcessorEdit.java       |   95 +
 .../workflowmodel/impl/AbstractCrystalizer.java |  194 ++
 .../impl/AbstractDataflowEdit.java              |   68 +
 .../impl/AbstractDataflowInputPortEdit.java     |   68 +
 .../impl/AbstractDataflowOutputPortEdit.java    |   70 +
 .../impl/AbstractDatalinkEdit.java              |   67 +
 .../impl/AbstractEventHandlingInputPort.java    |   53 +
 .../impl/AbstractFilteringInputPort.java        |  178 ++
 .../workflowmodel/impl/AbstractMergeEdit.java   |   52 +
 .../impl/AbstractProcessorEdit.java             |   68 +
 .../impl/BasicEventForwardingOutputPort.java    |   93 +
 .../t2/workflowmodel/impl/ConditionImpl.java    |   61 +
 .../t2/workflowmodel/impl/ConfigureEdit.java    |   78 +
 .../t2/workflowmodel/impl/Crystalizer.java      |   66 +
 .../t2/workflowmodel/impl/DataflowImpl.java     |  797 ++++++
 .../impl/DataflowInputPortImpl.java             |   93 +
 .../impl/DataflowOutputPortImpl.java            |  112 +
 .../impl/DataflowValidationReportImpl.java      |   94 +
 .../t2/workflowmodel/impl/DatalinkImpl.java     |   68 +
 .../t2/workflowmodel/impl/EditSupport.java      |   46 +
 .../t2/workflowmodel/impl/EditsImpl.java        | 1251 +++++++++
 .../t2/workflowmodel/impl/MergeImpl.java        |  234 ++
 .../workflowmodel/impl/MergeInputPortImpl.java  |   45 +
 .../workflowmodel/impl/MergeOutputPortImpl.java |   40 +
 .../impl/ProcessorCrystalizerImpl.java          |  103 +
 .../t2/workflowmodel/impl/ProcessorImpl.java    |  426 +++
 .../impl/ProcessorInputPortImpl.java            |   72 +
 .../impl/ProcessorOutputPortImpl.java           |   59 +
 .../taverna/t2/workflowmodel/impl/package.html  |    3 +
 .../activity/impl/ActivityInputPortImpl.java    |   88 +
 .../activity/impl/ActivityOutputPortImpl.java   |   75 +
 .../processor/activity/impl/package.html        |    3 +
 .../impl/AbstractDispatchLayerEdit.java         |   98 +
 .../dispatch/impl/DispatchStackImpl.java        |  317 +++
 .../processor/dispatch/impl/package.html        |    8 +
 .../iteration/impl/IterationStrategyImpl.java   |  345 +++
 .../impl/IterationStrategyStackImpl.java        |  154 +
 .../processor/iteration/impl/package.html       |    3 +
 ...t.sf.taverna.t2.annotation.AnnotationBeanSPI |   10 +
 ...sf.taverna.t2.annotation.AnnotationSourceSPI |    1 +
 ...f.taverna.t2.annotation.CurationEventBeanSPI |    1 +
 .../net.sf.taverna.t2.workflowmodel.Edits       |    1 +
 ...averna.t2.workflowmodel.health.HealthChecker |    1 +
 .../spring/workflowmodel-impl-context-osgi.xml  |   15 +
 .../spring/workflowmodel-impl-context.xml       |   13 +
 .../src/main/resources/provenanceContext.xml    |   23 +
 .../taverna/t2/annotation/TestAnnotations.java  |  192 ++
 .../t2/monitor/impl/MonitorTreeModelTest.java   |   56 +
 .../impl/AbstractDatalinkEditTest.java          |  187 ++
 .../impl/AddProcessorEditTest.java              |   90 +
 .../ChangeDataflowInputPortDepthEditTest.java   |   77 +
 ...eDataflowInputPortGranularDepthEditTest.java |   73 +
 .../impl/ConfigureActivityEditTest.java         |   90 +
 .../impl/ConnectDatalinkEditTest.java           |   88 +
 .../impl/ConnectMergedDatalinkEditTest.java     |  129 +
 .../impl/CreateDataflowInputPortEditTest.java   |   87 +
 .../impl/CreateDataflowOutputPortEditTest.java  |   81 +
 .../t2/workflowmodel/impl/DataflowImplTest.java |   43 +
 .../impl/DefaultDispatchStackEditTest.java      |   79 +
 .../t2/workflowmodel/impl/DummyActivity.java    |   40 +
 .../t2/workflowmodel/impl/DummyDataflow.java    |  143 +
 .../impl/DummyDataflowInputPort.java            |   39 +
 .../impl/DummyDataflowOutputPort.java           |   37 +
 .../t2/workflowmodel/impl/DummyProcessor.java   |  150 +
 .../impl/DummyValidationReport.java             |   69 +
 .../t2/workflowmodel/impl/EditsImplTests.java   |   61 +
 .../t2/workflowmodel/impl/EventKeeper.java      |   37 +
 .../MapProcessorPortsToActivityEditTest.java    |  133 +
 .../impl/ProcessorHealthReportTest.java         |  140 +
 .../impl/RemoveProcessorInputPortEditTest.java  |   69 +
 .../impl/RemoveProcessorOutputPortEditTest.java |   71 +
 ...pdateDataflowInternalIdentifierEditTest.java |   40 +
 .../processor/AsynchEchoActivity.java           |   61 +
 .../processor/DiagnosticEventHandler.java       |   70 +
 .../t2/workflowmodel/processor/EchoConfig.java  |   52 +
 .../NaiveProcessorConstructionTest.java         |   47 +
 .../t2/workflowmodel/processor/Tools.java       |   90 +
 .../processor/dispatch/DiagnosticLayer.java     |   75 +
 .../DiagnosticIterationStrategyNode.java        |  131 +
 .../impl/IterationTypeCheckerTest.java          |  217 ++
 .../src/test/resources/log4j.properties         |   10 +
 .../2_port_cross_product.xml                    |   10 +
 .../resources/serialized-fragments/activity.xml |   14 +
 .../serialized-fragments/dataflow_datalinks.xml |   84 +
 .../dataflow_with_condition.xml                 |   66 +
 .../dataflow_with_merge.xml                     |   60 +
 .../dataflow_with_unlinked_processor.xml        |   36 +
 .../serialized-fragments/dispatchLayer.xml      |   11 +
 .../serialized-fragments/dispatchStack.xml      |   51 +
 .../empty_dataflow_with_ports.xml               |   23 +
 .../serialized-fragments/processor.xml          |   28 +
 907 files changed, 106850 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..ebe0e5b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,24 @@
+# ignore project files #
+.classpath
+.project
+.settings/
+catalog-v001.xml
+
+# ignore target files #
+target/
+bin/
+build/
+dist/
+apidoc/
+*.swp
+
+# ignore svn files if there
+.svn
+
+# ignore log files #
+*.log
+/logs/*
+*/logs/*
+
+
+

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..dff5f3a
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1 @@
+language: java

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..1e4ab4e
--- /dev/null
+++ b/README.md
@@ -0,0 +1,3 @@
+# Apache Taverna Engine
+
+[![Build Status](https://travis-ci.org/taverna-incubator/incubator-taverna-engine.svg)](https://travis-ci.org/taverna-incubator/incubator-taverna-engine)

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..74508ca
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,87 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.taverna</groupId>
+		<artifactId>taverna-parent</artifactId>
+		<version>1-incubating-SNAPSHOT</version>
+	</parent>
+	<groupId>org.apache.taverna.engine</groupId>
+	<artifactId>taverna-engine</artifactId>
+	<version>3.1.0-incubating-SNAPSHOT</version>
+	<packaging>pom</packaging>
+	<name>Apache Taverna Engine and Platform</name>
+  <properties>
+    <taverna.language.version>0.15.0-incubating-SNAPSHOT</taverna.language.version>
+    <taverna.osgi.version>0.2.0-incubating-SNAPSHOT</taverna.osgi.version>
+  </properties>
+	<modules>
+    <!-- Avoid spaghetti dependencies
+    <module>taverna-platform-integration-tests</module>
+    <module>taverna-integration-tests</module>
+	-->
+    <module>taverna-activity-archetype</module>
+    <module>taverna-activity-test-utils</module>
+    <module>taverna-capability-api</module>
+    <module>taverna-capability-impl</module>
+    <module>taverna-credential-manager</module>
+    <module>taverna-credential-manager-impl</module>
+    <module>taverna-database-configuration-api</module>
+    <module>taverna-database-configuration-impl</module>
+
+    <module>taverna-dataflow-activity</module>
+    <module>taverna-execution-api</module>
+    <module>taverna-execution-hadoop</module>
+    <module>taverna-execution-impl</module>
+    <module>taverna-execution-local</module>
+    <module>taverna-execution-remote</module>
+    <module>taverna-observer</module>
+
+    <!-- FIXME: Upgrade to T3
+    <module>taverna-prov</module>
+    -->
+    <module>taverna-prov-owl-bindings</module>
+    <!--
+    <module>taverna-provenanceconnector</module>
+    -->
+    <module>taverna-reference-api</module>
+    <module>taverna-reference-impl</module>
+    <module>taverna-reference-testhelpers</module>
+    <module>taverna-reference-types</module>
+    <module>taverna-report-api</module>
+    <module>taverna-run-api</module>
+    <module>taverna-run-impl</module>
+    <module>taverna-services-api</module>
+    <module>taverna-services-impl</module>
+    <module>taverna-stringconstant-activity</module>
+    <module>taverna-workflowmodel-api</module>
+    <module>taverna-workflowmodel-core-extensions</module>
+    <module>taverna-workflowmodel-impl</module>
+  </modules>
+	<dependencyManagement>
+		<dependencies>
+			<dependency>
+				<groupId>log4j</groupId>
+				<artifactId>log4j</artifactId>
+				<version>${log4j.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>junit</groupId>
+				<artifactId>junit</artifactId>
+				<version>${junit.version}</version>
+				<scope>test</scope>
+			</dependency>
+		</dependencies>
+	</dependencyManagement>
+  <repositories>
+    <repository>
+      <id>taverna-incubating</id>
+      <name>Apache Taverna incubating Repository</name>
+        <url>http://repository.mygrid.org.uk/artifactory/incubator-snapshot-local/</url>
+      <releases>
+        <enabled>false</enabled>
+      </releases>
+      <snapshots />
+    </repository>
+  </repositories>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/pom.xml b/taverna-activity-archetype/pom.xml
new file mode 100644
index 0000000..72d7468
--- /dev/null
+++ b/taverna-activity-archetype/pom.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.taverna.engine</groupId>
+		<artifactId>taverna-engine</artifactId>
+		<version>3.1.0-incubating-SNAPSHOT</version>
+	</parent>
+	<artifactId>taverna-activity-archetype</artifactId>
+	<packaging>maven-archetype</packaging>
+	<name>Apache Taverna Activity archetype</name>
+	<description>Archetype to build a Taverna 3 service activity.
+	Includes engine and UI parts, and a test class to run the workbench with the new activity.
+	</description>
+	<build>
+		<extensions>
+			<extension>
+				<groupId>org.apache.maven.archetype</groupId>
+				<artifactId>archetype-packaging</artifactId>
+				<version>2.2</version>
+			</extension>
+		</extensions>
+		<plugins>
+			<plugin>
+				<artifactId>maven-archetype-plugin</artifactId>
+				<version>2.2</version>
+			</plugin>
+		</plugins>
+	</build>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/taverna-activity-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
new file mode 100644
index 0000000..719227f
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archetype-descriptor
+	xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
+	name="myfancytool"
+	xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<requiredProperties>
+		<requiredProperty key="classPrefix">
+			<defaultValue>Example</defaultValue>
+		</requiredProperty>
+	</requiredProperties>
+	<modules>
+		<module id="${rootArtifactId}-activity" dir="__rootArtifactId__-activity"
+			name="${rootArtifactId}-activity">
+			<fileSets>
+				<fileSet filtered="true" packaged="true" encoding="UTF-8">
+					<directory>src/main/java</directory>
+					<includes>
+						<include>**/*.java</include>
+					</includes>
+				</fileSet>
+				<fileSet encoding="UTF-8" filtered="true">
+					<directory>src/main/resources</directory>
+					<includes>
+						<include>**/*.xml</include>
+						<include>**/*.json</include>
+					</includes>
+				</fileSet>
+				<fileSet filtered="true" packaged="true" encoding="UTF-8">
+					<directory>src/test/java</directory>
+					<includes>
+						<include>**/*.java</include>
+					</includes>
+				</fileSet>
+			</fileSets>
+		</module>
+		<module id="${rootArtifactId}-activity-ui" dir="__rootArtifactId__-activity-ui"
+			name="${rootArtifactId}-activity-ui">
+			<fileSets>
+				<fileSet filtered="true" packaged="true" encoding="UTF-8">
+					<directory>src/main/java</directory>
+					<includes>
+						<include>**/*.java</include>
+					</includes>
+				</fileSet>
+				<fileSet encoding="UTF-8" filtered="true">
+					<directory>src/main/resources</directory>
+					<includes>
+						<include>**/*.xml</include>
+						<include>**/*.png</include>
+					</includes>
+				</fileSet>
+			</fileSets>
+		</module>
+		<module id="${rootArtifactId}-plugin" dir="__rootArtifactId__-plugin"
+			name="${rootArtifactId}-plugin" />
+	</modules>
+</archetype-descriptor>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/pom.xml b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/pom.xml
new file mode 100644
index 0000000..9f01ed6
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/pom.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>${groupId}</groupId>
+		<artifactId>${rootArtifactId}</artifactId>
+		<version>${version}</version>
+	</parent>
+	<artifactId>${artifactId}</artifactId>
+	<packaging>bundle</packaging>
+	<name>${classPrefix} Taverna activity UI bindings</name>
+
+	<dependencies>
+		<dependency>
+			<groupId>${project.groupId}</groupId>
+			<artifactId>${rootArtifactId}-activity</artifactId>
+			<version>${version}</version>
+		</dependency>
+		<dependency>
+			<groupId>net.sf.taverna.t2.ui-api</groupId>
+			<artifactId>activity-palette-api</artifactId>
+			<version>${t2.ui.api.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>net.sf.taverna.t2.ui-api</groupId>
+			<artifactId>menu-api</artifactId>
+			<version>${t2.ui.api.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>net.sf.taverna.t2.ui-api</groupId>
+			<artifactId>contextual-views-api</artifactId>
+			<version>${t2.ui.api.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>net.sf.taverna.t2.ui-api</groupId>
+			<artifactId>activity-tools</artifactId>
+			<version>${t2.ui.api.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-databind</artifactId>
+			<version>2.3.0</version>
+		</dependency>
+	</dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigurationPanel.java
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigurationPanel.java b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigurationPanel.java
new file mode 100644
index 0000000..d92efb7
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigurationPanel.java
@@ -0,0 +1,87 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package}.ui.config;
+
+import java.awt.GridLayout;
+import java.net.URI;
+
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JTextField;
+
+import net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ActivityConfigurationPanel;
+
+import uk.org.taverna.commons.services.ServiceRegistry;
+import uk.org.taverna.scufl2.api.activity.Activity;
+
+@SuppressWarnings("serial")
+public class ${classPrefix}ConfigurationPanel extends ActivityConfigurationPanel {
+
+	private final ServiceRegistry serviceRegistry;
+
+	private JTextField fieldString;
+	private JTextField fieldURI;
+
+	public ${classPrefix}ConfigurationPanel(Activity activity, ServiceRegistry serviceRegistry) {
+		super(activity);
+		this.serviceRegistry = serviceRegistry;
+		initialise();
+	}
+
+	protected void initialise() {
+		// call super.initialise() to initialise the configuration
+		super.initialise();
+
+		removeAll();
+		setLayout(new GridLayout(0, 2));
+
+		// FIXME: Create GUI depending on activity configuration bean
+		JLabel labelString = new JLabel("Example string:");
+		add(labelString);
+		fieldString = new JTextField(20);
+		add(fieldString);
+		labelString.setLabelFor(fieldString);
+
+		JLabel labelURI = new JLabel("Example URI:");
+		add(labelURI);
+		fieldURI = new JTextField(25);
+		add(fieldURI);
+		labelURI.setLabelFor(fieldURI);
+
+		// Populate fields from activity configuration
+		fieldString.setText(getProperty("exampleString"));
+		fieldURI.setText(getProperty("exampleUri"));
+	}
+
+	/**
+	 * Check that user values in UI are valid
+	 */
+	@Override
+	public boolean checkValues() {
+		try {
+			URI.create(fieldURI.getText());
+		} catch (IllegalArgumentException ex) {
+			JOptionPane.showMessageDialog(this, ex.getCause().getMessage(),
+					"Invalid URI", JOptionPane.ERROR_MESSAGE);
+			// Not valid, return false
+			return false;
+		}
+		// All valid, return true
+		return true;
+	}
+
+	/**
+	 * Set the configuration properties from the UI
+	 */
+	@Override
+	public void noteConfiguration() {
+		// FIXME: Update bean fields from your UI elements
+		setProperty("exampleString", fieldString.getText());
+		setProperty("exampleUri", fieldURI.getText());
+
+		configureInputPorts(serviceRegistry);
+		configureOutputPorts(serviceRegistry);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigureAction.java
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigureAction.java b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigureAction.java
new file mode 100644
index 0000000..c7d5d10
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigureAction.java
@@ -0,0 +1,49 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package}.ui.config;
+
+import java.awt.event.ActionEvent;
+
+import uk.org.taverna.commons.services.ServiceRegistry;
+import uk.org.taverna.scufl2.api.activity.Activity;
+
+import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionRegistry;
+import net.sf.taverna.t2.workbench.activityicons.ActivityIconManager;
+import net.sf.taverna.t2.workbench.edits.EditManager;
+import net.sf.taverna.t2.workbench.file.FileManager;
+import net.sf.taverna.t2.workbench.ui.actions.activity.ActivityConfigurationAction;
+import net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ActivityConfigurationDialog;
+
+@SuppressWarnings("serial")
+public class ${classPrefix}ConfigureAction extends ActivityConfigurationAction {
+
+	private final EditManager editManager;
+	private final FileManager fileManager;
+	private final ServiceRegistry serviceRegistry;
+
+	public ${classPrefix}ConfigureAction(Activity activity,
+			EditManager editManager, FileManager fileManager,
+			ActivityIconManager activityIconManager,
+			ServiceDescriptionRegistry serviceDescriptionRegistry,
+			ServiceRegistry serviceRegistry) {
+		super(activity, activityIconManager, serviceDescriptionRegistry);
+		this.editManager = editManager;
+		this.fileManager = fileManager;
+		this.serviceRegistry = serviceRegistry;
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		ActivityConfigurationDialog currentDialog = getDialog(getActivity());
+		if (currentDialog != null) {
+			currentDialog.toFront();
+			return;
+		}
+
+		${classPrefix}ConfigurationPanel panel = new ${classPrefix}ConfigurationPanel(getActivity(), serviceRegistry);
+		ActivityConfigurationDialog dialog = new ActivityConfigurationDialog(getActivity(), panel, editManager);
+
+		setDialog(getActivity(), dialog, fileManager);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/menu/__classPrefix__ConfigureMenuAction.java
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/menu/__classPrefix__ConfigureMenuAction.java b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/menu/__classPrefix__ConfigureMenuAction.java
new file mode 100644
index 0000000..a257a4e
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/menu/__classPrefix__ConfigureMenuAction.java
@@ -0,0 +1,67 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package}.ui.menu;
+
+import java.net.URI;
+
+import javax.swing.Action;
+
+import uk.org.taverna.commons.services.ServiceRegistry;
+
+import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionRegistry;
+import net.sf.taverna.t2.ui.menu.ContextualMenuComponent;
+import net.sf.taverna.t2.ui.menu.MenuComponent;
+import net.sf.taverna.t2.workbench.activityicons.ActivityIconManager;
+import net.sf.taverna.t2.workbench.activitytools.AbstractConfigureActivityMenuAction;
+import net.sf.taverna.t2.workbench.edits.EditManager;
+import net.sf.taverna.t2.workbench.file.FileManager;
+
+import ${package}.ui.config.${classPrefix}ConfigureAction;
+
+public class ${classPrefix}ConfigureMenuAction extends AbstractConfigureActivityMenuAction implements
+		MenuComponent, ContextualMenuComponent {
+
+	private static final URI ACTIVITY_TYPE = URI
+			.create("http://example.com/2013/activity/${rootArtifactId}");
+
+	private EditManager editManager;
+	private FileManager fileManager;
+	private ActivityIconManager activityIconManager;
+	private ServiceDescriptionRegistry serviceDescriptionRegistry;
+	private ServiceRegistry serviceRegistry;
+
+	public ${classPrefix}ConfigureMenuAction() {
+		super(ACTIVITY_TYPE);
+	}
+
+	@Override
+	protected Action createAction() {
+		Action result = new ${classPrefix}ConfigureAction(findActivity(), editManager, fileManager,
+				activityIconManager, serviceDescriptionRegistry, serviceRegistry);
+		result.putValue(Action.NAME, "Configure example service");
+		addMenuDots(result);
+		return result;
+	}
+
+	public void setEditManager(EditManager editManager) {
+		this.editManager = editManager;
+	}
+
+	public void setFileManager(FileManager fileManager) {
+		this.fileManager = fileManager;
+	}
+
+	public void setActivityIconManager(ActivityIconManager activityIconManager) {
+		this.activityIconManager = activityIconManager;
+	}
+
+	public void setServiceDescriptionRegistry(ServiceDescriptionRegistry serviceDescriptionRegistry) {
+		this.serviceDescriptionRegistry = serviceDescriptionRegistry;
+	}
+
+	public void setServiceRegistry(ServiceRegistry serviceRegistry) {
+		this.serviceRegistry = serviceRegistry;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceDesc.java
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceDesc.java b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceDesc.java
new file mode 100644
index 0000000..5de7bc4
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceDesc.java
@@ -0,0 +1,106 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package}.ui.serviceprovider;
+
+import java.net.URI;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+
+import uk.org.taverna.scufl2.api.configurations.Configuration;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
+import net.sf.taverna.t2.servicedescriptions.ServiceDescription;
+
+public class ${classPrefix}ServiceDesc extends ServiceDescription {
+
+	private static final URI ACTIVITY_TYPE = URI
+			.create("http://example.com/2013/activity/${rootArtifactId}");
+
+	// FIXME: Replace example fields and getters/setters with any required
+	// and optional fields. (All fields are searchable in the Service palette,
+	// for instance try a search for exampleString:3)
+	private String exampleString;
+	private String exampleUri;
+
+	public String getExampleString() {
+		return exampleString;
+	}
+	public void setExampleString(String exampleString) {
+		this.exampleString = exampleString;
+	}
+
+	public String getExampleUri() {
+		return exampleUri;
+	}
+	public void setExampleUri(String exampleUri) {
+		this.exampleUri = exampleUri;
+	}
+
+	/**
+	 * The type of Activity which should be instantiated when adding a service
+	 * for this description
+	 */
+	@Override
+	public URI getActivityType() {
+		return ACTIVITY_TYPE;
+	}
+
+	/**
+	 * The configuration  which is to be used for configuring the instantiated activity.
+	 * Making this configuration will typically require some of the fields set on this service
+	 * description, like an endpoint URL or method name.
+	 *
+	 */
+	@Override
+	public Configuration getActivityConfiguration() {
+		Configuration configuration = new Configuration();
+		configuration.setType(ACTIVITY_TYPE.resolve("#Config"));
+		ObjectNode json = configuration.getJsonAsObjectNode();
+		json.put("exampleString", exampleString);
+		json.put("exampleUri", exampleUri);
+		return configuration;
+	}
+
+	/**
+	 * An icon to represent this service description in the service palette.
+	 */
+	@Override
+	public Icon getIcon() {
+		return ${classPrefix}ServiceIcon.getIcon();
+	}
+
+	/**
+	 * The display name that will be shown in service palette and will
+	 * be used as a template for processor name when added to workflow.
+	 */
+	@Override
+	public String getName() {
+		return exampleString;
+	}
+
+	/**
+	 * The path to this service description in the service palette. Folders
+	 * will be created for each element of the returned path.
+	 */
+	@Override
+	public List<String> getPath() {
+		// For deeper paths you may return several strings
+		return Arrays.asList("${classPrefix}s " + exampleUri);
+	}
+
+	/**
+	 * Return a list of data values uniquely identifying this service
+	 * description (to avoid duplicates). Include only primary key like fields,
+	 * ie. ignore descriptions, icons, etc.
+	 */
+	@Override
+	protected List<? extends Object> getIdentifyingData() {
+		// FIXME: Use your fields instead of example fields
+		return Arrays.<Object>asList(exampleString, exampleUri);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceIcon.java
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceIcon.java b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceIcon.java
new file mode 100644
index 0000000..023edcb
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceIcon.java
@@ -0,0 +1,40 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package}.ui.serviceprovider;
+
+import java.net.URI;
+
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+
+import net.sf.taverna.t2.workbench.activityicons.ActivityIconSPI;
+
+public class ${classPrefix}ServiceIcon implements ActivityIconSPI {
+
+	private static final URI ACTIVITY_TYPE = URI
+			.create("http://example.com/2013/activity/${rootArtifactId}");
+
+	private static Icon icon;
+
+	@Override
+	public int canProvideIconScore(URI activityType) {
+		if (ACTIVITY_TYPE.equals(activityType)) {
+			return DEFAULT_ICON + 1;
+		}
+		return NO_ICON;
+	}
+
+	@Override
+	public Icon getIcon(URI activityType) {
+		return getIcon();
+	}
+
+	public static Icon getIcon() {
+		if (icon == null) {
+			icon = new ImageIcon(${classPrefix}ServiceIcon.class.getResource("/exampleIcon.png"));
+		}
+		return icon;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceProvider.java
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceProvider.java b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceProvider.java
new file mode 100644
index 0000000..8a30c6f
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceProvider.java
@@ -0,0 +1,75 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package}.ui.serviceprovider;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.Icon;
+
+import net.sf.taverna.t2.servicedescriptions.ServiceDescription;
+import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionProvider;
+
+public class ${classPrefix}ServiceProvider implements ServiceDescriptionProvider {
+
+	private static final URI providerId = URI
+		.create("http://example.com/2011/service-provider/${rootArtifactId}");
+
+	/**
+	 * Do the actual search for services. Return using the callBack parameter.
+	 */
+	public void findServiceDescriptionsAsync(
+			FindServiceDescriptionsCallBack callBack) {
+		// Use callback.status() for long-running searches
+		// callBack.status("Resolving example services");
+
+		List<ServiceDescription> results = new ArrayList<ServiceDescription>();
+
+		// FIXME: Implement the actual service search/lookup instead
+		// of dummy for-loop
+		for (int i = 1; i <= 5; i++) {
+			${classPrefix}ServiceDesc service = new ${classPrefix}ServiceDesc();
+			// Populate the service description bean
+			service.setExampleString("Example " + i);
+			service.setExampleUri("http://localhost:8192/service");
+
+			// Optional: set description
+			service.setDescription("Service example number " + i);
+			results.add(service);
+		}
+
+		// partialResults() can also be called several times from inside
+		// for-loop if the full search takes a long time
+		callBack.partialResults(results);
+
+		// No more results will be coming
+		callBack.finished();
+	}
+
+	/**
+	 * Icon for service provider
+	 */
+	public Icon getIcon() {
+		return ${classPrefix}ServiceIcon.getIcon();
+	}
+
+	/**
+	 * Name of service provider, appears in right click for 'Remove service
+	 * provider'
+	 */
+	public String getName() {
+		return "My example service";
+	}
+
+	@Override
+	public String toString() {
+		return getName();
+	}
+
+	public String getId() {
+		return providerId.toASCIIString();
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ActivityContextViewFactory.java
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ActivityContextViewFactory.java b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ActivityContextViewFactory.java
new file mode 100644
index 0000000..de87ef3
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ActivityContextViewFactory.java
@@ -0,0 +1,62 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package}.ui.view;
+
+import java.net.URI;
+import java.util.Arrays;
+import java.util.List;
+
+import uk.org.taverna.commons.services.ServiceRegistry;
+import uk.org.taverna.scufl2.api.activity.Activity;
+
+import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionRegistry;
+import net.sf.taverna.t2.workbench.activityicons.ActivityIconManager;
+import net.sf.taverna.t2.workbench.edits.EditManager;
+import net.sf.taverna.t2.workbench.file.FileManager;
+import net.sf.taverna.t2.workbench.ui.views.contextualviews.ContextualView;
+import net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ContextualViewFactory;
+
+public class ${classPrefix}ActivityContextViewFactory implements ContextualViewFactory<Activity> {
+
+	private static final URI ACTIVITY_TYPE = URI
+			.create("http://example.com/2013/activity/${rootArtifactId}");
+
+	private EditManager editManager;
+	private FileManager fileManager;
+	private ActivityIconManager activityIconManager;
+	private ServiceDescriptionRegistry serviceDescriptionRegistry;
+	private ServiceRegistry serviceRegistry;
+
+	@Override
+	public boolean canHandle(Object object) {
+		return object instanceof Activity && ((Activity) object).getType().equals(ACTIVITY_TYPE);
+	}
+
+	@Override
+	public List<ContextualView> getViews(Activity selection) {
+		return Arrays.<ContextualView>asList(new ${classPrefix}ContextualView(selection, editManager,
+				fileManager, activityIconManager, serviceDescriptionRegistry, serviceRegistry));
+	}
+
+	public void setEditManager(EditManager editManager) {
+		this.editManager = editManager;
+	}
+
+	public void setFileManager(FileManager fileManager) {
+		this.fileManager = fileManager;
+	}
+
+	public void setActivityIconManager(ActivityIconManager activityIconManager) {
+		this.activityIconManager = activityIconManager;
+	}
+
+	public void setServiceDescriptionRegistry(ServiceDescriptionRegistry serviceDescriptionRegistry) {
+		this.serviceDescriptionRegistry = serviceDescriptionRegistry;
+	}
+
+	public void setServiceRegistry(ServiceRegistry serviceRegistry) {
+		this.serviceRegistry = serviceRegistry;
+	}
+
+}


[08/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-reference-api/pom.xml b/taverna-reference-api/pom.xml
new file mode 100644
index 0000000..1c2664d
--- /dev/null
+++ b/taverna-reference-api/pom.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.taverna.engine</groupId>
+		<artifactId>taverna-engine</artifactId>
+		<version>3.1.0-incubating-SNAPSHOT</version>
+	</parent>
+	<artifactId>taverna-reference-api</artifactId>
+	<packaging>bundle</packaging>
+	<name>Apache Taverna Reference Manager API</name>
+	<description>
+		Core APIs and extension points for the T2 reference manager.
+		This includes the SPIs for external references, translators and
+		publishers.
+	</description>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-bundle-plugin</artifactId>
+				<configuration>
+					<instructions>
+						<Import-Package>
+						org.hibernate.proxy;resolution:=optional,
+						org.springframework.transaction.*;resolution:=optional, *
+						</Import-Package>
+					</instructions>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+	<dependencies>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>org.springframework.transaction</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+	</dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/AbstractExternalReference.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/AbstractExternalReference.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/AbstractExternalReference.java
new file mode 100644
index 0000000..599d0bb
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/AbstractExternalReference.java
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+import static net.sf.taverna.t2.reference.ReferencedDataNature.*;
+
+/**
+ * A trivial implementation of ExternalReference. This abstract class should be
+ * used as the superclass of any ExternalReference implementations as it
+ * provides base metadata for the hibernate-based persistence system used by the
+ * main reference manager implementation. While the interface contract cannot
+ * require this your extensions will likely not work properly unless you use
+ * this class.
+ * 
+ * @author Tom Oinn
+ */
+public abstract class AbstractExternalReference implements ExternalReferenceSPI {
+	// Used internally by Hibernate for this class and subclasses
+	private int primaryKey;
+
+	/**
+	 * Used by Hibernate internally to establish a foreign key relationship
+	 * between this abstract superclass and tables corresponding to
+	 * implementations of the ExternalReference interface. Has no impact on any
+	 * application level code, this method is only ever used by the internals of
+	 * the hibernate framework.
+	 */
+	public final void setPrimaryKey(int newKey) {
+		this.primaryKey = newKey;
+	}
+
+	/**
+	 * Used by Hibernate internally to establish a foreign key relationship
+	 * between this abstract superclass and tables corresponding to
+	 * implementations of the ExternalReference interface. Has no impact on any
+	 * application level code, this method is only ever used by the internals of
+	 * the hibernate framework.
+	 */
+	public final int getPrimaryKey() {
+		return this.primaryKey;
+	}
+
+	/**
+	 * Default to returning DataReferenceNature.UNKNOWN
+	 */
+	@Override
+	public ReferencedDataNature getDataNature() {
+		return UNKNOWN;
+	}
+
+	/**
+	 * Default to returning null for charset
+	 */
+	@Override
+	public String getCharset() {
+		return null;
+	}
+
+	/**
+	 * Default to a value of 0.0f for the resolution cost, but implementations
+	 * should at least attempt to set this to a more sensible level!
+	 */
+	@Override
+	public float getResolutionCost() {
+		return 0.0f;
+	}
+
+	@Override
+	public abstract ExternalReferenceSPI clone()
+			throws CloneNotSupportedException;
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ContextualizedT2Reference.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ContextualizedT2Reference.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ContextualizedT2Reference.java
new file mode 100644
index 0000000..a5699b0
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ContextualizedT2Reference.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+/**
+ * Used by the {@link ReferenceService#traverseFrom(T2Reference, int)} when
+ * traversing a collection structure. Each contextualized t2reference contains
+ * the {@link T2Reference} along with an integer array index representing the
+ * position of that reference within the traversal structure. The index
+ * [i<sub>0</sub>,i<sub>1</sub>,i<sub>2</sub> ... i<sub>n</sub>] is interpreted
+ * such that the reference is located at
+ * parent.get(i<sub>0</sub>).get(i<sub>1</sub
+ * >).get(i<sub>2</sub>)....get(i<sub>n</sub>). If the index is empty then the
+ * T2Reference <em>is</em> the original reference supplied to the
+ * {@link ReferenceService#traverseFrom(T2Reference, int) traverseFrom} method.
+ * 
+ * @author Tom Oinn
+ */
+public interface ContextualizedT2Reference {
+	/**
+	 * @return the T2Reference to which the associated index applies.
+	 */
+	T2Reference getReference();
+
+	/**
+	 * @return the index of this T2Reference
+	 */
+	int[] getIndex();
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/DaoException.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/DaoException.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/DaoException.java
new file mode 100644
index 0000000..7de38df
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/DaoException.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+/**
+ * Thrown by the Data Access Object interface methods, wrapping any underlying
+ * exception.
+ * 
+ * @author Tom Oinn
+ */
+public class DaoException extends RuntimeException {
+	static final long serialVersionUID = 8496141798637577803L;
+
+	public DaoException() {
+		super();
+	}
+
+	public DaoException(String message) {
+		super(message);
+	}
+
+	public DaoException(Throwable cause) {
+		super(cause);
+	}
+
+	public DaoException(String message, Throwable cause) {
+		super(message, cause);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/DereferenceException.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/DereferenceException.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/DereferenceException.java
new file mode 100644
index 0000000..d2f814f
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/DereferenceException.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+/**
+ * Thrown when a problem occurs during de-reference of an ExternalReferenceSPI
+ * implementation. This include operations which implicitly de-reference the
+ * reference such as those infering character set or data natures.
+ * 
+ * @author Tom Oinn
+ */
+public class DereferenceException extends RuntimeException {
+	private static final long serialVersionUID = 8054381613840005541L;
+
+	public DereferenceException() {
+		//
+	}
+
+	public DereferenceException(String message) {
+		super(message);
+	}
+
+	public DereferenceException(Throwable cause) {
+		super(cause);
+	}
+
+	public DereferenceException(String message, Throwable cause) {
+		super(message, cause);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocument.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocument.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocument.java
new file mode 100644
index 0000000..06a20e3
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocument.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Contains the definition of an error token within the workflow system.
+ * 
+ * @author Tom Oinn
+ * @author David Withers
+ */
+public interface ErrorDocument extends Identified {
+	/**
+	 * If the error document is created from a {@link Throwable} it will have a
+	 * stack trace, in this case the stack trace is represented as a list of
+	 * {@link StackTraceElement} beans
+	 */
+	List<StackTraceElementBean> getStackTraceStrings();
+
+	/**
+	 * If the error document is created from a {@link Throwable}, this contains
+	 * the message part of the {@link Throwable}.
+	 */
+	String getExceptionMessage();
+
+	/**
+	 * Error documents can carry an arbitrary string message, this returns it.
+	 */
+	String getMessage();
+
+	/**
+	 * If the error document is created from set of references that contain
+	 * error documents, this method returns them.
+	 */
+	Set<T2Reference> getErrorReferences();
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentDao.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentDao.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentDao.java
new file mode 100644
index 0000000..72fabf1
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentDao.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+import static org.springframework.transaction.annotation.Propagation.REQUIRED;
+import static org.springframework.transaction.annotation.Propagation.SUPPORTS;
+
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * Data access object handling ErrorDocument instances.
+ * 
+ * @author Tom Oinn
+ */
+public interface ErrorDocumentDao {
+	/**
+	 * Store a named ErrorDocument to the database.
+	 * 
+	 * @param errorDoc
+	 *            error document to store
+	 * @throws DaoException
+	 *             if any exception is thrown when connecting to the underlying
+	 *             store or when storing the error document
+	 */
+	@Transactional(propagation = REQUIRED, readOnly = false)
+	void store(ErrorDocument errorDoc) throws DaoException;
+
+	/**
+	 * Retrieves a named and populated ErrorDocument
+	 * 
+	 * @param reference
+	 *            id of the error document to retrieve
+	 * @return a previously stored ErrorDocument instance
+	 * @throws DaoException
+	 *             if any exception is thrown when connecting to the underlying
+	 *             data store or when attempting retrieval of the error document
+	 */
+	@Transactional(propagation = SUPPORTS, readOnly = true)
+	ErrorDocument get(T2Reference reference) throws DaoException;
+
+	@Transactional(propagation = SUPPORTS, readOnly = false)
+	boolean delete(ErrorDocument errorDoc) throws DaoException;
+
+	@Transactional(propagation = SUPPORTS, readOnly = false)
+	void deleteErrorDocumentsForWFRun(String workflowRunId) throws DaoException;
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentService.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentService.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentService.java
new file mode 100644
index 0000000..6eee715
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentService.java
@@ -0,0 +1,152 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+import java.util.Set;
+
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * Provides facilities to register list of T2References, register empty lists at
+ * any given depth and to resolve appropriate T2Reference instances back to
+ * these lists. Registration operations assign names and lock the list contents
+ * as a result. This service operates strictly on T2References, it neither tries
+ * to nor is capable of any form of reference resolution, so aspects such as
+ * collection traversal are not handled here (these are performed by the top
+ * level reference service)
+ * 
+ * @author Tom Oinn
+ */
+@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
+public interface ErrorDocumentService {
+	/**
+	 * Register a new error document.
+	 * <p>
+	 * The created reference will be related with a workflow run id passed
+	 * through ReferenceContext so we can track all data referenced by a
+	 * specific run.
+	 * 
+	 * @param message
+	 *            a free text message describing the error, if available. If
+	 *            there is no message use the empty string here.
+	 * @param t
+	 *            a Throwable describing the underlying fault causing this error
+	 *            document to be registered, if any. If there is no Throwable
+	 *            associated use null.
+	 * @param depth
+	 *            depth of the error, used when returning an error document
+	 *            instead of an identified list.
+	 * @return a new ErrorDocument instance, constructed fully and stored in the
+	 *         underlying storage system
+	 */
+	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
+	ErrorDocument registerError(String message, Throwable t, int depth,
+			ReferenceContext context) throws ErrorDocumentServiceException;
+
+	/**
+	 * Equivalent to <code>registerError(message, null, depth, context)</code>.
+	 */
+	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
+	ErrorDocument registerError(String message, int depth,
+			ReferenceContext context) throws ErrorDocumentServiceException;
+
+	/**
+	 * Equivalent to <code>registerError("", t, depth, context)</code>.
+	 */
+	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
+	ErrorDocument registerError(Throwable t, int depth, ReferenceContext context)
+			throws ErrorDocumentServiceException;
+
+	/**
+	 * Register a new error document.
+	 * <p>
+	 * The created reference will be related with a workflow run id passed
+	 * through ReferenceContext so we can track all data referenced by a
+	 * specific run.
+	 * 
+	 * @param message
+	 *            a free text message describing the error, if available. If
+	 *            there is no message use the empty string here.
+	 * @param errors
+	 *            a set of references that contain error documents.
+	 * @param depth
+	 *            depth of the error, used when returning an error document
+	 *            instead of an identified list.
+	 * @return a new ErrorDocument instance, constructed fully and stored in the
+	 *         underlying storage system
+	 */
+	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
+	ErrorDocument registerError(String message, Set<T2Reference> errors,
+			int depth, ReferenceContext context)
+			throws ErrorDocumentServiceException;
+
+	/**
+	 * Retrieve a previously named and registered ErrorDocument from the backing
+	 * store
+	 * 
+	 * @param id
+	 *            identifier of the error document to retrieve
+	 * @return an ErrorDocument
+	 * @throws ErrorDocumentServiceException
+	 *             if anything goes wrong with the retrieval process or if there
+	 *             is something wrong with the reference (such as it being of
+	 *             the wrong reference type).
+	 */
+	ErrorDocument getError(T2Reference id) throws ErrorDocumentServiceException;
+
+	/**
+	 * Functionality the same as {@link #getError(T2Reference) getError} but in
+	 * asynchronous mode, returning immediately and using the supplied callback
+	 * to communicate its results.
+	 * 
+	 * @param id
+	 *            a {@link T2Reference} identifying an {@link ErrorDocument} to
+	 *            retrieve
+	 * @param callback
+	 *            a {@link ErrorDocumentServiceCallback} used to convey the
+	 *            results of the asynchronous call
+	 * @throws ErrorDocumentServiceException
+	 *             if the reference set service is not correctly configured.
+	 *             Exceptions encountered when performing the asynchronous call
+	 *             are not returned here, for obvious reasons, and are instead
+	 *             messaged through the callback interface.
+	 */
+	void getErrorAsynch(T2Reference id, ErrorDocumentServiceCallback callback)
+			throws ErrorDocumentServiceException;
+
+	/**
+	 * Return the T2Reference for the sole child of an error document
+	 * identifier.
+	 */
+	T2Reference getChild(T2Reference errorId)
+			throws ErrorDocumentServiceException;
+
+	@Transactional(propagation = Propagation.SUPPORTS, readOnly = false)
+	boolean delete(T2Reference reference) throws ReferenceServiceException;
+
+	/**
+	 * Delete all {@link ErrorDocument}S used by the specific workflow run.
+	 */
+	@Transactional(propagation = Propagation.SUPPORTS, readOnly = false)
+	void deleteErrorDocumentsForWorkflowRun(String workflowRunId)
+			throws ReferenceServiceException;
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentServiceCallback.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentServiceCallback.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentServiceCallback.java
new file mode 100644
index 0000000..5e55672
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentServiceCallback.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+/**
+ * Callback interface used by asynchronous methods in the
+ * {@link ErrorDocumentService} interface
+ * 
+ * @author Tom Oinn
+ */
+public interface ErrorDocumentServiceCallback {
+	/**
+	 * Called when the requested {@link ReferenceSet} has been successfully
+	 * retrieved.
+	 * 
+	 * @param errorDoc
+	 *            the ErrorDocument requested
+	 */
+	void errorRetrieved(ErrorDocument errorDoc);
+
+	/**
+	 * Called if the retrieval failed for some reason
+	 * 
+	 * @param cause
+	 *            an ErrorDocumentServiceException explaining the retrieval
+	 *            failure
+	 */
+	void errorRetrievalFailed(ErrorDocumentServiceException cause);
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentServiceException.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentServiceException.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentServiceException.java
new file mode 100644
index 0000000..3959c6a
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ErrorDocumentServiceException.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+/**
+ * RuntimeException subclass thrown by the error document service layer
+ * interfaces. All underlying exceptions are either handled by the service layer
+ * or wrapped in this exception (or a subclass) and rethrown.
+ * 
+ * @author Tom Oinn
+ */
+public class ErrorDocumentServiceException extends RuntimeException {
+	private static final long serialVersionUID = 5556399589785258956L;
+
+	public ErrorDocumentServiceException() {
+		super();
+	}
+
+	public ErrorDocumentServiceException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+	public ErrorDocumentServiceException(String message) {
+		super(message);
+	}
+
+	public ErrorDocumentServiceException(Throwable cause) {
+		super(cause);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceBuilderSPI.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceBuilderSPI.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceBuilderSPI.java
new file mode 100644
index 0000000..2dfb340
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceBuilderSPI.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+import java.io.InputStream;
+
+/**
+ * Constructs an ExternalReferenceSPI instance from a byte stream. Used by the
+ * {@link ReferenceSetAugmentor} when there isn't a direct reference to
+ * reference translation path available for a desired target type, but available
+ * for external use wherever this functionality is needed.
+ * <p>
+ * Where an underlying resource is required this is extracted from the supplied
+ * ReferenceContext, this implies that all methods in implementations of this
+ * interface should be thread safe, allowing multiple concurrent threads
+ * cleanly. For SPI purposes implementations should be java beans with default
+ * constructors.
+ * 
+ * @author Tom Oinn
+ */
+public interface ExternalReferenceBuilderSPI<TargetType extends ExternalReferenceSPI> {
+	/**
+	 * Given a stream of bytes, build the appropriate target
+	 * ExternalReferenceSPI implementation which would de-reference to the value
+	 * of that stream and return it.
+	 * 
+	 * @param byteStream
+	 *            the bytestream to read target from.
+	 * @param context
+	 *            a reference resolution context, needed potentially to
+	 *            construct the new ExternalReferenceSchemeSPI, especially in
+	 *            cases where the context contains security agents giving access
+	 *            to a remote data staging system *
+	 * @throws ExternalReferenceConstructionException
+	 *             if an error occurs instantiating the new reference.
+	 * @return the newly constructed ExternalReferenceSPI instance.
+	 */
+	TargetType createReference(InputStream byteStream, ReferenceContext context);
+
+	/**
+	 * Expose the type of the ExternalReferenceSPI that this builder can
+	 * construct
+	 * 
+	 * @return the class of ExternalReferenceSPI returned by the create
+	 *         reference methods.
+	 */
+	Class<TargetType> getReferenceType();
+
+	/**
+	 * Because the reference builder may rely on facilities provided to it
+	 * through the context this method is available to check whether these
+	 * facilities are sufficient.
+	 * 
+	 * @param context
+	 *            the reference context that will be used to construct new
+	 *            references
+	 * @return whether the context contains necessary resources for the
+	 *         reference construction process
+	 */
+	boolean isEnabled(ReferenceContext context);
+
+	/**
+	 * Return an approximate complexity cost of the reference construction. In
+	 * general we can't make any guarantees about this because the complexity of
+	 * the construction depends on more than just the type involved - it can
+	 * depend on local configuration, network location relative to the data
+	 * stores referenced and in some cases on the data themselves. For now
+	 * though we assign an approximation, the default value is 1.0f and lower
+	 * values represent less costly operations.
+	 */
+	float getConstructionCost();
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceConstructionException.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceConstructionException.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceConstructionException.java
new file mode 100644
index 0000000..0892ecc
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceConstructionException.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+/**
+ * Thrown when an exception occurs during construction of an
+ * ExternalReferenceSPI instance. This includes construction through direct
+ * method invocation, through the ExternalReferenceBuilderSPI interface and
+ * through the ExternalReferenceTranslatorSPI interface.
+ * 
+ * @author Tom Oinn
+ */
+public class ExternalReferenceConstructionException extends RuntimeException {
+	private static final long serialVersionUID = 8334725795238353354L;
+
+	public ExternalReferenceConstructionException() {
+		super();
+	}
+
+	public ExternalReferenceConstructionException(String message) {
+		super(message);
+	}
+
+	public ExternalReferenceConstructionException(Throwable cause) {
+		super(cause);
+	}
+
+	public ExternalReferenceConstructionException(String message,
+			Throwable cause) {
+		super(message, cause);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceSPI.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceSPI.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceSPI.java
new file mode 100644
index 0000000..4d6a047
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceSPI.java
@@ -0,0 +1,132 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+import java.io.InputStream;
+
+/**
+ * A reference to a single piece of data. This may or may not be within the
+ * enactment infrastructure, it could refer to data held in a file, a URL, a
+ * grid storage system or anything of that nature. Ideally the data this
+ * reference points to should not change - we'd like to say 'must not change' at
+ * this point but this isn't always possible, implementations should aim to
+ * provide the appearance that data are immutable.
+ * <p>
+ * When used within the workflow engine implementations of this interface are
+ * always contained in a ReferenceSet instance.
+ * <p>
+ * Implementors of this interface are strongly advised to use the
+ * AbstractExternalReference superclass - this provides the necessary primary
+ * key information used by hibernate-based implementations of the reference
+ * manager. Technically we don't require it as it's possible that other backend
+ * stores may exist, but the core store used by T2 is based on hibernate so it's
+ * a very good idea to follow this! Basically if you don't your code won't work
+ * in the current system.
+ * <p>
+ * This interface is an SPI - while implementations are never constructed based
+ * on the SPI registry it is used to discover all implementing classes and
+ * automatically register their hibernate mapping files. Implementors should add
+ * their implementation class name to a
+ * META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceSPI file in
+ * the implementation artifact. For examples please refer to the
+ * t2reference-core-extensions module, this contains implementations of this
+ * interface for common basic reference types.
+ * <p>
+ * Note - if your implementation class has a complex hibernate mapping that uses
+ * components which are themselves mapped into the database (perfectly legal to
+ * do) then you must mark those components as instances of HibernateMappedEntity
+ * so their corresponding mapping and class definitions are loaded by the
+ * Hibernate backed reference set dao. If your implementation class uses inline
+ * compound keys or other component types where you reference another class but
+ * the other class is not mapped itself in hibernate you must instead make the
+ * component class an instance of HibernateComponentClass - a marker interface -
+ * for the same reason. Both of these are SPIs themselves, and require the
+ * appropriate entries to be added to their service metadata files in your
+ * extension jar.
+ * 
+ * @author Tom Oinn
+ */
+public interface ExternalReferenceSPI extends Cloneable {
+	/**
+	 * Determine, if possible, whether the data this reference refers to is
+	 * textual or binary in nature. If this determination is impossible, either
+	 * because the ExternalReference implementation does not know or because the
+	 * data is not accessible for some reason then this should return
+	 * ReferenceDataNature.UNKNOWN
+	 * 
+	 * @return the nature of the referenced data
+	 */
+	ReferencedDataNature getDataNature();
+
+	/**
+	 * For textual data return the character set that should be used to pull
+	 * data into a java String object. Callers must deal with a null return
+	 * value in the event of either unknown charset or unknown or binary data
+	 * types.
+	 * 
+	 * @return string character set, for example 'utf-8', or <code>null</code>
+	 *         if binary or unknown type.
+	 */
+	String getCharset();
+
+	/**
+	 * Open and return an InputStream to the data referenced using, if required,
+	 * any facilities within the supplied context.
+	 * 
+	 * @param context
+	 *            the ReferenceContext object used to obtain e.g. security
+	 *            agents or other facilities required when de-referencing this
+	 *            reference.
+	 * @return an InputStream providing access to the referenced data
+	 * @throws DereferenceException
+	 *             if the reference cannot be de-referenced. This may be because
+	 *             of problems with the context such as security failures, or it
+	 *             may be because the reference is inherently not possible to
+	 *             de-reference (as in the case of a non-serializable API
+	 *             consumer reference).
+	 */
+	InputStream openStream(ReferenceContext context)
+			throws DereferenceException;
+
+	/**
+	 * Approximate size of the stored data or -1 if we do not know.
+	 */
+	Long getApproximateSizeInBytes();
+
+	/**
+	 * Resolution cost is an informal guide to how costly the process of
+	 * de-referencing this reference would be. It's used when assessing which
+	 * out of a set of ExternalReferenceSPI implementations to use to get the
+	 * value of the reference(s), in particular when rendering to POJOs or when
+	 * translating throught the de-reference / construct from stream route. As
+	 * this property is highly complex and potentially expensive in itself to
+	 * evaluate there's no requirement for it to be absolutely correct, it's
+	 * just used as a guide that, for example, it is easier to get bytes from a
+	 * file on the local disk than to get them from a resource held on a grid on
+	 * the other side of the planet.
+	 * 
+	 * @return a float representing some notion of resolution cost, lower values
+	 *         represent cheaper de-reference paths.
+	 */
+	float getResolutionCost();
+
+	ExternalReferenceSPI clone() throws CloneNotSupportedException;
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceTranslatorSPI.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceTranslatorSPI.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceTranslatorSPI.java
new file mode 100644
index 0000000..bc46dce
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceTranslatorSPI.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+/**
+ * Constructs an ExternalReference instance from an existing ExternalReference,
+ * most usually of a different type. Used by the {@link ReferenceSetAugmentor}.
+ * This SPI should not be used for cases where an ExternalReferenceSPI is
+ * constructed from a stream of bytes, this is intended for direct reference to
+ * reference translation with the assumption that this is more efficient for
+ * whatever reason. For cases where the reference is constructed from a byte
+ * stream you should implement {@link ExternalReferenceBuilder} instead.
+ * <p>
+ * For SPI purposes implementations should be java beans with default
+ * constructors, any required state such as the location of remote repositories
+ * to which data can be staged will be passed in in the ReferenceContext.
+ * 
+ * @author Tom Oinn
+ */
+public interface ExternalReferenceTranslatorSPI<SourceType extends ExternalReferenceSPI, TargetType extends ExternalReferenceSPI> {
+	/**
+	 * Given an existing ExternalReferenceSPI, build the appropriate target
+	 * ExternalReferenceSPI implementation and return it.
+	 * 
+	 * @param sourceReference
+	 *            the reference to be used as source for the translation.
+	 * @param context
+	 *            a reference resolution context, needed potentially to access
+	 *            the existing external references or to construct the new one,
+	 *            especially in cases where the context contains security agents
+	 *            giving access to a remote data staging system
+	 * @throws ExternalReferenceConstructionException
+	 *             if an error occurs instantiating the new reference.
+	 * @return the newly constructed ExternalReferenceSPI instance.
+	 */
+	TargetType createReference(SourceType sourceReference,
+			ReferenceContext context);
+
+	/**
+	 * Return the type of external reference that this translator consumes.
+	 * 
+	 * @return ExternalReferenceSPI class corresponding to the reference type
+	 *         used as a source by this translator.
+	 */
+	Class<SourceType> getSourceReferenceType();
+
+	/**
+	 * Return the type of external reference this translator constructs.
+	 * 
+	 * @return ExternalReferenceSPI class corresponding to the reference type
+	 *         emitted by this translator.
+	 */
+	Class<TargetType> getTargetReferenceType();
+
+	/**
+	 * Because the reference translator may rely on facilities provided to it
+	 * through the context this method is available to check whether these
+	 * facilities are sufficient.
+	 * 
+	 * @param context
+	 *            the reference context that will be used to construct new
+	 *            references during the translation process
+	 * @return whether the context contains necessary resources for the
+	 *         reference construction process
+	 */
+	boolean isEnabled(ReferenceContext context);
+
+	/**
+	 * Return an approximate complexity cost of the translation. In general we
+	 * can't make any guarantees about this because the complexity of the
+	 * translation depends on more than just the types involved - it can depend
+	 * on local configuration, network location relative to the data stores
+	 * referenced and in some cases on the data themselves. For now though we
+	 * assign an approximation, the default value is 1.0f and lower values
+	 * represent less costly operations.
+	 */
+	float getTranslationCost();
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceValidationException.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceValidationException.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceValidationException.java
new file mode 100644
index 0000000..c8b540d
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ExternalReferenceValidationException.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+/**
+ * Thrown by setter methods and constructors of ExternalReferenceSPI
+ * implementations when fed parameters which cause some kind of format or
+ * validation error. These might include badly formed URL or file paths or any
+ * other property that fails to validate against some reference type specific
+ * scheme.
+ * 
+ * @author Tom Oinn
+ */
+public class ExternalReferenceValidationException extends RuntimeException {
+	private static final long serialVersionUID = 3031393671457773057L;
+
+	public ExternalReferenceValidationException() {
+		//
+	}
+
+	public ExternalReferenceValidationException(String message) {
+		super(message);
+	}
+
+	public ExternalReferenceValidationException(Throwable cause) {
+		super(cause);
+	}
+
+	public ExternalReferenceValidationException(String message, Throwable cause) {
+		super(message, cause);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/Identified.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/Identified.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/Identified.java
new file mode 100644
index 0000000..8e9c5fd
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/Identified.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+/**
+ * Interface for any object that has an associated {@link T2Reference}
+ * 
+ * @author Tom Oinn
+ */
+public interface Identified {
+	/**
+	 * Return an appropriately configured instance of T2Reference for this
+	 * identified object.
+	 * 
+	 * @return the id of this object in the form of a T2Reference
+	 */
+	T2Reference getId();
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/IdentifiedList.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/IdentifiedList.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/IdentifiedList.java
new file mode 100644
index 0000000..032906f
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/IdentifiedList.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+import java.util.List;
+
+/**
+ * An identified list is a list which is identified by a T2Reference. Lists are
+ * immutable once named - if getId() returns a non null value all list methods
+ * modifying the underlying list data will throw {@link IllegalStateException}.
+ * In the reference management API this list sub-interface is used to represent
+ * both collections of identifiers (i.e. 'raw' stored lists) and more fully
+ * resolved structures where the types in the list can be reference sets, error
+ * documents and other lists of such. The {@link ListDao} interface uses only
+ * the 'raw' form consisting of flat lists of identifiers.
+ * <p>
+ * The IdentifiedList has a unique T2Reference associated with it. If this is
+ * null the contents of the list may be modified, otherwise all modification
+ * operations throw {@link IllegalStateException}. Lists in T2, once named, are
+ * immutable.
+ * 
+ * @author Tom Oinn
+ * 
+ * @param <T>
+ */
+public interface IdentifiedList<T> extends List<T>, Identified {
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ListDao.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ListDao.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ListDao.java
new file mode 100644
index 0000000..7e064be
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ListDao.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+import static org.springframework.transaction.annotation.Propagation.REQUIRED;
+import static org.springframework.transaction.annotation.Propagation.SUPPORTS;
+
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * Data access object handling NamedLists of T2Reference instances.
+ * 
+ * @author Tom Oinn
+ */
+public interface ListDao {
+	/**
+	 * Store a named and populated IdentifiedList of T2Reference to the
+	 * database.
+	 * 
+	 * @param theList
+	 *            list to store
+	 * @throws DaoException
+	 *             if any exception is thrown when connecting to the underlying
+	 *             store or when storing the list
+	 */
+	@Transactional(propagation = REQUIRED, readOnly = false)
+	void store(IdentifiedList<T2Reference> theList) throws DaoException;
+
+	/**
+	 * Retrieves a named and populated IdentifiedList of T2Reference from the
+	 * database by T2Reference
+	 * 
+	 * @param reference
+	 *            id of the list to retrieve
+	 * @return a previously stored list of T2References
+	 * @throws DaoException
+	 *             if any exception is thrown when connecting to the underlying
+	 *             data store or when attempting retrieval of the list
+	 */
+	@Transactional(propagation = SUPPORTS, readOnly = true)
+	IdentifiedList<T2Reference> get(T2Reference reference) throws DaoException;
+
+	@Transactional(propagation = SUPPORTS, readOnly = false)
+	boolean delete(IdentifiedList<T2Reference> theList) throws DaoException;
+
+	@Transactional(propagation = SUPPORTS, readOnly = false)
+	void deleteIdentifiedListsForWFRun(String workflowRunId)
+			throws DaoException;
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ListService.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ListService.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ListService.java
new file mode 100644
index 0000000..dae18af
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ListService.java
@@ -0,0 +1,144 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+import static org.springframework.transaction.annotation.Propagation.REQUIRED;
+import static org.springframework.transaction.annotation.Propagation.SUPPORTS;
+
+import java.util.List;
+
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * Provides facilities to register list of T2References, register empty lists at
+ * any given depth and to resolve appropriate T2Reference instances back to
+ * these lists. Registration operations assign names and lock the list contents
+ * as a result. This service operates strictly on T2References, it neither tries
+ * to nor is capable of any form of reference resolution, so aspects such as
+ * collection traversal are not handled here (these are performed by the top
+ * level reference service)
+ * 
+ * @author Tom Oinn
+ */
+@Transactional(propagation = SUPPORTS, readOnly = true)
+public interface ListService {
+	/**
+	 * Register a new list of T2References. The depth of the list will be
+	 * calculated based on the depth of the references within it - if these are
+	 * not uniform the list won't be created (all children of a list in T2 must
+	 * have the same depth as their siblings). Provided this constraint is
+	 * satisfied the list is named and stored in the backing store. The returned
+	 * list is at this point immutable, operations modifying it either directly
+	 * or through the ListIterator will fail with an IllegalStateException.
+	 * Implementations should copy the input list rather than keeping a
+	 * reference to it to preserve this property.
+	 * <p>
+	 * The created references will be related with a workflow run id passed
+	 * through ReferenceContext so we can track all data referenced by a
+	 * specific run.
+	 * 
+	 * @param items
+	 *            the T2Reference instances to store as a list.
+	 * @return a new IdentifiedList of T2Reference instances allocated with a
+	 *         T2Reference itself as the unique name and cached by the backing
+	 *         store.
+	 * @throws ListServiceException
+	 *             if there is a problem either with the specified list of
+	 *             references or with the storage subsystem.
+	 */
+	@Transactional(propagation = REQUIRED, readOnly = false)
+	IdentifiedList<T2Reference> registerList(List<T2Reference> items,
+			ReferenceContext context) throws ListServiceException;
+
+	/**
+	 * Register a new empty list with the specified depth. This is needed
+	 * because in the case of empty lists we can't calculate the depth from the
+	 * list items (what with there not being any!), but the depth property is
+	 * critical for the T2 iteration and collection management system in the
+	 * enactor - we need to know that this is an empty list that
+	 * <em>would have</em> contained lists, for example.
+	 * <p>
+	 * The created references will be related with a workflow run id passed
+	 * through ReferenceContext so we can track all data referenced by a
+	 * specific run.
+	 * 
+	 * @param depth
+	 *            the depth of the empty list, must be >=1
+	 * @return a new empty IdentifiedList allocated with a T2Reference itself as
+	 *         the unique name and cached by the backing store.
+	 * @throws ListServiceException
+	 *             if there is a problem with the storage subsystem or if called
+	 *             with an invalid depth argument
+	 */
+	@Transactional(propagation = REQUIRED, readOnly = false)
+	IdentifiedList<T2Reference> registerEmptyList(int depth,
+			ReferenceContext context) throws ListServiceException;
+
+	/**
+	 * Retrieve a previously named and registered list of T2Reference instances
+	 * identified by the specified T2Reference (which must be of type
+	 * T2ReferenceType.IdentifiedList)
+	 * 
+	 * @param id
+	 *            identifier of the list of reference to retrieve
+	 * @return an IdentifiedList of T2References. Note that because this list is
+	 *         named it is effectively immutable, if you want to modify the list
+	 *         you have to create and register a new list, you cannot modify the
+	 *         returned value of this directly. This is why there is no update
+	 *         method in the service or dao for reference lists.
+	 * @throws ListServiceException
+	 *             if anything goes wrong with the retrieval process or if there
+	 *             is something wrong with the reference (such as it being of
+	 *             the wrong reference type).
+	 */
+	IdentifiedList<T2Reference> getList(T2Reference id)
+			throws ListServiceException;
+
+	/**
+	 * Functionality the same as {@link #getList(T2Reference) getList} but in
+	 * asynchronous mode, returning immediately and using the supplied callback
+	 * to communicate its results.
+	 * 
+	 * @param id
+	 *            a {@link T2Reference} identifying an {@link IdentifiedList} to
+	 *            retrieve
+	 * @param callback
+	 *            a {@link ListServiceCallback} used to convey the results of
+	 *            the asynchronous call
+	 * @throws ListServiceException
+	 *             if the reference set service is not correctly configured.
+	 *             Exceptions encountered when performing the asynchronous call
+	 *             are not returned here, for obvious reasons, and are instead
+	 *             messaged through the callback interface.
+	 */
+	void getListAsynch(T2Reference id, ListServiceCallback callback)
+			throws ListServiceException;
+
+	@Transactional(propagation = SUPPORTS, readOnly = false)
+	boolean delete(T2Reference reference) throws ReferenceServiceException;
+
+	/**
+	 * Delete all {@link IdentifiedList}S used by the specific workflow run.
+	 */
+	@Transactional(propagation = SUPPORTS, readOnly = false)
+	void deleteIdentifiedListsForWorkflowRun(String workflowRunId)
+			throws ReferenceServiceException;
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ListServiceCallback.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ListServiceCallback.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ListServiceCallback.java
new file mode 100644
index 0000000..754caf6
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ListServiceCallback.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+/**
+ * Callback interface used by asynchronous methods in the
+ * {@link ListService} interface
+ * 
+ * @author Tom Oinn
+ */
+public interface ListServiceCallback {
+	/**
+	 * Called when the requested {@link ReferenceSet} has been successfully
+	 * retrieved.
+	 * 
+	 * @param references
+	 *            the ReferenceSet requested
+	 */
+	void listRetrieved(IdentifiedList<T2Reference> references);
+
+	/**
+	 * Called if the retrieval failed for some reason
+	 * 
+	 * @param cause
+	 *            a ListServiceException explaining the retrieval
+	 *            failure
+	 */
+	void listRetrievalFailed(ListServiceException cause);
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ListServiceException.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ListServiceException.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ListServiceException.java
new file mode 100644
index 0000000..01cdd82
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ListServiceException.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+/**
+ * Thrown by methods in the ListService interface if anything goes wrong with
+ * list registration or retrieval. Any underlying exceptions that can't be
+ * handled in the service layer are wrapped in this and re-thrown.
+ * 
+ * @author Tom Oinn
+ */
+public class ListServiceException extends RuntimeException {
+	private static final long serialVersionUID = 5049346991071587866L;
+
+	public ListServiceException() {
+		super();
+	}
+
+	public ListServiceException(String message) {
+		super(message);
+	}
+
+	public ListServiceException(Throwable cause) {
+		super(cause);
+	}
+
+	public ListServiceException(String message, Throwable cause) {
+		super(message, cause);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceContext.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceContext.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceContext.java
new file mode 100644
index 0000000..0ce2de3
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/ReferenceContext.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference;
+
+import java.util.List;
+
+/**
+ * Many operations over the reference manager require access to an appropriate
+ * context. The context contains hooks out to platform level facilities such as
+ * the security agent framework (when used in conjunction with the enactor).
+ * <p>
+ * This interface is also used to pass in resources required by the external
+ * reference translation and construction SPIs. An example might be a translator
+ * from File to URL could work by copying the source file to a web share of some
+ * kind, but obviously this can't happen unless properties such as the location
+ * of the web share folder are known. These properties tend to be properties of
+ * the installation rather than of the code, referring as they do to resources
+ * on the machine hosting the reference manager (and elsewhere).
+ * <p>
+ * Where entities in the context represent properties of the platform rather
+ * than the 'session' they are likely to be configured in a central location
+ * such as a Spring context definition, this interface is neutral to those
+ * concerns.
+ * 
+ * @author Tom Oinn
+ */
+public interface ReferenceContext {
+	/**
+	 * Return a list of all entities in the resolution context which match the
+	 * supplied entity type argument.
+	 * 
+	 * @param <T>
+	 *            The generic type of the returned entity list. In general the
+	 *            compiler is smart enough that you don't need to specify this,
+	 *            it can pick it up from the entityType parameter.
+	 * @param entityType
+	 *            Class of entity to return. Use Object.class to return all
+	 *            entities within the reference context
+	 * @return a list of entities from the reference context which can be cast
+	 *         to the specified type.
+	 */
+	<T extends Object> List<T> getEntities(Class<T> entityType);
+
+	/**
+	 * Add an entity to the context.
+	 */
+	void addEntity(Object entity);
+}


[54/54] incubator-taverna-engine git commit: org.apache.taverna.scufl2

Posted by st...@apache.org.
org.apache.taverna.scufl2


Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/commit/1eca6315
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/tree/1eca6315
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/diff/1eca6315

Branch: refs/heads/master
Commit: 1eca6315f88bfd19672114e3f3b574246a2994a5
Parents: b8bb0b6
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sat Feb 21 23:43:42 2015 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sat Feb 21 23:43:42 2015 +0000

----------------------------------------------------------------------
 .../src/main/resources/META-INF/spring/run-context-osgi.xml        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/1eca6315/taverna-run-impl/src/main/resources/META-INF/spring/run-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-run-impl/src/main/resources/META-INF/spring/run-context-osgi.xml b/taverna-run-impl/src/main/resources/META-INF/spring/run-context-osgi.xml
index 3b07748..739d06f 100644
--- a/taverna-run-impl/src/main/resources/META-INF/spring/run-context-osgi.xml
+++ b/taverna-run-impl/src/main/resources/META-INF/spring/run-context-osgi.xml
@@ -13,6 +13,6 @@
 
 	<reference id="eventAdmin" interface="org.osgi.service.event.EventAdmin" />
 
-	<reference id="workflowBundleIO" interface="uk.org.taverna.scufl2.api.io.WorkflowBundleIO" />
+	<reference id="workflowBundleIO" interface="org.apache.taverna.scufl2.api.io.WorkflowBundleIO" />
 
 </beans:beans>


[05/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/HibernateReferenceSetDao.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/HibernateReferenceSetDao.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/HibernateReferenceSetDao.java
new file mode 100644
index 0000000..06791a6
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/HibernateReferenceSetDao.java
@@ -0,0 +1,197 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import static net.sf.taverna.t2.reference.T2ReferenceType.ReferenceSet;
+
+import java.util.List;
+
+import net.sf.taverna.t2.reference.DaoException;
+import net.sf.taverna.t2.reference.ReferenceSet;
+import net.sf.taverna.t2.reference.ReferenceSetDao;
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.reference.annotations.DeleteIdentifiedOperation;
+import net.sf.taverna.t2.reference.annotations.GetIdentifiedOperation;
+import net.sf.taverna.t2.reference.annotations.PutIdentifiedOperation;
+
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
+
+/**
+ * An implementation of ReferenceSetDao based on Spring's HibernateDaoSupport.
+ * To use this in spring inject a property 'sessionFactory' with either a
+ * {@link org.springframework.orm.hibernate3.LocalSessionFactoryBean
+ * LocalSessionFactoryBean} or the equivalent class from the T2Platform module
+ * to add SPI based implementation discovery and mapping. To use outside of
+ * Spring ensure you call the setSessionFactory(..) method before using this
+ * (but really, use it from Spring, so much easier).
+ * 
+ * @author Tom Oinn
+ */
+public class HibernateReferenceSetDao extends HibernateDaoSupport implements
+		ReferenceSetDao {
+	private static final String GET_REFSETS_FOR_RUN = "FROM ReferenceSetImpl WHERE namespacePart = :workflow_run_id";
+
+	/**
+	 * Store the specified new reference set
+	 * 
+	 * @param rs
+	 *            a reference set, must not already exist in the database.
+	 * @throws DaoException
+	 *             if the entry already exists in the database, if the supplied
+	 *             reference set isn't an instance of ReferenceSetImpl or if
+	 *             something else goes wrong connecting to the database
+	 */
+	@Override
+	@PutIdentifiedOperation
+	public void store(ReferenceSet rs) throws DaoException {
+		if (rs.getId() == null)
+			throw new DaoException(
+					"Supplied reference set has a null ID, allocate "
+							+ "an ID before calling the store method in the dao.");
+		if (!rs.getId().getReferenceType().equals(ReferenceSet))
+			throw new DaoException(
+					"Strangely the reference set ID doesn't have type "
+							+ "T2ReferenceType.ReferenceSet, something has probably "
+							+ "gone badly wrong somewhere earlier!");
+		if (!(rs instanceof ReferenceSetImpl))
+			throw new DaoException(
+					"Supplied reference set not an instance of ReferenceSetImpl");
+
+		try {
+			getHibernateTemplate().save(rs);
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+
+	/**
+	 * Update a pre-existing entry in the database
+	 * 
+	 * @param rs
+	 *            the reference set to update. This must already exist in the
+	 *            database
+	 * @throws DaoException
+	 */
+	@Override
+	@PutIdentifiedOperation
+	public void update(ReferenceSet rs) throws DaoException {
+		if (rs.getId() == null)
+			throw new DaoException(
+					"Supplied reference set has a null ID, allocate "
+							+ "an ID before calling the store method in the dao.");
+		if (!rs.getId().getReferenceType().equals(ReferenceSet))
+			throw new DaoException(
+					"Strangely the reference set ID doesn't have type "
+							+ "T2ReferenceType.ReferenceSet, something has probably "
+							+ "gone badly wrong somewhere earlier!");
+		if (!(rs instanceof ReferenceSetImpl))
+			throw new DaoException(
+					"Supplied reference set not an instance of ReferenceSetImpl");
+
+		try {
+			getHibernateTemplate().update(rs);
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+
+	/**
+	 * Fetch a reference set by id
+	 * 
+	 * @param ref
+	 *            the ReferenceSetT2ReferenceImpl to fetch
+	 * @return a retrieved ReferenceSetImpl
+	 * @throws DaoException
+	 *             if the supplied reference is of the wrong type or if
+	 *             something goes wrong fetching the data or connecting to the
+	 *             database
+	 */
+	@Override
+	@GetIdentifiedOperation
+	public ReferenceSetImpl get(T2Reference ref) throws DaoException {
+		if (ref == null)
+			throw new DaoException(
+					"Supplied reference is null, can't retrieve.");
+		if (!ref.getReferenceType().equals(ReferenceSet))
+			throw new DaoException(
+					"This dao can only retrieve reference of type T2Reference.ReferenceSet");
+		if (!(ref instanceof T2ReferenceImpl))
+			throw new DaoException(
+					"Reference must be an instance of T2ReferenceImpl");
+
+		try {
+			return (ReferenceSetImpl) getHibernateTemplate().get(
+					ReferenceSetImpl.class,
+					((T2ReferenceImpl) ref).getCompactForm());
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+
+	@Override
+	@DeleteIdentifiedOperation
+	public boolean delete(ReferenceSet rs) throws DaoException {
+		if (rs.getId() == null)
+			throw new DaoException(
+					"Supplied reference set has a null ID, allocate "
+							+ "an ID before calling the store method in the dao.");
+		if (!rs.getId().getReferenceType().equals(ReferenceSet))
+			throw new DaoException(
+					"Strangely the reference set ID doesn't have type "
+							+ "T2ReferenceType.ReferenceSet, something has probably "
+							+ "gone badly wrong somewhere earlier!");
+		if (!(rs instanceof ReferenceSetImpl))
+			throw new DaoException(
+					"Supplied reference set not an instance of ReferenceSetImpl");
+
+		try {
+			getHibernateTemplate().delete(rs);
+			return true;
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+
+	@Override
+	@SuppressWarnings("unchecked")
+	@DeleteIdentifiedOperation
+	public synchronized void deleteReferenceSetsForWFRun(String workflowRunId)
+			throws DaoException {
+		try {
+			// Select all ReferenceSets for this wf run
+			Session session = getSession();
+			Query selectQuery = session
+					.createQuery(GET_REFSETS_FOR_RUN);
+			selectQuery.setString("workflow_run_id", workflowRunId);
+			List<ReferenceSet> referenceSets = selectQuery.list();
+			session.close();
+			/*
+			 * need to close before we do delete otherwise hibernate complains
+			 * that two sessions are accessing collection
+			 */
+			getHibernateTemplate().deleteAll(referenceSets);
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/IdentifiedArrayList.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/IdentifiedArrayList.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/IdentifiedArrayList.java
new file mode 100644
index 0000000..e1bbe5c
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/IdentifiedArrayList.java
@@ -0,0 +1,252 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+
+import net.sf.taverna.t2.reference.IdentifiedList;
+
+/**
+ * Implementation of IdentifiedList which delegates to an ArrayList for its
+ * storage functionality.
+ * 
+ * @author Tom Oinn
+ * 
+ * @param <T>
+ */
+public class IdentifiedArrayList<T> extends AbstractEntityImpl implements
+		IdentifiedList<T> {
+	protected List<T> listDelegate = null;
+
+	// Constructors copied from ArrayList for convenience
+	public IdentifiedArrayList() {
+		super();
+		this.listDelegate = new ArrayList<>();
+	}
+
+	public IdentifiedArrayList(Collection<T> c) {
+		super();
+		this.listDelegate = new ArrayList<>(c);
+	}
+
+	public IdentifiedArrayList(int initialCapacity) {
+		super();
+		this.listDelegate = new ArrayList<>(initialCapacity);
+	}
+
+	private void checkUndefinedId() {
+		if (this.getId() != null)
+			throw new IllegalStateException(
+					"Attempt made to modify a list which has already been named");
+	}
+
+	@Override
+	public boolean add(T e) {
+		checkUndefinedId();
+		return listDelegate.add(e);
+	}
+
+	@Override
+	public void add(int index, T element) {
+		checkUndefinedId();
+		listDelegate.add(index, element);
+	}
+
+	@Override
+	public boolean addAll(Collection<? extends T> c) {
+		checkUndefinedId();
+		return listDelegate.addAll(c);
+	}
+
+	@Override
+	public boolean addAll(int index, Collection<? extends T> c) {
+		checkUndefinedId();
+		return listDelegate.addAll(index, c);
+	}
+
+	@Override
+	public void clear() {
+		checkUndefinedId();
+		listDelegate.clear();
+	}
+
+	@Override
+	public boolean contains(Object o) {
+		return listDelegate.contains(o);
+	}
+
+	@Override
+	public boolean containsAll(Collection<?> c) {
+		return listDelegate.containsAll(c);
+	}
+
+	@Override
+	public T get(int index) {
+		return listDelegate.get(index);
+	}
+
+	@Override
+	public int indexOf(Object o) {
+		return listDelegate.indexOf(o);
+	}
+
+	@Override
+	public boolean isEmpty() {
+		return listDelegate.isEmpty();
+	}
+
+	@Override
+	public Iterator<T> iterator() {
+		return listDelegate.iterator();
+	}
+
+	@Override
+	public int lastIndexOf(Object o) {
+		return listDelegate.lastIndexOf(o);
+	}
+
+	/**
+	 * The ListIterator can modify the list contents, so wrap the delegate's
+	 * list iterator and use as a delegate itself, checking for null ID on
+	 * operations which set list properties.
+	 * 
+	 * @param iteratorDelegate
+	 *            ListIterator to wrap.
+	 * @return wrapped ListIterator which throws IllegalStateException on calls
+	 *         which modify the list if the ID has been set to a non-null value
+	 */
+	private ListIterator<T> getCheckedListIterator(
+			final ListIterator<T> iteratorDelegate) {
+		return new ListIterator<T>() {
+			@Override
+			public void add(T e) {
+				checkUndefinedId();
+				iteratorDelegate.add(e);
+			}
+
+			@Override
+			public boolean hasNext() {
+				return iteratorDelegate.hasNext();
+			}
+
+			@Override
+			public boolean hasPrevious() {
+				return iteratorDelegate.hasPrevious();
+			}
+
+			@Override
+			public T next() {
+				return iteratorDelegate.next();
+			}
+
+			@Override
+			public int nextIndex() {
+				return iteratorDelegate.nextIndex();
+			}
+
+			@Override
+			public T previous() {
+				return iteratorDelegate.previous();
+			}
+
+			@Override
+			public int previousIndex() {
+				return iteratorDelegate.previousIndex();
+			}
+
+			@Override
+			public void remove() {
+				checkUndefinedId();
+				iteratorDelegate.remove();
+			}
+
+			@Override
+			public void set(T e) {
+				checkUndefinedId();
+				iteratorDelegate.set(e);
+			}
+		};
+	}
+
+	@Override
+	public ListIterator<T> listIterator() {
+		return getCheckedListIterator(listDelegate.listIterator());
+	}
+
+	@Override
+	public ListIterator<T> listIterator(int index) {
+		return getCheckedListIterator(listDelegate.listIterator(index));
+	}
+
+	@Override
+	public boolean remove(Object o) {
+		checkUndefinedId();
+		return listDelegate.remove(o);
+	}
+
+	@Override
+	public T remove(int index) {
+		checkUndefinedId();
+		return listDelegate.remove(index);
+	}
+
+	@Override
+	public boolean removeAll(Collection<?> c) {
+		checkUndefinedId();
+		return listDelegate.removeAll(c);
+	}
+
+	@Override
+	public boolean retainAll(Collection<?> c) {
+		checkUndefinedId();
+		return listDelegate.retainAll(c);
+	}
+
+	@Override
+	public T set(int index, T element) {
+		checkUndefinedId();
+		return listDelegate.set(index, element);
+	}
+
+	@Override
+	public int size() {
+		return listDelegate.size();
+	}
+
+	@Override
+	public List<T> subList(int fromIndex, int toIndex) {
+		return listDelegate.subList(fromIndex, toIndex);
+	}
+
+	@Override
+	public Object[] toArray() {
+		return listDelegate.toArray();
+	}
+
+	@Override
+	public <U> U[] toArray(U[] a) {
+		return listDelegate.toArray(a);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/InMemoryErrorDocumentDao.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/InMemoryErrorDocumentDao.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/InMemoryErrorDocumentDao.java
new file mode 100644
index 0000000..cb431d6
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/InMemoryErrorDocumentDao.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import net.sf.taverna.t2.reference.DaoException;
+import net.sf.taverna.t2.reference.ErrorDocument;
+import net.sf.taverna.t2.reference.ErrorDocumentDao;
+import net.sf.taverna.t2.reference.T2Reference;
+
+/**
+ * A trivial in-memory implementation of ErrorDocumentDao for either testing or
+ * very lightweight embedded systems. Uses a java Map as the backing store.
+ * 
+ * @author Tom Oinn
+ */
+public class InMemoryErrorDocumentDao implements ErrorDocumentDao {
+	private Map<T2Reference, ErrorDocument> store;
+
+	public InMemoryErrorDocumentDao() {
+		this.store = new ConcurrentHashMap<>();
+	}
+
+	@Override
+	public synchronized ErrorDocument get(T2Reference reference)
+			throws DaoException {
+		return store.get(reference);
+	}
+
+	@Override
+	public synchronized void store(ErrorDocument theDoc) throws DaoException {
+		store.put(theDoc.getId(), theDoc);
+	}
+
+	@Override
+	public synchronized boolean delete(ErrorDocument theDoc)
+			throws DaoException {
+		return store.remove(theDoc.getId()) != null;
+	}
+
+	@Override
+	public synchronized void deleteErrorDocumentsForWFRun(String workflowRunId)
+			throws DaoException {
+		for (T2Reference reference : store.keySet())
+			if (reference.getNamespacePart().equals(workflowRunId))
+				store.remove(reference);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/InMemoryListDao.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/InMemoryListDao.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/InMemoryListDao.java
new file mode 100644
index 0000000..112bf80
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/InMemoryListDao.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import net.sf.taverna.t2.reference.DaoException;
+import net.sf.taverna.t2.reference.IdentifiedList;
+import net.sf.taverna.t2.reference.ListDao;
+import net.sf.taverna.t2.reference.T2Reference;
+
+/**
+ * A trivial in-memory implementation of ListDao for either testing or very
+ * lightweight embedded systems. Uses a java Map as the backing store.
+ * 
+ * @author Tom Oinn
+ */
+public class InMemoryListDao implements ListDao {
+	private Map<T2Reference, IdentifiedList<T2Reference>> store;
+
+	public InMemoryListDao() {
+		this.store = new ConcurrentHashMap<>();
+	}
+
+	@Override
+	public synchronized IdentifiedList<T2Reference> get(T2Reference reference)
+			throws DaoException {
+		return store.get(reference);
+	}
+
+	@Override
+	public synchronized void store(IdentifiedList<T2Reference> theList)
+			throws DaoException {
+		store.put(theList.getId(), theList);
+	}
+
+	@Override
+	public boolean delete(IdentifiedList<T2Reference> theList)
+			throws DaoException {
+		return (store.remove(theList.getId()) != null);
+	}
+
+	@Override
+	public synchronized void deleteIdentifiedListsForWFRun(String workflowRunId)
+			throws DaoException {
+		for (T2Reference reference : store.keySet())
+			if (reference.getNamespacePart().equals(workflowRunId))
+				store.remove(reference);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/InMemoryReferenceSetDao.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/InMemoryReferenceSetDao.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/InMemoryReferenceSetDao.java
new file mode 100644
index 0000000..6d00337
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/InMemoryReferenceSetDao.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import net.sf.taverna.t2.reference.DaoException;
+import net.sf.taverna.t2.reference.ReferenceSet;
+import net.sf.taverna.t2.reference.ReferenceSetDao;
+import net.sf.taverna.t2.reference.T2Reference;
+
+/**
+ * A trivial in-memory implementation of ReferenceSetDao for either testing or
+ * very lightweight embedded systems. Uses a java Map as the backing store.
+ * 
+ * @author Tom Oinn
+ */
+public class InMemoryReferenceSetDao implements ReferenceSetDao {
+	private Map<T2Reference, ReferenceSet> store;
+
+	public InMemoryReferenceSetDao() {
+		this.store = new ConcurrentHashMap<>();
+	}
+
+	@Override
+	public synchronized ReferenceSet get(T2Reference reference)
+			throws DaoException {
+		return store.get(reference);
+	}
+
+	@Override
+	public synchronized void store(ReferenceSet refSet) throws DaoException {
+		store.put(refSet.getId(), refSet);
+	}
+
+	@Override
+	public synchronized void update(ReferenceSet refSet) throws DaoException {
+		store.put(refSet.getId(), refSet);
+	}
+
+	@Override
+	public synchronized boolean delete(ReferenceSet refSet) throws DaoException {
+		return store.remove(refSet.getId()) != null;
+	}
+
+	@Override
+	public synchronized void deleteReferenceSetsForWFRun(String workflowRunId)
+			throws DaoException {
+		for (T2Reference reference : store.keySet())
+			if (reference.getNamespacePart().equals(workflowRunId))
+				store.remove(reference);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ListServiceImpl.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ListServiceImpl.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ListServiceImpl.java
new file mode 100644
index 0000000..76c219a
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ListServiceImpl.java
@@ -0,0 +1,136 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import static net.sf.taverna.t2.reference.impl.T2ReferenceImpl.getAsImpl;
+
+import java.util.List;
+
+import net.sf.taverna.t2.reference.DaoException;
+import net.sf.taverna.t2.reference.IdentifiedList;
+import net.sf.taverna.t2.reference.ListService;
+import net.sf.taverna.t2.reference.ListServiceException;
+import net.sf.taverna.t2.reference.ReferenceContext;
+import net.sf.taverna.t2.reference.ReferenceServiceException;
+import net.sf.taverna.t2.reference.T2Reference;
+
+/**
+ * Implementation of ListService, inject with an appropriate ListDao and
+ * T2ReferenceGenerator to enable.
+ * 
+ * @author Tom Oinn
+ */
+public class ListServiceImpl extends AbstractListServiceImpl implements
+		ListService {
+	@Override
+	public IdentifiedList<T2Reference> getList(T2Reference id)
+			throws ListServiceException {
+		checkDao();
+		try {
+			return listDao.get(id);
+		} catch (DaoException de) {
+			throw new ListServiceException(de);
+		}
+	}
+
+	@Override
+	public IdentifiedList<T2Reference> registerEmptyList(int depth,
+			ReferenceContext context) throws ListServiceException {
+		if (depth < 1)
+			throw new ListServiceException(
+					"Can't register empty lists of depth " + depth);
+		checkDao();
+		checkGenerator();
+		T2ReferenceImpl newReference = getAsImpl(t2ReferenceGenerator
+				.nextListReference(false, depth, context));
+		T2ReferenceListImpl newList = new T2ReferenceListImpl();
+		newList.setTypedId(newReference);
+		try {
+			listDao.store(newList);
+			return newList;
+		} catch (DaoException de) {
+			throw new ListServiceException(de);
+		}
+	}
+
+	@Override
+	public IdentifiedList<T2Reference> registerList(List<T2Reference> items,
+			ReferenceContext context) throws ListServiceException {
+		checkDao();
+		checkGenerator();
+		if (items.isEmpty())
+			throw new ListServiceException(
+					"Can't register an empty list with this method,"
+							+ " use the registerEmptyList instead");
+		/*
+		 * Track whether there are any items in the collection which are or
+		 * contain error documents.
+		 */
+		boolean containsErrors = false;
+		// Track depth, ensure that all items have the same depth, fail if not.
+		int depth = items.get(0).getDepth();
+		if (depth < 0)
+			throw new ListServiceException(
+					"Can't register list of depth less than 1, but first item "
+							+ items.get(0) + " has depth " + depth);
+		T2ReferenceListImpl newList = new T2ReferenceListImpl();
+		int counter = 0;
+		for (T2Reference ref : items) {
+			if (ref.getDepth() != depth)
+				throw new ListServiceException(
+						"Mismatched depths in list registration; reference at index '"
+								+ counter + "' has depth " + ref.getDepth()
+								+ " but all preceeding items have depth "
+								+ depth);
+			if (ref.containsErrors())
+				// The collection's reference contains errors if any child does
+				containsErrors = true;
+			newList.add(ref);
+			counter++;
+		}
+		try {
+			T2ReferenceImpl newReference = getAsImpl(t2ReferenceGenerator
+					.nextListReference(containsErrors, depth + 1, context));
+			newList.setTypedId(newReference);
+			listDao.store(newList);
+			return newList;
+		} catch (Throwable t) {
+			throw new ListServiceException(t);
+		}
+	}
+
+	@Override
+	public boolean delete(T2Reference reference)
+			throws ReferenceServiceException {
+		checkDao();
+		IdentifiedList<T2Reference> list = listDao.get(reference);
+		if (list == null)
+			return false;
+		return listDao.delete(list);
+	}
+
+	@Override
+	public void deleteIdentifiedListsForWorkflowRun(String workflowRunId)
+			throws ReferenceServiceException {
+		checkDao();
+		listDao.deleteIdentifiedListsForWFRun(workflowRunId);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ReferenceServiceImpl.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ReferenceServiceImpl.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ReferenceServiceImpl.java
new file mode 100644
index 0000000..6dc3df4
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ReferenceServiceImpl.java
@@ -0,0 +1,731 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import static java.lang.Float.MAX_VALUE;
+import static net.sf.taverna.t2.reference.T2ReferenceType.ErrorDocument;
+import static net.sf.taverna.t2.reference.T2ReferenceType.IdentifiedList;
+import static net.sf.taverna.t2.reference.T2ReferenceType.ReferenceSet;
+import static net.sf.taverna.t2.reference.impl.T2ReferenceImpl.getAsImpl;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import net.sf.taverna.t2.reference.ContextualizedT2Reference;
+import net.sf.taverna.t2.reference.ErrorDocument;
+import net.sf.taverna.t2.reference.ErrorDocumentServiceException;
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.Identified;
+import net.sf.taverna.t2.reference.IdentifiedList;
+import net.sf.taverna.t2.reference.ListServiceException;
+import net.sf.taverna.t2.reference.ReferenceContext;
+import net.sf.taverna.t2.reference.ReferenceService;
+import net.sf.taverna.t2.reference.ReferenceServiceException;
+import net.sf.taverna.t2.reference.ReferenceSet;
+import net.sf.taverna.t2.reference.ReferenceSetServiceException;
+import net.sf.taverna.t2.reference.StreamToValueConverterSPI;
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.reference.ValueCarryingExternalReference;
+import net.sf.taverna.t2.reference.ValueToReferenceConversionException;
+import net.sf.taverna.t2.reference.ValueToReferenceConverterSPI;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Implementation of ReferenceService, inject with ReferenceSetService,
+ * ErrorDocumentService and ListService to enable.
+ * 
+ * @author Tom Oinn
+ * @author Alan R Williams
+ * @author Stuart Owen
+ * @author Stian Soiland-Reyes
+ */
+public class ReferenceServiceImpl extends AbstractReferenceServiceImpl
+		implements ReferenceService {
+	private final Logger log = Logger.getLogger(ReferenceServiceImpl.class);
+
+	/**
+	 * The top level registration method is used to register either as yet
+	 * unregistered ErrorDocuments and ReferenceSets (if these are passed in and
+	 * already have an identifier this call does nothing) and arbitrarily nested
+	 * Lists of the same. In addition any ExternalReferenceSPI instances found
+	 * will be wrapped in a single item ReferenceSet and registered, and any
+	 * Throwables will be wrapped in an ErrorDocument and registered. Lists will
+	 * be converted to IdentifiedList&lt;T2Reference&gt; and registered if all
+	 * children can be (or were already) appropriately named.
+	 * <p>
+	 * This method is only valid on parameters of the following type :
+	 * <ol>
+	 * <li>{@link ReferenceSet} - registered if not already registered,
+	 * otherwise returns existing T2Reference</li>
+	 * <li>{@link ErrorDocument} - same behaviour as ReferenceSet</li>
+	 * <li>{@link ExternalReferenceSPI} - wrapped in ReferenceSet, registered
+	 * and ID returned</li>
+	 * <li>Throwable - wrapped in ErrorDocument with no message, registered and
+	 * ID returned</li>
+	 * <li>List - all children are first registered, if this succeeds the list
+	 * is itself registered as an IdentifiedList of T2Reference and its
+	 * reference returned.</li>
+	 * </ol>
+	 * The exception to this is if the useConvertorSPI parameter is set to true
+	 * - in this case any objects which do not match the above allowed list will
+	 * be run through any available ValueToReferenceConvertorSPI instances in
+	 * turn until one succeeds or all fail, which may result in the creation of
+	 * ExternalReferenceSPI instances. As these can be registered such objects
+	 * will not cause an exception to be thrown.
+	 * 
+	 * @param o
+	 *            the object to register with the reference system, must comply
+	 *            with and will be interpreted as shown in the type list above.
+	 * @param targetDepth
+	 *            the depth of the top level object supplied. This is needed
+	 *            when registering empty collections and error documents,
+	 *            whether as top level types or as members of a collection
+	 *            within the top level type. If registering a collection this is
+	 *            the collection depth, so a List of ReferenceSchemeSPI would be
+	 *            depth 1. Failing to specify this correctly will result in
+	 *            serious problems downstream so be careful! We can't catch all
+	 *            potential problems in this method (although some errors will
+	 *            be trapped).
+	 * @param useConverterSPI
+	 *            whether to attempt to use the ValueToReferenceConvertorSPI
+	 *            registry (if defined and available) to map arbitrary objects
+	 *            to ExternalReferenceSPI instances on the fly. The registry of
+	 *            converters is generally injected into the implementation of
+	 *            this service.
+	 * @param context
+	 *            ReferenceContext to use if required by component services,
+	 *            this is most likely to be used by the object to reference
+	 *            converters if engaged.
+	 *            <p>
+	 *            If the context is null a new empty reference context is
+	 *            inserted.
+	 * @return a T2Reference to the registered object
+	 * @throws ReferenceServiceException
+	 *             if the object type (or, for collections, the recursive type
+	 *             of its contents) is not in the allowed list or if a problem
+	 *             occurs during registration. Also thrown if attempting to use
+	 *             the converter SPI without an attached registry.
+	 */
+	@Override
+	public T2Reference register(Object o, int targetDepth,
+			boolean useConverterSPI, ReferenceContext context)
+			throws ReferenceServiceException {
+		checkServices();
+		if (context == null)
+			context = new EmptyReferenceContext();
+		if (useConverterSPI)
+			checkConverterRegistry();
+		return getNameForObject(o, targetDepth, useConverterSPI, context);
+	}
+
+	@SuppressWarnings("unchecked")
+	private T2Reference getNameForObject(Object o, int currentDepth,
+			boolean useConverterSPI, ReferenceContext context)
+			throws ReferenceServiceException {
+		if (currentDepth < 0)
+			throw new ReferenceServiceException("Cannot register at depth "
+					+ currentDepth + ": " + o);
+		/*
+		 * First check whether this is an Identified, and if so whether it
+		 * already has an ID. If this is the case then return it, we assume that
+		 * anything which has an identifier already allocated must have been
+		 * registered (this is implicit in the contract for the various
+		 * sub-services
+		 */
+		if (o instanceof Identified) {
+			Identified i = (Identified) o;
+			if (i.getId() != null)
+				return i.getId();
+		}
+		/*
+		 * Then check whether the item *is* a T2Reference, in which case we can
+		 * just return it (useful for when registering lists of existing
+		 * references)
+		 */
+		if (o instanceof T2Reference)
+			return (T2Reference) o;
+
+		if (o.getClass().isArray()) {
+			Class<?> elementType = o.getClass().getComponentType();
+			if (elementType.getCanonicalName().equals("char")) {
+				char[] cArray = (char[]) o;
+				List<Character> cList = new ArrayList<>();
+				for (char c : cArray)
+					cList.add(new Character(c));
+				o = cList;
+			} else if (elementType.getCanonicalName().equals("short")) {
+				short[] cArray = (short[]) o;
+				List<Short> cList = new ArrayList<>();
+				for (short c : cArray)
+					cList.add(new Short(c));
+				o = cList;
+			} else if (elementType.getCanonicalName().equals("int")) {
+				int[] cArray = (int[]) o;
+				List<Integer> cList = new ArrayList<>();
+				for (int c : cArray)
+					cList.add(new Integer(c));
+				o = cList;
+			} else if (elementType.getCanonicalName().equals("long")) {
+				long[] cArray = (long[]) o;
+				List<Long> cList = new ArrayList<>();
+				for (long c : cArray)
+					cList.add(new Long(c));
+				o = cList;
+			} else if (elementType.getCanonicalName().equals("float")) {
+				float[] cArray = (float[]) o;
+				List<Float> cList = new ArrayList<>();
+				for (float c : cArray)
+					cList.add(new Float(c));
+				o = cList;
+			} else if (elementType.getCanonicalName().equals("double")) {
+				double[] cArray = (double[]) o;
+				List<Double> cList = new ArrayList<>();
+				for (double c : cArray)
+					cList.add(new Double(c));
+				o = cList;
+			} else if (elementType.getCanonicalName().equals("boolean")) {
+				boolean[] cArray = (boolean[]) o;
+				List<Boolean> cList = new ArrayList<>();
+				for (boolean c : cArray)
+					cList.add(new Boolean(c));
+				o = cList;
+			} else if (!elementType.getCanonicalName().equals("byte")) {
+				// Covert arrays of objects
+				Object[] cArray = (Object[]) o;
+				List<Object> cList = new ArrayList<>();
+				for (Object c : cArray)
+					cList.add(c);
+				o = cList;
+			}
+		}
+
+		// If a Collection but not a List
+		if ((o instanceof Collection) && !(o instanceof List)) {
+			List<Object> cList = new ArrayList<>();
+			cList.addAll((Collection<Object>) o);
+			o = cList;
+		}
+		// Next check lists.
+		if (o instanceof List) {
+			if (currentDepth < 1)
+				throw new ReferenceServiceException(
+						"Cannot register list at depth " + currentDepth);
+			List<?> l = (List<?>) o;
+			/*
+			 * If the list is empty then register a new empty list of the
+			 * appropriate depth and return it
+			 */
+			if (l.isEmpty())
+				try {
+					return listService.registerEmptyList(currentDepth, context)
+							.getId();
+				} catch (ListServiceException lse) {
+					throw new ReferenceServiceException(lse);
+				}
+			/*
+			 * Otherwise construct a new list of T2Reference and register it,
+			 * calling the getNameForObject method on all children of the list
+			 * to construct the list of references
+			 */
+			else {
+				List<T2Reference> references = new ArrayList<>();
+				for (Object item : l)
+					/*
+					 * Recursively call this method with a depth one lower than
+					 * the current depth
+					 */
+					references.add(getNameForObject(item, currentDepth - 1,
+							useConverterSPI, context));
+				try {
+					return listService.registerList(references, context)
+							.getId();
+				} catch (ListServiceException lse) {
+					throw new ReferenceServiceException(lse);
+				}
+			}
+		} else {
+			/*
+			 * Neither a list nor an already identified object, first thing is
+			 * to engage the converters if enabled. Only engage if we don't
+			 * already have a Throwable or an ExternalReferenceSPI instance
+			 */
+			if (useConverterSPI && (o instanceof Throwable == false)
+					&& (o instanceof ExternalReferenceSPI == false)) {
+				if (currentDepth != 0)
+					throw new ReferenceServiceException(
+							"Cannot register object " + o + " at depth "
+									+ currentDepth);
+
+				for (ValueToReferenceConverterSPI converter : converters)
+					if (converter.canConvert(o, context))
+						try {
+							o = converter.convert(o, context);
+							break;
+						} catch (ValueToReferenceConversionException vtrce) {
+							/*
+							 * Fail, but that doesn't matter at the moment as
+							 * there may be more converters to try.
+							 * 
+							 * TODO - log this!
+							 */
+						}
+			}
+			/*
+			 * If the object is neither a Throwable nor an ExternalReferenceSPI
+			 * instance at this point we should fail the registration process,
+			 * this means either that the conversion process wasn't enabled or
+			 * that it failed to map the object type correctly.
+			 */
+			if (!(o instanceof Throwable)
+					&& !(o instanceof ExternalReferenceSPI))
+				throw new ReferenceServiceException(
+						"Failed to register object "
+								+ o
+								+ ", found a type '"
+								+ o.getClass().getCanonicalName()
+								+ "' which cannot currently be registered with the reference manager");
+
+			// Have either a Throwable or an ExternalReferenceSPI
+			if (o instanceof Throwable)
+				// Wrap in an ErrorDocument and return the ID
+				try {
+					ErrorDocument doc = errorDocumentService.registerError(
+							(Throwable) o, currentDepth, context);
+					return doc.getId();
+				} catch (ErrorDocumentServiceException edse) {
+					throw new ReferenceServiceException(edse);
+				}
+			if (o instanceof ExternalReferenceSPI) {
+				if (currentDepth != 0)
+					throw new ReferenceServiceException(
+							"Cannot register external references at depth "
+									+ currentDepth);
+				try {
+					Set<ExternalReferenceSPI> references = new HashSet<ExternalReferenceSPI>();
+					references.add((ExternalReferenceSPI) o);
+					ReferenceSet rs = referenceSetService.registerReferenceSet(
+							references, context);
+					return rs.getId();
+				} catch (ReferenceSetServiceException rsse) {
+					throw new ReferenceServiceException(rsse);
+				}
+			}
+		}
+		throw new ReferenceServiceException(
+				"Should never see this, reference registration"
+						+ " logic has fallen off the end of the"
+						+ " world, check the code!");
+	}
+
+	/**
+	 * Perform recursive identifier resolution, building a collection structure
+	 * of Identified objects, any collection elements being IdentifiedLists of
+	 * Identified subclasses. If the id has depth 0 this will just return the
+	 * Identified to which that id refers.
+	 * 
+	 * @param id
+	 *            the T2Reference to resolve
+	 * @param ensureTypes
+	 *            a set of ExternalReferenceSPI classes, this is used to augment
+	 *            any resolved ReferenceSet instances to ensure that each one
+	 *            has at least one of the specified types. If augmentation is
+	 *            not required this can be set to null.
+	 * @param context
+	 *            the ReferenceContext to use to resolve this and any
+	 *            recursively resolved identifiers
+	 *            <p>
+	 *            If the context is null a new EmptyReferenceContext is inserted
+	 *            in its place.
+	 * @return fully resolved Identified subclass - this is either a (recursive)
+	 *         IdentifiedList of Identified, a ReferenceSet or an ErrorDocument
+	 * @throws ReferenceServiceException
+	 *             if any problems occur during resolution
+	 */
+	@Override
+	public Identified resolveIdentifier(T2Reference id,
+			Set<Class<ExternalReferenceSPI>> ensureTypes,
+			ReferenceContext context) throws ReferenceServiceException {
+		checkServices();
+		if (context == null)
+			context = new EmptyReferenceContext();
+		switch (id.getReferenceType()) {
+		case ReferenceSet:
+			try {
+				ReferenceSet rs;
+				if (ensureTypes == null)
+					rs = referenceSetService.getReferenceSet(id);
+				else
+					rs = referenceSetService.getReferenceSetWithAugmentation(
+							id, ensureTypes, context);
+				if (rs == null)
+					throw new ReferenceServiceException(
+							"Could not find ReferenceSet " + id);
+				return rs;
+			} catch (ReferenceSetServiceException rsse) {
+				throw new ReferenceServiceException(rsse);
+			}
+
+		case ErrorDocument:
+			try {
+				ErrorDocument ed = errorDocumentService.getError(id);
+				if (ed == null)
+					throw new ReferenceServiceException(
+							"Could not find ErrorDocument " + id);
+				return ed;
+			} catch (ErrorDocumentServiceException edse) {
+				throw new ReferenceServiceException(edse);
+			}
+
+		case IdentifiedList:
+			try {
+				IdentifiedList<T2Reference> idList = listService.getList(id);
+				if (idList == null)
+					throw new ReferenceServiceException(
+							"Could not find IdentifiedList " + id);
+				/*
+				 * Construct a new list, and populate with the result of
+				 * resolving each ID in turn
+				 */
+				IdentifiedArrayList<Identified> newList = new IdentifiedArrayList<>();
+				for (T2Reference item : idList)
+					newList.add(resolveIdentifier(item, ensureTypes, context));
+				newList.setTypedId(getAsImpl(id));
+				return newList;
+			} catch (ListServiceException lse) {
+				throw new ReferenceServiceException(lse);
+			}
+
+		default:
+			throw new ReferenceServiceException("Unsupported ID type : "
+					+ id.getReferenceType());
+		}
+	}
+
+	@Override
+	public Object renderIdentifier(T2Reference id, Class<?> leafClass,
+			ReferenceContext context) throws ReferenceServiceException {
+		// Check we have the services installed
+		checkServices();
+
+		// Insert an empty context if context was null
+		if (context == null)
+			context = new EmptyReferenceContext();
+		// Reject if the source reference contains errors
+		if (id.containsErrors())
+			throw new ReferenceServiceException(
+					"Can't render an identifier which contains errors to a POJO");
+
+		/*
+		 * Attempt to find an appropriate StreamToValueConverterSPI instance to
+		 * build the specified class
+		 */
+		StreamToValueConverterSPI<?> converter = null;
+		if (valueBuilders != null)
+			for (StreamToValueConverterSPI<?> stvc : valueBuilders) {
+				Class<?> builtClass = stvc.getPojoClass();
+				if (leafClass.isAssignableFrom(builtClass)) {
+					converter = stvc;
+					break;
+				}
+			}
+		if (converter == null)
+			log.warn("No stream->value converters found for type '"
+					+ leafClass.getCanonicalName() + "'");
+
+		// Render the identifier
+		return renderIdentifierInner(id, leafClass, context, converter);
+	}
+
+	private Object renderIdentifierInner(T2Reference id, Class<?> leafClass,
+			ReferenceContext context, StreamToValueConverterSPI<?> converter)
+			throws ReferenceServiceException {
+		checkServices();
+
+		switch (id.getReferenceType()) {
+		case IdentifiedList:
+			try {
+				IdentifiedList<T2Reference> idList = listService.getList(id);
+				if (idList == null)
+					throw new ReferenceServiceException(
+							"Could not find IdentifiedList " + id);
+				List<Object> result = new ArrayList<>();
+				for (T2Reference child : idList)
+					result.add(renderIdentifierInner(child, leafClass, context,
+							converter));
+				return result;
+			} catch (ListServiceException lse) {
+				throw new ReferenceServiceException(lse);
+			}
+
+		case ReferenceSet:
+			try {
+				ReferenceSet rs = referenceSetService.getReferenceSet(id);
+				if (rs == null)
+					throw new ReferenceServiceException(
+							"Could not find ReferenceSet " + id);
+				// Check that there are references in the set
+				if (rs.getExternalReferences().isEmpty())
+					throw new ReferenceServiceException(
+							"Can't render an empty reference set to a POJO");
+				/*
+				 * If we can't directly map to an appropriate value keep track
+				 * of the cheapest reference from which to try to build the pojo
+				 * from a stream
+				 */
+				ExternalReferenceSPI cheapestReference = null;
+				float cheapestReferenceCost = MAX_VALUE;
+				for (ExternalReferenceSPI ers : rs.getExternalReferences()) {
+					if (ers instanceof ValueCarryingExternalReference<?>) {
+						ValueCarryingExternalReference<?> vcer = (ValueCarryingExternalReference<?>) ers;
+						if (leafClass.isAssignableFrom(vcer.getValueType()))
+							return vcer.getValue();
+					}
+					// Got here so this wasn't an appropriate value type
+					if (cheapestReference == null
+							|| ers.getResolutionCost() < cheapestReferenceCost) {
+						cheapestReference = ers;
+						cheapestReferenceCost = ers.getResolutionCost();
+					}
+				}
+				if (converter != null && cheapestReference != null)
+					try (InputStream stream = cheapestReference
+							.openStream(context)) {
+						return converter.renderFrom(stream,
+								cheapestReference.getDataNature(),
+								cheapestReference.getCharset());
+					}
+			} catch (Exception e) {
+				throw new ReferenceServiceException(e);
+			}
+			throw new ReferenceServiceException(
+					"No converter found, and reference set didn't contain"
+							+ " an appropriate value carrying reference, cannot render to POJO");
+
+		default:
+			throw new ReferenceServiceException("Unsupported ID type : "
+					+ id.getReferenceType());
+		}
+	}
+
+	/**
+	 * Initiates a traversal of the specified t2reference, traversing to
+	 * whatever level of depth is required such that all identifiers returned
+	 * within the iterator have the specified depth. The context (i.e. the index
+	 * path from the originally specified reference to each reference within the
+	 * iteration) is included through use of the ContextualizedT2Reference
+	 * wrapper class
+	 * 
+	 * @param source
+	 *            the T2Reference from which to traverse. In general this is the
+	 *            root of a collection structure.
+	 * @param desiredDepth
+	 *            the desired depth of all returned T2References, must be less
+	 *            than or equal to that of the source reference.
+	 * @throws ReferenceServiceException
+	 *             if unable to create the iterator for some reason. Note that
+	 *             implementations are free to lazily perform the iteration so
+	 *             this method may succeed but the iterator produced can fail
+	 *             when used. If the iterator fails it will do so by throwing
+	 *             one of the underlying sub-service exceptions.
+	 */
+	@Override
+	public Iterator<ContextualizedT2Reference> traverseFrom(T2Reference source,
+			int desiredDepth) throws ReferenceServiceException {
+		checkServices();
+		if (desiredDepth < 0)
+			throw new ReferenceServiceException(
+					"Cannot traverse to a negative depth");
+		List<ContextualizedT2Reference> workingSet = new ArrayList<>();
+		workingSet.add(new ContextualizedT2ReferenceImpl(source, new int[0]));
+		int currentDepth = source.getDepth();
+		while (currentDepth > desiredDepth) {
+			List<ContextualizedT2Reference> newSet = new ArrayList<>();
+			for (ContextualizedT2Reference ci : workingSet) {
+				T2ReferenceImpl ref = (T2ReferenceImpl) ci.getReference();
+				switch (ref.getReferenceType()) {
+				case IdentifiedList:
+					try {
+						int position = 0;
+						for (T2Reference child : getListService().getList(ref))
+							newSet.add(new ContextualizedT2ReferenceImpl(child,
+									addIndex(ci.getIndex(), position++)));
+					} catch (ListServiceException lse) {
+						throw new ReferenceServiceException(lse);
+					}
+					break;
+				case ReferenceSet:
+					throw new ReferenceServiceException(
+							"Should never be trying to drill inside a data document identifier");
+				case ErrorDocument:
+					newSet.add(new ContextualizedT2ReferenceImpl(ref
+							.getDeeperErrorReference(), addIndex(ci.getIndex(),
+							0)));
+					break;
+				default:
+					throw new ReferenceServiceException(
+							"Fallen off end of case statement, unknown reference type!");
+				}
+			}
+			currentDepth--;
+			workingSet = newSet;
+		}
+		return workingSet.iterator();
+	}
+
+	/**
+	 * Append to an int[]
+	 * 
+	 * @param current
+	 *            current int[]
+	 * @param head
+	 *            new int item to append to the current array
+	 * @return new array of int with the head added
+	 */
+	private static int[] addIndex(int[] current, int head) {
+		int[] result = new int[current.length + 1];
+		System.arraycopy(current, 0, result, 0, current.length);
+		result[current.length] = head;
+		return result;
+	}
+
+	/**
+	 * Parse the reference contained in the string and return a
+	 * {@link T2Reference} with the correct properties
+	 */
+	@Override
+	public T2Reference referenceFromString(String reference) {
+		T2ReferenceImpl newRef = new T2ReferenceImpl();
+		Map<String, String> parseRef = parseRef(reference);
+		newRef.setNamespacePart(parseRef.get("namespace"));
+		newRef.setLocalPart(parseRef.get("localPart"));
+		String type = parseRef.get("type");
+		if (type.equals("ref")) {
+			newRef.setReferenceType(ReferenceSet);
+		} else if (type.equals("list")) {
+			newRef.setReferenceType(IdentifiedList);
+			newRef.setContainsErrors(Boolean.parseBoolean(parseRef.get("error")));
+			newRef.setDepth(Integer.parseInt(parseRef.get("depth")));
+		} else if (type.equals("error")) {
+			newRef.setContainsErrors(true);
+			newRef.setReferenceType(ErrorDocument);
+			newRef.setDepth(Integer.parseInt(parseRef.get("depth")));
+		} else {
+			return null;
+			// should throw an error
+		}
+
+		return newRef;
+	}
+
+	/**
+	 * Parse the reference and return a map with localPart, namespace, depth,
+	 * contains errors and the type
+	 * 
+	 * @param ref
+	 * @return
+	 */
+	private Map<String, String> parseRef(String ref) {
+		String[] split = ref.split("\\?");
+		/*
+		 * get the bit before and after the final '/' ie. the local part and the
+		 * depth, there might not be a split1[1] since it might not be a list
+		 */
+		String[] split2 = split[1].split("/");
+		// get the t2:abc:// and the namespace
+		String[] split3 = split[0].split("//");
+		// get the t2 bit and the reference type bit
+		String[] split4 = split3[0].split(":");
+
+		Map<String, String> refPartsMap = new HashMap<String, String>();
+		refPartsMap.put("type", split4[1]);
+		refPartsMap.put("namespace", split3[1]);
+		refPartsMap.put("localPart", split2[0]);
+
+		if (refPartsMap.get("type").equals("list")) {
+			refPartsMap.put("error", split2[1]);
+			refPartsMap.put("depth", split2[2]);
+		}
+		if (refPartsMap.get("type").equals("error"))
+			refPartsMap.put("depth", split2[1]);
+
+		return refPartsMap;
+
+	}
+
+	@Override
+	public boolean delete(List<T2Reference> references)
+			throws ReferenceServiceException {
+		for (T2Reference reference : references)
+			delete(reference);
+		return true;
+	}
+
+	@Override
+	public boolean delete(T2Reference reference)
+			throws ReferenceServiceException {
+		switch (reference.getReferenceType()) {
+		case IdentifiedList:
+			return listService.delete(reference);
+		case ReferenceSet:
+			return referenceSetService.delete(reference);
+		case ErrorDocument:
+			return errorDocumentService.delete(reference);
+		default:
+			throw new ReferenceServiceException("Unknown reference type!");
+		}
+	}
+
+	@Override
+	public void deleteReferencesForWorkflowRun(String workflowRunId)
+			throws ReferenceServiceException {
+		String errorString = "";
+		try {
+			listService.deleteIdentifiedListsForWorkflowRun(workflowRunId);
+		} catch (ReferenceServiceException resex) {
+			errorString += "Failed to delete lists for workflow run: "
+					+ workflowRunId + ".";
+		}
+		try {
+			referenceSetService
+					.deleteReferenceSetsForWorkflowRun(workflowRunId);
+		} catch (ReferenceServiceException resex) {
+			errorString += "Failed to delete reference sets for workflow run: "
+					+ workflowRunId + ".";
+		}
+		try {
+			errorDocumentService
+					.deleteErrorDocumentsForWorkflowRun(workflowRunId);
+		} catch (ReferenceServiceException resex) {
+			errorString += "Failed to delete error documents for workflow run: "
+					+ workflowRunId + ".";
+		}
+		if (!errorString.equals(""))
+			throw new ReferenceServiceException(errorString);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ReferenceSetAugmentorImpl.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ReferenceSetAugmentorImpl.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ReferenceSetAugmentorImpl.java
new file mode 100644
index 0000000..33c586b
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ReferenceSetAugmentorImpl.java
@@ -0,0 +1,462 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.PriorityQueue;
+import java.util.Set;
+
+import net.sf.taverna.t2.reference.ExternalReferenceBuilderSPI;
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ExternalReferenceTranslatorSPI;
+import net.sf.taverna.t2.reference.ReferenceContext;
+import net.sf.taverna.t2.reference.ReferenceSet;
+import net.sf.taverna.t2.reference.ReferenceSetAugmentationException;
+import net.sf.taverna.t2.reference.ReferenceSetAugmentor;
+import net.sf.taverna.t2.reference.ReferenceSetAugmentorCallback;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Implementation of ReferenceSetAugmentor using Dijkstra's shortest path
+ * algorithm over a type graph built from SPI instance registries of reference
+ * builders and reference translators.
+ * 
+ * @author Tom Oinn
+ */
+public class ReferenceSetAugmentorImpl implements ReferenceSetAugmentor {
+	private final Logger log = Logger
+			.getLogger(ReferenceSetAugmentorImpl.class);
+
+	/**
+	 * A list of ExternalReferenceBuilderSPI instances used to construct
+	 * ExternalReferenceSPI instances from byte streams
+	 */
+	private List<ExternalReferenceBuilderSPI<?>> builders;
+
+	/**
+	 * A list of ExternalReferenceTranslatorSPI instances used to construct
+	 * ExternalReferenceSPI instances from existing ExternalReferenceSPI
+	 * instances.
+	 */
+	private List<ExternalReferenceTranslatorSPI<?, ?>> translators;
+
+	private boolean cacheValid = false;
+
+	private final Set<Class<ExternalReferenceSPI>> knownReferenceTypes = new HashSet<>();
+	@SuppressWarnings("rawtypes")
+	private final Map<Class<ExternalReferenceSPI>, Set<ExternalReferenceTranslatorSPI>> adjacencySets = new HashMap<>();
+	private final Map<Class<ExternalReferenceSPI>, ShortestPathSolver> solvers = new HashMap<>();
+
+	/**
+	 * Default constructor to make life easier when using Spring. To be
+	 * functional this implementation should be injected with InstanceRegistry
+	 * implementations containing lists of known implementations of the
+	 * ExternalReferenceBuilderSPI and ExternalReferenceTranslatorSPI
+	 * interfaces.
+	 */
+	public ReferenceSetAugmentorImpl() {
+		super();
+	}
+
+	public void buildersUpdated(Object service, Map<?, ?> properties) {
+		cacheValid = false;
+	}
+
+	public void translatorsUpdated(Object service, Map<?, ?> properties) {
+		cacheValid = false;
+	}
+
+	/**
+	 * Inject a list containing all known implementations of
+	 * ExternalReferenceBuilderSPI.
+	 * 
+	 * @throws IllegalStateException
+	 *             if this has already been set, the instance registries should
+	 *             only be set on bean construction.
+	 */
+	public synchronized void setBuilders(
+			List<ExternalReferenceBuilderSPI<?>> builders) {
+		if (this.builders != null) {
+			log.error("Builder registry already injected, invalid operation");
+			throw new IllegalStateException(
+					"Can't inject the external reference builder registry "
+							+ "multiple times.");
+		}
+
+		this.builders = builders;
+		if (log.isDebugEnabled()) {
+			log.debug("* Builders injected :");
+			int counter = 0;
+			for (ExternalReferenceBuilderSPI<?> builder : builders)
+				log.debug("*   " + (++counter) + ") "
+						+ builder.getClass().getSimpleName() + ", builds "
+						+ builder.getReferenceType().getSimpleName());
+		}
+		cacheValid = false;
+	}
+
+	/**
+	 * Inject a list containing all known implementations of
+	 * ExternalReferenceTranslatorSPI.
+	 * 
+	 * @throws IllegalStateException
+	 *             if this has already been set, the instance registries should
+	 *             only be set on bean construction.
+	 */
+	public synchronized void setTranslators(
+			List<ExternalReferenceTranslatorSPI<?, ?>> translators) {
+		if (this.translators == null) {
+			this.translators = translators;
+			if (log.isDebugEnabled()) {
+				log.debug("* Translators injected :");
+				int counter = 0;
+				for (ExternalReferenceTranslatorSPI<?, ?> translator : translators)
+					log.debug("*   "
+							+ (++counter)
+							+ ") "
+							+ translator.getClass().getSimpleName()
+							+ ", translates "
+							+ translator.getSourceReferenceType()
+									.getSimpleName()
+							+ " to "
+							+ translator.getTargetReferenceType()
+									.getSimpleName());
+			}
+			cacheValid = false;
+		} else {
+			log.error("Translator registry already injected, invalid operation");
+			throw new IllegalStateException(
+					"Can't inject the translator registry multiple times.");
+		}
+	}
+
+	@SuppressWarnings({ "unchecked", "rawtypes" })
+	protected synchronized final void update() {
+		if (builders == null || translators == null || cacheValid)
+			return;
+		log.debug("# Refreshing shortest path cache");
+		knownReferenceTypes.clear();
+		solvers.clear();
+		adjacencySets.clear();
+		for (ExternalReferenceBuilderSPI erb : builders)
+			knownReferenceTypes.add(erb.getReferenceType());
+		for (ExternalReferenceTranslatorSPI ert : translators) {
+			knownReferenceTypes.add(ert.getSourceReferenceType());
+			knownReferenceTypes.add(ert.getTargetReferenceType());
+			getNeighbours(ert.getTargetReferenceType()).add(ert);
+		}
+		for (Class<ExternalReferenceSPI> type : knownReferenceTypes)
+			try {
+				solvers.put(type, new ShortestPathSolver(type));
+			} catch (Throwable t) {
+				log.error(t);
+				if (t instanceof RuntimeException)
+					throw (RuntimeException) t;
+			}
+		log.debug("# Path cache refresh done");
+		cacheValid = true;
+	}
+
+	@SuppressWarnings("rawtypes")
+	Set<ExternalReferenceTranslatorSPI> getNeighbours(
+			Class<ExternalReferenceSPI> node) {
+		Set<ExternalReferenceTranslatorSPI> adjacentTo = adjacencySets
+				.get(node);
+		if (adjacentTo != null)
+			return adjacentTo;
+
+		HashSet<ExternalReferenceTranslatorSPI> neighbours = new HashSet<>();
+		adjacencySets.put(node, neighbours);
+		return neighbours;
+	}
+
+	@Override
+	public final Set<ExternalReferenceSPI> augmentReferenceSet(
+			ReferenceSet references,
+			Set<Class<ExternalReferenceSPI>> targetReferenceTypes,
+			ReferenceContext context) throws ReferenceSetAugmentationException {
+		synchronized (this) {
+			if (!cacheValid)
+				update();
+		}
+
+		// Synchronize on the reference set itself
+		synchronized (references) {
+			/*
+			 * First check whether we actually need to modify the reference set
+			 * at all - it's perfectly valid to call the augmentor when nothing
+			 * actually needs to be done (ideally you wouldn't do this, but it's
+			 * likely to happen)
+			 */
+			for (ExternalReferenceSPI er : references.getExternalReferences())
+				if (targetReferenceTypes.contains(er.getClass()))
+					return new HashSet<>();
+
+			// Need to perform augmentation if we reach this point
+			List<TranslationPath> candidatePaths = new ArrayList<>();
+			for (Class<ExternalReferenceSPI> target : targetReferenceTypes) {
+				ShortestPathSolver solver = solvers.get(target);
+				if (solver == null) {
+					solver = new ShortestPathSolver(target);
+					solvers.put(target, solver);
+				}
+				if (solver != null)
+					for (TranslationPath path : solver.getTranslationPaths()) {
+						for (ExternalReferenceSPI er : references
+								.getExternalReferences())
+							if (er.getClass().equals(path.getSourceType()))
+								candidatePaths.add(path);
+						for (TranslationPath dereferenceBasedPath : path
+								.getDereferenceBasedPaths(references))
+							candidatePaths.add(dereferenceBasedPath);
+					}
+			}
+			/*
+			 * Now add candidate paths to represent a no-translator 'direct from
+			 * byte stream source' path for each target type compatible
+			 * reference builder
+			 */
+			for (ExternalReferenceBuilderSPI<?> builder : builders)
+				if (targetReferenceTypes.contains(builder.getReferenceType()))
+					/*
+					 * The builder can construct one of the target types, add
+					 * paths for all possible pairs of 'de-reference existing
+					 * reference' and the builder
+					 */
+					for (ExternalReferenceSPI er : references
+							.getExternalReferences()) {
+						TranslationPath newPath = new TranslationPath();
+						newPath.setBuilders(builders);
+						newPath.setInitialBuilder(builder);
+						newPath.setSourceReference(er);
+						candidatePaths.add(newPath);
+					}
+
+			/*
+			 * Got a list of candidate paths sorted by estimated overall path
+			 * cost
+			 */
+			Collections.sort(candidatePaths);
+			if (log.isDebugEnabled()) {
+				log.debug("Found "
+						+ candidatePaths.size()
+						+ " contextual translation path(s) including builder based :");
+				int counter = 0;
+				for (TranslationPath path : candidatePaths)
+					log.debug("  " + (++counter) + ") " + path.toString());
+			}
+
+			if (candidatePaths.isEmpty()) {
+				log.warn("No candidate paths found for augmentation");
+				throw new ReferenceSetAugmentationException(
+						"No candidate translation paths were found");
+			}
+
+			log.debug("Performing augmentation :");
+			int counter = 0;
+			for (TranslationPath path : candidatePaths)
+				try {
+					counter++;
+					Set<ExternalReferenceSPI> newReferences = path
+							.doTranslation(references, context);
+					if (log.isDebugEnabled())
+						log.debug("  Success (" + counter + "), created "
+								+ printRefSet(newReferences));
+					return newReferences;
+				} catch (Exception ex) {
+					log.debug("  Failed (" + counter + ")");
+					log.trace(ex);
+					// Use next path...
+				}
+			log.warn("  No paths succeeded, augmentation failed");
+			throw new ReferenceSetAugmentationException(
+					"All paths threw exceptions, can't perform augmentation");
+		}
+	}
+
+	private String printRefSet(Set<ExternalReferenceSPI> set) {
+		StringBuilder sb = new StringBuilder("[");
+		String sep = "";
+		for (ExternalReferenceSPI ref : set) {
+			sb.append(sep).append(ref.toString());
+			sep = ",";
+		}
+		return sb.append("]").toString();
+	}
+
+	@Override
+	public final void augmentReferenceSetAsynch(final ReferenceSet references,
+			final Set<Class<ExternalReferenceSPI>> targetReferenceTypes,
+			final ReferenceContext context,
+			final ReferenceSetAugmentorCallback callback)
+			throws ReferenceSetAugmentationException {
+		Runnable r = new Runnable() {
+			@Override
+			public void run() {
+				try {
+					callback.augmentationCompleted(augmentReferenceSet(
+							references, targetReferenceTypes, context));
+				} catch (ReferenceSetAugmentationException rsae) {
+					callback.augmentationFailed(rsae);
+				}
+			}
+		};
+		executeRunnable(r);
+	}
+
+	/**
+	 * Schedule a runnable for execution - current naive implementation uses a
+	 * new thread and executes immediately, but this is where any thread pool
+	 * logic would go if we wanted to add that.
+	 * 
+	 * @param r
+	 */
+	private void executeRunnable(Runnable r) {
+		new Thread(r).start();
+	}
+
+	class ShortestPathSolver {
+		private Map<Class<ExternalReferenceSPI>, Class<ExternalReferenceSPI>> predecessors;
+		private Map<Class<ExternalReferenceSPI>, ExternalReferenceTranslatorSPI<?, ?>> translators;
+		private Map<Class<ExternalReferenceSPI>, Float> shortestDistances;
+		private final Comparator<Class<ExternalReferenceSPI>> shortestDistanceComparator = new Comparator<Class<ExternalReferenceSPI>>() {
+			@Override
+			public int compare(Class<ExternalReferenceSPI> left,
+					Class<ExternalReferenceSPI> right) {
+				float shortestDistanceLeft = shortestDistances.get(left);
+				float shortestDistanceRight = shortestDistances.get(right);
+				if (shortestDistanceLeft > shortestDistanceRight)
+					return +1;
+				if (shortestDistanceLeft < shortestDistanceRight)
+					return -1;
+				return left.getCanonicalName().compareTo(
+						right.getCanonicalName());
+			}
+		};
+		private final PriorityQueue<Class<ExternalReferenceSPI>> unsettledNodes = new PriorityQueue<>(
+				10, shortestDistanceComparator);
+		private final Set<Class<ExternalReferenceSPI>> settledNodes = new HashSet<>();
+
+		private final List<TranslationPath> translationPaths = new ArrayList<>();
+
+		public List<TranslationPath> getTranslationPaths() {
+			return this.translationPaths;
+		}
+
+		public ShortestPathSolver(Class<ExternalReferenceSPI> targetType) {
+			log.debug("# Constructing shortest paths to '"
+					+ targetType.getSimpleName() + "'");
+			predecessors = new HashMap<>();
+			translators = new HashMap<>();
+			shortestDistances = new HashMap<>();
+			setShortestDistance(targetType, 0.0f);
+			unsettledNodes.add(targetType);
+			while (!unsettledNodes.isEmpty()) {
+				Class<ExternalReferenceSPI> u = extractMin();
+				settledNodes.add(u);
+				relaxNeighbours(u);
+			}
+			for (Class<ExternalReferenceSPI> c : settledNodes)
+				if (!c.equals(targetType)) {
+					// Don't calculate a path to itself!
+					TranslationPath p = new TranslationPath();
+					p.setBuilders(builders);
+					Class<ExternalReferenceSPI> node = c;
+					while (predecessors.get(node) != null) {
+						p.pathSteps().add(translators.get(node));
+						// Recurse, should terminate at the target type
+						node = predecessors.get(node);
+					}
+					translationPaths.add(p);
+				}
+			Collections.sort(translationPaths);
+			if (translationPaths.isEmpty())
+				log.debug("#   no paths discovered, type not reachable through translation");
+			else if (log.isDebugEnabled()) {
+				log.debug("#   found " + translationPaths.size()
+						+ " distinct path(s) :");
+				int counter = 0;
+				for (TranslationPath path : translationPaths)
+					log.debug("#     " + (++counter) + ") " + path);
+			}
+		}
+
+		@SuppressWarnings({ "unchecked", "rawtypes" })
+		private void relaxNeighbours(Class<ExternalReferenceSPI> u) {
+			log.trace("#     relaxing node " + u.getSimpleName());
+			Set<Class<ExternalReferenceSPI>> alreadySeen = new HashSet<>();
+			for (ExternalReferenceTranslatorSPI ert : getNeighbours(u)) {
+				// all the translators that translate *to* u
+				Class<ExternalReferenceSPI> v = ert.getSourceReferenceType();
+				log.trace("#     translator found from from '" + v + "' : "
+						+ ert.getClass().getSimpleName());
+				if (!alreadySeen.contains(v) && !isSettled(v)) {
+					/*
+					 * Avoid duplicate edges, always take the first one where
+					 * such duplicates exist
+					 */
+					alreadySeen.add(v);
+					if (getShortestDistance(v) > getShortestDistance(u)
+							+ ert.getTranslationCost()) {
+						setShortestDistance(
+								v,
+								getShortestDistance(u)
+										+ ert.getTranslationCost());
+						setPredecessor(v, u, ert);
+						unsettledNodes.add(v);
+					}
+				}
+			}
+		}
+
+		private boolean isSettled(Class<ExternalReferenceSPI> node) {
+			return settledNodes.contains(node);
+		}
+
+		private void setShortestDistance(Class<ExternalReferenceSPI> node,
+				float distance) {
+			shortestDistances.put(node, distance);
+		}
+
+		private float getShortestDistance(Class<ExternalReferenceSPI> node) {
+			Float d = shortestDistances.get(node);
+			return (d == null) ? Float.MAX_VALUE : d;
+		}
+
+		private Class<ExternalReferenceSPI> extractMin() {
+			return unsettledNodes.poll();
+		}
+
+		private void setPredecessor(Class<ExternalReferenceSPI> child,
+				Class<ExternalReferenceSPI> parent,
+				ExternalReferenceTranslatorSPI<?, ?> translator) {
+			predecessors.put(child, parent);
+			translators.put(child, translator);
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ReferenceSetImpl.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ReferenceSetImpl.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ReferenceSetImpl.java
new file mode 100644
index 0000000..437cd1d
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ReferenceSetImpl.java
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import java.util.Set;
+
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ReferenceSet;
+import net.sf.taverna.t2.reference.h3.HibernateMappedEntity;
+
+/**
+ * An implementation of ReferenceSet with the additional methods and metadata
+ * required by Hibernate3 to allow it to be persisted in a relational store. As
+ * with everything else in this package you shouldn't be using this class
+ * directly! Instead of this class you should use the registration methods on
+ * {@link net.sf.taverna.t2.reference.ReferenceSetService}, implementations of
+ * that interface will handle the construction of ReferenceSet implementations
+ * (including this one).
+ * 
+ * @author Tom Oinn
+ */
+public class ReferenceSetImpl extends AbstractEntityImpl implements
+		ReferenceSet, HibernateMappedEntity {
+	private Set<ExternalReferenceSPI> externalReferences;
+	private Long approximateSizeInBytes = new Long(-1);
+	
+	/**
+	 * Construct a new ReferenceSetImpl with the given set of external
+	 * references and identifier.
+	 * 
+	 * @param references
+	 *            the set of ExternalReferenceSPI which this reference set
+	 *            should contain initially
+	 * @param id
+	 *            the T2Reference to use, must be an instance of
+	 *            ReferenceSetT2ReferenceImpl so hibernate can make use of it as
+	 *            a compound primary key component
+	 */
+	public ReferenceSetImpl(Set<ExternalReferenceSPI> references,
+			T2ReferenceImpl id) {
+		setTypedId(id);
+		this.externalReferences = references;
+		
+		//  Should be at least one - otherwise we cannot calculate the data size
+		if (externalReferences != null && externalReferences.size() > 0) {
+			// Just take the first ExternalReferenceSPI returned
+			ExternalReferenceSPI externalReferenceSPI = externalReferences
+					.toArray(new ExternalReferenceSPI[0])[0];
+			approximateSizeInBytes = externalReferenceSPI
+					.getApproximateSizeInBytes();
+		}
+	}
+
+	/**
+	 * Default constructor, used by Hibernate when reconstructing this bean from
+	 * the database. If you call this directly from your code you must then call
+	 * both {@link #setExternalReferences(Set)} and
+	 * {@link #setId(T2ReferenceImpl)} before any use of the reference set. If
+	 * you're not writing the reference manager implementation you shouldn't be
+	 * using this class anyway.
+	 */
+	public ReferenceSetImpl() {
+		//
+	}
+
+	/**
+	 * For debugging purposes, prints a summary of the contents and identifier
+	 * of this reference set.
+	 * 
+	 * @return human readable string representation of this object. This is not
+	 *         regarded as 'stable' and should not be parsed for any reason!
+	 */
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder();
+		sb.append(getId()).append(" [").append(externalReferences.size())
+				.append("]\n");
+		for (ExternalReferenceSPI ref : externalReferences)
+			sb.append("  ").append(ref).append("\n");
+		return sb.toString();
+
+	}
+
+	@Override
+	public Set<ExternalReferenceSPI> getExternalReferences() {
+		return externalReferences;
+	}
+
+	/**
+	 * This method is only ever called from within Hibernate, and is used to
+	 * initialize the set of external references.
+	 */
+	public void setExternalReferences(Set<ExternalReferenceSPI> newReferences) {
+		this.externalReferences = newReferences;
+	}
+
+	public void setApproximateSizeInBytes(Long sizeInBytes) {
+		this.approximateSizeInBytes = sizeInBytes;
+	}
+
+	@Override
+	public Long getApproximateSizeInBytes() {
+		return approximateSizeInBytes;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ReferenceSetServiceImpl.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ReferenceSetServiceImpl.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ReferenceSetServiceImpl.java
new file mode 100644
index 0000000..7f04709
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ReferenceSetServiceImpl.java
@@ -0,0 +1,153 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import static net.sf.taverna.t2.reference.impl.T2ReferenceImpl.getAsImpl;
+
+import java.net.URI;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.WeakHashMap;
+
+import net.sf.taverna.t2.reference.DaoException;
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ReferenceContext;
+import net.sf.taverna.t2.reference.ReferenceServiceException;
+import net.sf.taverna.t2.reference.ReferenceSet;
+import net.sf.taverna.t2.reference.ReferenceSetAugmentationException;
+import net.sf.taverna.t2.reference.ReferenceSetService;
+import net.sf.taverna.t2.reference.ReferenceSetServiceException;
+import net.sf.taverna.t2.reference.T2Reference;
+
+/**
+ * Implementation of ReferenceSetService, inject with an appropriate
+ * ReferenceSetDao to enable. Implements translation functionality as long as an
+ * appropriate ReferenceSetAugmentor implementation is injected.
+ * 
+ * @author Tom Oinn
+ */
+public class ReferenceSetServiceImpl extends AbstractReferenceSetServiceImpl
+		implements ReferenceSetService {
+	@Override
+	public ReferenceSet getReferenceSet(T2Reference id)
+			throws ReferenceSetServiceException {
+		checkDao();
+		try {
+			return referenceSetDao.get(id);
+		} catch (DaoException de) {
+			throw new ReferenceSetServiceException(de);
+		}
+	}
+
+	private Map<URI,Object> locks = new WeakHashMap<>();
+
+	private Object getLock(T2Reference id) {
+		URI uri = id.toUri();
+		synchronized (locks) {
+			Object lock = locks.get(uri);
+			if (lock == null) {
+				lock = new Object();
+				locks.put(uri, lock);
+			}
+			return lock;
+		}
+	}
+
+	@Override
+	public ReferenceSet getReferenceSetWithAugmentation(T2Reference id,
+			Set<Class<ExternalReferenceSPI>> ensureTypes,
+			ReferenceContext context) throws ReferenceSetServiceException {
+		checkDao();
+		checkAugmentor();
+		if (context == null)
+			context = new EmptyReferenceContext();
+		// Obtain the reference set
+
+		try {
+			/*
+			 * Synchronize on the reference set, should ensure that we don't
+			 * have multiple concurrent translations assuming that Hibernate
+			 * retrieves the same entity each time. Except we have to
+			 * synchronize on the reference, and in fact we have to synchronize
+			 * on the URI form.
+			 */
+			synchronized (getLock(id)) {
+				ReferenceSet rs = getReferenceSet(id);
+				Set<ExternalReferenceSPI> newReferences = referenceSetAugmentor
+						.augmentReferenceSet(rs, ensureTypes, context);
+				if (!newReferences.isEmpty()) {
+					/*
+					 * Write back changes to the store if we got here, this can
+					 * potentially throw an unsupported operation exception in
+					 * which case we have to fail the augmentation.
+					 */
+					try {
+						rs.getExternalReferences().addAll(newReferences);
+					} catch (RuntimeException re) {
+						throw new ReferenceSetAugmentationException(
+								"Can't add new references back into existing reference set instance");
+					}
+					referenceSetDao.update(rs);
+				}
+				return rs;
+			}
+		} catch (ReferenceSetAugmentationException rsae) {
+			throw new ReferenceSetServiceException(rsae);
+		}
+	}
+
+	@Override
+	public ReferenceSet registerReferenceSet(
+			Set<ExternalReferenceSPI> references, ReferenceContext context)
+			throws ReferenceSetServiceException {
+		checkDao();
+		checkGenerator();
+		
+		ReferenceSetImpl rsi = new ReferenceSetImpl(new HashSet<>(references),
+				getAsImpl(t2ReferenceGenerator
+						.nextReferenceSetReference(context)));
+
+		try {
+			referenceSetDao.store(rsi);
+			return rsi;
+		} catch (DaoException de) {
+			throw new ReferenceSetServiceException(de);
+		}
+	}
+
+	@Override
+	public boolean delete(T2Reference reference)
+			throws ReferenceServiceException {
+		checkDao();
+		ReferenceSet set = referenceSetDao.get(reference);
+		if (set == null)
+			return false;
+		return referenceSetDao.delete(set);
+	}
+
+	@Override
+	public void deleteReferenceSetsForWorkflowRun(String workflowRunId)
+			throws ReferenceServiceException {
+		checkDao();
+		referenceSetDao.deleteReferenceSetsForWFRun(workflowRunId);
+	}
+}


[38/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/resources/t2flow/iteration.t2flow
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/resources/t2flow/iteration.t2flow b/taverna-integration-tests/src/test/resources/t2flow/iteration.t2flow
new file mode 100644
index 0000000..bec4c2d
--- /dev/null
+++ b/taverna-integration-tests/src/test/resources/t2flow/iteration.t2flow
@@ -0,0 +1,474 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.2.0"><dataflow id="80c80b32-1faa-4c8e-9294-eb85d6aaa764" role="top"><name>Workflow13</name><inputPorts><port><name>in</name><depth>0</depth><granularDepth>0</granularDepth><annotations /></port></inputPorts><outputPorts><port><name>cross</name><annotations /></port><port><name>dot</name><annotations /></port><port><name>crossdot</name><annotations /></port><port><name>dotdot</name><annotations /></port><port><name>dotcross</name><annotations /></port></outputPorts><processors><processor><name>cross</name><inputPorts><port><name>in1</name><depth>0</depth></port><port><name>in2</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>beanshell-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.
 t2.activities.beanshell.BeanshellActivity</class><inputMap><map from="in2" to="in2" /><map from="in1" to="in1" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean xmlns="">
+  <script>out=in1 + in2;</script>
+  <dependencies />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in1</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in2</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>0</granularDepth>
+      <name>out</name>
+      <depth>0</depth>
+      <mimeTypes />
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in1" depth="0" /><port name="in2" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>ListGenerator1</name><inputPorts><port><name>in</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>1</depth><granularDepth>1</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>beanshell-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.beanshell.Beans
 hellActivity</class><inputMap><map from="in" to="in" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean xmlns="">
+  <script>out = new ArrayList();
+
+for (int i = 0; i &lt; 10; i++) {
+  out.add(in + ":" + i);
+}</script>
+  <dependencies />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>1</granularDepth>
+      <name>out</name>
+      <depth>1</depth>
+      <mimeTypes />
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>ListGenerator2</name><inputPorts><port><name>in</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>1</depth><granularDepth>1</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>beanshell-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.beanshell.BeanshellActivity</class><inputMap>
 <map from="in" to="in" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean xmlns="">
+  <script>out = new ArrayList();
+
+for (int i = 0; i &lt; 10; i++) {
+  out.add(in + ":" + i);
+}</script>
+  <dependencies />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>1</granularDepth>
+      <name>out</name>
+      <depth>1</depth>
+      <mimeTypes />
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>dot</name><inputPorts><port><name>in2</name><depth>0</depth></port><port><name>in1</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>beanshell-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.beanshell.
 BeanshellActivity</class><inputMap><map from="in2" to="in2" /><map from="in1" to="in1" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean xmlns="">
+  <script>out=in1 + in2;</script>
+  <dependencies />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in1</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in2</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>0</granularDepth>
+      <name>out</name>
+      <depth>0</depth>
+      <mimeTypes />
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><dot><port name="in2" depth="0" /><port name="in1" depth="0" /></dot></strategy></iteration></iterationStrategyStack></processor><processor><name>crossdot</name><inputPorts><port><name>in1</name><depth>0</depth></port><port><name>in2</name><depth>0</depth></port><port><name>in3</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>beanshell-activity</artifact>
 <version>1.2</version></raven><class>net.sf.taverna.t2.activities.beanshell.BeanshellActivity</class><inputMap><map from="in2" to="in2" /><map from="in1" to="in1" /><map from="in3" to="in3" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean xmlns="">
+  <script>out = in1 + in2 + in3;</script>
+  <dependencies />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in1</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in2</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in3</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>0</granularDepth>
+      <name>out</name>
+      <depth>0</depth>
+      <mimeTypes />
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in1" depth="0" /><port name="in2" depth="0" /><dot><port name="in3" depth="0" /></dot></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>dotcross</name><inputPorts><port><name>in1</name><depth>0</depth></port><port><name>in2</name><depth>0</depth></port><port><name>in3</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</g
 roup><artifact>beanshell-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.beanshell.BeanshellActivity</class><inputMap><map from="in2" to="in2" /><map from="in1" to="in1" /><map from="in3" to="in3" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean xmlns="">
+  <script>out = in1 + in2 + in3;</script>
+  <dependencies />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in1</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in2</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in3</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>0</granularDepth>
+      <name>out</name>
+      <depth>0</depth>
+      <mimeTypes />
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in3" depth="0" /><dot><port name="in2" depth="0" /><port name="in1" depth="0" /></dot></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>dotdot</name><inputPorts><port><name>in1</name><depth>0</depth></port><port><name>in2</name><depth>0</depth></port><port><name>in3</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</gro
 up><artifact>beanshell-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.beanshell.BeanshellActivity</class><inputMap><map from="in2" to="in2" /><map from="in1" to="in1" /><map from="in3" to="in3" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean xmlns="">
+  <script>out = in1 + in2 + in3;</script>
+  <dependencies />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in1</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in2</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in3</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>0</granularDepth>
+      <name>out</name>
+      <depth>0</depth>
+      <mimeTypes />
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><dot><port name="in1" depth="0" /><port name="in2" depth="0" /><dot><port name="in3" depth="0" /></dot></dot></strategy></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>cross</processor><port>in1</port></sink><source type="processor"><processor>ListGenerator1</processor><port>out</port></source></datalink><datalink><sink type="processor"><processor>cross</processor><port>in2</port></sink><source type="processor"><processor>ListGenerator2</processor><port>out</port>
 </source></datalink><datalink><sink type="processor"><processor>ListGenerator1</processor><port>in</port></sink><source type="dataflow"><port>in</port></source></datalink><datalink><sink type="processor"><processor>ListGenerator2</processor><port>in</port></sink><source type="dataflow"><port>in</port></source></datalink><datalink><sink type="processor"><processor>dot</processor><port>in2</port></sink><source type="processor"><processor>ListGenerator2</processor><port>out</port></source></datalink><datalink><sink type="processor"><processor>dot</processor><port>in1</port></sink><source type="processor"><processor>ListGenerator1</processor><port>out</port></source></datalink><datalink><sink type="processor"><processor>crossdot</processor><port>in1</port></sink><source type="processor"><processor>ListGenerator1</processor><port>out</port></source></datalink><datalink><sink type="processor"><processor>crossdot</processor><port>in2</port></sink><source type="processor"><processor>ListGen
 erator2</processor><port>out</port></source></datalink><datalink><sink type="processor"><processor>crossdot</processor><port>in3</port></sink><source type="dataflow"><port>in</port></source></datalink><datalink><sink type="processor"><processor>dotcross</processor><port>in1</port></sink><source type="processor"><processor>ListGenerator1</processor><port>out</port></source></datalink><datalink><sink type="processor"><processor>dotcross</processor><port>in2</port></sink><source type="processor"><processor>ListGenerator2</processor><port>out</port></source></datalink><datalink><sink type="processor"><processor>dotcross</processor><port>in3</port></sink><source type="dataflow"><port>in</port></source></datalink><datalink><sink type="processor"><processor>dotdot</processor><port>in1</port></sink><source type="processor"><processor>ListGenerator1</processor><port>out</port></source></datalink><datalink><sink type="processor"><processor>dotdot</processor><port>in2</port></sink><source type
 ="processor"><processor>ListGenerator2</processor><port>out</port></source></datalink><datalink><sink type="processor"><processor>dotdot</processor><port>in3</port></sink><source type="processor"><processor>ListGenerator2</processor><port>out</port></source></datalink><datalink><sink type="dataflow"><port>cross</port></sink><source type="processor"><processor>cross</processor><port>out</port></source></datalink><datalink><sink type="dataflow"><port>dot</port></sink><source type="processor"><processor>dot</processor><port>out</port></source></datalink><datalink><sink type="dataflow"><port>crossdot</port></sink><source type="processor"><processor>crossdot</processor><port>out</port></source></datalink><datalink><sink type="dataflow"><port>dotdot</port></sink><source type="processor"><processor>dotdot</processor><port>out</port></source></datalink><datalink><sink type="dataflow"><port>dotcross</port></sink><source type="processor"><processor>dotcross</processor><port>out</port></source
 ></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>ad638364-a6e0-4852-abca-9f609c9553d2</identification>
+      </annotationBean>
+      <date>2010-08-19 13:43:43.797 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>3fb7f0a7-26f8-43e1-a122-87a25889f57d</identification>
+      </annotationBean>
+      <date>2011-02-22 08:25:53.793 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>13c70169-dfaa-4ea6-b6ab-3551dae7fa84</identification>
+      </annotationBean>
+      <date>2010-08-19 12:28:57.881 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>af1f698b-820d-4b35-a92e-9091c90b493e</identification>
+      </annotationBean>
+      <date>2011-02-22 09:30:17.881 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>be50375c-4f68-44aa-8604-9a80d8d97570</identification>
+      </annotationBean>
+      <date>2011-02-22 09:03:28.97 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>eb6a550d-f34e-4de9-b0fc-1b3df8ab36c4</identification>
+      </annotationBean>
+      <date>2010-08-31 14:32:44.634 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>ac70d4c0-5db9-48b1-ba32-8e11fff8ae59</identification>
+      </annotationBean>
+      <date>2011-02-22 08:31:32.90 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>78cb1427-d57f-42c2-a385-1d20c1580f3b</identification>
+      </annotationBean>
+      <date>2010-08-31 14:36:00.297 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>3b7c0b9c-572d-466b-af6d-0fb40699e8a5</identification>
+      </annotationBean>
+      <date>2010-08-31 12:50:40.306 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>7a22acbb-2f0f-41dd-a526-d2a9b4e267c5</identification>
+      </annotationBean>
+      <date>2011-02-22 08:59:59.964 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>80c80b32-1faa-4c8e-9294-eb85d6aaa764</identification>
+      </annotationBean>
+      <date>2011-02-22 09:40:37.744 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>bc9c64da-9143-4811-a22e-657c92fcfe94</identification>
+      </annotationBean>
+      <date>2011-02-22 09:23:49.109 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>c072030e-b367-4885-a770-7d892672d979</identification>
+      </annotationBean>
+      <date>2011-02-22 09:31:03.727 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>7ef10e93-7376-41a9-9255-552149094142</identification>
+      </annotationBean>
+      <date>2010-08-31 13:06:57.536 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/resources/t2flow/localworker.t2flow
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/resources/t2flow/localworker.t2flow b/taverna-integration-tests/src/test/resources/t2flow/localworker.t2flow
new file mode 100644
index 0000000..b3b2053
--- /dev/null
+++ b/taverna-integration-tests/src/test/resources/t2flow/localworker.t2flow
@@ -0,0 +1,67 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.2.0"><dataflow id="5eebce20-72f5-4ac7-a4bf-8086d59d0c9e" role="top"><name>Workflow5</name><inputPorts><port><name>in</name><depth>0</depth><granularDepth>0</granularDepth><annotations /></port></inputPorts><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>Concatenate_two_strings</name><inputPorts><port><name>string2</name><depth>0</depth></port><port><name>string1</name><depth>0</depth></port></inputPorts><outputPorts><port><name>output</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivity</class><inputMap><map from="string2" to="string2" /><map from="string1" to="string1" /></inputMap><outputMap><map f
 rom="output" to="output" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <localworkerName>org.embl.ebi.escience.scuflworkers.java.StringConcat</localworkerName>
+  <script>output = string1 + string2;</script>
+  <dependencies />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>string1</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>string2</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>0</granularDepth>
+      <name>output</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="string2" depth="0" /><port name="string1" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>string1_value</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /
 ><outputMap><map from="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>Hello </value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>Concatenate_two_strings</processor><port>string2</port></sink><source type="dataflow"><port>in</port></source></datalink><datalink><sink type="processor"><processor>Concatenate_two_strings</processor><port>string1</port></sink><source type="processor"><processor>string1_value</processor><port>value</port></source></datalink><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>C
 oncatenate_two_strings</processor><port>output</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>5eebce20-72f5-4ac7-a4bf-8086d59d0c9e</identification>
+      </annotationBean>
+      <date>2011-02-21 13:44:43.621 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/resources/t2flow/rest.t2flow
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/resources/t2flow/rest.t2flow b/taverna-integration-tests/src/test/resources/t2flow/rest.t2flow
new file mode 100644
index 0000000..f3f90b8
--- /dev/null
+++ b/taverna-integration-tests/src/test/resources/t2flow/rest.t2flow
@@ -0,0 +1,154 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3.0"><dataflow id="8e36176a-2975-498b-93f7-f2beba774532" role="top"><name>Workflow11</name><inputPorts /><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>REST_Service</name><inputPorts><port><name>id</name><depth>0</depth></port></inputPorts><outputPorts><port><name>responseBody</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>rest-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.rest.RESTActivity</class><inputMap><map from="id" to="id" /></inputMap><outputMap><map from="responseBody" to="responseBody" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.rest.RESTActivityConfigurationBean xmlns="">
+  <httpMethod>GET</httpMethod>
+  <urlSignature>http://www.uniprot.org/uniprot/{id}.xml</urlSignature>
+  <acceptsHeaderValue>text/plain</acceptsHeaderValue>
+  <contentTypeForUpdates>application/xml</contentTypeForUpdates>
+  <outgoingDataFormat>String</outgoingDataFormat>
+  <sendHTTPExpectRequestHeader>false</sendHTTPExpectRequestHeader>
+  <showRedirectionOutputPort>false</showRedirectionOutputPort>
+  <escapeParameters>true</escapeParameters>
+  <otherHTTPHeaders />
+  <activityInputs>
+    <entry>
+      <string>id</string>
+      <java-class>java.lang.String</java-class>
+    </entry>
+  </activityInputs>
+</net.sf.taverna.t2.activities.rest.RESTActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="id" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>id_value</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" to="value" />
 </outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>P12345</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>REST_Service</processor><port>id</port></sink><source type="processor"><processor>id_value</processor><port>value</port></source></datalink><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>REST_Service</processor><port>responseBody</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xm
 lns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>30c58a3d-4037-4b92-b7d6-3aea761bdada</identification>
+      </annotationBean>
+      <date>2011-11-02 08:52:32.796 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>d090ff3c-c84d-461f-9027-ccd07fe0a352</identification>
+      </annotationBean>
+      <date>2011-11-02 10:09:35.558 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>1e2069a6-54c3-4e09-b639-c9bb27356eb9</identification>
+      </annotationBean>
+      <date>2011-11-02 09:59:38.235 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>f88604da-4047-4ab9-bd19-23cbbb8be88b</identification>
+      </annotationBean>
+      <date>2011-11-02 10:12:00.757 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>8e36176a-2975-498b-93f7-f2beba774532</identification>
+      </annotationBean>
+      <date>2012-02-10 15:56:15.960 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>b3887d66-e945-444d-820a-ddb5c1d6cecb</identification>
+      </annotationBean>
+      <date>2011-11-02 10:00:26.717 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>bbf68124-dbeb-482b-80c6-e461d264a98b</identification>
+      </annotationBean>
+      <date>2011-11-02 10:12:59.372 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>c2802c60-cc0e-4bc0-b401-473476811e46</identification>
+      </annotationBean>
+      <date>2011-11-02 10:02:16.255 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>d73137e0-8cfb-4536-849e-6d30b1b1f4dc</identification>
+      </annotationBean>
+      <date>2011-11-02 08:49:30.655 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>3f67a647-2d0e-4d7e-9937-5bde3d562fde</identification>
+      </annotationBean>
+      <date>2011-11-02 10:10:29.316 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>f76689f8-2629-4168-b0a6-e70c88acaca9</identification>
+      </annotationBean>
+      <date>2012-02-10 15:49:11.156 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/resources/t2flow/secure-basic-authentication-https.t2flow
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/resources/t2flow/secure-basic-authentication-https.t2flow b/taverna-integration-tests/src/test/resources/t2flow/secure-basic-authentication-https.t2flow
new file mode 100644
index 0000000..0cbff10
--- /dev/null
+++ b/taverna-integration-tests/src/test/resources/t2flow/secure-basic-authentication-https.t2flow
@@ -0,0 +1,74 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3-SNAPSHOT-20110621T1150"><dataflow id="12203b36-f878-45f7-a16e-863e1bbc81b8" role="top"><name>Workflow18</name><inputPorts /><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>Service_protected_with_Basic_AuthN_and_HTTPS</name><inputPorts /><outputPorts><port><name>responseBody</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>rest-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.rest.RESTActivity</class><inputMap /><outputMap><map from="responseBody" to="responseBody" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.rest.RESTActivityConfigurationBean xmlns="">
+  <httpMethod>GET</httpMethod>
+  <urlSignature>https://heater.cs.man.ac.uk:7443/examples-basic-authentication/taverna-test-page.html</urlSignature>
+  <acceptsHeaderValue>text/plain</acceptsHeaderValue>
+  <contentTypeForUpdates>application/xml</contentTypeForUpdates>
+  <outgoingDataFormat>String</outgoingDataFormat>
+  <sendHTTPExpectRequestHeader>false</sendHTTPExpectRequestHeader>
+  <showRedirectionOutputPort>false</showRedirectionOutputPort>
+  <escapeParameters>true</escapeParameters>
+  <otherHTTPHeaders />
+  <activityInputs />
+</net.sf.taverna.t2.activities.rest.RESTActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>Service_protected_with_Basic_AuthN_and_HTTPS</processor><port>responseBody</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>adb25995-c890-40c7-b091-2c2512024864</identification>
+      </annotationBean>
+      <date>2010-11-29 10:35:54.270 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>12203b36-f878-45f7-a16e-863e1bbc81b8</identification>
+      </annotationBean>
+      <date>2010-11-29 15:35:51.711 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>837b1710-ff29-4eef-85a0-51fc76139364</identification>
+      </annotationBean>
+      <date>2010-11-22 14:15:20.380 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>b7887959-6d6c-4466-8d15-16b4e20051db</identification>
+      </annotationBean>
+      <date>2010-11-22 14:16:43.484 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>388333c0-fd34-4571-ab0c-f67c10c2ed64</identification>
+      </annotationBean>
+      <date>2010-11-22 14:21:12.760 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/resources/t2flow/secure-basic-authentication.t2flow
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/resources/t2flow/secure-basic-authentication.t2flow b/taverna-integration-tests/src/test/resources/t2flow/secure-basic-authentication.t2flow
new file mode 100644
index 0000000..998b69a
--- /dev/null
+++ b/taverna-integration-tests/src/test/resources/t2flow/secure-basic-authentication.t2flow
@@ -0,0 +1,74 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3-SNAPSHOT-20110621T1150"><dataflow id="6eca35ba-d7d4-43d9-8593-93eba828cc46" role="top"><name>Workflow18</name><inputPorts /><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>Service_protected_with_Basic_AuthN</name><inputPorts /><outputPorts><port><name>responseBody</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>rest-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.rest.RESTActivity</class><inputMap /><outputMap><map from="responseBody" to="responseBody" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.rest.RESTActivityConfigurationBean xmlns="">
+  <httpMethod>GET</httpMethod>
+  <urlSignature>http://heater.cs.man.ac.uk:7070/examples-basic-authentication/taverna-test-page.html</urlSignature>
+  <acceptsHeaderValue>text/plain</acceptsHeaderValue>
+  <contentTypeForUpdates>application/xml</contentTypeForUpdates>
+  <outgoingDataFormat>String</outgoingDataFormat>
+  <sendHTTPExpectRequestHeader>false</sendHTTPExpectRequestHeader>
+  <showRedirectionOutputPort>false</showRedirectionOutputPort>
+  <escapeParameters>true</escapeParameters>
+  <otherHTTPHeaders />
+  <activityInputs />
+</net.sf.taverna.t2.activities.rest.RESTActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>Service_protected_with_Basic_AuthN</processor><port>responseBody</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>837b1710-ff29-4eef-85a0-51fc76139364</identification>
+      </annotationBean>
+      <date>2010-11-22 14:15:20.380 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>6eca35ba-d7d4-43d9-8593-93eba828cc46</identification>
+      </annotationBean>
+      <date>2010-11-29 10:41:02.602 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>adb25995-c890-40c7-b091-2c2512024864</identification>
+      </annotationBean>
+      <date>2010-11-29 10:35:54.270 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>b7887959-6d6c-4466-8d15-16b4e20051db</identification>
+      </annotationBean>
+      <date>2010-11-22 14:16:43.484 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>388333c0-fd34-4571-ab0c-f67c10c2ed64</identification>
+      </annotationBean>
+      <date>2010-11-22 14:21:12.760 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file


[52/54] incubator-taverna-engine git commit: org.apache.taverna.scufl2 imports

Posted by st...@apache.org.
org.apache.taverna.scufl2 imports


Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/commit/4ee7aa06
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/tree/4ee7aa06
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/diff/4ee7aa06

Branch: refs/heads/master
Commit: 4ee7aa069c234061bfd9e5a6e6fe1498bb94f073
Parents: 246a16e
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sat Feb 21 23:28:01 2015 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sat Feb 21 23:28:07 2015 +0000

----------------------------------------------------------------------
 .../__classPrefix__ConfigurationPanel.java      |  2 +-
 .../config/__classPrefix__ConfigureAction.java  |  2 +-
 .../__classPrefix__ServiceDesc.java             |  2 +-
 ...classPrefix__ActivityContextViewFactory.java |  2 +-
 .../ui/view/__classPrefix__ContextualView.java  |  2 +-
 .../capability/api/ActivityService.java         |  4 +-
 .../capability/api/ConfigurationException.java  |  4 +-
 .../activity/impl/ActivityServiceImpl.java      |  4 +-
 .../execution/api/AbstractExecution.java        | 14 ++---
 .../execution/api/AbstractExecutionService.java |  6 +--
 .../platform/execution/api/Execution.java       |  6 +--
 .../api/ExecutionEnvironmentService.java        |  2 +-
 .../execution/api/ExecutionService.java         |  6 +--
 .../execution/api/WorkflowCompiler.java         |  4 +-
 .../execution/api/AbstractExecutionTest.java    | 10 ++--
 .../impl/ExecutionEnvironmentServiceImpl.java   | 14 ++---
 .../execution/impl/local/LocalExecution.java    | 10 ++--
 .../impl/local/LocalExecutionService.java       |  6 +--
 .../impl/local/LocalProcessorReport.java        |  2 +-
 .../impl/local/WorkflowToDataflowMapper.java    | 56 ++++++++++----------
 .../impl/local/LocalExecutionTest.java          |  2 +-
 .../execution/impl/remote/RemoteExecution.java  | 10 ++--
 .../impl/remote/RemoteExecutionService.java     |  6 +--
 .../uk/org/taverna/platform/PlatformIT.java     |  4 +-
 .../java/uk/org/taverna/platform/RunIT.java     |  4 +-
 .../uk/org/taverna/platform/ActivityIT.java     |  2 +-
 .../org/taverna/platform/CommandLineToolIT.java |  8 +--
 .../uk/org/taverna/platform/ExecutionIT.java    |  8 +--
 .../org/taverna/platform/LocalExecutionIT.java  |  6 +--
 .../uk/org/taverna/platform/PlatformIT.java     | 22 ++++----
 .../java/uk/org/taverna/platform/RunIT.java     |  2 +-
 .../uk/org/taverna/platform/RunParallelIT.java  |  2 +-
 .../uk/org/taverna/platform/RunWorkflowsIT.java |  2 +-
 .../provtaverna/export/W3ProvenanceExport.java  | 16 +++---
 .../lineageservice/EventProcessor.java          |  2 +-
 .../taverna/platform/report/ActivityReport.java |  2 +-
 .../org/taverna/platform/report/Invocation.java |  2 +-
 .../platform/report/ProcessorReport.java        |  2 +-
 .../taverna/platform/report/StatusReport.java   |  4 +-
 .../taverna/platform/report/WorkflowReport.java |  2 +-
 .../platform/report/StatusReportTest.java       |  2 +-
 .../taverna/platform/run/api/RunProfile.java    | 10 ++--
 .../taverna/platform/run/api/RunService.java    |  6 +--
 .../platform/run/api/RunProfileTest.java        | 16 +++---
 .../uk/org/taverna/platform/run/impl/Run.java   |  8 +--
 .../platform/run/impl/RunServiceImpl.java       | 10 ++--
 .../platform/run/impl/WorkflowReportJSON.java   | 14 ++---
 .../platform/run/impl/DummyWorkflowReport.java  | 12 ++---
 .../org/taverna/platform/run/impl/RunTest.java  |  2 +-
 .../run/impl/WorkflowReportJSONTest.java        |  4 +-
 .../commons/services/ServiceRegistry.java       |  4 +-
 .../services/impl/ServiceRegistryImpl.java      |  4 +-
 52 files changed, 179 insertions(+), 179 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigurationPanel.java
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigurationPanel.java b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigurationPanel.java
index d92efb7..8f81c8d 100644
--- a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigurationPanel.java
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigurationPanel.java
@@ -13,7 +13,7 @@ import javax.swing.JTextField;
 import net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ActivityConfigurationPanel;
 
 import uk.org.taverna.commons.services.ServiceRegistry;
-import uk.org.taverna.scufl2.api.activity.Activity;
+import org.apache.taverna.scufl2.api.activity.Activity;
 
 @SuppressWarnings("serial")
 public class ${classPrefix}ConfigurationPanel extends ActivityConfigurationPanel {

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigureAction.java
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigureAction.java b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigureAction.java
index c7d5d10..0a68bcd 100644
--- a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigureAction.java
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigureAction.java
@@ -6,7 +6,7 @@ package ${package}.ui.config;
 import java.awt.event.ActionEvent;
 
 import uk.org.taverna.commons.services.ServiceRegistry;
-import uk.org.taverna.scufl2.api.activity.Activity;
+import org.apache.taverna.scufl2.api.activity.Activity;
 
 import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionRegistry;
 import net.sf.taverna.t2.workbench.activityicons.ActivityIconManager;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceDesc.java
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceDesc.java b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceDesc.java
index 5de7bc4..6724103 100644
--- a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceDesc.java
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceDesc.java
@@ -9,7 +9,7 @@ import java.util.List;
 
 import javax.swing.Icon;
 
-import uk.org.taverna.scufl2.api.configurations.Configuration;
+import org.apache.taverna.scufl2.api.configurations.Configuration;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
 

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ActivityContextViewFactory.java
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ActivityContextViewFactory.java b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ActivityContextViewFactory.java
index de87ef3..b4563bd 100644
--- a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ActivityContextViewFactory.java
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ActivityContextViewFactory.java
@@ -8,7 +8,7 @@ import java.util.Arrays;
 import java.util.List;
 
 import uk.org.taverna.commons.services.ServiceRegistry;
-import uk.org.taverna.scufl2.api.activity.Activity;
+import org.apache.taverna.scufl2.api.activity.Activity;
 
 import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionRegistry;
 import net.sf.taverna.t2.workbench.activityicons.ActivityIconManager;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ContextualView.java
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ContextualView.java b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ContextualView.java
index b7066a0..d970dc7 100644
--- a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ContextualView.java
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ContextualView.java
@@ -20,7 +20,7 @@ import net.sf.taverna.t2.workbench.edits.EditManager;
 import net.sf.taverna.t2.workbench.file.FileManager;
 import net.sf.taverna.t2.workbench.ui.actions.activity.ActivityContextualView;
 
-import uk.org.taverna.scufl2.api.activity.Activity;
+import org.apache.taverna.scufl2.api.activity.Activity;
 
 import ${package}.ui.config.${classPrefix}ConfigureAction;
 

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ActivityService.java
----------------------------------------------------------------------
diff --git a/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ActivityService.java b/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ActivityService.java
index 8fd1619..683ea0e 100644
--- a/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ActivityService.java
+++ b/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ActivityService.java
@@ -24,8 +24,8 @@ import java.net.URI;
 import java.util.Set;
 
 import net.sf.taverna.t2.workflowmodel.processor.activity.Activity;
-import uk.org.taverna.scufl2.api.port.InputActivityPort;
-import uk.org.taverna.scufl2.api.port.OutputActivityPort;
+import org.apache.taverna.scufl2.api.port.InputActivityPort;
+import org.apache.taverna.scufl2.api.port.OutputActivityPort;
 
 import com.fasterxml.jackson.databind.JsonNode;
 

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ConfigurationException.java
----------------------------------------------------------------------
diff --git a/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ConfigurationException.java b/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ConfigurationException.java
index be0e8a5..6abf43a 100644
--- a/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ConfigurationException.java
+++ b/taverna-capability-api/src/main/java/uk/org/taverna/platform/capability/api/ConfigurationException.java
@@ -21,9 +21,9 @@
 package uk.org.taverna.platform.capability.api;
 
 /**
- * Thrown when a {@link uk.org.taverna.scufl2.api.common.Configurable
+ * Thrown when a {@link org.apache.taverna.scufl2.api.common.Configurable
  * Configurable} cannot be configured by a
- * {@link uk.org.taverna.scufl2.api.configurations.Configuration Configuration}.
+ * {@link org.apache.taverna.scufl2.api.configurations.Configuration Configuration}.
  * 
  * @author David Withers
  */

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-capability-impl/src/main/java/uk/org/taverna/platform/capability/activity/impl/ActivityServiceImpl.java
----------------------------------------------------------------------
diff --git a/taverna-capability-impl/src/main/java/uk/org/taverna/platform/capability/activity/impl/ActivityServiceImpl.java b/taverna-capability-impl/src/main/java/uk/org/taverna/platform/capability/activity/impl/ActivityServiceImpl.java
index 91f910c..8a2f73e 100644
--- a/taverna-capability-impl/src/main/java/uk/org/taverna/platform/capability/activity/impl/ActivityServiceImpl.java
+++ b/taverna-capability-impl/src/main/java/uk/org/taverna/platform/capability/activity/impl/ActivityServiceImpl.java
@@ -32,8 +32,8 @@ import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityOutputPort;
 import uk.org.taverna.platform.capability.api.ActivityConfigurationException;
 import uk.org.taverna.platform.capability.api.ActivityNotFoundException;
 import uk.org.taverna.platform.capability.api.ActivityService;
-import uk.org.taverna.scufl2.api.port.InputActivityPort;
-import uk.org.taverna.scufl2.api.port.OutputActivityPort;
+import org.apache.taverna.scufl2.api.port.InputActivityPort;
+import org.apache.taverna.scufl2.api.port.OutputActivityPort;
 
 import com.fasterxml.jackson.databind.JsonNode;
 

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecution.java
----------------------------------------------------------------------
diff --git a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecution.java b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecution.java
index c3802ce..5b464ef 100644
--- a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecution.java
+++ b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecution.java
@@ -27,13 +27,13 @@ import org.purl.wf4ever.robundle.Bundle;
 import uk.org.taverna.platform.report.ActivityReport;
 import uk.org.taverna.platform.report.ProcessorReport;
 import uk.org.taverna.platform.report.WorkflowReport;
-import uk.org.taverna.scufl2.api.activity.Activity;
-import uk.org.taverna.scufl2.api.common.Scufl2Tools;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-import uk.org.taverna.scufl2.api.core.Processor;
-import uk.org.taverna.scufl2.api.core.Workflow;
-import uk.org.taverna.scufl2.api.profiles.ProcessorBinding;
-import uk.org.taverna.scufl2.api.profiles.Profile;
+import org.apache.taverna.scufl2.api.activity.Activity;
+import org.apache.taverna.scufl2.api.common.Scufl2Tools;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.core.Processor;
+import org.apache.taverna.scufl2.api.core.Workflow;
+import org.apache.taverna.scufl2.api.profiles.ProcessorBinding;
+import org.apache.taverna.scufl2.api.profiles.Profile;
 
 /**
  * Abstract implementation of an {@link Execution}.

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecutionService.java
----------------------------------------------------------------------
diff --git a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecutionService.java b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecutionService.java
index f9357df..d463795 100755
--- a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecutionService.java
+++ b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/AbstractExecutionService.java
@@ -27,9 +27,9 @@ import java.util.Map;
 import org.purl.wf4ever.robundle.Bundle;
 
 import uk.org.taverna.platform.report.WorkflowReport;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-import uk.org.taverna.scufl2.api.core.Workflow;
-import uk.org.taverna.scufl2.api.profiles.Profile;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.core.Workflow;
+import org.apache.taverna.scufl2.api.profiles.Profile;
 
 /**
  * A common super type for concrete implementations of <code>ExecutionService</code>s.

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/Execution.java
----------------------------------------------------------------------
diff --git a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/Execution.java b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/Execution.java
index 28a982d..8e2f03a 100644
--- a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/Execution.java
+++ b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/Execution.java
@@ -23,9 +23,9 @@ package uk.org.taverna.platform.execution.api;
 import org.purl.wf4ever.robundle.Bundle;
 
 import uk.org.taverna.platform.report.WorkflowReport;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-import uk.org.taverna.scufl2.api.core.Workflow;
-import uk.org.taverna.scufl2.api.profiles.Profile;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.core.Workflow;
+import org.apache.taverna.scufl2.api.profiles.Profile;
 
 /**
  * Interface for a single execution of a Taverna workflow.

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionEnvironmentService.java
----------------------------------------------------------------------
diff --git a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionEnvironmentService.java b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionEnvironmentService.java
index 5559069..9f0b5fd 100644
--- a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionEnvironmentService.java
+++ b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionEnvironmentService.java
@@ -22,7 +22,7 @@ package uk.org.taverna.platform.execution.api;
 
 import java.util.Set;
 
-import uk.org.taverna.scufl2.api.profiles.Profile;
+import org.apache.taverna.scufl2.api.profiles.Profile;
 
 /**
  * Service for finding <code>ExecutionEnvironment</code>s.

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionService.java
----------------------------------------------------------------------
diff --git a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionService.java b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionService.java
index 2ae7067..2b67788 100755
--- a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionService.java
+++ b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/ExecutionService.java
@@ -25,9 +25,9 @@ import java.util.Set;
 import org.purl.wf4ever.robundle.Bundle;
 
 import uk.org.taverna.platform.report.WorkflowReport;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-import uk.org.taverna.scufl2.api.core.Workflow;
-import uk.org.taverna.scufl2.api.profiles.Profile;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.core.Workflow;
+import org.apache.taverna.scufl2.api.profiles.Profile;
 
 /**
  * Service for executing Taverna workflows. There may be several <code>ExecutionService</code>s

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/WorkflowCompiler.java
----------------------------------------------------------------------
diff --git a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/WorkflowCompiler.java b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/WorkflowCompiler.java
index 70b8fcd..a183cd1 100644
--- a/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/WorkflowCompiler.java
+++ b/taverna-execution-api/src/main/java/uk/org/taverna/platform/execution/api/WorkflowCompiler.java
@@ -1,8 +1,8 @@
 package uk.org.taverna.platform.execution.api;
 
 import net.sf.taverna.t2.workflowmodel.Dataflow;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-import uk.org.taverna.scufl2.api.core.Workflow;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.core.Workflow;
 
 /**
  * A workflow compilation service converts a workflow (in a

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-execution-api/src/test/java/uk/org/taverna/platform/execution/api/AbstractExecutionTest.java
----------------------------------------------------------------------
diff --git a/taverna-execution-api/src/test/java/uk/org/taverna/platform/execution/api/AbstractExecutionTest.java b/taverna-execution-api/src/test/java/uk/org/taverna/platform/execution/api/AbstractExecutionTest.java
index 635527e..92f705b 100644
--- a/taverna-execution-api/src/test/java/uk/org/taverna/platform/execution/api/AbstractExecutionTest.java
+++ b/taverna-execution-api/src/test/java/uk/org/taverna/platform/execution/api/AbstractExecutionTest.java
@@ -32,11 +32,11 @@ import uk.org.taverna.databundle.DataBundles;
 import uk.org.taverna.platform.report.ActivityReport;
 import uk.org.taverna.platform.report.ProcessorReport;
 import uk.org.taverna.platform.report.WorkflowReport;
-import uk.org.taverna.scufl2.api.activity.Activity;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-import uk.org.taverna.scufl2.api.core.Processor;
-import uk.org.taverna.scufl2.api.core.Workflow;
-import uk.org.taverna.scufl2.api.profiles.Profile;
+import org.apache.taverna.scufl2.api.activity.Activity;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.core.Processor;
+import org.apache.taverna.scufl2.api.core.Workflow;
+import org.apache.taverna.scufl2.api.profiles.Profile;
 
 /**
  * @author David Withers

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-execution-impl/src/main/java/uk/org/taverna/platform/execution/impl/ExecutionEnvironmentServiceImpl.java
----------------------------------------------------------------------
diff --git a/taverna-execution-impl/src/main/java/uk/org/taverna/platform/execution/impl/ExecutionEnvironmentServiceImpl.java b/taverna-execution-impl/src/main/java/uk/org/taverna/platform/execution/impl/ExecutionEnvironmentServiceImpl.java
index 13eeec2..c05848f 100644
--- a/taverna-execution-impl/src/main/java/uk/org/taverna/platform/execution/impl/ExecutionEnvironmentServiceImpl.java
+++ b/taverna-execution-impl/src/main/java/uk/org/taverna/platform/execution/impl/ExecutionEnvironmentServiceImpl.java
@@ -33,13 +33,13 @@ import uk.org.taverna.platform.capability.api.DispatchLayerNotFoundException;
 import uk.org.taverna.platform.execution.api.ExecutionEnvironment;
 import uk.org.taverna.platform.execution.api.ExecutionEnvironmentService;
 import uk.org.taverna.platform.execution.api.ExecutionService;
-import uk.org.taverna.scufl2.api.activity.Activity;
-import uk.org.taverna.scufl2.api.common.NamedSet;
-import uk.org.taverna.scufl2.api.common.Scufl2Tools;
-import uk.org.taverna.scufl2.api.configurations.Configuration;
-import uk.org.taverna.scufl2.api.core.Processor;
-import uk.org.taverna.scufl2.api.profiles.ProcessorBinding;
-import uk.org.taverna.scufl2.api.profiles.Profile;
+import org.apache.taverna.scufl2.api.activity.Activity;
+import org.apache.taverna.scufl2.api.common.NamedSet;
+import org.apache.taverna.scufl2.api.common.Scufl2Tools;
+import org.apache.taverna.scufl2.api.configurations.Configuration;
+import org.apache.taverna.scufl2.api.core.Processor;
+import org.apache.taverna.scufl2.api.profiles.ProcessorBinding;
+import org.apache.taverna.scufl2.api.profiles.Profile;
 
 import com.fasterxml.jackson.databind.JsonNode;
 

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecution.java
----------------------------------------------------------------------
diff --git a/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecution.java b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecution.java
index e176d4d..e4786ca 100644
--- a/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecution.java
+++ b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecution.java
@@ -57,9 +57,9 @@ import uk.org.taverna.platform.execution.api.InvalidWorkflowException;
 import uk.org.taverna.platform.report.ActivityReport;
 import uk.org.taverna.platform.report.ProcessorReport;
 import uk.org.taverna.platform.report.WorkflowReport;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-import uk.org.taverna.scufl2.api.core.Workflow;
-import uk.org.taverna.scufl2.api.profiles.Profile;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.core.Workflow;
+import org.apache.taverna.scufl2.api.profiles.Profile;
 
 /**
  * An {@link uk.org.taverna.platform.execution.api.Execution Execution} for
@@ -192,13 +192,13 @@ public class LocalExecution extends AbstractExecution implements ResultListener
 
 	@Override
 	public ProcessorReport createProcessorReport(
-			uk.org.taverna.scufl2.api.core.Processor processor) {
+			org.apache.taverna.scufl2.api.core.Processor processor) {
 		return new LocalProcessorReport(processor);
 	}
 
 	@Override
 	public ActivityReport createActivityReport(
-			uk.org.taverna.scufl2.api.activity.Activity activity) {
+			org.apache.taverna.scufl2.api.activity.Activity activity) {
 		return new ActivityReport(activity);
 	}
 

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionService.java
----------------------------------------------------------------------
diff --git a/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionService.java b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionService.java
index 9038e0f..5cd238b 100644
--- a/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionService.java
+++ b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionService.java
@@ -38,9 +38,9 @@ import uk.org.taverna.platform.execution.api.Execution;
 import uk.org.taverna.platform.execution.api.ExecutionEnvironment;
 import uk.org.taverna.platform.execution.api.InvalidWorkflowException;
 import uk.org.taverna.platform.execution.api.WorkflowCompiler;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-import uk.org.taverna.scufl2.api.core.Workflow;
-import uk.org.taverna.scufl2.api.profiles.Profile;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.core.Workflow;
+import org.apache.taverna.scufl2.api.profiles.Profile;
 
 /**
  * Service for executing Taverna workflows on a local Taverna Dataflow Engine.

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalProcessorReport.java
----------------------------------------------------------------------
diff --git a/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalProcessorReport.java b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalProcessorReport.java
index 0677eaf..2db354c 100644
--- a/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalProcessorReport.java
+++ b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalProcessorReport.java
@@ -10,7 +10,7 @@ import net.sf.taverna.t2.monitor.MonitorableProperty;
 import net.sf.taverna.t2.monitor.NoSuchPropertyException;
 import net.sf.taverna.t2.monitor.SteerableProperty;
 import uk.org.taverna.platform.report.ProcessorReport;
-import uk.org.taverna.scufl2.api.core.Processor;
+import org.apache.taverna.scufl2.api.core.Processor;
 
 /**
  * ProcessorReport implementation based on MonitorableProperty objects.

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/WorkflowToDataflowMapper.java
----------------------------------------------------------------------
diff --git a/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/WorkflowToDataflowMapper.java b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/WorkflowToDataflowMapper.java
index 986705a..1bce24b 100644
--- a/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/WorkflowToDataflowMapper.java
+++ b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/WorkflowToDataflowMapper.java
@@ -54,34 +54,34 @@ import uk.org.taverna.platform.capability.api.DispatchLayerConfigurationExceptio
 import uk.org.taverna.platform.capability.api.DispatchLayerNotFoundException;
 import uk.org.taverna.platform.capability.api.DispatchLayerService;
 import uk.org.taverna.platform.execution.api.InvalidWorkflowException;
-import uk.org.taverna.scufl2.api.activity.Activity;
-import uk.org.taverna.scufl2.api.common.Scufl2Tools;
-import uk.org.taverna.scufl2.api.configurations.Configuration;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-import uk.org.taverna.scufl2.api.core.BlockingControlLink;
-import uk.org.taverna.scufl2.api.core.ControlLink;
-import uk.org.taverna.scufl2.api.core.DataLink;
-import uk.org.taverna.scufl2.api.core.Processor;
-import uk.org.taverna.scufl2.api.core.Workflow;
-import uk.org.taverna.scufl2.api.iterationstrategy.CrossProduct;
-import uk.org.taverna.scufl2.api.iterationstrategy.DotProduct;
-import uk.org.taverna.scufl2.api.iterationstrategy.IterationStrategyNode;
-import uk.org.taverna.scufl2.api.iterationstrategy.IterationStrategyStack;
-import uk.org.taverna.scufl2.api.iterationstrategy.IterationStrategyTopNode;
-import uk.org.taverna.scufl2.api.iterationstrategy.PortNode;
-import uk.org.taverna.scufl2.api.port.InputActivityPort;
-import uk.org.taverna.scufl2.api.port.InputProcessorPort;
-import uk.org.taverna.scufl2.api.port.InputWorkflowPort;
-import uk.org.taverna.scufl2.api.port.OutputActivityPort;
-import uk.org.taverna.scufl2.api.port.OutputProcessorPort;
-import uk.org.taverna.scufl2.api.port.OutputWorkflowPort;
-import uk.org.taverna.scufl2.api.port.Port;
-import uk.org.taverna.scufl2.api.port.ReceiverPort;
-import uk.org.taverna.scufl2.api.port.SenderPort;
-import uk.org.taverna.scufl2.api.profiles.ProcessorBinding;
-import uk.org.taverna.scufl2.api.profiles.ProcessorInputPortBinding;
-import uk.org.taverna.scufl2.api.profiles.ProcessorOutputPortBinding;
-import uk.org.taverna.scufl2.api.profiles.Profile;
+import org.apache.taverna.scufl2.api.activity.Activity;
+import org.apache.taverna.scufl2.api.common.Scufl2Tools;
+import org.apache.taverna.scufl2.api.configurations.Configuration;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.core.BlockingControlLink;
+import org.apache.taverna.scufl2.api.core.ControlLink;
+import org.apache.taverna.scufl2.api.core.DataLink;
+import org.apache.taverna.scufl2.api.core.Processor;
+import org.apache.taverna.scufl2.api.core.Workflow;
+import org.apache.taverna.scufl2.api.iterationstrategy.CrossProduct;
+import org.apache.taverna.scufl2.api.iterationstrategy.DotProduct;
+import org.apache.taverna.scufl2.api.iterationstrategy.IterationStrategyNode;
+import org.apache.taverna.scufl2.api.iterationstrategy.IterationStrategyStack;
+import org.apache.taverna.scufl2.api.iterationstrategy.IterationStrategyTopNode;
+import org.apache.taverna.scufl2.api.iterationstrategy.PortNode;
+import org.apache.taverna.scufl2.api.port.InputActivityPort;
+import org.apache.taverna.scufl2.api.port.InputProcessorPort;
+import org.apache.taverna.scufl2.api.port.InputWorkflowPort;
+import org.apache.taverna.scufl2.api.port.OutputActivityPort;
+import org.apache.taverna.scufl2.api.port.OutputProcessorPort;
+import org.apache.taverna.scufl2.api.port.OutputWorkflowPort;
+import org.apache.taverna.scufl2.api.port.Port;
+import org.apache.taverna.scufl2.api.port.ReceiverPort;
+import org.apache.taverna.scufl2.api.port.SenderPort;
+import org.apache.taverna.scufl2.api.profiles.ProcessorBinding;
+import org.apache.taverna.scufl2.api.profiles.ProcessorInputPortBinding;
+import org.apache.taverna.scufl2.api.profiles.ProcessorOutputPortBinding;
+import org.apache.taverna.scufl2.api.profiles.Profile;
 
 import com.fasterxml.jackson.databind.JsonNode;
 

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-execution-local/src/test/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionTest.java
----------------------------------------------------------------------
diff --git a/taverna-execution-local/src/test/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionTest.java b/taverna-execution-local/src/test/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionTest.java
index 58a667e..80b4d65 100644
--- a/taverna-execution-local/src/test/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionTest.java
+++ b/taverna-execution-local/src/test/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionTest.java
@@ -71,7 +71,7 @@ public class LocalExecutionTest {
 
 	/**
 	 * Test method for
-	 * {@link uk.org.taverna.platform.execution.impl.local.LocalExecution#DataflowExecution(uk.org.taverna.scufl2.api.core.Workflow, java.util.Map, net.sf.taverna.t2.reference.ReferenceService)}
+	 * {@link uk.org.taverna.platform.execution.impl.local.LocalExecution#DataflowExecution(org.apache.taverna.scufl2.api.core.Workflow, java.util.Map, net.sf.taverna.t2.reference.ReferenceService)}
 	 * .
 	 * 
 	 * @throws Exception

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecution.java
----------------------------------------------------------------------
diff --git a/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecution.java b/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecution.java
index cf94d39..8231409 100644
--- a/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecution.java
+++ b/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecution.java
@@ -26,11 +26,11 @@ import uk.org.taverna.platform.execution.api.AbstractExecution;
 import uk.org.taverna.platform.report.ActivityReport;
 import uk.org.taverna.platform.report.ProcessorReport;
 import uk.org.taverna.platform.report.WorkflowReport;
-import uk.org.taverna.scufl2.api.activity.Activity;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-import uk.org.taverna.scufl2.api.core.Processor;
-import uk.org.taverna.scufl2.api.core.Workflow;
-import uk.org.taverna.scufl2.api.profiles.Profile;
+import org.apache.taverna.scufl2.api.activity.Activity;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.core.Processor;
+import org.apache.taverna.scufl2.api.core.Workflow;
+import org.apache.taverna.scufl2.api.profiles.Profile;
 
 /**
  * An {@link uk.org.taverna.platform.execution.api.Execution Execution} for executing a Taverna workflow on a Taverna Server.

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecutionService.java
----------------------------------------------------------------------
diff --git a/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecutionService.java b/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecutionService.java
index 6ca8db7..6910a3d 100644
--- a/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecutionService.java
+++ b/taverna-execution-remote/src/main/java/uk/org/taverna/platform/execution/impl/remote/RemoteExecutionService.java
@@ -29,9 +29,9 @@ import uk.org.taverna.platform.execution.api.AbstractExecutionService;
 import uk.org.taverna.platform.execution.api.Execution;
 import uk.org.taverna.platform.execution.api.ExecutionEnvironment;
 import uk.org.taverna.platform.execution.api.InvalidWorkflowException;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-import uk.org.taverna.scufl2.api.core.Workflow;
-import uk.org.taverna.scufl2.api.profiles.Profile;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.core.Workflow;
+import org.apache.taverna.scufl2.api.profiles.Profile;
 
 /**
  * Service for executing Taverna workflows on a Taverna Server.

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java b/taverna-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java
index 24bcbdb..789ec33 100644
--- a/taverna-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java
+++ b/taverna-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java
@@ -37,8 +37,8 @@ import uk.org.taverna.databundle.DataBundles;
 import uk.org.taverna.databundle.ErrorDocument;
 import uk.org.taverna.platform.report.State;
 import uk.org.taverna.platform.report.WorkflowReport;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-import uk.org.taverna.scufl2.api.io.WorkflowBundleIO;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.io.WorkflowBundleIO;
 
 @Ignore
 public class PlatformIT {

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-integration-tests/src/test/java/uk/org/taverna/platform/RunIT.java
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/java/uk/org/taverna/platform/RunIT.java b/taverna-integration-tests/src/test/java/uk/org/taverna/platform/RunIT.java
index 72cbe40..b10d384 100644
--- a/taverna-integration-tests/src/test/java/uk/org/taverna/platform/RunIT.java
+++ b/taverna-integration-tests/src/test/java/uk/org/taverna/platform/RunIT.java
@@ -53,8 +53,8 @@ import uk.org.taverna.platform.report.State;
 import uk.org.taverna.platform.report.WorkflowReport;
 import uk.org.taverna.platform.run.api.RunProfile;
 import uk.org.taverna.platform.run.api.RunService;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-import uk.org.taverna.scufl2.api.io.WorkflowBundleIO;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.io.WorkflowBundleIO;
 
 public class RunIT extends PlatformIT {
 

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ActivityIT.java
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ActivityIT.java b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ActivityIT.java
index bb82107..5d578dc 100644
--- a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ActivityIT.java
+++ b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ActivityIT.java
@@ -30,7 +30,7 @@ import org.osgi.framework.ServiceReference;
 import uk.org.taverna.platform.capability.activity.ActivityConfigurationException;
 import uk.org.taverna.platform.capability.activity.ActivityNotFoundException;
 import uk.org.taverna.platform.capability.activity.ActivityService;
-import uk.org.taverna.scufl2.api.configurations.ConfigurationDefinition;
+import org.apache.taverna.scufl2.api.configurations.ConfigurationDefinition;
 
 public class ActivityIT extends PlatformIT {
 

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/CommandLineToolIT.java
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/CommandLineToolIT.java b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/CommandLineToolIT.java
index f2df658..58b9fe8 100644
--- a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/CommandLineToolIT.java
+++ b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/CommandLineToolIT.java
@@ -26,8 +26,8 @@ import org.osgi.framework.ServiceReference;
 
 import uk.org.taverna.commandline.args.CommandLineArguments;
 import uk.org.taverna.platform.run.api.RunService;
-import uk.org.taverna.scufl2.api.io.WorkflowBundleIO;
-import uk.org.taverna.scufl2.api.io.WorkflowBundleReader;
+import org.apache.taverna.scufl2.api.io.WorkflowBundleIO;
+import org.apache.taverna.scufl2.api.io.WorkflowBundleReader;
 
 public class CommandLineToolIT extends PlatformIT {
 
@@ -45,7 +45,7 @@ public class CommandLineToolIT extends PlatformIT {
 
 		if (workflowReader == null) {
 			ServiceReference workflowBundleReaderServiceReference = bundleContext
-					.getServiceReferences("uk.org.taverna.scufl2.api.io.WorkflowBundleReader",
+					.getServiceReferences("org.apache.taverna.scufl2.api.io.WorkflowBundleReader",
 							"(mediaType=application/vnd.taverna.t2flow+xml)")[0];
 			workflowBundleReader = (WorkflowBundleReader) bundleContext
 					.getService(workflowBundleReaderServiceReference);
@@ -53,7 +53,7 @@ public class CommandLineToolIT extends PlatformIT {
 
 		if (workflowBundleIO == null) {
 			ServiceReference workflowBundleIOServiceReference = bundleContext
-					.getServiceReference("uk.org.taverna.scufl2.api.io.WorkflowBundleIO");
+					.getServiceReference("org.apache.taverna.scufl2.api.io.WorkflowBundleIO");
 			workflowBundleIO = (WorkflowBundleIO) bundleContext
 					.getService(workflowBundleIOServiceReference);
 		}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ExecutionIT.java
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ExecutionIT.java b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ExecutionIT.java
index 76a25b3..8e4ad1b 100644
--- a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ExecutionIT.java
+++ b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ExecutionIT.java
@@ -39,10 +39,10 @@ import uk.org.taverna.platform.execution.api.Execution;
 import uk.org.taverna.platform.execution.api.ExecutionEnvironment;
 import uk.org.taverna.platform.execution.api.ExecutionEnvironmentService;
 import uk.org.taverna.platform.execution.api.InvalidWorkflowException;
-import uk.org.taverna.scufl2.api.configurations.ConfigurationDefinition;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-import uk.org.taverna.scufl2.api.core.Workflow;
-import uk.org.taverna.scufl2.api.profiles.Profile;
+import org.apache.taverna.scufl2.api.configurations.ConfigurationDefinition;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.core.Workflow;
+import org.apache.taverna.scufl2.api.profiles.Profile;
 
 public class ExecutionIT extends PlatformIT {
 

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/LocalExecutionIT.java
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/LocalExecutionIT.java b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/LocalExecutionIT.java
index 92068d5..3c2c5a7 100644
--- a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/LocalExecutionIT.java
+++ b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/LocalExecutionIT.java
@@ -33,9 +33,9 @@ import uk.org.taverna.platform.execution.api.ExecutionEnvironment;
 import uk.org.taverna.platform.execution.api.ExecutionService;
 import uk.org.taverna.platform.report.State;
 import uk.org.taverna.platform.report.WorkflowReport;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-import uk.org.taverna.scufl2.api.core.Workflow;
-import uk.org.taverna.scufl2.api.profiles.Profile;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.core.Workflow;
+import org.apache.taverna.scufl2.api.profiles.Profile;
 
 public class LocalExecutionIT extends PlatformIT {
 

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java
index 40b35e9..517c21f 100644
--- a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java
+++ b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java
@@ -47,9 +47,9 @@ import uk.org.taverna.configuration.database.DatabaseConfiguration;
 import uk.org.taverna.platform.data.api.Data;
 import uk.org.taverna.platform.report.State;
 import uk.org.taverna.platform.report.WorkflowReport;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-import uk.org.taverna.scufl2.api.io.WorkflowBundleReader;
-import uk.org.taverna.scufl2.translator.t2flow.T2FlowReader;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.io.WorkflowBundleReader;
+import org.apache.taverna.scufl2.translator.t2flow.T2FlowReader;
 
 public class PlatformIT extends AbstractConfigurableBundleCreatorTests {
 
@@ -197,13 +197,13 @@ public class PlatformIT extends AbstractConfigurableBundleCreatorTests {
 				"uk.org.taverna.osgi.services, xml-parser-service, 0.0.1-SNAPSHOT",
 				"uk.org.taverna.osgi.services, xml-transformer-service, 0.0.1-SNAPSHOT",
 				// FIXME: Add the other scufl2 modules
-				"uk.org.taverna.scufl2, scufl2-api, 0.9.2",
-				"uk.org.taverna.scufl2, scufl2-rdfxml, 0.9.2",
-				"uk.org.taverna.scufl2, scufl2-ucfpackage, 0.9.2",
-				"uk.org.taverna.scufl2, scufl2-t2flow, 0.9.2",
-				"uk.org.taverna.scufl2, scufl2-validation, 0.9.2",
-				"uk.org.taverna.scufl2, scufl2-validation-correctness, 0.9.2",
-				"uk.org.taverna.scufl2, scufl2-validation-structural, 0.9.2",
+				"org.apache.taverna.scufl2, scufl2-api, 0.9.2",
+				"org.apache.taverna.scufl2, scufl2-rdfxml, 0.9.2",
+				"org.apache.taverna.scufl2, scufl2-ucfpackage, 0.9.2",
+				"org.apache.taverna.scufl2, scufl2-t2flow, 0.9.2",
+				"org.apache.taverna.scufl2, scufl2-validation, 0.9.2",
+				"org.apache.taverna.scufl2, scufl2-validation-correctness, 0.9.2",
+				"org.apache.taverna.scufl2, scufl2-validation-structural, 0.9.2",
 				"net.sf.taverna.t2, results, 2.0-SNAPSHOT",
 				"net.sf.taverna.t2, baclava, 0.1-SNAPSHOT",
 		// "net.sf.taverna.t2.taverna-commandline, taverna-commandline-common, 2.0-SNAPSHOT"
@@ -239,7 +239,7 @@ public class PlatformIT extends AbstractConfigurableBundleCreatorTests {
 
 		if (workflowBundleReader == null) {
 			ServiceReference[] workflowBundleReaderReferences = bundleContext.getServiceReferences(
-					"uk.org.taverna.scufl2.api.io.WorkflowBundleReader", null);
+					"org.apache.taverna.scufl2.api.io.WorkflowBundleReader", null);
 			for (ServiceReference serviceReference : workflowBundleReaderReferences) {
 				workflowBundleReader = (WorkflowBundleReader) bundleContext
 						.getService(serviceReference);

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunIT.java
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunIT.java b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunIT.java
index 9911e7c..c1931af 100644
--- a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunIT.java
+++ b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunIT.java
@@ -41,7 +41,7 @@ import uk.org.taverna.platform.report.State;
 import uk.org.taverna.platform.report.WorkflowReport;
 import uk.org.taverna.platform.run.api.RunProfile;
 import uk.org.taverna.platform.run.api.RunService;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
 
 public class RunIT extends PlatformIT {
 

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunParallelIT.java
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunParallelIT.java b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunParallelIT.java
index 7ba4a4f..b450c94 100644
--- a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunParallelIT.java
+++ b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunParallelIT.java
@@ -33,7 +33,7 @@ import uk.org.taverna.platform.report.State;
 import uk.org.taverna.platform.report.WorkflowReport;
 import uk.org.taverna.platform.run.api.RunProfile;
 import uk.org.taverna.platform.run.api.RunService;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
 
 public class RunParallelIT extends PlatformIT {
 

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunWorkflowsIT.java
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunWorkflowsIT.java b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunWorkflowsIT.java
index 6c36821..dee97f0 100644
--- a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunWorkflowsIT.java
+++ b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/RunWorkflowsIT.java
@@ -32,7 +32,7 @@ import uk.org.taverna.platform.report.State;
 import uk.org.taverna.platform.report.WorkflowReport;
 import uk.org.taverna.platform.run.api.RunProfile;
 import uk.org.taverna.platform.run.api.RunService;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
 
 public class RunWorkflowsIT extends PlatformIT {
 

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/W3ProvenanceExport.java
----------------------------------------------------------------------
diff --git a/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/W3ProvenanceExport.java b/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/W3ProvenanceExport.java
index 110ff72..d776539 100644
--- a/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/W3ProvenanceExport.java
+++ b/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/W3ProvenanceExport.java
@@ -1,6 +1,6 @@
 package org.purl.wf4ever.provtaverna.export;
 
-import static uk.org.taverna.scufl2.translator.t2flow.T2FlowParser.ravenURI;
+import static org.apache.taverna.scufl2.translator.t2flow.T2FlowParser.ravenURI;
 
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
@@ -56,13 +56,13 @@ import org.purl.wf4ever.robundle.manifest.PathAnnotation;
 import org.purl.wf4ever.robundle.manifest.PathMetadata;
 
 import uk.org.taverna.databundle.DataBundles;
-import uk.org.taverna.scufl2.api.common.URITools;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-import uk.org.taverna.scufl2.api.io.ReaderException;
-import uk.org.taverna.scufl2.api.io.WorkflowBundleIO;
-import uk.org.taverna.scufl2.api.io.WorkflowBundleReader;
-import uk.org.taverna.scufl2.api.io.WorkflowBundleWriter;
-import uk.org.taverna.scufl2.translator.t2flow.T2FlowReader;
+import org.apache.taverna.scufl2.api.common.URITools;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.io.ReaderException;
+import org.apache.taverna.scufl2.api.io.WorkflowBundleIO;
+import org.apache.taverna.scufl2.api.io.WorkflowBundleReader;
+import org.apache.taverna.scufl2.api.io.WorkflowBundleWriter;
+import org.apache.taverna.scufl2.translator.t2flow.T2FlowReader;
 
 import com.hp.hpl.jena.datatypes.xsd.XSDDatatype;
 import com.hp.hpl.jena.ontology.Individual;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/EventProcessor.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/EventProcessor.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/EventProcessor.java
index 291da99..aa0c07d 100644
--- a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/EventProcessor.java
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/EventProcessor.java
@@ -114,7 +114,7 @@ import org.jdom.Namespace;
 import org.jdom.input.SAXBuilder;
 import org.jdom.output.XMLOutputter;
 
-import uk.org.taverna.scufl2.api.io.WorkflowBundleIO;
+import org.apache.taverna.scufl2.api.io.WorkflowBundleIO;
 
 /**
  * @author Paolo Missier

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-report-api/src/main/java/uk/org/taverna/platform/report/ActivityReport.java
----------------------------------------------------------------------
diff --git a/taverna-report-api/src/main/java/uk/org/taverna/platform/report/ActivityReport.java b/taverna-report-api/src/main/java/uk/org/taverna/platform/report/ActivityReport.java
index 0375dcd..4a9d1ea 100644
--- a/taverna-report-api/src/main/java/uk/org/taverna/platform/report/ActivityReport.java
+++ b/taverna-report-api/src/main/java/uk/org/taverna/platform/report/ActivityReport.java
@@ -20,7 +20,7 @@
  ******************************************************************************/
 package uk.org.taverna.platform.report;
 
-import uk.org.taverna.scufl2.api.activity.Activity;
+import org.apache.taverna.scufl2.api.activity.Activity;
 
 /**
  * Report about the {@link State} of an {@link Activity} invocation.

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-report-api/src/main/java/uk/org/taverna/platform/report/Invocation.java
----------------------------------------------------------------------
diff --git a/taverna-report-api/src/main/java/uk/org/taverna/platform/report/Invocation.java b/taverna-report-api/src/main/java/uk/org/taverna/platform/report/Invocation.java
index 166b226..fc95157 100644
--- a/taverna-report-api/src/main/java/uk/org/taverna/platform/report/Invocation.java
+++ b/taverna-report-api/src/main/java/uk/org/taverna/platform/report/Invocation.java
@@ -28,7 +28,7 @@ import java.util.SortedSet;
 import java.util.TreeMap;
 import java.util.TreeSet;
 
-import uk.org.taverna.scufl2.api.port.Port;
+import org.apache.taverna.scufl2.api.port.Port;
 
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonProperty;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-report-api/src/main/java/uk/org/taverna/platform/report/ProcessorReport.java
----------------------------------------------------------------------
diff --git a/taverna-report-api/src/main/java/uk/org/taverna/platform/report/ProcessorReport.java b/taverna-report-api/src/main/java/uk/org/taverna/platform/report/ProcessorReport.java
index 97a74a1..1912eb3 100644
--- a/taverna-report-api/src/main/java/uk/org/taverna/platform/report/ProcessorReport.java
+++ b/taverna-report-api/src/main/java/uk/org/taverna/platform/report/ProcessorReport.java
@@ -26,7 +26,7 @@ import java.util.Set;
 import java.util.SortedMap;
 import java.util.TreeMap;
 
-import uk.org.taverna.scufl2.api.core.Processor;
+import org.apache.taverna.scufl2.api.core.Processor;
 
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonPropertyOrder;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-report-api/src/main/java/uk/org/taverna/platform/report/StatusReport.java
----------------------------------------------------------------------
diff --git a/taverna-report-api/src/main/java/uk/org/taverna/platform/report/StatusReport.java b/taverna-report-api/src/main/java/uk/org/taverna/platform/report/StatusReport.java
index a49ea7b..254230f 100644
--- a/taverna-report-api/src/main/java/uk/org/taverna/platform/report/StatusReport.java
+++ b/taverna-report-api/src/main/java/uk/org/taverna/platform/report/StatusReport.java
@@ -29,8 +29,8 @@ import java.util.NavigableSet;
 import java.util.SortedSet;
 import java.util.TreeSet;
 
-import uk.org.taverna.scufl2.api.common.Ported;
-import uk.org.taverna.scufl2.api.common.URITools;
+import org.apache.taverna.scufl2.api.common.Ported;
+import org.apache.taverna.scufl2.api.common.URITools;
 
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonProperty;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-report-api/src/main/java/uk/org/taverna/platform/report/WorkflowReport.java
----------------------------------------------------------------------
diff --git a/taverna-report-api/src/main/java/uk/org/taverna/platform/report/WorkflowReport.java b/taverna-report-api/src/main/java/uk/org/taverna/platform/report/WorkflowReport.java
index 8148793..fc000fc 100644
--- a/taverna-report-api/src/main/java/uk/org/taverna/platform/report/WorkflowReport.java
+++ b/taverna-report-api/src/main/java/uk/org/taverna/platform/report/WorkflowReport.java
@@ -29,7 +29,7 @@ import java.util.logging.Logger;
 
 import org.purl.wf4ever.robundle.Bundle;
 
-import uk.org.taverna.scufl2.api.core.Workflow;
+import org.apache.taverna.scufl2.api.core.Workflow;
 
 import com.fasterxml.jackson.annotation.JsonIgnore;
 

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-report-api/src/test/java/uk/org/taverna/platform/report/StatusReportTest.java
----------------------------------------------------------------------
diff --git a/taverna-report-api/src/test/java/uk/org/taverna/platform/report/StatusReportTest.java b/taverna-report-api/src/test/java/uk/org/taverna/platform/report/StatusReportTest.java
index 9cee3a8..3c39cbb 100644
--- a/taverna-report-api/src/test/java/uk/org/taverna/platform/report/StatusReportTest.java
+++ b/taverna-report-api/src/test/java/uk/org/taverna/platform/report/StatusReportTest.java
@@ -31,7 +31,7 @@ import java.util.Date;
 import org.junit.Before;
 import org.junit.Test;
 
-import uk.org.taverna.scufl2.api.core.Workflow;
+import org.apache.taverna.scufl2.api.core.Workflow;
 
 /**
  * Unit tests for StatusReport.

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-run-api/src/main/java/uk/org/taverna/platform/run/api/RunProfile.java
----------------------------------------------------------------------
diff --git a/taverna-run-api/src/main/java/uk/org/taverna/platform/run/api/RunProfile.java b/taverna-run-api/src/main/java/uk/org/taverna/platform/run/api/RunProfile.java
index 9954685..b3a94ad 100644
--- a/taverna-run-api/src/main/java/uk/org/taverna/platform/run/api/RunProfile.java
+++ b/taverna-run-api/src/main/java/uk/org/taverna/platform/run/api/RunProfile.java
@@ -3,11 +3,11 @@ package uk.org.taverna.platform.run.api;
 import org.purl.wf4ever.robundle.Bundle;
 
 import uk.org.taverna.platform.execution.api.ExecutionEnvironment;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
 
 /**
  * A <code>RunProfile</code> specifies the parameters required to run a
- * {@link uk.org.taverna.scufl2.api.core.Workflow}.
+ * {@link org.apache.taverna.scufl2.api.core.Workflow}.
  * 
  * @author David Withers
  */
@@ -20,7 +20,7 @@ public class RunProfile {
 
 	/**
 	 * Constructs a <code>RunProfile</code> that specifies the parameters
-	 * required to run a {@link uk.org.taverna.scufl2.api.core.Workflow}. The
+	 * required to run a {@link org.apache.taverna.scufl2.api.core.Workflow}. The
 	 * main <code>Workflow</code> and <code>Profile</code> from the
 	 * <code>WorkflowBundle</code> are used.
 	 * 
@@ -41,7 +41,7 @@ public class RunProfile {
 
 	/**
 	 * Constructs a <code>RunProfile</code> that specifies the parameters
-	 * required to run a {@link uk.org.taverna.scufl2.api.core.Workflow}.
+	 * required to run a {@link org.apache.taverna.scufl2.api.core.Workflow}.
 	 * 
 	 * @param executionEnvironment
 	 *            the {@link ExecutionEnvironment} used to execute the
@@ -54,7 +54,7 @@ public class RunProfile {
 	 *            the main <code>Workflow</code> from the
 	 *            <code>WorkflowBundle</code>
 	 * @param profile
-	 *            the {@link uk.org.taverna.scufl2.api.profiles.Profile} to use
+	 *            the {@link org.apache.taverna.scufl2.api.profiles.Profile} to use
 	 *            when running the <code>Workflow</code>. If null uses the main
 	 *            <code>Profile</code> from the <code>WorkflowBundle</code>
 	 * @param dataBundle

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-run-api/src/main/java/uk/org/taverna/platform/run/api/RunService.java
----------------------------------------------------------------------
diff --git a/taverna-run-api/src/main/java/uk/org/taverna/platform/run/api/RunService.java b/taverna-run-api/src/main/java/uk/org/taverna/platform/run/api/RunService.java
index 9dda709..1e98021 100644
--- a/taverna-run-api/src/main/java/uk/org/taverna/platform/run/api/RunService.java
+++ b/taverna-run-api/src/main/java/uk/org/taverna/platform/run/api/RunService.java
@@ -12,9 +12,9 @@ import uk.org.taverna.platform.execution.api.InvalidExecutionIdException;
 import uk.org.taverna.platform.execution.api.InvalidWorkflowException;
 import uk.org.taverna.platform.report.State;
 import uk.org.taverna.platform.report.WorkflowReport;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-import uk.org.taverna.scufl2.api.core.Workflow;
-import uk.org.taverna.scufl2.api.profiles.Profile;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.core.Workflow;
+import org.apache.taverna.scufl2.api.profiles.Profile;
 
 /**
  * Service for managing runs of Taverna workflows.

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-run-api/src/test/java/uk/org/taverna/platform/run/api/RunProfileTest.java
----------------------------------------------------------------------
diff --git a/taverna-run-api/src/test/java/uk/org/taverna/platform/run/api/RunProfileTest.java b/taverna-run-api/src/test/java/uk/org/taverna/platform/run/api/RunProfileTest.java
index e6225ee..5399ea6 100644
--- a/taverna-run-api/src/test/java/uk/org/taverna/platform/run/api/RunProfileTest.java
+++ b/taverna-run-api/src/test/java/uk/org/taverna/platform/run/api/RunProfileTest.java
@@ -33,9 +33,9 @@ import uk.org.taverna.databundle.DataBundles;
 import uk.org.taverna.platform.execution.api.ExecutionEnvironment;
 import uk.org.taverna.platform.execution.impl.local.LocalExecutionEnvironment;
 import uk.org.taverna.platform.execution.impl.local.LocalExecutionService;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-import uk.org.taverna.scufl2.api.core.Workflow;
-import uk.org.taverna.scufl2.api.profiles.Profile;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.core.Workflow;
+import org.apache.taverna.scufl2.api.profiles.Profile;
 
 /**
  *
@@ -74,7 +74,7 @@ public class RunProfileTest {
 
 	/**
 	 * Test method for
-	 * {@link uk.org.taverna.platform.run.api.RunProfile#RunProfile(uk.org.taverna.scufl2.api.container.WorkflowBundle, java.util.Map, net.sf.taverna.t2.reference.ReferenceService, uk.org.taverna.platform.execution.api.ExecutionService)}
+	 * {@link uk.org.taverna.platform.run.api.RunProfile#RunProfile(org.apache.taverna.scufl2.api.container.WorkflowBundle, java.util.Map, net.sf.taverna.t2.reference.ReferenceService, uk.org.taverna.platform.execution.api.ExecutionService)}
 	 * .
 	 */
 	@Test
@@ -84,7 +84,7 @@ public class RunProfileTest {
 
 	/**
 	 * Test method for
-	 * {@link uk.org.taverna.platform.run.api.RunProfile#RunProfile(uk.org.taverna.scufl2.api.container.WorkflowBundle, uk.org.taverna.scufl2.api.core.Workflow, uk.org.taverna.scufl2.api.profiles.Profile, java.util.Map, net.sf.taverna.t2.reference.ReferenceService, uk.org.taverna.platform.execution.api.ExecutionService)}
+	 * {@link uk.org.taverna.platform.run.api.RunProfile#RunProfile(org.apache.taverna.scufl2.api.container.WorkflowBundle, org.apache.taverna.scufl2.api.core.Workflow, org.apache.taverna.scufl2.api.profiles.Profile, java.util.Map, net.sf.taverna.t2.reference.ReferenceService, uk.org.taverna.platform.execution.api.ExecutionService)}
 	 * .
 	 */
 	@Test
@@ -105,7 +105,7 @@ public class RunProfileTest {
 
 	/**
 	 * Test method for
-	 * {@link uk.org.taverna.platform.run.api.RunProfile#setWorkflowBundle(uk.org.taverna.scufl2.api.container.WorkflowBundle)}
+	 * {@link uk.org.taverna.platform.run.api.RunProfile#setWorkflowBundle(org.apache.taverna.scufl2.api.container.WorkflowBundle)}
 	 * .
 	 */
 	@Test
@@ -132,7 +132,7 @@ public class RunProfileTest {
 
 	/**
 	 * Test method for
-	 * {@link uk.org.taverna.platform.run.api.RunProfile#setWorkflow(uk.org.taverna.scufl2.api.core.Workflow)}
+	 * {@link uk.org.taverna.platform.run.api.RunProfile#setWorkflow(org.apache.taverna.scufl2.api.core.Workflow)}
 	 * .
 	 */
 	@Test
@@ -165,7 +165,7 @@ public class RunProfileTest {
 
 	/**
 	 * Test method for
-	 * {@link uk.org.taverna.platform.run.api.RunProfile#setProfile(uk.org.taverna.scufl2.api.profiles.Profile)}
+	 * {@link uk.org.taverna.platform.run.api.RunProfile#setProfile(org.apache.taverna.scufl2.api.profiles.Profile)}
 	 * .
 	 */
 	@Test

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/Run.java
----------------------------------------------------------------------
diff --git a/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/Run.java b/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/Run.java
index 453df96..475796f 100755
--- a/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/Run.java
+++ b/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/Run.java
@@ -46,10 +46,10 @@ import uk.org.taverna.platform.report.WorkflowReport;
 import uk.org.taverna.platform.run.api.RunProfile;
 import uk.org.taverna.platform.run.api.RunProfileException;
 import uk.org.taverna.platform.run.api.RunStateException;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-import uk.org.taverna.scufl2.api.core.Workflow;
-import uk.org.taverna.scufl2.api.io.ReaderException;
-import uk.org.taverna.scufl2.api.profiles.Profile;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.core.Workflow;
+import org.apache.taverna.scufl2.api.io.ReaderException;
+import org.apache.taverna.scufl2.api.profiles.Profile;
 
 /**
  * A single run of a {@link Workflow}.

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/RunServiceImpl.java
----------------------------------------------------------------------
diff --git a/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/RunServiceImpl.java b/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/RunServiceImpl.java
index 5ee2a75..e6da8d2 100755
--- a/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/RunServiceImpl.java
+++ b/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/RunServiceImpl.java
@@ -53,11 +53,11 @@ import uk.org.taverna.platform.run.api.RunProfile;
 import uk.org.taverna.platform.run.api.RunProfileException;
 import uk.org.taverna.platform.run.api.RunService;
 import uk.org.taverna.platform.run.api.RunStateException;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-import uk.org.taverna.scufl2.api.core.Workflow;
-import uk.org.taverna.scufl2.api.io.ReaderException;
-import uk.org.taverna.scufl2.api.io.WorkflowBundleIO;
-import uk.org.taverna.scufl2.api.profiles.Profile;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.core.Workflow;
+import org.apache.taverna.scufl2.api.io.ReaderException;
+import org.apache.taverna.scufl2.api.io.WorkflowBundleIO;
+import org.apache.taverna.scufl2.api.profiles.Profile;
 
 /**
  * Implementation of the <code>RunService</code>.

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/WorkflowReportJSON.java
----------------------------------------------------------------------
diff --git a/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/WorkflowReportJSON.java b/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/WorkflowReportJSON.java
index c1a3395..fb1cd43 100644
--- a/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/WorkflowReportJSON.java
+++ b/taverna-run-impl/src/main/java/uk/org/taverna/platform/run/impl/WorkflowReportJSON.java
@@ -41,13 +41,13 @@ import uk.org.taverna.platform.report.ProcessorReport;
 import uk.org.taverna.platform.report.State;
 import uk.org.taverna.platform.report.StatusReport;
 import uk.org.taverna.platform.report.WorkflowReport;
-import uk.org.taverna.scufl2.api.activity.Activity;
-import uk.org.taverna.scufl2.api.common.URITools;
-import uk.org.taverna.scufl2.api.common.WorkflowBean;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-import uk.org.taverna.scufl2.api.core.Processor;
-import uk.org.taverna.scufl2.api.core.Workflow;
-import uk.org.taverna.scufl2.api.io.ReaderException;
+import org.apache.taverna.scufl2.api.activity.Activity;
+import org.apache.taverna.scufl2.api.common.URITools;
+import org.apache.taverna.scufl2.api.common.WorkflowBean;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.core.Processor;
+import org.apache.taverna.scufl2.api.core.Workflow;
+import org.apache.taverna.scufl2.api.io.ReaderException;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.JsonNode;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/DummyWorkflowReport.java
----------------------------------------------------------------------
diff --git a/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/DummyWorkflowReport.java b/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/DummyWorkflowReport.java
index 84fc2d7..3dfed87 100644
--- a/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/DummyWorkflowReport.java
+++ b/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/DummyWorkflowReport.java
@@ -15,12 +15,12 @@ import uk.org.taverna.platform.report.ActivityReport;
 import uk.org.taverna.platform.report.Invocation;
 import uk.org.taverna.platform.report.ProcessorReport;
 import uk.org.taverna.platform.report.WorkflowReport;
-import uk.org.taverna.scufl2.api.common.Scufl2Tools;
-import uk.org.taverna.scufl2.api.container.WorkflowBundle;
-import uk.org.taverna.scufl2.api.core.Processor;
-import uk.org.taverna.scufl2.api.io.ReaderException;
-import uk.org.taverna.scufl2.api.io.WorkflowBundleIO;
-import uk.org.taverna.scufl2.api.profiles.ProcessorBinding;
+import org.apache.taverna.scufl2.api.common.Scufl2Tools;
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.core.Processor;
+import org.apache.taverna.scufl2.api.io.ReaderException;
+import org.apache.taverna.scufl2.api.io.WorkflowBundleIO;
+import org.apache.taverna.scufl2.api.profiles.ProcessorBinding;
 
 
 public class DummyWorkflowReport {

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/RunTest.java
----------------------------------------------------------------------
diff --git a/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/RunTest.java b/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/RunTest.java
index 80f22c8..f0da91d 100644
--- a/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/RunTest.java
+++ b/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/RunTest.java
@@ -20,7 +20,7 @@ import uk.org.taverna.platform.execution.api.ExecutionEnvironment;
 import uk.org.taverna.platform.execution.api.ExecutionService;
 import uk.org.taverna.platform.report.State;
 import uk.org.taverna.platform.run.api.RunProfile;
-import uk.org.taverna.scufl2.api.io.WorkflowBundleIO;
+import org.apache.taverna.scufl2.api.io.WorkflowBundleIO;
 
 public class RunTest extends DummyWorkflowReport {
 

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/WorkflowReportJSONTest.java
----------------------------------------------------------------------
diff --git a/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/WorkflowReportJSONTest.java b/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/WorkflowReportJSONTest.java
index 502f606..fb8f61f 100644
--- a/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/WorkflowReportJSONTest.java
+++ b/taverna-run-impl/src/test/java/uk/org/taverna/platform/run/impl/WorkflowReportJSONTest.java
@@ -22,8 +22,8 @@ import uk.org.taverna.platform.report.Invocation;
 import uk.org.taverna.platform.report.ProcessorReport;
 import uk.org.taverna.platform.report.State;
 import uk.org.taverna.platform.report.WorkflowReport;
-import uk.org.taverna.scufl2.api.common.URITools;
-import uk.org.taverna.scufl2.api.core.Processor;
+import org.apache.taverna.scufl2.api.common.URITools;
+import org.apache.taverna.scufl2.api.core.Processor;
 
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-services-api/src/main/java/uk/org/taverna/commons/services/ServiceRegistry.java
----------------------------------------------------------------------
diff --git a/taverna-services-api/src/main/java/uk/org/taverna/commons/services/ServiceRegistry.java b/taverna-services-api/src/main/java/uk/org/taverna/commons/services/ServiceRegistry.java
index a40a1d7..62e45b4 100644
--- a/taverna-services-api/src/main/java/uk/org/taverna/commons/services/ServiceRegistry.java
+++ b/taverna-services-api/src/main/java/uk/org/taverna/commons/services/ServiceRegistry.java
@@ -23,8 +23,8 @@ package uk.org.taverna.commons.services;
 import java.net.URI;
 import java.util.Set;
 
-import uk.org.taverna.scufl2.api.port.InputActivityPort;
-import uk.org.taverna.scufl2.api.port.OutputActivityPort;
+import org.apache.taverna.scufl2.api.port.InputActivityPort;
+import org.apache.taverna.scufl2.api.port.OutputActivityPort;
 
 import com.fasterxml.jackson.databind.JsonNode;
 

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/4ee7aa06/taverna-services-impl/src/main/java/uk/org/taverna/commons/services/impl/ServiceRegistryImpl.java
----------------------------------------------------------------------
diff --git a/taverna-services-impl/src/main/java/uk/org/taverna/commons/services/impl/ServiceRegistryImpl.java b/taverna-services-impl/src/main/java/uk/org/taverna/commons/services/impl/ServiceRegistryImpl.java
index 6847f75..2532005 100644
--- a/taverna-services-impl/src/main/java/uk/org/taverna/commons/services/impl/ServiceRegistryImpl.java
+++ b/taverna-services-impl/src/main/java/uk/org/taverna/commons/services/impl/ServiceRegistryImpl.java
@@ -29,8 +29,8 @@ import uk.org.taverna.commons.services.ServiceRegistry;
 import uk.org.taverna.platform.capability.api.ActivityConfigurationException;
 import uk.org.taverna.platform.capability.api.ActivityNotFoundException;
 import uk.org.taverna.platform.capability.api.ActivityService;
-import uk.org.taverna.scufl2.api.port.InputActivityPort;
-import uk.org.taverna.scufl2.api.port.OutputActivityPort;
+import org.apache.taverna.scufl2.api.port.InputActivityPort;
+import org.apache.taverna.scufl2.api.port.OutputActivityPort;
 
 import com.fasterxml.jackson.databind.JsonNode;
 


[16/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/api/NativeAnswer.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/api/NativeAnswer.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/api/NativeAnswer.java
new file mode 100644
index 0000000..65454cc
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/api/NativeAnswer.java
@@ -0,0 +1,66 @@
+/**
+ * 
+ */
+package net.sf.taverna.t2.provenance.api;
+
+import java.util.List;
+import java.util.Map;
+
+import net.sf.taverna.t2.provenance.lineageservice.Dependencies;
+import net.sf.taverna.t2.provenance.lineageservice.utils.QueryPort;
+import net.sf.taverna.t2.provenance.lineageservice.LineageQueryResultRecord;
+
+/**
+ * Java bean used to encapsulate the results of a provenance query. <br/>
+ * This takes the form of a nested map, see {@link #getAnswer} for details on
+ * its structure.
+ * 
+ * @author Paolo Missier
+ */
+public class NativeAnswer {
+	Map<QueryPort, Map<String, List<Dependencies>>> answer;
+
+	/**
+	 * @return a Map of the form: {@link QueryPort} --> ( &lt;path> --> [
+	 *         {@link Dependencies} ]) where
+	 *         <ul>
+	 *         <li> {@link QueryVar} denotes one of the ports in the &lt;select>
+	 *         element of the input query, for example:
+	 *         <em>converter:atlasSlice</em>
+	 *         <li>&lt;path&gt; is the index within the value associated to the
+	 *         port, for instance [1,2,3] or []. The inner Map structure
+	 *         accounts for multiple paths, so for example if the query asked
+	 *         for the provenance of elements [1,2] and [2,3] of the value bound
+	 *         to <em>converter:atlasSlice</em>, then the inner Map structure
+	 *         contains two entries, one for each of the two paths.
+	 *         <li>for each such path, the corresponding [{@link Dependencies}]
+	 *         is a list of {@link Dependencies}, each associated with one
+	 *         <it>target processor and port</it> mentioned in the input query.
+	 *         For example, for path [1,2] of value bound to
+	 *         <em>converter:atlasSlice</em>, you may see the following list of
+	 *         Dependencies:
+	 *         <ul>
+	 *         <li>converter:atlasSlice:[2]
+	 *         <li>slicer:atlasAverage[2]
+	 *         <li>slicer:atlasAverage[0]
+	 *         </ul>
+	 *         etc. <br/>
+	 *         Each of these elements is described by a Java bean,
+	 *         {@link LineageQueryResultRecord}, which represents a single
+	 *         provenance data record. This means that the particular value
+	 *         depends on each of these other values that are mentioned in the
+	 *         Dependencies list.
+	 */
+	public Map<QueryPort, Map<String, List<Dependencies>>> getAnswer() {
+		return answer;
+	}
+
+	/**
+	 * @param sets
+	 *            the query answer, in the format described in
+	 *            {@link #getAnswer()}
+	 */
+	public void setAnswer(Map<QueryPort, Map<String, List<Dependencies>>> answer) {
+		this.answer = answer;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/api/ProvenanceAccess.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/api/ProvenanceAccess.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/api/ProvenanceAccess.java
new file mode 100644
index 0000000..f3d6df9
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/api/ProvenanceAccess.java
@@ -0,0 +1,725 @@
+/*******************************************************************************
+ * Copyright (C) 2009 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ *
+ ******************************************************************************/
+package net.sf.taverna.t2.provenance.api;
+
+import static java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
+import static javax.naming.Context.INITIAL_CONTEXT_FACTORY;
+
+import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import net.sf.taverna.t2.invocation.InvocationContext;
+import net.sf.taverna.t2.invocation.impl.InvocationContextImpl;
+import net.sf.taverna.t2.provenance.Provenance;
+import net.sf.taverna.t2.provenance.ProvenanceConnectorFactory;
+import net.sf.taverna.t2.provenance.connector.AbstractProvenanceConnector;
+import net.sf.taverna.t2.provenance.lineageservice.Dependencies;
+import net.sf.taverna.t2.provenance.lineageservice.LineageQueryResultRecord;
+import net.sf.taverna.t2.provenance.lineageservice.ProvenanceAnalysis;
+import net.sf.taverna.t2.provenance.lineageservice.ProvenanceQuery;
+import net.sf.taverna.t2.provenance.lineageservice.ProvenanceWriter;
+import net.sf.taverna.t2.provenance.lineageservice.utils.Collection;
+import net.sf.taverna.t2.provenance.lineageservice.utils.DataLink;
+import net.sf.taverna.t2.provenance.lineageservice.utils.DataflowInvocation;
+import net.sf.taverna.t2.provenance.lineageservice.utils.PortBinding;
+import net.sf.taverna.t2.provenance.lineageservice.utils.ProcessorEnactment;
+import net.sf.taverna.t2.provenance.lineageservice.utils.ProvenanceProcessor;
+import net.sf.taverna.t2.provenance.lineageservice.utils.Port;
+import net.sf.taverna.t2.provenance.lineageservice.utils.Workflow;
+import net.sf.taverna.t2.provenance.lineageservice.utils.WorkflowRun;
+import net.sf.taverna.t2.provenance.lineageservice.utils.WorkflowTree;
+import net.sf.taverna.t2.reference.ReferenceService;
+import net.sf.taverna.t2.reference.T2Reference;
+
+import org.apache.commons.dbcp.BasicDataSource;
+import org.apache.log4j.Logger;
+
+/**
+ * This API is the single access point into the Taverna provenance database. Its
+ * main functionality is to let clients query the content of the DB, either
+ * using dedicated methods that retrieve specific entity values from the DB, or
+ * through a more general XML-based query language. Examples of XML provenance
+ * queries can be found in the external package
+ * {@link net.sf.taverna.t2.provenance.apic.client.resources}. Class
+ * {@link net.sf.taverna.t2.provenance.api.client.ProvenanceAPISampleClient}
+ * provides an example of API client that third parties would use to interact
+ * with this API.
+ * <p/>
+ * The XML schema for the XML query language is {@code pquery.xsd} in
+ * {@link net.sf.taverna.t2.provenance.apic.client.resources}
+ * 
+ * @author Paolo Missier
+ * @author Stuart Owen
+ */
+public class ProvenanceAccess implements Provenance {
+	private static Logger logger = Logger.getLogger(ProvenanceAccess.class);
+
+	private AbstractProvenanceConnector connector = null;
+	private ProvenanceAnalysis analyser = null;
+	private ProvenanceQuery querier;
+	private ProvenanceWriter writer;
+	
+	private String connectorType;
+	private final List<ProvenanceConnectorFactory> provenanceConnectorFactories;
+
+	public ProvenanceAccess(String connectorType,
+			List<ProvenanceConnectorFactory> provenanceConnectorFactories) {
+		this.connectorType = connectorType;
+		this.provenanceConnectorFactories = provenanceConnectorFactories;
+		init();
+	}
+
+	public ProvenanceAccess(String connectorType, InvocationContext context,
+			List<ProvenanceConnectorFactory> provenanceConnectorFactories) {
+		this.connectorType = connectorType;
+		this.provenanceConnectorFactories = provenanceConnectorFactories;
+		init(context);
+	}
+
+	/**
+	 * The recommended data source intitialisation method, where only a driver
+	 * name and jdbc url are required.<p/>
+	 * If the driver supports multiple connections, then a pool will be created
+	 * of 10 min idle, 50 max idle, and 50 max active connections.
+	 * 
+	 * @param driverClassName
+	 * @param jdbcUrl
+	 */
+	public static void initDataSource(String driverClassName, String jdbcUrl) {
+		initDataSource(driverClassName, jdbcUrl, null, null, 10, 50, 50);
+	}
+
+	/**
+	 * Initialises a named JNDI DataSource if not already set up externally. The
+	 * DataSource is named jdbc/taverna
+	 * 
+	 * @param driverClassName
+	 *            - the classname for the driver to be used.
+	 * @param jdbcUrl
+	 *            - the jdbc connection url
+	 * @param username
+	 *            - the username, if required (otherwise null)
+	 * @param password
+	 *            - the password, if required (oteherwise null)
+	 * @param minIdle
+	 *            - if the driver supports multiple connections, then the
+	 *            minumum number of idle connections in the pool
+	 * @param maxIdle
+	 *            - if the driver supports multiple connections, then the
+	 *            maximum number of idle connections in the pool
+	 * @param maxActive
+	 *            - if the driver supports multiple connections, then the
+	 *            minumum number of connections in the pool
+	 */
+	public static void initDataSource(String driverClassName, String jdbcUrl,
+			String username, String password, int minIdle, int maxIdle,
+			int maxActive) {
+		System.setProperty(INITIAL_CONTEXT_FACTORY,
+				"org.osjava.sj.memory.MemoryContextFactory");
+		System.setProperty("org.osjava.sj.jndi.shared", "true");
+
+		BasicDataSource ds = new BasicDataSource();
+		ds.setDriverClassName(driverClassName);
+		ds.setDefaultTransactionIsolation(TRANSACTION_READ_UNCOMMITTED);
+		ds.setMaxActive(maxActive);
+		ds.setMinIdle(minIdle);
+		ds.setMaxIdle(maxIdle);
+		ds.setDefaultAutoCommit(true);
+		if (username != null)
+			ds.setUsername(username);
+		if (password != null)
+			ds.setPassword(password);
+		ds.setUrl(jdbcUrl);
+
+		try {
+			new InitialContext().rebind("jdbc/taverna", ds);
+		} catch (NamingException ex) {
+			logger.error("Problem rebinding the jdbc context", ex);
+		}
+	}
+
+	/**
+	 * Initialises a default Reference Service for storing data and their associated references.
+	 * This creates a reference service using the named JNDI Data Source 'jdbc/taverna'.<br/>
+	 * the new Reference Service is associated to the {@link AbstractProvenanceConnector}, enabling data references to be resolved
+	 */
+	@Override
+	public InvocationContext initDefaultReferenceService() {
+		// FIXME
+		return initReferenceService("hibernateReferenceServiceContext.xml");
+	}
+
+	/**
+	 * Initialises the Reference Service for a given hibernate context definition.
+	 * This mapping file must be available in the root of the classpath.
+	 * @see #initDefaultReferenceService()
+	 * @param hibernateContext
+	 */
+	@Override
+	public InvocationContext initReferenceService(String hibernateContext) {
+		// FIXME
+		return new InvocationContextImpl(refService, connector);
+	}
+
+	private ReferenceService refService;
+	/**
+	 * Set the Reference Service for the connector of this ProvenanceAccess
+	 * if you do not 'like' the default one created when ProvenanceAccess is created.
+	 */
+	public void setReferenceService(ReferenceService refService) {
+		this.refService = refService;
+		if (connector != null)
+			connector.setReferenceService(refService);
+	}
+
+	@Override
+	public void init() {
+		init(initDefaultReferenceService());
+	}
+
+	@Override
+	public void init(InvocationContext context) {
+		for (ProvenanceConnectorFactory factory : provenanceConnectorFactories)
+			if (connectorType.equalsIgnoreCase(factory.getConnectorType()))
+				connector = factory.getProvenanceConnector();
+		logger.info("Provenance being captured using: " + connector);
+
+		//slight change, the init is outside but it also means that the init call has to ensure that the dbURL
+		//is set correctly
+		connector.init();
+
+		connector.setReferenceService(context.getReferenceService()); // CHECK context.getReferenceService());
+		connector.setInvocationContext(context);
+
+		analyser = connector.getProvenanceAnalysis();
+		analyser.setInvocationContext(context);
+
+		querier = connector.getQuery();
+		writer = connector.getWriter();
+		writer.setQuery(querier);
+
+		logger.info("using writer of type: " + writer.getClass());
+	}
+
+	/*
+	 * main provenance query methods
+	 */
+
+	/**
+	 * Executes a provenance query. Please see separate doc. for the XML query language schema.
+	 * @throws SQLException
+	 */
+	@Override
+	public QueryAnswer executeQuery(Query pq) throws SQLException {
+		return analyser.lineageQuery(pq.getTargetPorts(), pq.getRunIDList().get(0),
+				pq.getSelectedProcessors());
+	}
+
+	/**
+	 * Returns individal records from the provenance DB in response to a query
+	 * that specifies specific elements within values associated with a
+	 * processor port, in the context of a specific run of a workflow. <br/>
+	 * This is used in the workbench to retrieve the "intermediate results" at
+	 * various points during workflow execution, as opposed to a set of
+	 * dependencies in response to a full-fledged provenance query.
+	 * 
+	 * @param workflowRunId
+	 *            lineage scope -- a specific instance
+	 * @param processorName
+	 *            for a specific processor [required]
+	 * @param a
+	 *            specific (input or output) variable [optional]
+	 * @param iteration
+	 *            and a specific iteration [optional]
+	 * @return a list of @ LineageQueryResultRecord} , encapsulated in a
+	 *         {@link Dependencies} object
+	 * @throws SQLException
+	 */
+	@Override
+	public Dependencies fetchPortData(String workflowRunId, String workflowId,
+			String processorName, String portName, String iteration) {
+		logger.info("running fetchPortData on instance " + workflowRunId
+				+ " workflow " + workflowId + " processor " + processorName
+				+ " port " + portName + " iteration " + iteration);
+		// TODO add context workflowID to query
+		try {
+			return analyser.fetchIntermediateResult(workflowRunId, workflowId,
+					processorName, portName, iteration);
+		} catch (SQLException e) {
+			logger.error("Problem with fetching intermediate results", e);
+			return null;
+		}
+	}
+
+	/**
+	 * @param record a record representing a single value -- possibly within a list hierarchy
+	 * @return the URI for topmost containing collection when the input record is within a list hierarchy, or null otherwise
+	 */
+	@Override
+	public String getContainingCollection(LineageQueryResultRecord record)  {
+		return querier.getContainingCollection(record);
+	}
+
+	/*
+	 * manage instances
+	 */
+
+	/**
+	 * @param workflowId
+	 *            defines the scope of the query - if null then the query runs
+	 *            on all available workflows
+	 * @param conditions
+	 *            additional conditions to be defined. This is a placeholder as
+	 *            conditions are currently ignored
+	 * @return a list of workflowRunId, each representing one run of the input
+	 *         workflowID
+	 */
+	@Override
+	public List<WorkflowRun> listRuns(String workflowId,
+			Map<String, String> conditions) {
+		try {
+			return querier.getRuns(workflowId, conditions);
+		} catch (SQLException e) {
+			logger.error("Problem with listing runs", e);
+			return null;
+		}
+	}
+
+	@Override
+	public boolean isTopLevelDataflow(String workflowId) {
+		return querier.isTopLevelDataflow(workflowId);
+	}
+
+	@Override
+	public boolean isTopLevelDataflow(String workflowId, String workflowRunId) {
+		return querier.isTopLevelDataflow(workflowId, workflowRunId);
+	}
+
+	@Override
+	public String getLatestRunID() throws SQLException {
+		return querier.getLatestRunID();
+	}
+
+	/**
+	 * Removes all records that pertain to a specific run (but not the static
+	 * specification of the workflow run)
+	 * 
+	 * @param runID
+	 *            the internal ID of a run. This can be obtained using
+	 *            {@link #listRuns(String, Map)}
+	 * @return the set of data references that pertain to the deleted run. This
+	 *         can be used by the Data Manager to ensure that no dangling
+	 *         references are left in the main Taverna data repositorry
+	 */
+	@Override
+	public Set<String> removeRun(String runID) {
+		// implement using clearDynamic() method or a variation. Collect references and forward
+		try {
+			Set<String> danglingDataRefs = writer.clearDBDynamic(runID);
+
+			if (logger.isDebugEnabled())
+				logger.debug("references collected during removeRun: " + danglingDataRefs);
+
+			// TODO send the list of dangling refs to the Data manager for removal of the corresponding data values
+			return danglingDataRefs;
+		} catch (SQLException e) {
+			logger.error("Problem while removing run : " + runID, e);
+			return null;
+		}
+	}
+
+	/**
+	 * removes all records pertaining to the static structure of a workflow.
+	 * 
+	 * @param workflowId
+	 *            the ID (not the external name) of the workflow whose static
+	 *            structure is to be deleted from the DB
+	 */
+	@Override
+	public void removeWorkflow(String workflowId) {
+		try {
+			writer.clearDBStatic(workflowId);
+		} catch (SQLException e) {
+			logger.error("Problem with removing static workflow: " + workflowId, e);
+		}
+	}
+
+	/**
+	 * returns a set of workflowIDs for a given runID. The set is a singleton if
+	 * the workflow has no nesting, but in general the list contains one
+	 * workflowID for each nested workflow involved in the run
+	 * 
+	 * @param runID
+	 *            the internal ID for a specific workflow run
+	 * @return a list of workflow IDs, one for each nested workflow involved in
+	 *         the input run
+	 */
+	@Override
+	public List<String> getWorkflowID(String runID) {
+		try {
+			return querier.getWorkflowIdsForRun(runID);
+		} catch (SQLException e) {
+			logger.error("Problem getting workflow ID: " + runID, e);
+			return null;
+		}
+	}
+
+	/**
+	 * @param runID
+	 *            the internal ID for a specific workflow run
+	 * @return the ID of the top-level workflow that executed during the input
+	 *         run
+	 */
+	@Override
+	public String getTopLevelWorkflowID(String runID) {
+		try {
+			return querier.getTopLevelWorkflowIdForRun(runID);
+		} catch (SQLException e) {
+			logger.error("Problem getting top level workflow: " + runID, e);
+			return null;
+		}
+	}
+
+	@Override
+	public List<Workflow> getWorkflowsForRun(String runID) {
+		try {
+			return querier.getWorkflowsForRun(runID);
+		} catch (SQLException e) {
+			logger.error("Problem getting workflows for run:" + runID, e);
+			return null;
+		}
+	}
+
+	/**
+	 * @return a list of {@link WorkflowRun} beans, each representing the
+	 *         complete description of a workflow run (note that this is not
+	 *         just the ID of the run)
+	 */
+	@Override
+	public List<WorkflowRun> getAllWorkflowIDs() {
+		try {
+			return querier.getRuns(null, null);
+		} catch (SQLException e) {
+			logger.error("Problem getting all workflow IDs", e);
+			return null;
+		}
+	}
+
+//	/ access static workflow structure
+
+	/**
+	 * @param workflowID
+	 * @return a Map: workflowID -> [ @ link ProvenanceProcessor} ] Each entry
+	 *         in the list pertains to one composing sub-workflow (if no nesting
+	 *         then this contains only one workflow, namely the top level one)
+	 */
+	@Override
+	public Map<String, List<ProvenanceProcessor>> getProcessorsInWorkflow(
+			String workflowID) {
+		return querier.getProcessorsDeep(null, workflowID);
+	}
+
+	@Override
+	public List<Collection> getCollectionsForRun(String wfInstanceID) {
+		return querier.getCollectionsForRun(wfInstanceID);
+	}
+
+	@Override
+	public List<PortBinding> getPortBindings(Map<String, String> constraints)
+			throws SQLException {
+		return querier.getPortBindings(constraints);
+	}
+
+	/**
+	 * lists all ports for a workflow
+	 * 
+	 * @param workflowID
+	 * @return a list of {@link Port} beans, each representing an input or
+	 *         output port for the workflow
+	 */
+	@Override
+	public List<Port> getPortsForDataflow(String workflowID) {
+		return querier.getPortsForDataflow(workflowID);
+	}
+
+	/**
+	 * lists all ports for a workflow
+	 * 
+	 * @param workflowID
+	 * @return a list of {@link Port} beans, each representing an input or
+	 *         output port for the workflow or a processor in the workflow
+	 */
+	@Override
+	public List<Port> getAllPortsInDataflow(String workflowID) {
+		return querier.getAllPortsInDataflow(workflowID);
+	}
+
+	/**
+	 * list all ports for a specific processor within a workflow
+	 * 
+	 * @param workflowID
+	 * @param processorName
+	 * @return a list of {@link Port} beans, each representing an input or
+	 *         output port for the input processor
+	 */
+	@Override
+	public List<Port> getPortsForProcessor(String workflowID,
+			String processorName) {
+		return querier.getPortsForProcessor(workflowID, processorName);
+	}
+
+	// PM added 5/2010
+	@Override
+	public String getWorkflowNameByWorkflowID(String workflowID) {
+		return querier.getWorkflow(workflowID).getExternalName();
+	}
+
+	@Override
+	public WorkflowTree getWorkflowNestingStructure(String workflowID)
+			throws SQLException {
+		return querier.getWorkflowNestingStructure(workflowID);
+	}
+
+//	public List<ProvenanceProcessor> getSuccessors(String workflowID, String processorName, String portName) {
+//	return null; // TODO
+//	}
+
+//	public List<String>   getActivities(String workflowID, String processorName) {
+//	return null; // TODO
+//	}
+
+//	/ configure provenance query functionality
+
+	/**
+	 * include valus of output ports in the query result? input port values are
+	 * always included<br>
+	 * default is FALSE
+	 */
+	@Override
+	public void toggleIncludeProcessorOutputs(boolean active) {
+		analyser.setReturnOutputs(active);
+	}
+
+	@Override
+	public boolean isIncludeProcessorOutputs() {
+		return analyser.isReturnOutputs();
+	}
+
+	/**
+	 * @return an instance of {@link InvocationContext} that can be used by a
+	 *         client to deref a Taverna data reference
+	 */
+	@Override
+	public InvocationContext getInvocationContext() {
+		return getProvenanceConnector().getInvocationContext();
+	}
+
+//	/ OPM management
+
+	/**
+	 * should an OPM graph be generated in response to a query?<br>
+	 * default is TRUE
+	 */
+	@Override
+	public void toggleOPMGeneration(boolean active) {
+		analyser.setGenerateOPMGraph(active);
+	}
+
+	/**
+	 * 
+	 * @return true if OPM is set to be generated in response to a query
+	 */
+	@Override
+	public boolean isOPMGenerationActive() {
+		return analyser.isGenerateOPMGraph();
+	}
+
+	/**
+	 * should actual artifact values be attached to OPM artifact nodes?<br>
+	 * default is FALSE<br/>
+	 * THIS IS CURRENTLY UNSUPPORTED -- DEFAULTS TO FALSE
+	 * 
+	 * @param active
+	 */
+	@Override
+	public void toggleAttachOPMArtifactValues(boolean active) {
+		analyser.setRecordArtifactValues(active);
+	}
+
+	/**
+	 * @return true if the OPM graph artifacts are annotated with actual values
+	 */
+	@Override
+	public boolean isAttachOPMArtifactValues() {
+		return analyser.isRecordArtifactValues();
+	}
+
+	/**
+	 * @deprecated as workflow 'names' are not globally unique, this method
+	 *             should not be used!
+	 * @param workflowName
+	 * @return
+	 */
+	@Override
+	public String getWorkflowIDForExternalName(String workflowName) {
+		return querier.getWorkflowIdForExternalName(workflowName);
+	}
+
+	@Override
+	public List<ProvenanceProcessor> getProcessorsForWorkflowID(
+			String workflowID) {
+		return querier.getProcessorsForWorkflow(workflowID);
+	}
+
+	/**
+	 * @return the singleton {@link AbstractProvenanceConnector} used by the API
+	 *         to operate on the DB. Currently we support MySQL
+	 *         {@link MySQLProvenanceConnector} and Derby
+	 *         {@link DerbyProvenanceConnector} connectors. The set of supported
+	 *         connectors is extensible. The available connectors are discovered
+	 *         automatically by the API upon startup, and it includes all the
+	 *         connectors that are mentioned in the &lt;dependencies> section of
+	 *         pom.xml for Maven module
+	 *         {@code net.sf.taverna.t2.core.provenanceconnector}
+	 */
+	@Override
+	public AbstractProvenanceConnector getProvenanceConnector() {
+		return connector;
+	}
+
+	/**
+	 * @param provenanceConnector
+	 *            a specific provenanceConnector used by the API
+	 */
+	public void setProvenanceConnector(
+			AbstractProvenanceConnector provenanceConnector) {
+		this.connector = provenanceConnector;
+	}
+
+	/**
+	 * @return
+	 */
+	@Override
+	public ProvenanceAnalysis getAnalysis() {
+		return analyser;
+	}
+
+	/**
+	 * @param pa
+	 *            the pa to set
+	 */
+	public void setPa(ProvenanceAnalysis pa) {
+		this.analyser = pa;
+	}
+
+	/**
+	 * @return the pq
+	 */
+	@Override
+	public ProvenanceQuery getQuery() {
+		return querier;
+	}
+
+	/**
+	 * @param pq
+	 *            the pq to set
+	 */
+	public void setPq(ProvenanceQuery pq) {
+		this.querier = pq;
+	}
+
+	@Override
+	public List<ProcessorEnactment> getProcessorEnactments(
+			String workflowRunId, String... processorPath) {
+		return querier.getProcessorEnactments(workflowRunId, processorPath);
+	}
+
+	@Override
+	public ProcessorEnactment getProcessorEnactmentByProcessId(
+			String workflowRunId, String processIdentifier, String iteration) {
+		return querier.getProcessorEnactmentByProcessId(workflowRunId,
+				processIdentifier, iteration);
+	}
+
+	@Override
+	public ProcessorEnactment getProcessorEnactment(String processorEnactmentId) {
+		return querier.getProcessorEnactment(processorEnactmentId);
+	}
+
+	@Override
+	public ProvenanceProcessor getProvenanceProcessor(String workflowId,
+			String processorNameRef) {
+		return querier.getProvenanceProcessorByName(workflowId, processorNameRef);
+	}
+
+	@Override
+	public ProvenanceProcessor getProvenanceProcessor(String processorId) {
+		return querier.getProvenanceProcessorById(processorId);
+	}
+
+	@Override
+	public Map<Port, T2Reference> getDataBindings(String dataBindingId) {
+		Map<Port, T2Reference> references = new HashMap<>();
+		for (Entry<Port, String> entry : querier.getDataBindings(dataBindingId)
+				.entrySet())
+			references.put(entry.getKey(), getProvenanceConnector()
+					.getReferenceService()
+					.referenceFromString(entry.getValue()));
+		return references;
+	}
+
+	@Override
+	public DataflowInvocation getDataflowInvocation(String workflowRunId) {
+		return querier.getDataflowInvocation(workflowRunId);
+	}
+
+	@Override
+	public DataflowInvocation getDataflowInvocation(
+			ProcessorEnactment processorEnactment) {
+		return querier.getDataflowInvocation(processorEnactment);
+	}
+
+	@Override
+	public List<DataflowInvocation> getDataflowInvocations(String workflowRunId) {
+		return querier.getDataflowInvocations(workflowRunId);
+	}
+
+	@Override
+	public List<DataLink> getDataLinks(String workflowId) {
+		try {
+			Map<String, String> queryConstraints = new HashMap<>();
+			queryConstraints.put("workflowId", workflowId);
+			return querier.getDataLinks(queryConstraints);
+		} catch (SQLException e) {
+			logger.error(
+					"Problem getting datalinks for workflow:" + workflowId, e);
+			return null;
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/api/ProvenanceConnectorType.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/api/ProvenanceConnectorType.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/api/ProvenanceConnectorType.java
new file mode 100644
index 0000000..5c32d42
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/api/ProvenanceConnectorType.java
@@ -0,0 +1,16 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package net.sf.taverna.t2.provenance.api;
+
+/**
+ * Defines names for the common Provenance Connector types
+ * 
+ * @author Stuart Owen
+ */
+public class ProvenanceConnectorType {
+	public static final String MYSQL = "mysql";
+	public static final String DERBY = "derby";
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/api/Query.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/api/Query.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/api/Query.java
new file mode 100644
index 0000000..e859c39
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/api/Query.java
@@ -0,0 +1,105 @@
+/**
+ * 
+ */
+package net.sf.taverna.t2.provenance.api;
+
+import java.util.List;
+
+import net.sf.taverna.t2.provenance.lineageservice.utils.ProvenanceProcessor;
+import net.sf.taverna.t2.provenance.lineageservice.utils.QueryPort;
+
+/**
+ * Bean encapsulating one provenance query, consisting of the following
+ * elements:
+ * <ul>
+ * <li>static scope: the (single) name of the workflow whose run(s) are queried
+ * <li>dynamic scope: a list of workflow run IDs.
+ * <li>a list of &lt;select> variables, encoded as List&lt;{@link QueryPort}>
+ * <li>a list of &lt;target> processors, encoded as List&lt;
+ * {@link ProvenanceProcessor}>
+ * </ul>
+ * 
+ * @author Paolo Missier
+ */
+public class Query {
+	private String workflowName;
+	private List<QueryPort> targetPorts;
+	private List<String> runIDList;
+	private List<ProvenanceProcessor> selectedProcessors;
+
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder();
+		sb.append("\n **** QUERY SCOPE: ****\n").append("\tworkflow name: ")
+				.append(getWorkflowName()).append("\n\truns: ");
+		for (String r : getRunIDList())
+			sb.append("\n\t").append(r);
+		sb.append("\n**** TARGET PORTS: ****\n");
+		for (QueryPort v : getTargetPorts())
+			sb.append("\n\t").append(v);
+		sb.append("\n\n**** SELECTED PROCESSORS: **** ");
+		for (ProvenanceProcessor pp : getSelectedProcessors())
+			sb.append("\n\t").append(pp);
+		return sb.toString();
+	}
+
+	/**
+	 * @return the targetVars
+	 */
+	public List<QueryPort> getTargetPorts() {
+		return targetPorts;
+	}
+
+	/**
+	 * @param targetVars
+	 *            the targetVars to set
+	 */
+	public void setTargetPorts(List<QueryPort> targetVars) {
+		this.targetPorts = targetVars;
+	}
+
+	/**
+	 * @return the selectedProcessors
+	 */
+	public List<ProvenanceProcessor> getSelectedProcessors() {
+		return selectedProcessors;
+	}
+
+	/**
+	 * @param selectedProcessors
+	 *            the selectedProcessors to set
+	 */
+	public void setFocus(List<ProvenanceProcessor> selectedProcessors) {
+		this.selectedProcessors = selectedProcessors;
+	}
+
+	/**
+	 * @return the runIDList
+	 */
+	public List<String> getRunIDList() {
+		return runIDList;
+	}
+
+	/**
+	 * @param runIDList
+	 *            the runIDList to set
+	 */
+	public void setRunIDList(List<String> runIDList) {
+		this.runIDList = runIDList;
+	}
+
+	/**
+	 * @return the workflowName
+	 */
+	public String getWorkflowName() {
+		return workflowName;
+	}
+
+	/**
+	 * @param workflowName
+	 *            the workflowName to set
+	 */
+	public void setWorkflowName(String workflowName) {
+		this.workflowName = workflowName;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/api/QueryAnswer.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/api/QueryAnswer.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/api/QueryAnswer.java
new file mode 100644
index 0000000..1cc563c
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/api/QueryAnswer.java
@@ -0,0 +1,47 @@
+/**
+ * 
+ */
+package net.sf.taverna.t2.provenance.api;
+
+/**
+ * Encapsulates a native Java data structure as a well as a String that holds
+ * the OPM graph that represents the query answer
+ * 
+ * @author Paolo Missier
+ * 
+ */
+public class QueryAnswer {
+	private NativeAnswer nativeAnswer;
+	private String _OPMAnswer_AsRDF;
+
+	/**
+	 * @return the native Java part of the query answer
+	 */
+	public NativeAnswer getNativeAnswer() {
+		return nativeAnswer;
+	}
+
+	/**
+	 * @param sets
+	 *            the query answer
+	 */
+	public void setNativeAnswer(NativeAnswer a) {
+		this.nativeAnswer = a;
+	}
+
+	/**
+	 * @return the OPM graph as RDF/XML string, or null if OPM was inhibited
+	 *         {@see OPM.computeGraph in APIClient.properties}
+	 */
+	public String getOPMAnswer_AsRDF() {
+		return _OPMAnswer_AsRDF;
+	}
+
+	/**
+	 * @param set
+	 *            the OPM graph as RDF/XML string
+	 */
+	public void setOPMAnswer_AsRDF(String asRDF) {
+		_OPMAnswer_AsRDF = asRDF;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/connector/AbstractProvenanceConnector.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/connector/AbstractProvenanceConnector.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/connector/AbstractProvenanceConnector.java
new file mode 100644
index 0000000..1609efe
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/connector/AbstractProvenanceConnector.java
@@ -0,0 +1,646 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.provenance.connector;
+
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+
+import net.sf.taverna.t2.invocation.InvocationContext;
+import net.sf.taverna.t2.provenance.item.ProvenanceItem;
+import net.sf.taverna.t2.provenance.item.WorkflowProvenanceItem;
+import net.sf.taverna.t2.provenance.lineageservice.EventProcessor;
+import net.sf.taverna.t2.provenance.lineageservice.LineageQueryResultRecord;
+import net.sf.taverna.t2.provenance.lineageservice.Provenance;
+import net.sf.taverna.t2.provenance.lineageservice.ProvenanceAnalysis;
+import net.sf.taverna.t2.provenance.lineageservice.ProvenanceQuery;
+import net.sf.taverna.t2.provenance.lineageservice.ProvenanceWriter;
+import net.sf.taverna.t2.provenance.lineageservice.WorkflowDataProcessor;
+import net.sf.taverna.t2.provenance.reporter.ProvenanceReporter;
+import net.sf.taverna.t2.reference.ReferenceService;
+
+import org.apache.log4j.Logger;
+
+import uk.org.taverna.configuration.database.DatabaseManager;
+
+/**
+ * Collects {@link ProvenanceItem}s as it travels up and down the dispatch stack
+ * inside the InvocationContext
+ *
+ * @author Ian Dunlop
+ * @author Stuart Owen
+ *
+ */
+public abstract class AbstractProvenanceConnector implements ProvenanceReporter {
+
+	public static enum ActivityTable {
+		Activity, activityId, activityDefinition, workflowId;
+
+		public static String getCreateTable() {
+			return "CREATE TABLE " + Activity + "(\n"
+			+ activityId + " varchar(36) NOT NULL,\n"
+			+ activityDefinition + " blob NOT NULL,\n"
+			+ workflowId + " varchar(100) NOT NULL, \n"
+			+ "PRIMARY KEY (" + activityId + ")\n" + ")";
+		}
+	}
+
+	public static enum CollectionTable {
+		Collection, collID, parentCollIDRef, workflowRunId, processorNameRef, portName, iteration;
+		public static String getCreateTable() {
+			return "CREATE TABLE " + Collection + " (\n"
+				+ collID + " varchar(100) NOT NULL,\n"
+				+ parentCollIDRef + " varchar(100) NOT NULL ,\n"
+				+ workflowRunId + " varchar(36) NOT NULL,\n"
+				+ processorNameRef + " varchar(100) NOT NULL,\n"
+				+ portName + " varchar(100) NOT NULL,\n"
+				+ iteration + " varchar(2000) NOT NULL default '',\n"
+				+ " PRIMARY KEY (\n"
+				+ collID + "," + workflowRunId + "," + processorNameRef
+				+ "," + portName + "," + parentCollIDRef + "," + iteration
+				+ "))";
+		}
+	}
+
+	public static enum DataBindingTable {
+		DataBinding, dataBindingId, portId, t2Reference, workflowRunId;
+
+		public static String getCreateTable() {
+			return "CREATE TABLE " + DataBinding + "(\n"
+			+ dataBindingId + " varchar(36) NOT NULL,\n"
+			+ portId + " varchar(36) NOT NULL,\n"
+			+ t2Reference + " varchar(100) NOT NULL,\n"
+			+ workflowRunId + " varchar(100) NOT NULL, \n"
+			+ "PRIMARY KEY (" + dataBindingId + "," + portId + ")\n" + ")";
+		}
+	}
+
+	public static enum DataflowInvocationTable {
+		DataflowInvocation, dataflowInvocationId,
+		workflowId,
+		invocationStarted, invocationEnded,
+		inputsDataBinding, outputsDataBinding,
+		parentProcessorEnactmentId, workflowRunId, completed;
+
+		public static String getCreateTable() {
+			return "CREATE TABLE " + DataflowInvocation + "(\n"
+			+ dataflowInvocationId + " varchar(36) NOT NULL,\n"
+			+ workflowId + " varchar(100) NOT NULL, \n"
+			+ invocationStarted + " timestamp, \n"
+			+ invocationEnded + " timestamp, \n"
+			+ inputsDataBinding + " varchar(36),\n"
+			+ outputsDataBinding + " varchar(36),\n"
+			+ parentProcessorEnactmentId + " varchar(36), \n"
+			+ workflowRunId + " varchar(100) NOT NULL, \n"
+			+ completed + " smallint NOT NULL,\n"
+			+ "PRIMARY KEY (" + dataflowInvocationId+ ")\n" + ")";
+		}
+	}
+
+	public static enum DataLinkTable {
+		Datalink, sourcePortName, sourcePortId, destinationPortId,
+		destinationPortName, sourceProcessorName, destinationProcessorName, workflowId;
+		public static String getCreateTable() {
+			return "CREATE TABLE " + Datalink + " (\n"
+					+ sourcePortName + " varchar(100) NOT NULL ,\n"
+					+ sourcePortId + " varchar(36) NOT NULL ,\n"
+					+ destinationPortId + " varchar(36) NOT NULL ,\n"
+					+ destinationPortName + " varchar(100) NOT NULL,\n"
+					+ sourceProcessorName + " varchar(100) NOT NULL,\n"
+					+ destinationProcessorName + " varchar(100) NOT NULL,\n"
+					+ workflowId + " varchar(36) NOT NULL,"
+					+ " PRIMARY KEY  ("
+					+ sourcePortId + "," + destinationPortId + "," + workflowId
+					+ "))";
+		}
+	}
+
+	public static enum PortBindingTable {
+		PortBinding, portName, workflowRunId, value, collIDRef, positionInColl, processorNameRef, valueType, ref, iteration, workflowId;
+		public static String getCreateTable() {
+			return  "CREATE TABLE " + PortBinding + " (\n"
+			+ portName + " varchar(100) NOT NULL,\n"
+			+ workflowRunId + " varchar(100) NOT NULL,\n"
+			+ value + " varchar(100) default NULL,\n"
+			+ collIDRef + " varchar(100),\n"
+			+ positionInColl + " int NOT NULL,\n"
+			+ processorNameRef + " varchar(100) NOT NULL,\n"
+			+ valueType + " varchar(50) default NULL,\n"
+			+ ref + " varchar(100) default NULL,\n"
+			+ iteration + " varchar(2000) NOT NULL,\n"
+			+ workflowId + " varchar(36),\n"
+			+ "PRIMARY KEY (\n"
+			+ portName + "," + workflowRunId + ","
+			+ processorNameRef + "," + iteration + ", " + workflowId
+			+ "))";
+		}
+	}
+
+	public static enum PortTable {
+		Port, portId, processorId, portName, isInputPort, processorName,
+		workflowId, depth, resolvedDepth, iterationStrategyOrder;
+		public static String getCreateTable() {
+			return  "CREATE TABLE " + Port + " (\n"
+			+ portId + " varchar(36) NOT NULL,\n"
+			+ processorId + " varchar(36),\n"
+			+ portName + " varchar(100) NOT NULL,\n"
+			+ isInputPort + " smallint NOT NULL ,\n"
+			+ processorName + " varchar(100) NOT NULL,\n"
+			+ workflowId + " varchar(36) NOT NULL,\n"
+			+ depth + " int,\n"
+			+ resolvedDepth + " int,\n"
+			+ iterationStrategyOrder + " smallint, \n"
+			+ "PRIMARY KEY (" + "portId" + "),\n"
+			+ "CONSTRAINT port_constraint UNIQUE (\n"
+			+ portName + "," + isInputPort + "," + processorName + "," + workflowId + "\n"
+			+ "))";
+		}
+	}
+
+	public static enum ProcessorEnactmentTable {
+		ProcessorEnactment, processEnactmentId, workflowRunId, processorId,
+		processIdentifier, iteration, parentProcessorEnactmentId,
+		enactmentStarted, enactmentEnded, initialInputsDataBindingId,
+		finalOutputsDataBindingId;
+
+		public static String getCreateTable() {
+			return "CREATE TABLE " + ProcessorEnactment + " (\n"
+			+ processEnactmentId + " varchar(36) NOT NULL, \n"
+			+ workflowRunId + " varchar(100) NOT NULL, \n"
+			+ processorId + " varchar(36) NOT NULL, \n"
+			+ processIdentifier + " varchar(2047) NOT NULL, \n"
+			+ iteration + " varchar(100) NOT NULL, \n"
+			+ parentProcessorEnactmentId + " varchar(36), \n"
+			+ enactmentStarted + " timestamp, \n"
+			+ enactmentEnded + " timestamp, \n"
+			+ initialInputsDataBindingId + " varchar(36), \n"
+			+ finalOutputsDataBindingId + " varchar(36), \n"
+			+ " PRIMARY KEY (" + processEnactmentId + ")" + ")";
+		}
+	}
+
+	public static enum ProcessorTable {
+		Processor,processorId, processorName,workflowId,firstActivityClass,isTopLevel ;
+		public static String getCreateTable() {
+			return  "CREATE TABLE "+ Processor +" (\n"
+			+ processorId + " varchar(36) NOT NULL,\n"
+			+ processorName + " varchar(100) NOT NULL,\n"
+			+ workflowId + " varchar(36) NOT NULL ,\n\n"
+			+ firstActivityClass + " varchar(100) default NULL,\n"
+			+ isTopLevel + " smallint, \n"
+			+ "PRIMARY KEY (" + processorId+ "),\n"
+			+ "CONSTRAINT processor_constraint UNIQUE (\n"
+			+	processorName + "," + workflowId + "))";
+		}
+	}
+
+	public static enum ServiceInvocationTable {
+		ServiceInvocation, processorEnactmentId, workflowRunId,
+		invocationNumber, invocationStarted, invocationEnded,
+		inputsDataBinding, outputsDataBinding, failureT2Reference,
+		activityId, initiatingDispatchLayer, finalDispatchLayer;
+
+		public static String getCreateTable() {
+			return "CREATE TABLE " + ServiceInvocation + "(\n"
+			+ processorEnactmentId + " varchar(36) NOT NULL,\n"
+			+ workflowRunId + " varchar(100) NOT NULL, \n"
+			+ invocationNumber + " bigint NOT NULL,\n"
+			+ invocationStarted + " timestamp, \n"
+			+ invocationEnded + " timestamp, \n"
+			+ inputsDataBinding + " varchar(36),\n"
+			+ outputsDataBinding + " varchar(36),\n"
+			+ failureT2Reference + " varchar(100) default NULL,\n"
+			+ activityId + " varchar(36),\n"
+			+ initiatingDispatchLayer + " varchar(250) NOT NULL,\n"
+			+ finalDispatchLayer + " varchar(250) NOT NULL,\n"
+			+ "PRIMARY KEY (" + processorEnactmentId + ", "
+			+ invocationNumber + "))";
+		}
+	}
+
+	public static enum WorkflowRunTable {
+		WorkflowRun, workflowRunId, workflowId, timestamp;
+		public static String getCreateTable() {
+			return  "CREATE TABLE " + WorkflowRun + " (\n"
+			+ workflowRunId + " varchar(36) NOT NULL,\n"
+			+ workflowId + " varchar(36) NOT NULL,\n"
+			+ timestamp + " timestamp NOT NULL default CURRENT_TIMESTAMP,\n"
+			+ " PRIMARY KEY (" + workflowRunId + ", " + workflowId + "))";
+		}
+	}
+
+	public static enum WorkflowTable {
+		WorkflowTable, workflowId, parentWorkflowId, externalName, dataflow;
+		public static String getCreateTable() {
+			return "CREATE TABLE " + "Workflow (\n" +
+					workflowId	+ " varchar(36) NOT NULL,\n"
+					+ parentWorkflowId + " varchar(100),\n"
+					+ externalName + " varchar(100),\n"
+					+ dataflow + " blob, \n"
+					+ "PRIMARY KEY  (" + workflowId	+ "))";
+		}
+	}
+
+	private static Logger logger = Logger.getLogger(AbstractProvenanceConnector.class);
+	private String saveEvents;
+	private ProvenanceAnalysis provenanceAnalysis;
+	private ExecutorService executor = Executors.newSingleThreadExecutor();
+	private boolean finished = false;
+	private String sessionID;
+	private InvocationContext invocationContext;
+	private ReferenceService referenceService;
+
+	private Provenance provenance;
+	private ProvenanceWriter writer;
+	private ProvenanceQuery query;
+	private WorkflowDataProcessor wfdp;
+	private EventProcessor eventProcessor;
+	private final DatabaseManager databaseManager;
+
+	public AbstractProvenanceConnector(DatabaseManager databaseManager) {
+		this.databaseManager = databaseManager;
+	}
+
+	/**
+	 * Set up the the {@link EventProcessor}, {@link ProvenanceWriter} &
+	 * {@link ProvenanceQuery}. Since it is an SPI you don't want any code
+	 * cluttering the default constructor. Call this method after instantiation
+	 * and after the dbURL has been set.
+	 */
+	public void init() {
+        createDatabase();
+		try {
+			setWfdp(new WorkflowDataProcessor());
+			getWfdp().setPq(getQuery());
+			getWfdp().setPw(getWriter());
+
+			setEventProcessor(new EventProcessor());
+			getEventProcessor().setPw(getWriter());
+			getEventProcessor().setPq(getQuery());
+			getEventProcessor().setWfdp(getWfdp());
+
+			setProvenanceAnalysis(new ProvenanceAnalysis(getQuery()));
+			setProvenance(new Provenance(getEventProcessor()));
+		} catch (InstantiationException | IllegalAccessException
+				| ClassNotFoundException | SQLException e) {
+			logger.error("Problem with provenance initialisation: ", e);
+		}
+	}
+
+	/**
+	 * @return the invocationContext
+	 */
+	@Override
+	public InvocationContext getInvocationContext() {
+		return invocationContext;
+	}
+
+	/**
+	 * @param invocationContext
+	 *            the invocationContext to set
+	 */
+	@Override
+	public void setInvocationContext(InvocationContext invocationContext) {
+		this.invocationContext = invocationContext;
+	}
+
+	/**
+	 * @return the referenceService
+	 */
+	@Override
+	public ReferenceService getReferenceService() {
+		return referenceService;
+	}
+
+	/**
+	 * @param referenceService
+	 *            the referenceService to set
+	 */
+	@Override
+	public void setReferenceService(ReferenceService referenceService) {
+		this.referenceService = referenceService;
+	}
+
+	/**
+	 * Uses a {@link ScheduledThreadPoolExecutor} to process events in a Thread
+	 * safe manner
+	 */
+	@Override
+	public synchronized void addProvenanceItem(
+			final ProvenanceItem provenanceItem) {
+
+//		Runnable runnable = new Runnable() {
+//
+//			public void run() {
+				try {
+
+					getProvenance().acceptRawProvenanceEvent(
+							provenanceItem.getEventType(), provenanceItem);
+
+				} catch (SQLException e) {
+					logger.warn("Could not add provenance for " + provenanceItem.getEventType() + " " + provenanceItem.getIdentifier(), e);
+				} catch (IOException e) {
+					logger.error("Could not add provenance for " + provenanceItem.getEventType() + " " + provenanceItem.getIdentifier(), e);
+				} catch (RuntimeException e) {
+					logger.error("Could not add provenance for " + provenanceItem.getEventType() + " " + provenanceItem.getIdentifier(), e);
+				}
+//
+//			}
+//		};
+//		getExecutor().execute(runnable);
+
+	}
+
+	protected Connection getConnection() throws SQLException {
+		return databaseManager.getConnection();
+	}
+
+	/**
+	 * Used by database backed provenance stores. Ask the implementation to
+	 * create the database. Requires each datbase type to create all its own
+	 * tables
+	 */
+	public abstract void createDatabase();
+
+
+	public void clearDatabase() { clearDatabase(true); }
+
+	/**
+	 * Clear all the values in the database but keep the db there
+	 */
+	public void clearDatabase(boolean isClearDB) {
+		if (isClearDB) {
+			logger.info("clearing DB");
+			try {
+				getWriter().clearDBStatic();
+
+				Set<String> danglingDataRefs = getWriter().clearDBDynamic();
+
+				logger.info("references collected during removeRun:");
+				for (String s : danglingDataRefs)
+					logger.info(s);
+			} catch (SQLException e) {
+				logger.error("Problem clearing database", e);
+			}
+		} else {
+			logger.error("clearDB is FALSE: not clearing");
+		}
+
+//		String q = null;
+//		Connection connection = null;
+
+//		Statement stmt = null;
+//		try {
+//		connection = getConnection();
+//		stmt = connection.createStatement();
+//		} catch (SQLException e) {
+//		logger.warn("Could not create database statement :" + e);
+//		} catch (InstantiationException e) {
+//		logger.warn("Could not create database statement :" + e);
+//		} catch (IllegalAccessException e) {
+//		logger.warn("Could not create database statement :" + e);
+//		} catch (ClassNotFoundException e) {
+//		logger.warn("Could not create database statement :" + e);
+//		}
+
+//		q = "DELETE FROM Workflow";
+//		try {
+//		stmt.executeUpdate(q);
+//		} catch (SQLException e) {
+//		logger.warn("Could not execute statement " + q + " :" + e);
+//		}
+
+//		q = "DELETE FROM Processor";
+//		try {
+//		stmt.executeUpdate(q);
+//		} catch (SQLException e) {
+//		logger.warn("Could not execute statement " + q + " :" + e);
+//		}
+
+//		q = "DELETE FROM Datalink";
+//		try {
+//		stmt.executeUpdate(q);
+//		} catch (SQLException e) {
+//		logger.warn("Could not execute statement " + q + " :" + e);
+//		}
+
+//		q = "DELETE FROM Port";
+//		try {
+//		stmt.executeUpdate(q);
+//		} catch (SQLException e) {
+//		logger.warn("Could not execute statement " + q + " :" + e);
+//		}
+
+//		q = "DELETE FROM WorkflowRun";
+//		try {
+//		stmt.executeUpdate(q);
+//		} catch (SQLException e) {
+//		logger.warn("Could not execute statement " + q + " :" + e);
+//		}
+
+//		q = "DELETE FROM ProcBinding";
+//		try {
+//		stmt.executeUpdate(q);
+//		} catch (SQLException e) {
+//		logger.warn("Could not execute statement " + q + " :" + e);
+//		}
+
+//		q = "DELETE FROM PortBinding";
+//		try {
+//		stmt.executeUpdate(q);
+//		} catch (SQLException e) {
+//		logger.warn("Could not execute statement " + q + " :" + e);
+//		}
+
+//		q = "DELETE FROM Collection";
+//		try {
+//		stmt.executeUpdate(q);
+//		} catch (SQLException e) {
+//		logger.warn("Could not execute statement " + q + " :" + e);
+//		}
+
+
+//		if (connection!=null) try {
+//		connection.close();
+//		} catch (SQLException ex) {
+//		logger.error("Error closing connection",ex);
+//		}
+	}
+
+	/**
+	 * The name for this type of provenance connector. Is used by the workbench
+	 * to ensure it adds the correct one to the InvocationContext
+	 *
+	 * @return
+	 */
+	public abstract String getName();
+
+	/**
+	 * A unique identifier for this run of provenance, should correspond to the
+	 * initial {@link WorkflowProvenanceItem} idenifier that gets sent through
+	 *
+	 * @param identifier
+	 */
+	@Override
+	public void setSessionID(String sessionID) {
+		this.sessionID = sessionID;
+	}
+
+	/**
+	 * What is the unique identifier used by this connector
+	 *
+	 * @return
+	 */
+	@Override
+	public String getSessionID() {
+		return sessionID;
+	}
+
+
+	public List<LineageQueryResultRecord> computeLineage(String workflowRun,
+			String port, String proc, String path, Set<String> selectedProcessors) {
+		return null;
+	}
+
+	public String getDataflowInstance(String dataflowId) {
+		try {
+			return (getProvenance()).getPq().getRuns(dataflowId, null).get(0)
+					.getWorkflowRunId();
+		} catch (SQLException e) {
+			logger.error("Error finding the dataflow instance", e);
+			return null;
+		}
+	}
+
+	/**
+	 * @return the saveEvents
+	 */
+	public String getSaveEvents() {
+		return saveEvents;
+	}
+
+	/**
+	 * @param saveEvents
+	 *            the saveEvents to set
+	 */
+	public void setSaveEvents(String saveEvents) {
+		this.saveEvents = saveEvents;
+	}
+
+	public void setProvenance(Provenance provenance) {
+		this.provenance = provenance;
+	}
+
+	public Provenance getProvenance() {
+		return provenance;
+	}
+
+	public void setFinished(boolean finished) {
+		this.finished = finished;
+	}
+
+	public boolean isFinished() {
+		return finished;
+	}
+
+	public void setExecutor(ExecutorService executor) {
+		this.executor = executor;
+	}
+
+	public synchronized ExecutorService getExecutor() {
+		return executor;
+	}
+
+	public void setProvenanceAnalysis(ProvenanceAnalysis provenanceAnalysis) {
+		this.provenanceAnalysis = provenanceAnalysis;
+	}
+
+	/**
+	 * Use this {@link ProvenanceAnalysis} to carry out lineage queries on the
+	 * provenance
+	 *
+	 * @return
+	 */
+	public ProvenanceAnalysis getProvenanceAnalysis() {
+		return provenanceAnalysis;
+	}
+
+	/**
+	 * @return the writer
+	 */
+	public ProvenanceWriter getWriter() {
+		return writer;
+	}
+
+	/**
+	 * @param writer the writer to set
+	 */
+	protected void setWriter(ProvenanceWriter writer) {
+		this.writer = writer;
+	}
+
+	/**
+	 * @return the query
+	 */
+	public ProvenanceQuery getQuery() {
+		return query;
+	}
+
+	/**
+	 * @param query the query to set
+	 */
+	protected void setQuery(ProvenanceQuery query) {
+		this.query = query;
+	}
+
+	/**
+	 * @return the wfdp
+	 */
+	public WorkflowDataProcessor getWfdp() {
+		return wfdp;
+	}
+
+	/**
+	 * @param wfdp the wfdp to set
+	 */
+	public void setWfdp(WorkflowDataProcessor wfdp) {
+		this.wfdp = wfdp;
+	}
+
+	/**
+	 * @return the eventProcessor
+	 */
+	public EventProcessor getEventProcessor() {
+		return eventProcessor;
+	}
+
+	/**
+	 * @param eventProcessor the eventProcessor to set
+	 */
+	public void setEventProcessor(EventProcessor eventProcessor) {
+		this.eventProcessor = eventProcessor;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/connector/ProvenanceSQL.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/connector/ProvenanceSQL.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/connector/ProvenanceSQL.java
new file mode 100644
index 0000000..628c80e
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/connector/ProvenanceSQL.java
@@ -0,0 +1,5 @@
+package net.sf.taverna.t2.provenance.connector;
+
+public class ProvenanceSQL {
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/AnnotationsLoader.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/AnnotationsLoader.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/AnnotationsLoader.java
new file mode 100644
index 0000000..203c168
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/AnnotationsLoader.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.provenance.lineageservice;
+
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.jdom.Document;
+import org.jdom.Element;
+import org.jdom.JDOMException;
+import org.jdom.input.SAXBuilder;
+
+/**
+ * @author Paolo Missier
+ * 
+ */
+public class AnnotationsLoader {
+	private static Logger logger = Logger.getLogger(AnnotationsLoader.class);
+
+	/**
+	 * @param annotationFile
+	 *            by convention we use <workflow file name>+"annotations"
+	 * @return a map pname -> annotation so that the lineage query alg can use
+	 *         the annotation when processing pname
+	 */
+	@SuppressWarnings("unchecked")
+	public Map<String,List<String>>  getAnnotations(String annotationFile)  {
+		Map<String, List<String>> procAnnotations = new HashMap<>();
+
+		// load XML file as doc
+//		parse the event into DOM
+		SAXBuilder b = new SAXBuilder();
+
+		try {
+			Document d = b.build(new FileReader(annotationFile));
+			if (d == null)
+				return null;
+
+			// look for all processor elements
+			for (Element el : (List<Element>) d.getRootElement().getChildren()) {
+				String pName = el.getAttributeValue("name");
+				logger.info("processor name: " + pName);
+
+				List<String> annotations = new ArrayList<>();
+				// extract all annotations for this pname
+
+				for (Element annotElement : (List<Element>) el.getChildren()) {
+					String annot = annotElement.getAttributeValue("type");
+					logger.info("annotation: " + annot);
+
+					// add this annotation
+					annotations.add(annot);
+				}
+
+				procAnnotations.put(pName, annotations);
+			}
+		} catch (JDOMException | IOException e) {
+			logger.error("Problem getting annotations from: " + annotationFile,
+					e);
+		}
+		return procAnnotations;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/Dependencies.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/Dependencies.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/Dependencies.java
new file mode 100644
index 0000000..3522dce
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/Dependencies.java
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.provenance.lineageservice;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.ListIterator;
+
+/**
+ * Java bean to hold a list of {@link LineageQueryResultRecord}, representing
+ * one record in the provenance DB at the finest possible level of granularity,
+ * i.e., a single value possibly within a collection, bound to a processor port
+ * and associated to a specific run of a specific workflow.
+ * 
+ * @author Paolo Missier
+ * @see LineageQueryResultRecord
+ */
+public class Dependencies {
+	final public static String COLL_TYPE = "referenceSetCollection";
+	final public static String ATOM_TYPE = "referenceSet";
+	
+	boolean printResolvedValue;
+
+	private List<LineageQueryResultRecord> records = new ArrayList<>();
+
+	public ListIterator<LineageQueryResultRecord> iterator() {
+		return getRecords().listIterator();
+	}
+
+	/**
+	 * adds a single record to the list of dependencies
+	 * 
+	 * @param workflowId
+	 * @param pname
+	 * @param vname
+	 * @param workflowRun
+	 * @param iteration
+	 * @param collIdRef
+	 * @param parentCollIDRef
+	 * @param value
+	 * @param resolvedValue
+	 * @param type
+	 * @param isInput
+	 * @param isCollection
+	 */
+	public void addLineageQueryResultRecord(String workflowId, String pname,
+			String vname, String workflowRun, String iteration,
+			String collIdRef, String parentCollIDRef, String value,
+			String resolvedValue, String type, boolean isInput,
+			boolean isCollection) {
+
+		LineageQueryResultRecord record = new LineageQueryResultRecord();
+
+		record.setWorkflowId(workflowId);
+		record.setWorkflowRunId(workflowRun);
+		record.setProcessorName(pname);
+		record.setValue(value);
+		record.setPortName(vname);
+		record.setIteration(iteration);
+		record.setResolvedValue(resolvedValue);
+		record.setIsInputPort(isInput);
+		record.setCollectionT2Reference(collIdRef);
+		record.setParentCollIDRef(parentCollIDRef);
+		record.setCollection(isCollection);
+
+		getRecords().add(record);
+	}
+
+	/**
+	 * populates the bean with an entire list of {@link LineageQueryResultRecord} elements
+	 * @param records
+	 */
+	public void setRecords(List<LineageQueryResultRecord> records) {
+		this.records = records;
+	}
+
+	/**
+	 * @return the entire set of records
+	 */
+	public List<LineageQueryResultRecord> getRecords() {
+		return records;
+	}
+
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder();
+		for (LineageQueryResultRecord record : getRecords()) {
+			record.setPrintResolvedValue(printResolvedValue);
+			sb.append("***  record: ****\n"+record.toString());
+		}		
+		return sb.toString();
+	}
+
+	/**
+	 * @return true is the records contain the actual values, in addition to the URI references to the values
+	 * <br/>NOT YET SUPPORTED. This switch is currently ignored and no values are returned in the current version 
+	 */
+	public boolean isPrintResolvedValue() {
+		return printResolvedValue;
+	}
+
+	/**
+	 * @param toggles insertion of values in addition to references to values in the records
+	 * <br/>NOT YET SUPPORTED. This switch is currently ignored and no values are returned in the current version 
+	 */
+	public void setPrintResolvedValue(boolean printResolvedValue) {
+		this.printResolvedValue = printResolvedValue;
+	}
+}


[34/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/SwingAwareObserver.java
----------------------------------------------------------------------
diff --git a/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/SwingAwareObserver.java b/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/SwingAwareObserver.java
new file mode 100644
index 0000000..39435d7
--- /dev/null
+++ b/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/SwingAwareObserver.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (C) 2012 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.lang.observer;
+
+import javax.swing.SwingUtilities;
+
+/**
+ * Implementation of an {@link Observer} that adds calls to notify to the AWT event dispatching
+ * thread.
+ *
+ * @author David Withers
+ */
+public abstract class SwingAwareObserver<Message> implements Observer<Message> {
+
+	@Override
+	public void notify(final Observable<Message> sender, final Message message) throws Exception {
+	    Runnable runnable = new Runnable() {
+			@Override
+			public void run() {
+				notifySwing(sender, message);
+			}
+	    };
+		if (SwingUtilities.isEventDispatchThread()) {
+			runnable.run();
+		} else {
+			// T2-971
+			SwingUtilities.invokeLater(runnable);
+		}
+	}
+
+	public abstract void notifySwing(Observable<Message> sender, Message message);
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/package-info.java
----------------------------------------------------------------------
diff --git a/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/package-info.java b/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/package-info.java
new file mode 100644
index 0000000..e9d3ff2
--- /dev/null
+++ b/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/package-info.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+/**
+ * Implementation of the observer pattern.  {@link Observer}s registers with an 
+ * {@link Observable} using {@link Observable#addObserver(Observer)}, and will receive 
+ * notifications as a call to {@link Observer#notify(Observable, Object)}. 
+ * <p>
+ * Typical implementations of {@link Observable} will be delegating to a 
+ * {@link MultiCaster} to do the boring observer registration and message 
+ * dispatching.
+ * </p>
+ * <p>
+ * Example of Observable:
+ * <pre>
+ * public class MyObservable implements Observable<MyEvent> {
+ * 	 public static class MyEvent {
+ * 		// ..
+ * 	 }
+ * 	 private MultiCaster&lt:MyEvent&gt; multiCaster = new MultiCaster&lt:MyEvent&gt;(this);
+ * 
+ *	 public void doStuff() {
+ *		multiCaster.notify(new MyEvent());
+ *	 }
+ * 
+ * 	 public void addObserver(Observer<MyEvent> observer) {
+ * 		multiCaster.addObserver(observer);
+ * 	 }
+ * 
+ * 	 public List<Observer<MyEvent>> getObservers() {
+ * 		return multiCaster.getObservers();
+ * 	 }
+ * 
+ * 	 public void removeObserver(Observer<MyEvent> observer) {
+ * 		multiCaster.removeObserver(observer);
+ * 	 }
+ * }
+ * </pre>
+ * And an observer that is notified when MyObservable.doStuff() is called:
+ * <pre>
+ * public class MyObserver implements Observer<MyEvent> {
+ *	 public void notify(Observable<MyEvent> sender, MyEvent message) {
+ *		System.out.println("Receieved " + message + " from " + sender);
+ * 	 }
+ * }
+ * </pre>
+ * Example of usage:
+ * <pre>
+ * 		MyObservable observable = new MyObservable();
+ *		MyObserver observer = new MyObserver();
+ *		observable.addObserver(observer);
+ *		observable.doStuff();
+ *	</pre>
+ */
+package net.sf.taverna.t2.lang.observer;
+

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-observer/src/test/java/net/sf/taverna/t2/lang/observer/ObserverTest.java
----------------------------------------------------------------------
diff --git a/taverna-observer/src/test/java/net/sf/taverna/t2/lang/observer/ObserverTest.java b/taverna-observer/src/test/java/net/sf/taverna/t2/lang/observer/ObserverTest.java
new file mode 100644
index 0000000..661cbbc
--- /dev/null
+++ b/taverna-observer/src/test/java/net/sf/taverna/t2/lang/observer/ObserverTest.java
@@ -0,0 +1,133 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.lang.observer;
+
+import static org.junit.Assert.*;
+
+import java.util.List;
+
+import net.sf.taverna.t2.lang.observer.MultiCaster;
+import net.sf.taverna.t2.lang.observer.Observable;
+import net.sf.taverna.t2.lang.observer.Observer;
+
+import org.junit.Test;
+
+public class ObserverTest {
+
+	@Test
+	public void registerObserver() throws Exception {
+		MyObservable observable = new MyObservable();
+		MyObserver observer1 = new MyObserver();
+		MyObserver observer2 = new MyObserver();
+
+		observable.triggerEvent(); // don't notify, but increase count
+		assertNull(observer1.lastMessage);
+		observable.addObserver(observer1);
+		assertNull(observer1.lastMessage);
+		assertNull(observer2.lastMessage);
+		assertNull(observer1.lastSender);
+		assertNull(observer2.lastSender);
+		observable.triggerEvent();
+		assertEquals("This is message 1", observer1.lastMessage);
+		assertSame(observable, observer1.lastSender);
+		assertNull(observer2.lastSender);
+
+		observable.addObserver(observer2);
+		assertNull(observer2.lastMessage);
+		observable.triggerEvent();
+		assertEquals("This is message 2", observer1.lastMessage);
+		assertEquals("This is message 2", observer2.lastMessage);
+		assertSame(observable, observer1.lastSender);
+		assertSame(observable, observer2.lastSender);
+
+		MyObservable otherObservable = new MyObservable();
+		otherObservable.addObserver(observer2);
+		otherObservable.triggerEvent();
+		// New instance, should start from 0
+		assertEquals("This is message 0", observer2.lastMessage);
+		assertSame(otherObservable, observer2.lastSender);
+
+		// observer1 unchanged
+		assertEquals("This is message 2", observer1.lastMessage);
+		assertSame(observable, observer1.lastSender);
+
+	}
+
+	@Test
+	public void concurrencyTest() {
+		MyObservable observable = new MyObservable();
+		MyObserver dummyObserver = new MyObserver();
+		SelvRemovingObserver selfRemoving = new SelvRemovingObserver();
+		observable.addObserver(dummyObserver);
+		observable.addObserver(selfRemoving);
+		assertEquals(2, observable.getObservers().size());
+		observable.triggerEvent();
+		
+		
+	}
+	
+	public class MyObservable implements Observable<String> {
+
+		private int counter = 0;
+		MultiCaster<String> multiCaster = new MultiCaster<String>(this);
+
+		public void addObserver(Observer<String> observer) {
+			multiCaster.addObserver(observer);
+		}
+
+		public void removeObserver(Observer<String> observer) {
+			multiCaster.removeObserver(observer);
+		}
+
+		public void triggerEvent() {
+			multiCaster.notify("This is message " + counter++);
+		}
+
+		public List<Observer<String>> getObservers() {
+			return multiCaster.getObservers();
+		}
+	}
+
+	public class MyObserver implements Observer<String> {
+		String lastMessage = null;
+		Observable<String> lastSender = null;
+
+		public void notify(Observable<String> sender, String message) {
+			lastSender = sender;
+			lastMessage = message;
+		}
+	}
+	
+	public class SelvRemovingObserver implements Observer<String> {
+
+		public int called=0;
+		
+		public void notify(Observable<String> sender, String message) {
+			called++;
+			if (called > 1) {
+				fail("Did not remove itself");
+			}
+			sender.removeObserver(this);
+		}
+		
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/pom.xml b/taverna-platform-integration-tests/pom.xml
new file mode 100644
index 0000000..362fbdc
--- /dev/null
+++ b/taverna-platform-integration-tests/pom.xml
@@ -0,0 +1,635 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.taverna.engine</groupId>
+		<artifactId>taverna-engine</artifactId>
+		<version>3.1.0-incubating-SNAPSHOT</version>
+	</parent>
+	<artifactId>taverna-integration-tests</artifactId>
+	<name>Apache Taverna Platform integration tests</name>
+	<properties>
+		<spring.dm.version>2.0.0.M1</spring.dm.version>
+		<spring.version>3.0.0.RC1</spring.version>
+	</properties>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-surefire-plugin</artifactId>
+				<configuration>
+					<forkMode>pertest</forkMode>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-dependency-plugin</artifactId>
+				<executions>
+					<execution>
+						<id>copy</id>
+						<phase>generate-test-resources</phase>
+						<goals>
+							<goal>copy</goal>
+						</goals>
+						<configuration>
+							<artifactItems>
+								<!-- xerces and xalan are required for the tests but the test framework -->
+								<!-- fails to run if they are put on the test classpath by maven -->
+								<!-- This ensures they are pulled into the local repository -->
+								<artifactItem>
+									<groupId>org.apache.xalan</groupId>
+									<artifactId>com.springsource.org.apache.xalan</artifactId>
+									<version>2.7.1</version>
+								</artifactItem>
+								<artifactItem>
+									<groupId>org.apache.xerces</groupId>
+									<artifactId>com.springsource.org.apache.xerces</artifactId>
+									<version>2.9.1</version>
+								</artifactItem>
+							</artifactItems>
+							<outputDirectory>${project.build.directory}/tmp</outputDirectory>
+							<overWriteReleases>false</overWriteReleases>
+							<overWriteSnapshots>true</overWriteSnapshots>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+	<dependencies>
+		<!-- Spring OSGI testing framework -->
+		<dependency>
+			<groupId>org.springframework.osgi</groupId>
+			<artifactId>spring-osgi-test</artifactId>
+			<version>${spring.dm.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework.osgi</groupId>
+			<artifactId>spring-osgi-annotation</artifactId>
+			<version>${spring.dm.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework.osgi</groupId>
+			<artifactId>spring-osgi-core</artifactId>
+			<version>${spring.dm.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework.osgi</groupId>
+			<artifactId>spring-osgi-extender</artifactId>
+			<version>${spring.dm.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>org.springframework.aop</artifactId>
+			<version>${spring.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>org.springframework.asm</artifactId>
+			<version>${spring.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>org.springframework.beans</artifactId>
+			<version>${spring.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>org.springframework.context</artifactId>
+			<version>${spring.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>org.springframework.core</artifactId>
+			<version>${spring.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>org.springframework.jdbc</artifactId>
+			<version>${spring.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>org.springframework.orm</artifactId>
+			<version>${spring.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>org.springframework.transaction</artifactId>
+			<version>${spring.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.derby</groupId>
+			<artifactId>com.springsource.org.apache.derby</artifactId>
+			<version>10.5.1000001.764942</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.derby</groupId>
+			<artifactId>com.springsource.org.apache.derby.client</artifactId>
+			<version>10.5.1000001.764942</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.derby</groupId>
+			<artifactId>com.springsource.org.apache.derby.drda</artifactId>
+			<version>10.5.1000001.764942</version>
+		</dependency>
+		<dependency>
+			<groupId>org.aopalliance</groupId>
+			<artifactId>com.springsource.org.aopalliance</artifactId>
+			<version>1.0.0</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.aspectj</groupId>
+			<artifactId>com.springsource.org.aspectj.runtime</artifactId>
+			<version>1.6.0</version>
+		</dependency>
+		<dependency>
+			<groupId>org.aspectj</groupId>
+			<artifactId>com.springsource.org.aspectj.weaver</artifactId>
+			<version>1.6.0</version>
+		</dependency>
+		<dependency>
+			<groupId>org.objectweb.asm</groupId>
+			<artifactId>com.springsource.org.objectweb.asm</artifactId>
+			<version>2.2.3</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>com.springsource.slf4j.api</artifactId>
+			<version>1.5.6</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>com.springsource.slf4j.log4j</artifactId>
+			<version>1.5.6</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+			<version>1.2.16</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>com.springsource.slf4j.org.apache.commons.logging</artifactId>
+			<version>1.5.6</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>3.8.2</version>
+			<scope>test</scope>
+		</dependency>
+
+		<!-- Equinox OSGI Framework -->
+		<dependency>
+			<groupId>org.eclipse.osgi</groupId>
+			<artifactId>org.eclipse.osgi</artifactId>
+			<version>3.6.0.v20100517</version>
+			<scope>test</scope>
+		</dependency>
+
+		<!-- Felix OSGI Framework -->
+		<dependency>
+			<groupId>org.apache.felix</groupId>
+			<artifactId>org.apache.felix.main</artifactId>
+			<version>3.2.2</version>
+			<scope>test</scope>
+		</dependency>
+
+		<!-- OSGI Enterprise Services -->
+		<dependency>
+			<groupId>org.apache.aries.jndi</groupId>
+			<artifactId>org.apache.aries.jndi</artifactId>
+			<version>0.3</version>
+		</dependency>
+
+		<!-- Taverna OSGI Services -->
+		<!-- <dependency> <groupId>org.apache.taverna.osgi</groupId> <artifactId>xml-parser-service</artifactId>
+			<version>${taverna.osgi.version}</version> <exclusions> <exclusion> <groupId>org.apache.xerces</groupId>
+			<artifactId>com.springsource.org.apache.xerces</artifactId> </exclusion>
+			</exclusions> </dependency> -->
+		<dependency>
+			<groupId>org.apache.taverna.osgi</groupId>
+			<artifactId>xml-transformer-service</artifactId>
+			<version>${taverna.osgi.version}</version>
+			<exclusions>
+				<exclusion>
+					<groupId>org.apache.xalan</groupId>
+					<artifactId>com.springsource.org.apache.xalan</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+
+		<!-- Taverna -->
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-workflowmodel-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-workflowmodel-core-extensions</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-workflowmodel-impl</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-reference-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-reference-types</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>reference-impl</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-observer</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<!-- is this needed here?  (Why?)
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>ui</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+	-->
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-credential-manager</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-credential-manager-impl</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.osgi</groupId>
+			<artifactId>taverna-configuration-api</artifactId>
+			<version>${taverna.osgi.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.osgi</groupId>
+			<artifactId>taverna-configuration-impl</artifactId>
+			<version>${taverna.osgi.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.osgi</groupId>
+			<artifactId>taverna-app-configuration-api</artifactId>
+			<version>${taverna.osgi.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.osgi</groupId>
+			<artifactId>taverna-app-configuration-impl</artifactId>
+			<version>${taverna.osgi.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-database-configuration-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-database-configuration-impl</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+
+		<!-- Taverna Platform -->
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-capability-impl</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-execution-impl</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-run-impl</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-execution-local</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-report-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+
+		<!-- Scufl2 -->
+		<dependency>
+			<groupId>org.apache.taverna.language</groupId>
+			<artifactId>taverna-scufl2-api</artifactId>
+			<version>${taverna.language.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.language</groupId>
+			<artifactId>taverna-scufl2-t2flow</artifactId>
+			<version>${taverna.language.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.language</groupId>
+			<artifactId>taverna-scufl2-rdfxml</artifactId>
+			<version>${taverna.language.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.language</groupId>
+			<artifactId>taverna-scufl2-ucfpackage</artifactId>
+			<version>${taverna.language.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.language</groupId>
+			<artifactId>taverna-scufl2-validation</artifactId>
+			<version>${taverna.language.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.language</groupId>
+			<artifactId>taverna-scufl2-validation-correctness</artifactId>
+			<version>${taverna.language.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.language</groupId>
+			<artifactId>taverna-scufl2-validation-structural</artifactId>
+			<version>${taverna.language.version}</version>
+		</dependency>
+
+		<!-- Taverna CommandLine Tool -->
+		<dependency>
+			<groupId>org.apache.taverna.commandline</groupId>
+			<artifactId>taverna-commandline-common</artifactId>
+			<version>2.0-SNAPSHOT</version>
+		</dependency>
+
+		<!-- Dependencies declared as provided by some poms - specified here to
+			ensure that they are in the local repository for the testing framework -->
+		<dependency>
+			<groupId>commons-dbcp</groupId>
+			<artifactId>commons-dbcp</artifactId>
+			<version>1.4</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-pool</groupId>
+			<artifactId>commons-pool</artifactId>
+			<version>1.5.6</version>
+		</dependency>
+		<dependency>
+			<groupId>com.sun.xml</groupId>
+			<artifactId>com.springsource.com.sun.xml.bind</artifactId>
+			<version>2.2.0</version>
+		</dependency>
+		<dependency>
+			<groupId>com.thoughtworks.xstream</groupId>
+			<artifactId>com.springsource.com.thoughtworks.xstream</artifactId>
+			<version>1.2.2</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.activation</groupId>
+			<artifactId>com.springsource.javax.activation</artifactId>
+			<version>1.1.1</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.jms</groupId>
+			<artifactId>com.springsource.javax.jms</artifactId>
+			<version>1.1.0</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.mail</groupId>
+			<artifactId>com.springsource.javax.mail</artifactId>
+			<version>1.4.0</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.servlet</groupId>
+			<artifactId>com.springsource.javax.servlet</artifactId>
+			<version>2.5.0</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.transaction</groupId>
+			<artifactId>com.springsource.javax.transaction</artifactId>
+			<version>1.1.0</version>
+		</dependency>
+		<dependency>
+			<groupId>javax.wsdl</groupId>
+			<artifactId>com.springsource.javax.wsdl</artifactId>
+			<version>1.6.1</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.xml.soap</groupId>
+			<artifactId>com.springsource.javax.xml.soap</artifactId>
+			<version>1.3.0</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.xml.rpc</groupId>
+			<artifactId>com.springsource.javax.xml.rpc</artifactId>
+			<version>1.1.0</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.xml.stream</groupId>
+			<artifactId>com.springsource.javax.xml.stream</artifactId>
+			<version>1.0.1</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.axis</groupId>
+			<artifactId>com.springsource.org.apache.axis</artifactId>
+			<version>1.4.0</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>com.springsource.org.apache.commons.codec</artifactId>
+			<version>1.4.0</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>com.springsource.org.apache.commons.csv</artifactId>
+			<version>1.0.0.BUILD-20080106</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>com.springsource.org.apache.commons.discovery</artifactId>
+			<version>0.4.0</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>com.springsource.org.apache.commons.httpclient</artifactId>
+			<version>3.1.0</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>com.springsource.org.apache.commons.io</artifactId>
+			<version>1.4.0</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>com.springsource.org.apache.commons.lang</artifactId>
+			<version>2.5.0</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>com.springsource.org.apache.commons.logging</artifactId>
+			<version>1.1.1</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>com.springsource.org.apache.commons.net</artifactId>
+			<version>1.4.1</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>com.springsource.org.apache.commons.cli</artifactId>
+			<version>1.2.0</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.httpcomponents</groupId>
+			<artifactId>com.springsource.org.apache.httpcomponents.httpclient</artifactId>
+			<version>4.1.1</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.httpcore</groupId>
+			<artifactId>com.springsource.org.apache.httpcomponents.httpcore</artifactId>
+			<version>4.1</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.ws.security</groupId>
+			<artifactId>wss4j</artifactId>
+			<version>1.5.12</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.xml</groupId>
+			<artifactId>com.springsource.org.apache.xml.resolver</artifactId>
+			<version>1.2.0</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.xmlbeans</groupId>
+			<artifactId>com.springsource.org.apache.xmlbeans</artifactId>
+			<version>2.4.0</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.xmlcommons</groupId>
+			<artifactId>com.springsource.org.apache.xmlcommons</artifactId>
+			<version>1.3.4</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.xalan</groupId>
+			<artifactId>com.springsource.org.apache.xml.serializer</artifactId>
+			<version>2.7.1</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.xml</groupId>
+			<artifactId>com.springsource.org.apache.xml.security</artifactId>
+			<version>1.4.2</version>
+			<scope>test</scope>
+			<exclusions>
+				<exclusion>
+					<groupId>org.apache.xalan</groupId>
+					<artifactId>com.springsource.org.apache.xalan</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+		<!-- <dependency> <groupId>org.apache.ws</groupId> <artifactId>com.springsource.org.apache.ws.security</artifactId>
+			<version>1.5.8</version> <scope>test</scope> <exclusions> <exclusion> <groupId>org.apache.xalan</groupId>
+			<artifactId>com.springsource.org.apache.xalan</artifactId> </exclusion> </exclusions>
+			</dependency> -->
+			<!--
+		<dependency>
+			<groupId>org.beanshell</groupId>
+			<artifactId>com.springsource.bsh</artifactId>
+			<version>2.0.0.b4</version>
+		</dependency>
+		<dependency>
+			<groupId>org.biomart</groupId>
+			<artifactId>martservice</artifactId>
+			<version>2.0-SNAPSHOT</version>
+		</dependency>
+	-->
+		<dependency>
+			<groupId>org.dom4j</groupId>
+			<artifactId>com.springsource.org.dom4j</artifactId>
+			<version>1.6.1</version>
+		</dependency>
+		<dependency>
+			<groupId>org.jaxen</groupId>
+			<artifactId>com.springsource.org.jaxen</artifactId>
+			<version>1.1.1</version>
+		</dependency>
+		<dependency>
+			<groupId>org.jdom</groupId>
+			<artifactId>com.springsource.org.jdom</artifactId>
+			<version>1.1.0</version>
+		</dependency>
+		<!-- <dependency> <groupId>org.odftoolkit</groupId> <artifactId>odfdom-java.bundle</artifactId>
+			<version>0.7.0</version> <exclusions> <exclusion> <groupId>org.apache.xerces</groupId>
+			<artifactId>com.springsource.org.apache.xerces</artifactId> </exclusion>
+			</exclusions> </dependency> -->
+		<dependency>
+			<groupId>org.opensaml</groupId>
+			<artifactId>com.springsource.org.opensaml</artifactId>
+			<version>1.1.0</version>
+			<scope>test</scope>
+			<exclusions>
+				<exclusion>
+					<groupId>org.apache.xalan</groupId>
+					<artifactId>com.springsource.org.apache.xalan</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+		<dependency>
+			<groupId>org.xmlpull</groupId>
+			<artifactId>com.springsource.org.xmlpull</artifactId>
+			<version>1.1.3.4-O</version>
+		</dependency>
+	</dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ActivityIT.java
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ActivityIT.java b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ActivityIT.java
new file mode 100644
index 0000000..bb82107
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ActivityIT.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform;
+
+import java.net.URI;
+import java.util.List;
+
+import net.sf.taverna.t2.workflowmodel.processor.activity.Activity;
+
+import org.osgi.framework.ServiceReference;
+
+import uk.org.taverna.platform.capability.activity.ActivityConfigurationException;
+import uk.org.taverna.platform.capability.activity.ActivityNotFoundException;
+import uk.org.taverna.platform.capability.activity.ActivityService;
+import uk.org.taverna.scufl2.api.configurations.ConfigurationDefinition;
+
+public class ActivityIT extends PlatformIT {
+
+	public void testGetActivityURIs() {
+		ServiceReference activityServiceReference = bundleContext.getServiceReference("uk.org.taverna.platform.activity.ActivityService");
+		ActivityService activityService = (ActivityService) bundleContext.getService(activityServiceReference);
+		List<URI> activityURIs = activityService.getActivityURIs();
+		System.out.println("================= Available Activities ===================");
+		for (URI uri : activityURIs) {
+			System.out.println(uri);
+		}
+		System.out.println("==========================================================");
+		System.out.println("");
+	}
+
+	public void testCreateActivity() throws ActivityNotFoundException, ActivityConfigurationException {
+		ServiceReference activityServiceReference = bundleContext.getServiceReference("uk.org.taverna.platform.activity.ActivityService");
+		ActivityService activityService = (ActivityService) bundleContext.getService(activityServiceReference);
+		List<URI> activityURIs = activityService.getActivityURIs();
+		for (URI uri : activityURIs) {
+			System.out.println("Creating activity " + uri);
+			Activity<?> activity = activityService.createActivity(uri, null);
+		}
+	}
+
+	public void testGetActivityConfigurationDefinition() throws Exception {
+		ServiceReference activityServiceReference = bundleContext.getServiceReference("uk.org.taverna.platform.activity.ActivityService");
+		ActivityService activityService = (ActivityService) bundleContext.getService(activityServiceReference);
+
+		List<URI> activityURIs = activityService.getActivityURIs();
+		System.out.println("============ Activity Configuration Definitions ==========");
+		for (URI uri : activityURIs) {
+			ConfigurationDefinition configurationDefinition = activityService.getActivityConfigurationDefinition(uri);
+			System.out.println(configurationDefinition);
+		}
+		System.out.println("==========================================================");
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/CommandLineToolIT.java
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/CommandLineToolIT.java b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/CommandLineToolIT.java
new file mode 100644
index 0000000..f2df658
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/CommandLineToolIT.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform;
+
+import net.sf.taverna.t2.commandline.CommandLineTool;
+
+import org.osgi.framework.ServiceReference;
+
+import uk.org.taverna.commandline.args.CommandLineArguments;
+import uk.org.taverna.platform.run.api.RunService;
+import uk.org.taverna.scufl2.api.io.WorkflowBundleIO;
+import uk.org.taverna.scufl2.api.io.WorkflowBundleReader;
+
+public class CommandLineToolIT extends PlatformIT {
+
+	private RunService runService;
+	private WorkflowBundleIO workflowBundleIO;
+	private WorkflowBundleReader workflowReader;
+
+	protected void setup() throws Exception {
+		super.setup();
+		if (runService == null) {
+			ServiceReference runServiceReference = bundleContext
+					.getServiceReference("uk.org.taverna.platform.run.api.RunService");
+			runService = (RunService) bundleContext.getService(runServiceReference);
+		}
+
+		if (workflowReader == null) {
+			ServiceReference workflowBundleReaderServiceReference = bundleContext
+					.getServiceReferences("uk.org.taverna.scufl2.api.io.WorkflowBundleReader",
+							"(mediaType=application/vnd.taverna.t2flow+xml)")[0];
+			workflowBundleReader = (WorkflowBundleReader) bundleContext
+					.getService(workflowBundleReaderServiceReference);
+		}
+
+		if (workflowBundleIO == null) {
+			ServiceReference workflowBundleIOServiceReference = bundleContext
+					.getServiceReference("uk.org.taverna.scufl2.api.io.WorkflowBundleIO");
+			workflowBundleIO = (WorkflowBundleIO) bundleContext
+					.getService(workflowBundleIOServiceReference);
+		}
+	}
+
+	public void testCommandLineTool() throws Exception {
+
+		setup();
+
+		CommandLineTool cmdTool = new CommandLineTool();
+		cmdTool.setRunService(runService);
+		cmdTool.setCredentialManager(credentialManager);
+		cmdTool.setWorkflowBundleIO(workflowBundleIO);
+		cmdTool.setCommandLineArgumentsService(new CommandLineArguments() {
+			public String[] getCommandLineArguments() {
+				return new String[] { "-outputdoc", "/tmp/taverna3/baclava-output1.xml",
+						"/Users/alex/Desktop/t2flows/simple-wf-no-inputs-one-output.t2flow" };
+			}
+
+		});
+		cmdTool.run();
+
+		cmdTool.setCommandLineArgumentsService(new CommandLineArguments() {
+			public String[] getCommandLineArguments() {
+				return new String[] { "-inputvalue", "in", "Taverna 3 Platform rules",
+						"-outputdoc", "/tmp/taverna3/baclava-output2.xml",
+						"/Users/alex/Desktop/t2flows/simple-wf-one-input-one-output.t2flow" };
+			}
+
+		});
+		cmdTool.run();
+
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ExecutionIT.java
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ExecutionIT.java b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ExecutionIT.java
new file mode 100644
index 0000000..76a25b3
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ExecutionIT.java
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform;
+
+import java.net.URI;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.osgi.framework.ServiceReference;
+
+import uk.org.taverna.platform.capability.activity.ActivityConfigurationException;
+import uk.org.taverna.platform.capability.activity.ActivityNotFoundException;
+import uk.org.taverna.platform.data.api.Data;
+import uk.org.taverna.platform.capability.dispatch.DispatchLayerConfigurationException;
+import uk.org.taverna.platform.capability.dispatch.DispatchLayerNotFoundException;
+import uk.org.taverna.platform.execution.api.AbstractExecutionEnvironment;
+import uk.org.taverna.platform.execution.api.AbstractExecutionService;
+import uk.org.taverna.platform.execution.api.Execution;
+import uk.org.taverna.platform.execution.api.ExecutionEnvironment;
+import uk.org.taverna.platform.execution.api.ExecutionEnvironmentService;
+import uk.org.taverna.platform.execution.api.InvalidWorkflowException;
+import uk.org.taverna.scufl2.api.configurations.ConfigurationDefinition;
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+import uk.org.taverna.scufl2.api.core.Workflow;
+import uk.org.taverna.scufl2.api.profiles.Profile;
+
+public class ExecutionIT extends PlatformIT {
+
+	private ExecutionEnvironmentService executionEnvironmentService;
+
+	protected void setup() throws Exception {
+		super.setup();
+		ServiceReference[] executionServiceReferences = bundleContext.getServiceReferences(
+				"uk.org.taverna.platform.execution.api.ExecutionEnvironmentService", null);
+		assertEquals(1, executionServiceReferences.length);
+		executionEnvironmentService = (ExecutionEnvironmentService) bundleContext
+				.getService(executionServiceReferences[0]);
+
+	}
+
+	public void testGetExecutionEnvironments() throws Exception {
+		setup();
+
+		Set<ExecutionEnvironment> executionEnvironments = executionEnvironmentService
+				.getExecutionEnvironments();
+		int size = executionEnvironments.size();
+
+		bundleContext.registerService("uk.org.taverna.platform.execution.api.ExecutionService",
+				new AbstractExecutionService("test id", "test name", "test description") {
+					public Set<ExecutionEnvironment> getExecutionEnvivonments() {
+						return Collections
+								.<ExecutionEnvironment> singleton(new AbstractExecutionEnvironment(
+										"test id", "test name", "test description", this) {
+									public List<URI> getDispatchLayerURIs() {
+										return Collections.singletonList(URI
+												.create("http://ns.taverna.org.uk/2010/dispatchlayer/testDispatchLayer"));
+									}
+
+									public List<URI> getActivityURIs() {
+										return Collections.singletonList(URI
+												.create("http://ns.taverna.org.uk/2010/activity/testActivity"));
+									}
+
+									public boolean dispatchLayerExists(URI uri) {
+										return false;
+									}
+
+									public boolean activityExists(URI uri) {
+										return false;
+									}
+
+									public ConfigurationDefinition getActivityConfigurationDefinition(
+											URI uri) throws ActivityNotFoundException,
+											ActivityConfigurationException {
+										return null;
+									}
+
+									public ConfigurationDefinition getDispatchLayerConfigurationDefinition(
+											URI uri) throws DispatchLayerNotFoundException,
+											DispatchLayerConfigurationException {
+										return null;
+									}
+								});
+					}
+
+					protected Execution createExecutionImpl(WorkflowBundle workflowBundle,
+							Workflow workflow, Profile profile, Map<String, Data> inputs) throws InvalidWorkflowException {
+						return null;
+					}
+				}, null);
+
+
+		executionEnvironments = executionEnvironmentService
+				.getExecutionEnvironments();
+		assertEquals(size + 1, executionEnvironments.size());
+
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			System.out.println(executionEnvironment);
+		}
+	}
+
+	public void testGetExecutionEnvironmentsProfile() throws Exception {
+		setup();
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/beanshell.t2flow");
+
+		Set<ExecutionEnvironment> executionEnvironments = executionEnvironmentService
+				.getExecutionEnvironments(workflowBundle.getMainProfile());
+		assertTrue(executionEnvironments.size() > 0);
+
+		System.out.println(executionEnvironments.iterator().next());
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/LocalExecutionIT.java
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/LocalExecutionIT.java b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/LocalExecutionIT.java
new file mode 100644
index 0000000..92068d5
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/LocalExecutionIT.java
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.osgi.framework.ServiceReference;
+
+import uk.org.taverna.platform.data.api.Data;
+import uk.org.taverna.platform.data.api.DataService;
+import uk.org.taverna.platform.execution.api.ExecutionEnvironment;
+import uk.org.taverna.platform.execution.api.ExecutionService;
+import uk.org.taverna.platform.report.State;
+import uk.org.taverna.platform.report.WorkflowReport;
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+import uk.org.taverna.scufl2.api.core.Workflow;
+import uk.org.taverna.scufl2.api.profiles.Profile;
+
+public class LocalExecutionIT extends PlatformIT {
+
+	private ExecutionService executionService;
+	private DataService dataService;
+	private Set<ExecutionEnvironment> executionEnvironments;
+
+	protected void setup() throws Exception {
+		super.setup();
+		if (executionService == null) {
+			ServiceReference[] executionServiceReferences = bundleContext.getServiceReferences(
+					"uk.org.taverna.platform.execution.api.ExecutionService",
+					"(org.springframework.osgi.bean.name=localExecution)");
+			assertEquals(1, executionServiceReferences.length);
+			executionService = (ExecutionService) bundleContext
+					.getService(executionServiceReferences[0]);
+			executionEnvironments = executionService.getExecutionEnvivonments();
+			assertEquals(1, executionEnvironments.size());
+		}
+		if (dataService == null) {
+			ServiceReference dataServiceReference = bundleContext
+					.getServiceReference("uk.org.taverna.platform.data.DataService");
+			dataService = (DataService) bundleContext.getService(dataServiceReference);
+		}
+	}
+
+	public void testLocalExecution() throws Exception {
+		setup();
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/in-out.t2flow");
+		Workflow workflow = workflowBundle.getMainWorkflow();
+		Profile profile = workflowBundle.getMainProfile();
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			Map<String, Data> inputs = Collections.singletonMap("in", dataService.create("test-input"));
+
+			String executionId = executionService.createExecution(executionEnvironment,
+					workflowBundle, workflow, profile, inputs);
+			WorkflowReport report = executionService.getWorkflowReport(executionId);
+			assertEquals(State.CREATED, report.getState());
+			executionService.start(executionId);
+
+			Map<String, Data> results = report.getOutputs();
+			assertNotNull(results);
+			waitForResults(results, report, "out");
+
+			Object result = results.get("out").getValue();
+			assertEquals("test-input", result);
+			assertEquals(State.COMPLETED, report.getState());
+			System.out.println(report);
+		}
+	}
+
+	public void testLocalExecution2() throws Exception {
+		setup();
+
+		WorkflowBundle workflowBundle = loadWorkflow("/t2flow/beanshell.t2flow");
+		Workflow workflow = workflowBundle.getMainWorkflow();
+		Profile profile = workflowBundle.getMainProfile();
+
+		for (ExecutionEnvironment executionEnvironment : executionEnvironments) {
+			Map<String, Data> inputs = Collections.singletonMap("in", dataService.create("test-input"));
+
+			String executionId = executionService.createExecution(executionEnvironment,
+					workflowBundle, workflow, profile, inputs);
+			WorkflowReport report = executionService.getWorkflowReport(executionId);
+			System.out.println(report);
+			assertEquals(State.CREATED, report.getState());
+			executionService.start(executionId);
+			System.out.println(report);
+
+			Map<String, Data> results = report.getOutputs();
+			waitForResults(results, report, "out");
+
+			List<Data> result = results.get("out").getElements();
+			assertEquals(1000, result.size());
+			assertEquals("test-input:0", result.get(0).getValue());
+			assertEquals(State.COMPLETED, report.getState());
+			System.out.println(report);
+		}
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/OSGIFrameworkIT.java
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/OSGIFrameworkIT.java b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/OSGIFrameworkIT.java
new file mode 100644
index 0000000..38f46c7
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/OSGIFrameworkIT.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform;
+
+import java.io.IOException;
+
+import org.osgi.framework.Bundle;
+import org.springframework.core.io.Resource;
+import org.springframework.osgi.util.OsgiStringUtils;
+
+public class OSGIFrameworkIT extends PlatformIT {
+
+	public void testOsgiEnvironment() throws Exception {
+		Bundle[] bundles = bundleContext.getBundles();
+		for (int i = 0; i < bundles.length; i++) {
+			System.out.println(OsgiStringUtils.nullSafeName(bundles[i]));
+		}
+		System.out.println();
+	}
+
+	protected String[] getTestFrameworkBundlesNames() {
+		String[] frameworkBundles = super.getTestFrameworkBundlesNames();
+		System.out.println("Test Framework bundles:");
+		for (String bundle : frameworkBundles) {
+			System.out.println("  " + bundle);
+		}
+		return frameworkBundles;
+	}
+
+	protected String[] getTestBundlesNames() {
+		String[] frameworkBundles = super.getTestBundlesNames();
+		System.out.println("Framework bundles:");
+		for (String bundle : frameworkBundles) {
+			System.out.println("  " + bundle);
+		}
+		return frameworkBundles;
+	}
+
+	public void testPrintConfig() throws IOException {
+		Resource[] bundles = getTestBundles();
+		Resource[] testBundles = getTestFrameworkBundles();
+		StringBuilder sb = new StringBuilder();
+		StringBuilder sb2 = new StringBuilder();
+		System.out.println("mkdir platform");
+		System.out.println("mkdir platform/configuration");
+		sb2.append("cp ");
+		sb.append("osgi.bundles=");
+		boolean printComma = false;
+		for (Resource resource : bundles) {
+			if (printComma) {
+				sb.append(", ");
+				sb2.append(" ");
+			}
+			sb.append(resource.getFilename() + "@start");
+			sb2.append(resource.getFile());
+			printComma = true;
+		}
+		for (Resource resource : testBundles) {
+			if (!resource.getFilename().contains("test")) {
+				if (printComma) {
+					sb.append(", ");
+					sb2.append(" ");
+				}
+				sb.append(resource.getFilename() + "@start");
+				sb2.append(resource.getFile());
+				printComma = true;
+			}
+		}
+		sb2.append(" platform");
+		System.out.println("echo \"" + sb.toString() + "\" > platform/configuration/config.ini");
+		System.out.println(sb2.toString());
+		System.out.println("zip platform.zip platform/*");
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java
new file mode 100644
index 0000000..40b35e9
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java
@@ -0,0 +1,378 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+import java.util.Map;
+import java.util.Properties;
+
+import net.sf.taverna.t2.reference.ErrorDocument;
+import net.sf.taverna.t2.reference.StackTraceElementBean;
+import net.sf.taverna.t2.security.credentialmanager.CredentialManager;
+import net.sf.taverna.t2.security.credentialmanager.MasterPasswordProvider;
+
+import org.eclipse.osgi.framework.internal.core.Constants;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.jndi.JNDIContextManager;
+import org.springframework.osgi.test.AbstractConfigurableBundleCreatorTests;
+import org.springframework.osgi.test.platform.OsgiPlatform;
+import org.springframework.osgi.test.platform.Platforms;
+
+import uk.org.taverna.configuration.app.ApplicationConfiguration;
+import uk.org.taverna.configuration.database.DatabaseConfiguration;
+import uk.org.taverna.platform.data.api.Data;
+import uk.org.taverna.platform.report.State;
+import uk.org.taverna.platform.report.WorkflowReport;
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+import uk.org.taverna.scufl2.api.io.WorkflowBundleReader;
+import uk.org.taverna.scufl2.translator.t2flow.T2FlowReader;
+
+public class PlatformIT extends AbstractConfigurableBundleCreatorTests {
+
+	protected WorkflowBundleReader workflowBundleReader;
+	protected CredentialManager credentialManager;
+	protected MasterPasswordProvider masterPasswordProvider;
+	protected DatabaseConfiguration databaseConfiguration;
+	protected JNDIContextManager jndiContextManager;
+	protected ApplicationConfiguration applicationConfiguration;
+
+	protected String getPlatformName() {
+		// return Platforms.FELIX;
+		return Platforms.EQUINOX;
+	}
+
+	@Override
+	protected OsgiPlatform createPlatform() {
+		OsgiPlatform platform = super.createPlatform();
+		Properties config = platform.getConfigurationProperties();
+		config.setProperty("org.osgi.framework.system.packages.extra",
+				"com.sun.org.apache.xml.internal.utils");
+		return platform;
+	}
+
+	@Override
+	protected String[] getTestBundlesNames() {
+		return new String[] {
+				"com.jcraft.jsch, com.springsource.com.jcraft.jsch, 0.1.41",
+				"com.sun.xml, com.springsource.com.sun.xml.bind, 2.2.0",
+				"com.sun.xml, com.springsource.com.sun.xml.fastinfoset, 1.2.2",
+				"com.thoughtworks.xstream, com.springsource.com.thoughtworks.xstream, 1.2.2",
+				"commons-dbcp, commons-dbcp, 1.4",
+				"commons-pool, commons-pool, 1.5.6",
+				"javax.activation, com.springsource.javax.activation, 1.1.1",
+				"javax.jms, com.springsource.javax.jms, 1.1.0",
+				"javax.mail, com.springsource.javax.mail, 1.4.0",
+				"javax.servlet, com.springsource.javax.servlet, 2.5.0",
+				"javax.transaction, com.springsource.javax.transaction, 1.1.0",// for derby client
+				"javax.wsdl, com.springsource.javax.wsdl, 1.6.1",
+				"javax.xml.bind, com.springsource.javax.xml.bind, 2.2.0",
+				"javax.xml.rpc, com.springsource.javax.xml.rpc, 1.1.0",
+				"javax.xml.soap, com.springsource.javax.xml.soap, 1.3.0",
+				"javax.xml.stream, com.springsource.javax.xml.stream, 1.0.1",
+				"org.antlr, com.springsource.antlr, 2.7.6",
+				"org.apache.aries, org.apache.aries.util, 0.3",
+				"org.apache.aries.proxy, org.apache.aries.proxy.api, 0.3",
+				"org.apache.aries.jndi, org.apache.aries.jndi, 0.3",
+				"org.apache.axis, com.springsource.org.apache.axis, 1.4.0",
+				"org.apache.commons, com.springsource.org.apache.commons.cli, 1.2.0",
+				"org.apache.commons, com.springsource.org.apache.commons.codec, 1.4.0",
+				"org.apache.commons, com.springsource.org.apache.commons.csv, 1.0.0.BUILD-20080106",
+				"org.apache.commons, com.springsource.org.apache.commons.collections, 3.2.0",
+				"org.apache.commons, com.springsource.org.apache.commons.discovery, 0.4.0",
+				"org.apache.commons, com.springsource.org.apache.commons.httpclient, 3.1.0",
+				"org.apache.commons, com.springsource.org.apache.commons.io, 1.4.0",
+				"org.apache.commons, com.springsource.org.apache.commons.lang, 2.5.0",
+				"org.apache.commons, com.springsource.org.apache.commons.logging, 1.1.1",
+				"org.apache.commons, com.springsource.org.apache.commons.net, 1.4.1",
+				// "org.apache.derby, derby, 10.5.3.0_1",
+				"org.apache.derby, com.springsource.org.apache.derby, 10.5.1000001.764942",
+				"org.apache.derby, com.springsource.org.apache.derby.client, 10.5.1000001.764942",
+				"org.apache.derby, com.springsource.org.apache.derby.drda, 10.5.1000001.764942",
+				"org.apache.httpcomponents, com.springsource.org.apache.httpcomponents.httpclient, 4.1.1",
+				"org.apache.httpcore, com.springsource.org.apache.httpcomponents.httpcore, 4.1",
+				"org.apache.log4j, com.springsource.org.apache.log4j, 1.2.16",
+				"org.apache.ws, com.springsource.org.apache.ws.security, 1.5.8",
+				// "org.apache.ws.security, wss4j, 1.5.12",
+				"org.apache.xml, com.springsource.org.apache.xml.resolver, 1.2.0",
+				"org.apache.xmlbeans, com.springsource.org.apache.xmlbeans, 2.4.0",
+				"org.apache.xmlcommons, com.springsource.org.apache.xmlcommons, 1.3.4",
+				"org.apache.xalan, com.springsource.org.apache.xalan, 2.7.1",
+				"org.apache.xalan, com.springsource.org.apache.xml.serializer, 2.7.1",
+				"org.apache.xerces, com.springsource.org.apache.xerces, 2.9.1",
+				"org.apache.xml, com.springsource.org.apache.xml.security, 1.4.2",
+				"org.aspectj, com.springsource.org.aspectj.runtime, 1.6.0",
+				"org.aspectj, com.springsource.org.aspectj.weaver, 1.6.0",
+				"org.beanshell, com.springsource.bsh, 2.0.0.b4",
+				"org.biomart, martservice, 2.0-SNAPSHOT",
+				"org.bouncycastle, bcprov-jdk16, 1.46",
+				"org.dom4j, com.springsource.org.dom4j, 1.6.1",
+				"org.hibernate, com.springsource.org.hibernate, 3.2.6.ga",
+				"org.jaxen, com.springsource.org.jaxen, 1.1.1",
+				"org.jboss.javassist, com.springsource.javassist, 3.3.0.ga",
+				"org.jdom, com.springsource.org.jdom, 1.1.0",
+				"org.jvnet.staxex, com.springsource.org.jvnet.staxex, 1.0.0",
+				"org.objectweb.asm, com.springsource.org.objectweb.asm, 1.5.3",
+				"org.objectweb.asm, com.springsource.org.objectweb.asm.attrs, 1.5.3",
+				"org.opensaml, com.springsource.org.opensaml, 1.1.0",
+				"org.springframework, org.springframework.jdbc, 3.0.0.RC1",
+				"org.springframework, org.springframework.orm, 3.0.0.RC1",
+				"org.springframework, org.springframework.transaction, 3.0.0.RC1",
+				// "org.springframework, org.springframework.beans, 3.0.5.RELEASE",
+				// "org.springframework, org.springframework.core, 3.0.5.RELEASE",
+				// "org.springframework, org.springframework.context, 3.0.5.RELEASE",
+				// "org.springframework, org.springframework.transaction, 3.0.5.RELEASE",
+				"org.xmlpull, com.springsource.org.xmlpull, 1.1.3.4-O",
+				"net.sf.taverna, wsdl-generic, 1.10-SNAPSHOT",
+				"net.sf.taverna.jedit, jedit-syntax, 2.2.4-SNAPSHOT",
+				"net.sf.taverna.t2.activities, apiconsumer-activity, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2.activities, beanshell-activity, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2.activities, biomart-activity, 2.0-SNAPSHOT",
+				// "net.sf.taverna.t2.activities, biomoby-activity, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2.activities, dataflow-activity, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2.activities, dependency-activity, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2.activities, external-tool-activity, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2.activities, localworker-activity, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2.activities, rest-activity, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2.activities, rshell-activity, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2.activities, soaplab-activity, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2.activities, spreadsheet-import-activity, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2.activities, stringconstant-activity, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2.activities, wsdl-activity, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2.activities, xpath-activity, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2.core, provenance-derby, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2.core, provenance-mysql, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2.core, provenanceconnector, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2.core, reference-api, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2.core, reference-core-extensions, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2.core, reference-impl, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2.core, workflowmodel-api, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2.core, workflowmodel-core-extensions, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2.core, workflowmodel-impl, 2.0-SNAPSHOT",
+				// "net.sf.taverna.t2.infrastructure, appconfig, 3.0-SNAPSHOT",
+				"net.sf.taverna.t2.lang, ui, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2.lang, observer, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2.security, credential-manager, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2.security, credential-manager-impl, 2.0-SNAPSHOT",
+				"net.sourceforge.cglib, com.springsource.net.sf.cglib, 2.1.3",
+				"uk.org.taverna.configuration, taverna-app-configuration-api, 0.1.0-SNAPSHOT",
+				"uk.org.taverna.configuration, taverna-app-configuration-impl, 0.1.0-SNAPSHOT",
+				"uk.org.taverna.configuration, taverna-configuration-api, 0.1.0-SNAPSHOT",
+				"uk.org.taverna.configuration, taverna-configuration-impl, 0.1.0-SNAPSHOT",
+				"uk.org.taverna.configuration, taverna-database-configuration-api, 0.1.0-SNAPSHOT",
+				"uk.org.taverna.configuration, taverna-database-configuration-impl, 0.1.0-SNAPSHOT",
+				"uk.org.taverna.platform, report, 0.1.2-SNAPSHOT",
+				"uk.org.taverna.platform, data, 0.1.2-SNAPSHOT",
+				"uk.org.taverna.platform, execution-local, 0.1.2-SNAPSHOT",
+				"uk.org.taverna.platform, execution-remote, 0.1.2-SNAPSHOT",
+				"uk.org.taverna.platform, taverna-capability-api, 0.1.2-SNAPSHOT",
+				"uk.org.taverna.platform, taverna-capability-impl, 0.1.2-SNAPSHOT",
+				"uk.org.taverna.platform, taverna-execution-api, 0.1.2-SNAPSHOT",
+				"uk.org.taverna.platform, taverna-execution-impl, 0.1.2-SNAPSHOT",
+				"uk.org.taverna.platform, taverna-run-api, 0.1.2-SNAPSHOT",
+				"uk.org.taverna.platform, taverna-run-impl, 0.1.2-SNAPSHOT",
+				"uk.org.taverna.osgi.services, xml-parser-service, 0.0.1-SNAPSHOT",
+				"uk.org.taverna.osgi.services, xml-transformer-service, 0.0.1-SNAPSHOT",
+				// FIXME: Add the other scufl2 modules
+				"uk.org.taverna.scufl2, scufl2-api, 0.9.2",
+				"uk.org.taverna.scufl2, scufl2-rdfxml, 0.9.2",
+				"uk.org.taverna.scufl2, scufl2-ucfpackage, 0.9.2",
+				"uk.org.taverna.scufl2, scufl2-t2flow, 0.9.2",
+				"uk.org.taverna.scufl2, scufl2-validation, 0.9.2",
+				"uk.org.taverna.scufl2, scufl2-validation-correctness, 0.9.2",
+				"uk.org.taverna.scufl2, scufl2-validation-structural, 0.9.2",
+				"net.sf.taverna.t2, results, 2.0-SNAPSHOT",
+				"net.sf.taverna.t2, baclava, 0.1-SNAPSHOT",
+		// "net.sf.taverna.t2.taverna-commandline, taverna-commandline-common, 2.0-SNAPSHOT"
+		};
+	}
+
+	protected void setup() throws Exception {
+
+		if (masterPasswordProvider == null) {
+			masterPasswordProvider = new MasterPasswordProvider() {
+				public String getMasterPassword(boolean firstTime) {
+					return "test";
+				}
+
+				public void setMasterPassword(String password) {
+				}
+
+				public int getProviderPriority() {
+					return 0;
+				}
+			};
+			bundleContext.registerService(
+					"net.sf.taverna.t2.security.credentialmanager.MasterPasswordProvider",
+					masterPasswordProvider, null);
+		}
+
+		if (credentialManager == null) {
+			ServiceReference credentialManagerReference = bundleContext
+					.getServiceReference("net.sf.taverna.t2.security.credentialmanager.CredentialManager");
+			credentialManager = (CredentialManager) bundleContext
+					.getService(credentialManagerReference);
+		}
+
+		if (workflowBundleReader == null) {
+			ServiceReference[] workflowBundleReaderReferences = bundleContext.getServiceReferences(
+					"uk.org.taverna.scufl2.api.io.WorkflowBundleReader", null);
+			for (ServiceReference serviceReference : workflowBundleReaderReferences) {
+				workflowBundleReader = (WorkflowBundleReader) bundleContext
+						.getService(serviceReference);
+				if (workflowBundleReader.getMediaTypes().contains(
+						T2FlowReader.APPLICATION_VND_TAVERNA_T2FLOW_XML)) {
+					break;
+				}
+			}
+		}
+
+		if (databaseConfiguration == null) {
+			ServiceReference databaseConfigurationReference = bundleContext
+					.getServiceReference("uk.org.taverna.configuration.database.DatabaseConfiguration");
+			databaseConfiguration = (DatabaseConfiguration) bundleContext
+					.getService(databaseConfigurationReference);
+			ServiceReference jndiContextManagerReference = bundleContext
+					.getServiceReference("org.osgi.service.jndi.JNDIContextManager");
+			jndiContextManager = (JNDIContextManager) bundleContext
+					.getService(jndiContextManagerReference);
+			ServiceReference applicationConfigurationReference = bundleContext
+					.getServiceReference("uk.org.taverna.configuration.app.ApplicationConfiguration");
+			applicationConfiguration = (ApplicationConfiguration) bundleContext
+					.getService(applicationConfigurationReference);
+		}
+
+	}
+
+	public void testOsgiPlatformStarts() throws Exception {
+		System.out.println(Constants.FRAMEWORK_VENDOR + " = "
+				+ bundleContext.getProperty(Constants.FRAMEWORK_VENDOR));
+		System.out.println(Constants.FRAMEWORK_VERSION + " = "
+				+ bundleContext.getProperty(Constants.FRAMEWORK_VERSION));
+		System.out.println(Constants.FRAMEWORK_EXECUTIONENVIRONMENT + " = "
+				+ bundleContext.getProperty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT));
+		System.out.println(Constants.OSGI_IMPL_VERSION_KEY + " = "
+				+ bundleContext.getProperty(Constants.OSGI_IMPL_VERSION_KEY));
+	}
+
+	public WorkflowBundle loadWorkflow(String t2FlowFile) throws Exception {
+		URL wfResource = getClass().getResource(t2FlowFile);
+		assertNotNull(wfResource);
+		return workflowBundleReader.readBundle(wfResource.openStream(),
+				T2FlowReader.APPLICATION_VND_TAVERNA_T2FLOW_XML);
+	}
+
+	public File loadFile(String fileName) throws IOException, FileNotFoundException {
+		File file = File.createTempFile("platform-test", null);
+		InputStream inputStream = getClass().getResource(fileName).openStream();
+		OutputStream outputStream = new FileOutputStream(file);
+		byte[] buffer = new byte[64];
+		int length = -1;
+		while ((length = inputStream.read(buffer)) >= 0) {
+			outputStream.write(buffer, 0, length);
+		}
+		outputStream.flush();
+		outputStream.close();
+		return file;
+	}
+
+	public void printErrors(Data data) {
+			ErrorDocument error = (ErrorDocument) data.getValue();
+			String message = error.getMessage();
+			if (message != null) {
+				System.out.println(message);
+			}
+			String exceptionMessage = error.getExceptionMessage();
+			if (exceptionMessage != null) {
+				System.out.println(exceptionMessage);
+			}
+			for (StackTraceElementBean stackTraceElementBean : error.getStackTraceStrings()) {
+				System.out.println(stackTraceElementBean.getClassName());
+				System.out.println(stackTraceElementBean.getMethodName());
+				System.out.println(stackTraceElementBean.getLineNumber());
+			}
+//			Set<T2Reference> errorReferences = error.getErrorReferences();
+//			for (T2Reference t2Reference : errorReferences) {
+//				printErrors(referenceService, t2Reference);
+//			}
+	}
+
+	public boolean checkResult(Data result, String expectedResult) {
+		if (result.isError()) {
+			printErrors(result);
+			return false;
+		} else {
+			Object resultObject = result.getValue();
+			String resultValue = null;
+			if (resultObject instanceof byte[]) {
+				resultValue = new String((byte[]) resultObject);
+			} else {
+				resultValue = (String) resultObject;
+			}
+
+			if (resultValue.startsWith(expectedResult)) {
+				return true;
+			} else {
+				System.out.println("Expected: " + expectedResult + ", Actual: " + resultValue);
+				return false;
+			}
+		}
+	}
+
+	public boolean waitForState(WorkflowReport report, State state) throws InterruptedException {
+		return waitForState(report, state, true);
+	}
+
+	public boolean waitForState(WorkflowReport report, State state, boolean printReport)
+			throws InterruptedException {
+		int wait = 0;
+		while (!report.getState().equals(state) && wait++ < 30) {
+			if (printReport)
+				System.out.println(report);
+			Thread.sleep(500);
+		}
+		return report.getState().equals(state);
+	}
+
+	public void waitForResults(Map<String, Data> results, WorkflowReport report, String... ports)
+			throws InterruptedException {
+		int wait = 0;
+		while (!resultsReady(results, ports) && wait++ < 20) {
+			System.out.println(report);
+			Thread.sleep(500);
+		}
+	}
+
+	private boolean resultsReady(Map<String, Data> results, String... ports) {
+		for (String port : ports) {
+			if (!results.containsKey(port)) {
+				return false;
+			}
+		}
+		return true;
+	}
+
+}


[50/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ContextualView.java
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ContextualView.java b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ContextualView.java
new file mode 100644
index 0000000..b7066a0
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ContextualView.java
@@ -0,0 +1,91 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package}.ui.view;
+
+import java.awt.Frame;
+
+import javax.swing.Action;
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+import uk.org.taverna.commons.services.ServiceRegistry;
+
+import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionRegistry;
+import net.sf.taverna.t2.workbench.activityicons.ActivityIconManager;
+import net.sf.taverna.t2.workbench.edits.EditManager;
+import net.sf.taverna.t2.workbench.file.FileManager;
+import net.sf.taverna.t2.workbench.ui.actions.activity.ActivityContextualView;
+
+import uk.org.taverna.scufl2.api.activity.Activity;
+
+import ${package}.ui.config.${classPrefix}ConfigureAction;
+
+@SuppressWarnings("serial")
+public class ${classPrefix}ContextualView extends ActivityContextualView {
+
+	private final EditManager editManager;
+	private final FileManager fileManager;
+	private final ActivityIconManager activityIconManager;
+	private final ServiceDescriptionRegistry serviceDescriptionRegistry;
+	private final ServiceRegistry serviceRegistry;
+
+	private JLabel description = new JLabel("ads");
+
+	public ${classPrefix}ContextualView(Activity activity, EditManager editManager,
+			FileManager fileManager, ActivityIconManager activityIconManager,
+			ServiceDescriptionRegistry serviceDescriptionRegistry, ServiceRegistry serviceRegistry) {
+		super(activity);
+		this.editManager = editManager;
+		this.fileManager = fileManager;
+		this.activityIconManager = activityIconManager;
+		this.serviceDescriptionRegistry = serviceDescriptionRegistry;
+		this.serviceRegistry = serviceRegistry;
+		initView();
+	}
+
+	@Override
+	public JComponent getMainFrame() {
+		JPanel jPanel = new JPanel();
+		jPanel.add(description);
+		refreshView();
+		return jPanel;
+	}
+
+	@Override
+	public String getViewTitle() {
+		JsonNode configuration = getConfigBean().getJson();
+		return "${classPrefix} service " + configuration.get("exampleString").asText();
+	}
+
+	/**
+	 * Typically called when the activity configuration has changed.
+	 */
+	@Override
+	public void refreshView() {
+		JsonNode configuration = getConfigBean().getJson();
+		description.setText("${classPrefix} service " + configuration.get("exampleUri").asText()
+				+ " - " + configuration.get("exampleString").asText());
+		// TODO: Might also show extra service information looked
+		// up dynamically from endpoint/registry
+	}
+
+	/**
+	 * View position hint
+	 */
+	@Override
+	public int getPreferredPosition() {
+		// We want to be on top
+		return 100;
+	}
+
+	@Override
+	public Action getConfigureAction(final Frame owner) {
+		return new ${classPrefix}ConfigureAction(getActivity(), editManager, fileManager,
+				activityIconManager, serviceDescriptionRegistry, serviceRegistry);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/META-INF/spring/context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/META-INF/spring/context-osgi.xml b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/META-INF/spring/context-osgi.xml
new file mode 100644
index 0000000..32ad4f1
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/META-INF/spring/context-osgi.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans:beans xmlns="http://www.springframework.org/schema/osgi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:beans="http://www.springframework.org/schema/beans"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans.xsd
+                      http://www.springframework.org/schema/osgi
+                      http://www.springframework.org/schema/osgi/spring-osgi.xsd">
+
+	<service ref="${classPrefix}ServiceIcon" interface="net.sf.taverna.t2.workbench.activityicons.ActivityIconSPI" />
+
+	<service ref="${classPrefix}ServiceProvider" interface="net.sf.taverna.t2.servicedescriptions.ServiceDescriptionProvider" />
+
+	<service ref="${classPrefix}ConfigureMenuAction" auto-export="interfaces" />
+
+	<service ref="${classPrefix}ActivityContextViewFactory" interface="net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ContextualViewFactory" />
+
+	<reference id="editManager" interface="net.sf.taverna.t2.workbench.edits.EditManager" />
+	<reference id="fileManager" interface="net.sf.taverna.t2.workbench.file.FileManager" />
+	<reference id="menuManager" interface="net.sf.taverna.t2.ui.menu.MenuManager" />
+	<reference id="selectionManager" interface="net.sf.taverna.t2.workbench.selection.SelectionManager" />
+	<reference id="activityIconManager" interface="net.sf.taverna.t2.workbench.activityicons.ActivityIconManager" />
+	<reference id="colourManager" interface="net.sf.taverna.t2.workbench.configuration.colour.ColourManager" />
+	<reference id="serviceDescriptionRegistry" interface="net.sf.taverna.t2.servicedescriptions.ServiceDescriptionRegistry" />
+	<reference id="serviceRegistry" interface="uk.org.taverna.commons.services.ServiceRegistry" />
+
+</beans:beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/META-INF/spring/context.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/META-INF/spring/context.xml b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/META-INF/spring/context.xml
new file mode 100644
index 0000000..cfc5a00
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/META-INF/spring/context.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+	<bean id="${classPrefix}ServiceIcon"
+		class="${package}.ui.serviceprovider.${classPrefix}ServiceIcon" />
+
+	<bean id="${classPrefix}ServiceProvider"
+		class="${package}.ui.serviceprovider.${classPrefix}ServiceProvider" />
+
+	<bean id="${classPrefix}ConfigureMenuAction"
+		class="${package}.ui.menu.${classPrefix}ConfigureMenuAction">
+		<property name="editManager" ref="editManager" />
+		<property name="fileManager" ref="fileManager" />
+		<property name="activityIconManager" ref="activityIconManager" />
+		<property name="serviceDescriptionRegistry" ref="serviceDescriptionRegistry" />
+		<property name="serviceRegistry" ref="serviceRegistry" />
+	</bean>
+
+	<bean id="${classPrefix}ActivityContextViewFactory"
+		class="${package}.ui.view.${classPrefix}ActivityContextViewFactory">
+		<property name="editManager" ref="editManager" />
+		<property name="fileManager" ref="fileManager" />
+		<property name="activityIconManager" ref="activityIconManager" />
+		<property name="serviceDescriptionRegistry" ref="serviceDescriptionRegistry" />
+		<property name="serviceRegistry" ref="serviceRegistry" />
+	</bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/exampleIcon.png
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/exampleIcon.png b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/exampleIcon.png
new file mode 100644
index 0000000..3ef7be4
Binary files /dev/null and b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/exampleIcon.png differ

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/pom.xml b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/pom.xml
new file mode 100644
index 0000000..755b218
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/pom.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>${groupId}</groupId>
+		<artifactId>${rootArtifactId}</artifactId>
+		<version>${version}</version>
+	</parent>
+	<artifactId>${artifactId}</artifactId>
+	<packaging>bundle</packaging>
+	<name>${classPrefix} Taverna activity</name>
+
+	<dependencies>
+		<dependency>
+			<groupId>net.sf.taverna.t2.core</groupId>
+			<artifactId>workflowmodel-api</artifactId>
+			<version>${t2.core.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>net.sf.taverna.t2.core</groupId>
+			<artifactId>reference-api</artifactId>
+			<version>${t2.core.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>com.fasterxml.jackson.core</groupId>
+			<artifactId>jackson-databind</artifactId>
+			<version>2.3.0</version>
+		</dependency>
+
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>4.4</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>net.sf.taverna.t2.core</groupId>
+			<artifactId>workflowmodel-impl</artifactId>
+			<version>${t2.core.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>net.sf.taverna.t2.activities</groupId>
+			<artifactId>activity-test-utils</artifactId>
+			<version>${t2.activities.version}</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__Activity.java
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__Activity.java b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__Activity.java
new file mode 100644
index 0000000..6696cfe
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__Activity.java
@@ -0,0 +1,135 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package};
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+import net.sf.taverna.t2.invocation.InvocationContext;
+import net.sf.taverna.t2.reference.ReferenceService;
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.workflowmodel.processor.activity.AbstractAsynchronousActivity;
+import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityConfigurationException;
+import net.sf.taverna.t2.workflowmodel.processor.activity.AsynchronousActivity;
+import net.sf.taverna.t2.workflowmodel.processor.activity.AsynchronousActivityCallback;
+
+/**
+ * ${classPrefix} <code>Activity<code>.
+ */
+public class ${classPrefix}Activity extends AbstractAsynchronousActivity<JsonNode>
+		implements AsynchronousActivity<JsonNode> {
+
+	public static final String ACTIVITY_TYPE = "http://example.com/2013/activity/${rootArtifactId}";
+
+	/*
+	 * Best practice: Keep port names as constants to avoid misspelling. This
+	 * would not apply if port names are looked up dynamically from the service
+	 * operation, like done for WSDL services.
+	 */
+	public static final String IN_FIRST_INPUT = "firstInput";
+	public static final String IN_EXTRA_DATA = "extraData";
+	public static final String OUT_MORE_OUTPUTS = "moreOutputs";
+	public static final String OUT_SIMPLE_OUTPUT = "simpleOutput";
+	public static final String OUT_REPORT = "report";
+
+	private JsonNode configuration;
+
+	@Override
+	public void configure(JsonNode configuration) throws ActivityConfigurationException {
+
+		// Any pre-config sanity checks
+		if (configuration.get("exampleString").asText().equals("invalidExample")) {
+			throw new ActivityConfigurationException(
+					"Example string can't be 'invalidExample'");
+		}
+		// Store for getConfiguration(), but you could also make
+		// getConfiguration() return a new bean from other sources
+		this.configuration = configuration;
+
+		// OPTIONAL:
+		// Do any server-side lookups and configuration, like resolving WSDLs
+
+		// myClient = new MyClient(configuration.get("exampleUri").asText());
+		// this.service = myClient.getService(configuration.get("exampleString").asText());
+
+	}
+
+	@Override
+	public JsonNode getConfiguration() {
+		return configuration;
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public void executeAsynch(final Map<String, T2Reference> inputs,
+			final AsynchronousActivityCallback callback) {
+		// Don't execute service directly now, request to be run ask to be run
+		// from thread pool and return asynchronously
+		callback.requestRun(new Runnable() {
+
+			public void run() {
+				InvocationContext context = callback
+						.getContext();
+				ReferenceService referenceService = context
+						.getReferenceService();
+				// Resolve inputs
+				String firstInput = (String) referenceService.renderIdentifier(inputs.get(IN_FIRST_INPUT),
+						String.class, context);
+
+				// Support our configuration-dependendent input
+				boolean optionalPorts = configuration.get("exampleString").asText().equals("specialCase");
+
+				List<byte[]> special = null;
+				// We'll also allow IN_EXTRA_DATA to be optionally not provided
+				if (optionalPorts && inputs.containsKey(IN_EXTRA_DATA)) {
+					// Resolve as a list of byte[]
+					special = (List<byte[]>) referenceService.renderIdentifier(
+							inputs.get(IN_EXTRA_DATA), byte[].class, context);
+				}
+
+
+				// TODO: Do the actual service invocation
+//				try {
+//					results = this.service.invoke(firstInput, special)
+//				} catch (ServiceException ex) {
+//					callback.fail("Could not invoke ${classPrefix} service " + configBean.getExampleUri(),
+//							ex);
+//					// Make sure we don't call callback.receiveResult later
+//					return;
+//				}
+
+				// Register outputs
+				Map<String, T2Reference> outputs = new HashMap<>();
+				String simpleValue = "simple";
+				T2Reference simpleRef = referenceService.register(simpleValue, 0, true, context);
+				outputs.put(OUT_SIMPLE_OUTPUT, simpleRef);
+
+				// For list outputs, only need to register the top level list
+				List<String> moreValues = new ArrayList<>();
+				moreValues.add("Value 1");
+				moreValues.add("Value 2");
+				T2Reference moreRef = referenceService.register(moreValues, 1, true, context);
+				outputs.put(OUT_MORE_OUTPUTS, moreRef);
+
+				if (optionalPorts) {
+					// Populate our optional output port
+					// NOTE: Need to return output values for all defined output ports
+					String report = "Everything OK";
+					outputs.put(OUT_REPORT, referenceService.register(report,
+							0, true, context));
+				}
+
+				// return map of output data, with empty index array as this is
+				// the only and final result (this index parameter is used if
+				// pipelining output)
+				callback.receiveResult(outputs, new int[0]);
+			}
+		});
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__ActivityFactory.java
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__ActivityFactory.java b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__ActivityFactory.java
new file mode 100644
index 0000000..0fcb08b
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__ActivityFactory.java
@@ -0,0 +1,97 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package};
+
+import static ${package}.${classPrefix}Activity.*;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.HashSet;
+import java.util.Set;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import net.sf.taverna.t2.workflowmodel.Edits;
+import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityFactory;
+import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityInputPort;
+import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityOutputPort;
+
+/**
+ * ${classPrefix} <code>ActivityFactory<code>.
+ */
+public class ${classPrefix}ActivityFactory implements ActivityFactory {
+
+	private Edits edits;
+
+	@Override
+	public ${classPrefix}Activity createActivity() {
+		return new ${classPrefix}Activity();
+	}
+
+	@Override
+	public URI getActivityType() {
+		return URI.create(${classPrefix}Activity.ACTIVITY_TYPE);
+	}
+
+	@Override
+	public JsonNode getActivityConfigurationSchema() {
+		ObjectMapper objectMapper = new ObjectMapper();
+		try {
+			return objectMapper.readTree(getClass().getResource("/schema.json"));
+		} catch (IOException e) {
+			return objectMapper.createObjectNode();
+		}
+	}
+
+	@Override
+	public Set<ActivityInputPort> getInputPorts(JsonNode configuration) {
+		Set<ActivityInputPort> inputPorts = new HashSet<>();
+
+		// FIXME: Replace with your input port definitions
+
+		// Hard coded input port, expecting a single String
+		inputPorts.add(edits.createActivityInputPort(IN_FIRST_INPUT, 0, true, null, String.class));
+
+		// Optional ports depending on configuration
+		if (configuration.get("exampleString").asText().equals("specialCase")) {
+			// depth 1, ie. list of binary byte[] arrays
+			inputPorts.add(edits.createActivityInputPort(IN_EXTRA_DATA, 1, true, null, byte[].class));
+		}
+
+		return inputPorts;
+	}
+
+	@Override
+	public Set<ActivityOutputPort> getOutputPorts(JsonNode configuration) {
+		Set<ActivityOutputPort> outputPorts = new HashSet<>();
+
+		// FIXME: Replace with your output port definitions
+
+		// Optional ports depending on configuration
+		if (configuration.get("exampleString").asText().equals("specialCase")) {
+			outputPorts.add(edits.createActivityOutputPort(OUT_REPORT, 0, 0));
+		}
+
+		// Single value output port (depth 0)
+		outputPorts.add(edits.createActivityOutputPort(OUT_SIMPLE_OUTPUT, 0, 0));
+		// Output port with list of values (depth 1)
+		outputPorts.add(edits.createActivityOutputPort(OUT_MORE_OUTPUTS, 1, 1));
+
+		return outputPorts;
+	}
+
+	/**
+	 * Sets the edits property.
+	 * <p>
+	 * This method is used by Spring. The property name must match the property specified
+	 * in the Spring context file.
+	 *
+	 * @param edits the <code>Edits</code> used to create input/output ports
+	 */
+	public void setEdits(Edits edits) {
+		this.edits = edits;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__ActivityHealthChecker.java
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__ActivityHealthChecker.java b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__ActivityHealthChecker.java
new file mode 100644
index 0000000..f5568fc
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__ActivityHealthChecker.java
@@ -0,0 +1,66 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package};
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+import net.sf.taverna.t2.visit.VisitReport;
+import net.sf.taverna.t2.visit.VisitReport.Status;
+import net.sf.taverna.t2.workflowmodel.health.HealthCheck;
+import net.sf.taverna.t2.workflowmodel.health.HealthChecker;
+
+/**
+ * ${classPrefix} <code>HealthChecker</code>.
+ */
+public class ${classPrefix}ActivityHealthChecker implements
+		HealthChecker<${classPrefix}Activity> {
+
+	public boolean canVisit(Object o) {
+		// Return True if we can visit the object. We could do
+		// deeper (but not time consuming) checks here, for instance
+		// if the health checker only deals with ${classPrefix}Activity where
+		// a certain configuration option is enabled.
+		return o instanceof ${classPrefix}Activity;
+	}
+
+	public boolean isTimeConsuming() {
+		// Return true if the health checker does a network lookup
+		// or similar time consuming checks, in which case
+		// it would only be performed when using File->Validate workflow
+		// or File->Run.
+		return false;
+	}
+
+	public VisitReport visit(${classPrefix}Activity activity, List<Object> ancestry) {
+		JsonNode config = activity.getConfiguration();
+
+		// We'll build a list of subreports
+		List<VisitReport> subReports = new ArrayList<>();
+
+		if (!URI.create(config.get("exampleUri").asText()).isAbsolute()) {
+			// Report Severe problems we know won't work
+			VisitReport report = new VisitReport(HealthCheck.getInstance(),
+					activity, "Example URI must be absolute", HealthCheck.INVALID_URL,
+					Status.SEVERE);
+			subReports.add(report);
+		}
+
+		if (config.get("exampleString").asText().equals("")) {
+			// Warning on possible problems
+			subReports.add(new VisitReport(HealthCheck.getInstance(), activity,
+					"Example string empty", HealthCheck.NO_CONFIGURATION,
+					Status.WARNING));
+		}
+
+		// The default explanation here will be used if the subreports list is
+		// empty
+		return new VisitReport(HealthCheck.getInstance(), activity,
+				"${classPrefix} service OK", HealthCheck.NO_PROBLEM, subReports);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/META-INF/spring/context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/META-INF/spring/context-osgi.xml b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/META-INF/spring/context-osgi.xml
new file mode 100644
index 0000000..e8d6e12
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/META-INF/spring/context-osgi.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans:beans xmlns="http://www.springframework.org/schema/osgi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:beans="http://www.springframework.org/schema/beans"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+                                 http://www.springframework.org/schema/beans/spring-beans.xsd
+                                 http://www.springframework.org/schema/osgi
+                                 http://www.springframework.org/schema/osgi/spring-osgi.xsd">
+
+	<!-- Services to be registered with the OSGi service register -->
+	<service ref="${classPrefix}ActivityHealthChecker" interface="net.sf.taverna.t2.workflowmodel.health.HealthChecker" />
+
+	<service ref="${classPrefix}ActivityFactory" interface="net.sf.taverna.t2.workflowmodel.processor.activity.ActivityFactory" />
+
+	<!-- References to services required from the OSGi service register -->
+	<reference id="edits" interface="net.sf.taverna.t2.workflowmodel.Edits" />
+
+</beans:beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/META-INF/spring/context.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/META-INF/spring/context.xml b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/META-INF/spring/context.xml
new file mode 100644
index 0000000..49f5428
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/META-INF/spring/context.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+                           http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+	<bean id="${classPrefix}ActivityHealthChecker" class="${package}.${classPrefix}ActivityHealthChecker" />
+
+	<bean id="${classPrefix}ActivityFactory" class="${package}.${classPrefix}ActivityFactory">
+		<property name="edits" ref="edits" />
+	</bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/schema.json
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/schema.json b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/schema.json
new file mode 100644
index 0000000..2916b11
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/schema.json
@@ -0,0 +1,25 @@
+{
+    "$schema": "http://json-schema.org/draft-03/schema#",
+    "id": "http://example.com/2013/activity/${rootArtifactId}.schema.json",
+    "title": "${classPrefix} activity configuration",
+    "type": "object",
+    "properties": {
+        "@context": {
+            "description": "JSON-LD context for interpreting the configuration as RDF",
+            "required": true,
+            "enum": ["http://example.com/2013/activity/${rootArtifactId}.context.json"]
+        },
+        "exampleString": {
+            "title": "Example String",
+            "description": "An example string property",
+            "type": "string",
+            "required": true
+        },
+        "exampleUri": {
+            "title": "Example URI",
+            "description": "An example uri property",
+            "type": "string",
+            "required": true
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/test/java/__classPrefix__ActivityFactoryTest.java
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/test/java/__classPrefix__ActivityFactoryTest.java b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/test/java/__classPrefix__ActivityFactoryTest.java
new file mode 100644
index 0000000..4de382e
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/test/java/__classPrefix__ActivityFactoryTest.java
@@ -0,0 +1,103 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package};
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertTrue;
+
+import java.net.URI;
+import java.util.HashSet;
+import java.util.Set;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.JsonNodeFactory;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
+import net.sf.taverna.t2.workflowmodel.impl.EditsImpl;
+import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityInputPort;
+import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityOutputPort;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class ${classPrefix}ActivityFactoryTest {
+
+	private ObjectNode configuration;
+
+	private ${classPrefix}ActivityFactory activityFactory;
+
+	@Before
+	public void setUp() throws Exception {
+		configuration = JsonNodeFactory.instance.objectNode();
+		configuration.put("exampleString", "something");
+		configuration.put("exampleUri", "http://localhost:8080/myEndPoint");
+
+		activityFactory = new ${classPrefix}ActivityFactory();
+		activityFactory.setEdits(new EditsImpl());
+	}
+
+	@Test
+	public void testCreateActivity() {
+		${classPrefix}Activity activity = activityFactory.createActivity();
+		assertNotNull(activity);
+		assertNotSame(activity, activityFactory.createActivity());
+	}
+
+	@Test
+	public void testGetActivityURI() {
+		assertEquals(URI.create(${classPrefix}Activity.ACTIVITY_TYPE), activityFactory.getActivityType());
+	}
+
+	@Test
+	public void testGetActivityConfigurationSchema() {
+		JsonNode configurationSchema = activityFactory.getActivityConfigurationSchema();
+		assertNotNull(configurationSchema);
+		assertTrue(configurationSchema.has("properties"));
+		JsonNode propertiesNode = configurationSchema.get("properties");
+		assertTrue(propertiesNode.has("exampleString"));
+		assertTrue(propertiesNode.has("exampleUri"));
+	}
+
+	@Test
+	public void testGetInputPorts() {
+		Set<String> expectedInputs = new HashSet<String>();
+		expectedInputs.add("firstInput");
+
+		Set<ActivityInputPort> inputPorts = activityFactory.getInputPorts(configuration);
+		assertEquals("Unexpected inputs", expectedInputs.size(), inputPorts.size());
+		for (ActivityInputPort inputPort : inputPorts) {
+			assertTrue("Wrong input : " + inputPort.getName(), expectedInputs
+					.remove(inputPort.getName()));
+		}
+
+		ObjectNode specialConfiguration = JsonNodeFactory.instance.objectNode();
+		specialConfiguration.put("exampleString", "specialCase");
+		specialConfiguration.put("exampleUri", "http://localhost:8080/myEndPoint");
+
+		assertEquals("Unexpected inputs", 2, activityFactory.getInputPorts(specialConfiguration).size());
+	}
+
+	@Test
+	public void testGetOutputPorts() {
+		Set<String> expectedOutputs = new HashSet<String>();
+		expectedOutputs.add("simpleOutput");
+		expectedOutputs.add("moreOutputs");
+
+		Set<ActivityOutputPort> outputPorts = activityFactory.getOutputPorts(configuration);
+		assertEquals("Unexpected outputs", expectedOutputs.size(), outputPorts.size());
+		for (ActivityOutputPort outputPort : outputPorts) {
+			assertTrue("Wrong output : " + outputPort.getName(),
+					expectedOutputs.remove(outputPort.getName()));
+		}
+
+		ObjectNode specialConfiguration = JsonNodeFactory.instance.objectNode();
+		specialConfiguration.put("exampleString", "specialCase");
+		specialConfiguration.put("exampleUri", "http://localhost:8080/myEndPoint");
+
+		assertEquals("Unexpected outputs", 3, activityFactory.getOutputPorts(specialConfiguration).size());
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/test/java/__classPrefix__ActivityTest.java
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/test/java/__classPrefix__ActivityTest.java b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/test/java/__classPrefix__ActivityTest.java
new file mode 100644
index 0000000..e992290
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/test/java/__classPrefix__ActivityTest.java
@@ -0,0 +1,76 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package};
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.net.URI;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.JsonNodeFactory;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
+import net.sf.taverna.t2.activities.testutils.ActivityInvoker;
+import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityConfigurationException;
+import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityInputPort;
+import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityOutputPort;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class ${classPrefix}ActivityTest {
+
+	private ObjectNode configuration;
+
+	private ${classPrefix}Activity activity = new ${classPrefix}Activity();
+
+	@Before
+	public void makeConfiguration() throws Exception {
+		configuration = JsonNodeFactory.instance.objectNode();
+		configuration.put("exampleString", "something");
+		configuration.put("exampleUri", "http://localhost:8080/myEndPoint");
+	}
+
+	@Test
+	public void configureActivity() throws Exception {
+		activity.configure(configuration);
+		assertTrue(configuration.equals(activity.getConfiguration()));
+	}
+
+	@Test(expected = ActivityConfigurationException.class)
+	public void invalidConfiguration() throws ActivityConfigurationException {
+		ObjectNode invalidBean = JsonNodeFactory.instance.objectNode();
+		invalidBean.put("exampleString", "invalidExample");
+		// Should throw ActivityConfigurationException
+		activity.configure(invalidBean);
+	}
+
+	@Test
+	public void executeAsynch() throws Exception {
+		activity.configure(configuration);
+
+		Map<String, Object> inputs = new HashMap<String, Object>();
+		inputs.put("firstInput", "hello");
+
+		Map<String, Class<?>> expectedOutputTypes = new HashMap<String, Class<?>>();
+		expectedOutputTypes.put("simpleOutput", String.class);
+		expectedOutputTypes.put("moreOutputs", String.class);
+
+		Map<String, Object> outputs = ActivityInvoker.invokeAsyncActivity(
+				activity, inputs, expectedOutputTypes);
+
+		assertEquals("Unexpected outputs", 2, outputs.size());
+		assertEquals("simple", outputs.get("simpleOutput"));
+		assertEquals(Arrays.asList("Value 1", "Value 2"), outputs
+				.get("moreOutputs"));
+
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-plugin/pom.xml b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-plugin/pom.xml
new file mode 100644
index 0000000..72c44ed
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-plugin/pom.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>${groupId}</groupId>
+		<artifactId>${rootArtifactId}</artifactId>
+		<version>${version}</version>
+	</parent>
+	<artifactId>${artifactId}</artifactId>
+	<packaging>taverna-plugin</packaging>
+	<name>${classPrefix} Taverna plugin</name>
+	<description>Description of Example Taverna plugin</description>
+	<dependencies>
+		<dependency>
+			<groupId>${project.groupId}</groupId>
+			<artifactId>${rootArtifactId}-activity</artifactId>
+			<version>${version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.groupId}</groupId>
+			<artifactId>${rootArtifactId}-activity-ui</artifactId>
+			<version>${version}</version>
+		</dependency>
+	</dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/pom.xml b/taverna-activity-archetype/src/main/resources/archetype-resources/pom.xml
new file mode 100644
index 0000000..57b4aa9
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/pom.xml
@@ -0,0 +1,192 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+
+	<groupId>${groupId}</groupId>
+	<artifactId>${artifactId}</artifactId>
+	<version>${version}</version>
+	<packaging>pom</packaging>
+	<name>${classPrefix} Taverna project</name>
+
+	<properties>
+		<t2.core.version>2.0.1-SNAPSHOT</t2.core.version>
+		<t2.activities.version>2.0.1-SNAPSHOT</t2.activities.version>
+		<t2.ui.api.version>2.0-SNAPSHOT</t2.ui.api.version>
+	</properties>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<version>2.3.2</version>
+				<configuration>
+					<source>1.7</source>
+					<target>1.7</target>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-source-plugin</artifactId>
+				<version>2.1.2</version>
+				<executions>
+					<execution>
+						<goals>
+							<goal>jar</goal>
+							<goal>test-jar</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-jar-plugin</artifactId>
+				<version>2.3.1</version>
+				<executions>
+					<execution>
+						<goals>
+							<goal>test-jar</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-surefire-plugin</artifactId>
+				<version>2.7.1</version>
+				<configuration>
+					<skip>false</skip>
+					<systemProperties>
+						<property>
+							<name>java.awt.headless</name>
+							<value>true</value>
+						</property>
+					</systemProperties>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-bundle-plugin</artifactId>
+			</plugin>
+			<plugin>
+				<groupId>net.sf.taverna.t2.maven.plugins</groupId>
+				<artifactId>taverna-maven-plugin</artifactId>
+				<version>0.3.1-SNAPSHOT</version>
+				<extensions>true</extensions>
+			</plugin>
+		</plugins>
+		<pluginManagement>
+			<plugins>
+				<plugin>
+					<groupId>org.apache.felix</groupId>
+					<artifactId>maven-bundle-plugin</artifactId>
+					<version>2.3.7</version>
+					<extensions>true</extensions>
+				</plugin>
+				<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+				<plugin>
+					<groupId>org.eclipse.m2e</groupId>
+					<artifactId>lifecycle-mapping</artifactId>
+					<version>1.0.0</version>
+					<configuration>
+						<lifecycleMappingMetadata>
+							<pluginExecutions>
+								<pluginExecution>
+									<pluginExecutionFilter>
+										<groupId>
+											net.sf.taverna.t2.maven.plugins
+										</groupId>
+										<artifactId>
+											taverna-maven-plugin
+										</artifactId>
+										<versionRange>
+											[0.3.1-SNAPSHOT,)
+										</versionRange>
+										<goals>
+											<goal>plugin-generate</goal>
+										</goals>
+									</pluginExecutionFilter>
+									<action>
+										<ignore></ignore>
+									</action>
+								</pluginExecution>
+							</pluginExecutions>
+						</lifecycleMappingMetadata>
+					</configuration>
+				</plugin>
+			</plugins>
+		</pluginManagement>
+	</build>
+
+	<dependencies>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>4.4</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+
+	<repositories>
+		<repository>
+			<!-- The myGrid repository for Taverna dependencies -->
+			<releases />
+			<snapshots>
+				<enabled>false</enabled>
+			</snapshots>
+			<id>mygrid-repository</id>
+			<name>myGrid Repository</name>
+			<url>http://www.mygrid.org.uk/maven/repository</url>
+		</repository>
+		<repository>
+			<!-- The myGrid snapshot repository for Taverna dependencies -->
+			<releases>
+				<enabled>false</enabled>
+			</releases>
+			<snapshots />
+			<id>mygrid-snapshot-repository</id>
+			<name>myGrid Snapshot Repository</name>
+			<url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
+		</repository>
+		<repository>
+			<!-- The repository that your jars are deployed to -->
+			<id>my-repository</id>
+			<name>My Repository</name>
+			<url>http://www.example.com/maven/repository</url>
+		</repository>
+		<repository>
+			<!-- The repository that your snapshot jars are deployed to -->
+			<releases>
+				<enabled>false</enabled>
+			</releases>
+			<snapshots />
+			<id>my-snapshot-repository</id>
+			<name>My snapshot Repository</name>
+			<url>file:///tmp/test-plugins/</url>
+		</repository>
+	</repositories>
+
+	<pluginRepositories>
+		<pluginRepository>
+			<id>mygrid-repository</id>
+			<name>myGrid Repository</name>
+			<url>http://www.mygrid.org.uk/maven/repository</url>
+		</pluginRepository>
+	</pluginRepositories>
+
+	<!-- The location of your plugin site -->
+	<distributionManagement>
+		<repository>
+			<id>my-plugin-site</id>
+			<name>My Plugin Site</name>
+			<url>scpexe://example.com/www/taverna/plugins/</url>
+		</repository>
+		<snapshotRepository>
+			<id>my-test-plugin-site</id>
+			<name>My Test Plugin Site</name>
+			<url>file:///tmp/test-plugins/</url>
+		</snapshotRepository>
+	</distributionManagement>
+
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-test-utils/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-test-utils/pom.xml b/taverna-activity-test-utils/pom.xml
new file mode 100644
index 0000000..7d55112
--- /dev/null
+++ b/taverna-activity-test-utils/pom.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.taverna.engine</groupId>
+		<artifactId>taverna-engine</artifactId>
+		<version>3.1.0-incubating-SNAPSHOT</version>
+	</parent>
+	<artifactId>taverna-activity-test-utils</artifactId>
+	<name>Apache Taverna Activity test utils</name>
+	<dependencies>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-workflowmodel-impl</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-reference-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-reference-impl</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-reference-types</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+	</dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-test-utils/src/main/java/net/sf/taverna/t2/activities/testutils/ActivityInvoker.java
----------------------------------------------------------------------
diff --git a/taverna-activity-test-utils/src/main/java/net/sf/taverna/t2/activities/testutils/ActivityInvoker.java b/taverna-activity-test-utils/src/main/java/net/sf/taverna/t2/activities/testutils/ActivityInvoker.java
new file mode 100644
index 0000000..934e31a
--- /dev/null
+++ b/taverna-activity-test-utils/src/main/java/net/sf/taverna/t2/activities/testutils/ActivityInvoker.java
@@ -0,0 +1,250 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.activities.testutils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.ServiceLoader;
+
+import net.sf.taverna.t2.reference.ExternalReferenceBuilderSPI;
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ExternalReferenceTranslatorSPI;
+import net.sf.taverna.t2.reference.ReferenceService;
+import net.sf.taverna.t2.reference.StreamToValueConverterSPI;
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.reference.ValueToReferenceConverterSPI;
+import net.sf.taverna.t2.reference.impl.ErrorDocumentServiceImpl;
+import net.sf.taverna.t2.reference.impl.InMemoryErrorDocumentDao;
+import net.sf.taverna.t2.reference.impl.InMemoryListDao;
+import net.sf.taverna.t2.reference.impl.InMemoryReferenceSetDao;
+import net.sf.taverna.t2.reference.impl.ListServiceImpl;
+import net.sf.taverna.t2.reference.impl.ReferenceServiceImpl;
+import net.sf.taverna.t2.reference.impl.ReferenceSetAugmentorImpl;
+import net.sf.taverna.t2.reference.impl.ReferenceSetServiceImpl;
+import net.sf.taverna.t2.reference.impl.SimpleT2ReferenceGenerator;
+import net.sf.taverna.t2.workflowmodel.processor.activity.AbstractAsynchronousActivity;
+import net.sf.taverna.t2.workflowmodel.processor.activity.AsynchronousActivity;
+
+/**
+ * Helper class to facilitate in executing Activities in isolation.
+ * 
+ * @author Stuart Owen
+ * @author Alex Nenadic
+ * @author Stian Soiland-Reyes
+ * @author David Withers
+ */
+public class ActivityInvoker {
+
+	/**
+	 * Timeout in seconds
+	 */
+	public static long TIMEOUT = 30;
+
+	
+	/**
+	 * Invokes an {@link AsynchronousActivity} with a given set of input Objects
+	 * and returns a Map<String,Object> of requested output values.
+	 * 
+	 * @param activity
+	 *            the activity to be tested
+	 * @param inputs
+	 *            a Map<String,Object> of input Objects
+	 * @param requestedOutputs
+	 *            a List<String> of outputs to be examined
+	 * 
+	 * @return a Map<String,Object> of the outputs requested by requestedOutput
+	 *         or <code>null</code> if a failure occurs
+	 * @throws InterruptedException 
+	 * @throws Throwable 
+	 */
+/*	public static Map<String, Object> invokeAsyncActivity(
+			AbstractAsynchronousActivity<?> activity,
+			Map<String, Object> inputs, Map<String, Class<?>> requestedOutputs)
+			throws Exception {
+		Map<String, Object> results = new HashMap<String, Object>();
+
+		ApplicationContext context = new RavenAwareClassPathXmlApplicationContext(
+		"inMemoryActivityTestsContext.xml");
+		ReferenceService referenceService = (ReferenceService) context.getBean("t2reference.service.referenceService");
+
+		DummyCallback callback = new DummyCallback(referenceService);
+		Map<String, T2Reference> inputEntities = new HashMap<String, T2Reference>();
+		for (String inputName : inputs.keySet()) {
+			Object val = inputs.get(inputName);
+			if (val instanceof List) {
+				inputEntities.put(inputName, referenceService.register(val, 1, true, callback.getContext()));
+			} else {
+				inputEntities.put(inputName, referenceService.register(val, 0, true, callback.getContext()));
+			}
+		}
+
+		activity.executeAsynch(inputEntities, callback);
+		callback.thread.join();
+
+		if (callback.failed) {
+			results = null;
+		} else {
+			for (Map.Entry<String, Class<?>> output : requestedOutputs.entrySet()) {
+				T2Reference id = callback.data.get(output.getKey());
+				if (id != null) {
+					Object result;
+					result = referenceService.renderIdentifier(id, output.getValue(), callback.getContext());
+					results.put(output.getKey(), result);
+				}
+			}
+		}
+		return results;
+	}
+	*/
+
+	// Changed this method to render the T2Reference to an object only if the type of the object in 
+	// requestedOutputs is not an instance of ExternalReferenceSPI. Otherwise, the calling test method 
+	// should get activity ReferenceSet and render the object itself. This was needed for API consumer activity 
+	// testing - see ApiConsumerActivityTest.
+	// Also added support for multi-dimensional lists.
+	public static Map<String, Object> invokeAsyncActivity(
+			AbstractAsynchronousActivity<?> activity,
+			Map<String, Object> inputs, Map<String, Class<?>> requestedOutputs) throws InterruptedException
+			 {
+		
+		Map<String, Object> results = new HashMap<String, Object>();
+
+		ReferenceService referenceService = createReferenceService();
+		
+		DummyCallback callback = new DummyCallback(referenceService);
+		Map<String, T2Reference> inputEntities = new HashMap<String, T2Reference>();
+		for (String inputName : inputs.keySet()) {
+			Object val = inputs.get(inputName);
+			int depth = getDepth(val);
+			inputEntities.put(inputName, referenceService.register(val, depth, true, callback.getContext()));
+		}
+
+		activity.executeAsynch(inputEntities, callback);
+		callback.thread.join(TIMEOUT*1000);
+
+		
+		if (callback.failed) {
+			throw callback.failures.get(0);
+		} else {
+			for (Map.Entry<String, Class<?>> output : requestedOutputs.entrySet()) {
+				T2Reference id = callback.data.get(output.getKey());
+				if (ExternalReferenceSPI.class.isAssignableFrom(output.getValue())){
+					// Do not render the object - just resolve the T2Reference
+					Object result;
+					result = referenceService.resolveIdentifier(id, null, callback.getContext());
+					results.put(output.getKey(), result);
+				}
+				else{
+					// Try to render the object behind the reference
+					Object result;
+					result = referenceService.renderIdentifier(id, output.getValue(), callback.getContext());
+					results.put(output.getKey(), result);
+				}
+			}
+		}
+		return results;
+	}
+
+	private static ReferenceService createReferenceService() {
+		SimpleT2ReferenceGenerator referenceGenerator = new SimpleT2ReferenceGenerator();
+		ReferenceSetAugmentorImpl referenceSetAugmentor = new ReferenceSetAugmentorImpl();
+		referenceSetAugmentor.setBuilders((List<ExternalReferenceBuilderSPI<?>>) getBuilders());
+		referenceSetAugmentor.setTranslators(getTranslators());
+		
+		ReferenceSetServiceImpl referenceSetService = new ReferenceSetServiceImpl();
+		referenceSetService.setT2ReferenceGenerator(referenceGenerator);
+		referenceSetService.setReferenceSetDao(new InMemoryReferenceSetDao());
+		referenceSetService.setReferenceSetAugmentor(referenceSetAugmentor);
+		
+		ListServiceImpl listService = new ListServiceImpl();
+		listService.setT2ReferenceGenerator(referenceGenerator);
+		listService.setListDao(new InMemoryListDao());
+		
+		ErrorDocumentServiceImpl errorDocumentService = new ErrorDocumentServiceImpl();
+		errorDocumentService.setT2ReferenceGenerator(referenceGenerator);
+		errorDocumentService.setErrorDao(new InMemoryErrorDocumentDao());
+		
+		ReferenceServiceImpl referenceService = new ReferenceServiceImpl();
+		referenceService.setReferenceSetService(referenceSetService);
+		referenceService.setListService(listService);
+		referenceService.setErrorDocumentService(errorDocumentService);
+		referenceService.setConverters(getConverters());
+		referenceService.setValueBuilders(getValueBuilders());
+		
+		return referenceService;
+	}
+	
+	private static <T> List<T> getImplementations(Class<T> api) {
+		List<T> implementations = new ArrayList<T>();
+		ServiceLoader<T> serviceLoader = ServiceLoader.load(api);
+		for (T implementation : serviceLoader) {
+			implementations.add(implementation);
+		}
+		return implementations;
+	}
+	
+	private static List<StreamToValueConverterSPI> getValueBuilders() {
+		return getImplementations(StreamToValueConverterSPI.class);
+	}
+
+	private static List<ValueToReferenceConverterSPI> getConverters() {
+		return getImplementations(ValueToReferenceConverterSPI.class);
+	}
+
+	private static List<ExternalReferenceTranslatorSPI<?, ?>> getTranslators() {
+		List<ExternalReferenceTranslatorSPI<?, ?>> implementations = new ArrayList<ExternalReferenceTranslatorSPI<?, ?>>();
+		ServiceLoader<ExternalReferenceTranslatorSPI> serviceLoader = ServiceLoader.load(ExternalReferenceTranslatorSPI.class);
+		for (ExternalReferenceTranslatorSPI implementation : serviceLoader) {
+			implementations.add(implementation);
+		}
+		return implementations;
+	}
+
+	private static List<ExternalReferenceBuilderSPI<?>> getBuilders() {
+		List<ExternalReferenceBuilderSPI<?>> implementations = new ArrayList<ExternalReferenceBuilderSPI<?>>();
+		ServiceLoader<ExternalReferenceBuilderSPI> serviceLoader = ServiceLoader.load(ExternalReferenceBuilderSPI.class);
+		for (ExternalReferenceBuilderSPI implementation : serviceLoader) {
+			implementations.add(implementation);
+		}
+		return implementations;
+	}
+
+	/**
+	 * If an object is activity list - returns its depth, 0 otherwise (for single objects).
+	 * @param obj
+	 * @return
+	 */
+	private static int getDepth(Object obj){
+
+		if (obj instanceof List) {
+			// Assumes all sub-lists are of the same depth,
+			// so just uses the first sub-list to calculate it.
+			Object[] sublists = ((List<?>)obj).toArray();
+			int depth = 1;
+			depth = getDepth(sublists[0]) + 1;
+			return depth;
+		} else {
+			return 0;
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-test-utils/src/main/java/net/sf/taverna/t2/activities/testutils/DummyCallback.java
----------------------------------------------------------------------
diff --git a/taverna-activity-test-utils/src/main/java/net/sf/taverna/t2/activities/testutils/DummyCallback.java b/taverna-activity-test-utils/src/main/java/net/sf/taverna/t2/activities/testutils/DummyCallback.java
new file mode 100644
index 0000000..016caef
--- /dev/null
+++ b/taverna-activity-test-utils/src/main/java/net/sf/taverna/t2/activities/testutils/DummyCallback.java
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.activities.testutils;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import net.sf.taverna.t2.invocation.InvocationContext;
+import net.sf.taverna.t2.invocation.impl.InvocationContextImpl;
+import net.sf.taverna.t2.reference.ReferenceService;
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.workflowmodel.processor.activity.AsynchronousActivityCallback;
+import net.sf.taverna.t2.workflowmodel.processor.dispatch.events.DispatchErrorType;
+
+import org.apache.log4j.Logger;
+
+/**
+ * A DummyCallback to aid with testing Activities.
+ * 
+ * @author Stuart Owen
+ * @author David Withers
+ * @author Stian Soiland-Reyes
+ *
+ */
+public class DummyCallback implements AsynchronousActivityCallback {
+	
+	private static Logger logger = Logger
+	.getLogger(DummyCallback.class);
+
+	public ReferenceService referenceService;
+	public InvocationContext invocationContext;
+	public Map<String, T2Reference> data;
+	public Thread thread;
+
+	public boolean failed = false;
+	
+	public List<RuntimeException> failures = new ArrayList<RuntimeException>();
+	
+	public DummyCallback(ReferenceService referenceService) {
+		this.referenceService = referenceService;
+		this.invocationContext = new InvocationContextImpl(referenceService, null);
+	}
+
+	public void fail(String message, Throwable t) {
+		fail(message, t, null);
+	}
+
+	public void fail(String message) {
+		fail(message, null, null);
+	}
+
+	public void fail(String message, Throwable t, DispatchErrorType arg2) {
+		failed = true;
+		failures.add(new RuntimeException(arg2+message, t));
+		logger.error("", t);
+	}
+	
+	/*public SecurityAgentManager getLocalSecurityManager() {
+		// TODO Auto-generated method stub
+		return null;
+	}*/
+
+	public void receiveCompletion(int[] completionIndex) {
+		// TODO Auto-generated method stub
+
+	}
+
+	public void receiveResult(Map<String, T2Reference> data,
+			int[] index) {
+		this.data = data;
+	}
+
+	public void requestRun(Runnable runMe) {
+		thread = new Thread(runMe);
+		thread.start();
+	}
+
+	public InvocationContext getContext() {
+		return invocationContext;
+	}
+
+	public String getParentProcessIdentifier() {
+		// TODO Auto-generated method stub
+		return "";
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-test-utils/src/main/java/net/sf/taverna/t2/activities/testutils/LocationConstants.java
----------------------------------------------------------------------
diff --git a/taverna-activity-test-utils/src/main/java/net/sf/taverna/t2/activities/testutils/LocationConstants.java b/taverna-activity-test-utils/src/main/java/net/sf/taverna/t2/activities/testutils/LocationConstants.java
new file mode 100644
index 0000000..c2c214d
--- /dev/null
+++ b/taverna-activity-test-utils/src/main/java/net/sf/taverna/t2/activities/testutils/LocationConstants.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.activities.testutils;
+
+/**
+ * A definition of constants for base locations of external resources used for testing.
+ * 
+ * @author Stuart Owen
+ *
+ */
+public interface LocationConstants {
+	public static final String WSDL_TEST_BASE="http://www.mygrid.org.uk/taverna-tests/testwsdls/";
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-test-utils/src/main/resources/context-parts/componentservices.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-test-utils/src/main/resources/context-parts/componentservices.xml b/taverna-activity-test-utils/src/main/resources/context-parts/componentservices.xml
new file mode 100644
index 0000000..36ac3e3
--- /dev/null
+++ b/taverna-activity-test-utils/src/main/resources/context-parts/componentservices.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ReferenceSet, ErrorDocument and List services, requires raven.repository -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:raven="http://taverna.sf.net/schema/artifact-support"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans 
+	http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+	http://taverna.sf.net/schema/artifact-support 
+	http://taverna.sf.net/schema/artifact-support/artifact-support.xsd">
+
+	<!-- t2 reference generator -->
+	<bean id="t2reference.referenceGenerator"
+		raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT"
+		raven:repository="raven.repository"
+		class="net.sf.taverna.t2.reference.impl.SimpleT2ReferenceGenerator">
+		<property name="namespace" value="testNamespace" />
+	</bean>
+
+	<!-- reference set service -->
+	<bean id="t2reference.service.referenceSetService"
+		raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT"
+		raven:repository="raven.repository"
+		class="net.sf.taverna.t2.reference.impl.ReferenceSetServiceImpl">
+		<property name="referenceSetDao">
+			<ref bean="t2reference.dao.referenceSetDao" />
+		</property>
+		<property name="t2ReferenceGenerator">
+			<ref bean="t2reference.referenceGenerator" />
+		</property>
+		<property name="referenceSetAugmentor">
+			<ref bean="t2reference.augmentor" />
+		</property>
+	</bean>
+
+	<bean id="t2reference.augmentor"
+		class="net.sf.taverna.t2.reference.impl.ReferenceSetAugmentorImpl"
+		raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT"
+		raven:repository="raven.repository">
+		<property name="builderRegistry">
+			<bean
+				class="net.sf.taverna.platform.spring.InstanceRegistryFactoryBean">
+				<property name="spiRegistry">
+					<bean
+						class="net.sf.taverna.platform.spring.SpiRegistryFactoryBean">
+						<property name="repository">
+							<ref bean="raven.repository" />
+						</property>
+						<property name="spiClassName"
+							value="net.sf.taverna.t2.reference.ExternalReferenceBuilderSPI" />
+					</bean>
+				</property>
+			</bean>
+		</property>
+		<property name="translatorRegistry">
+			<bean
+				class="net.sf.taverna.platform.spring.InstanceRegistryFactoryBean">
+				<property name="spiRegistry">
+					<bean
+						class="net.sf.taverna.platform.spring.SpiRegistryFactoryBean">
+						<property name="repository">
+							<ref bean="raven.repository" />
+						</property>
+						<property name="spiClassName"
+							value="net.sf.taverna.t2.reference.ExternalReferenceTranslatorSPI" />
+					</bean>
+				</property>
+			</bean>
+		</property>
+	</bean>
+
+	<!-- error document service -->
+	<bean id="t2reference.service.errorDocumentService"
+		raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT"
+		raven:repository="raven.repository"
+		class="net.sf.taverna.t2.reference.impl.ErrorDocumentServiceImpl">
+		<property name="errorDao">
+			<ref bean="t2reference.dao.errorDocumentDao" />
+		</property>
+		<property name="t2ReferenceGenerator">
+			<ref bean="t2reference.referenceGenerator" />
+		</property>
+	</bean>
+
+	<!-- list service -->
+	<bean id="t2reference.service.listService"
+		raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT"
+		raven:repository="raven.repository"
+		class="net.sf.taverna.t2.reference.impl.ListServiceImpl">
+		<property name="listDao">
+			<ref bean="t2reference.dao.listDao" />
+		</property>
+		<property name="t2ReferenceGenerator">
+			<ref bean="t2reference.referenceGenerator" />
+		</property>
+	</bean>
+
+
+
+
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-test-utils/src/main/resources/context-parts/dao_hibernate.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-test-utils/src/main/resources/context-parts/dao_hibernate.xml b/taverna-activity-test-utils/src/main/resources/context-parts/dao_hibernate.xml
new file mode 100644
index 0000000..563eb96
--- /dev/null
+++ b/taverna-activity-test-utils/src/main/resources/context-parts/dao_hibernate.xml
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- Dao implementations based on Spring's hibernate templates -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:raven="http://taverna.sf.net/schema/artifact-support"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans 
+	http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+	http://taverna.sf.net/schema/artifact-support 
+	http://taverna.sf.net/schema/artifact-support/artifact-support.xsd">
+
+	<!-- An SPI-enabled hibernate session factory -->
+	<bean id="t2reference.orm.h3.sessionFactory"
+		class="net.sf.taverna.platform.spring.orm.hibernate3.SpiRegistryAwareLocalSessionFactoryBean">
+		<property name="dataSource">
+			<ref bean="t2reference.jdbc.datasource" />
+		</property>
+		<property name="hibernateProperties">
+			<ref bean="t2reference.orm.h3.properties" />
+		</property>
+		<property name="lobHandler">
+			<bean
+				class="org.springframework.jdbc.support.lob.DefaultLobHandler" />
+		</property>
+		<!-- Need to map the abstract superclass for the SPI first, SPI classes -->
+		<!-- are subclasses of this and hibernate can be picky about the order  -->
+		<property name="mappingResources">
+			<list>
+				<value>
+					net/sf/taverna/t2/reference/AbstractExternalReference.hbm.xml
+				</value>
+			</list>
+		</property>
+		<!-- SPI enabled session, uses the linked SPI registry or registries     -->
+		<!-- to gather Class definitions and uses the slightly patched hibernate -->
+		<!-- to ensure that raven is used to fetch these back when required      -->
+		<property name="spiRegistries">
+			<list>
+				<!-- SPI used by the raven-aware hibernate session factory bean -->
+				<!-- This *must* go before the external reference SPI bean or   -->
+				<!-- those beans won't find the mapping for their superclasses  -->
+				<bean
+					class="net.sf.taverna.platform.spring.SpiRegistryFactoryBean">
+					<property name="repository">
+						<ref bean="raven.repository" />
+					</property>
+					<property name="spiClassName"
+						value="net.sf.taverna.t2.reference.h3.HibernateMappedEntity" />
+				</bean>
+				<!-- SPI used by the raven-aware hibernate session factory bean -->
+				<bean
+					class="net.sf.taverna.platform.spring.SpiRegistryFactoryBean">
+					<property name="repository">
+						<ref bean="raven.repository" />
+					</property>
+					<property name="spiClassName"
+						value="net.sf.taverna.t2.reference.ExternalReferenceSPI" />
+				</bean>
+			</list>
+		</property>
+		<property name="preloadRegistries">
+			<list>
+				<bean
+					class="net.sf.taverna.platform.spring.SpiRegistryFactoryBean">
+					<property name="repository">
+						<ref bean="raven.repository" />
+					</property>
+					<property name="spiClassName"
+						value="net.sf.taverna.t2.reference.h3.HibernateComponentClass" />
+				</bean>
+			</list>
+		</property>
+	</bean>
+
+	<bean id="t2reference.dao.referenceSetDao"
+		raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT"
+		raven:repository="raven.repository"
+		class="net.sf.taverna.t2.reference.impl.HibernateReferenceSetDao">
+		<property name="sessionFactory">
+			<ref local="t2reference.orm.h3.sessionFactory" />
+		</property>
+	</bean>
+
+	<bean id="t2reference.dao.errorDocumentDao"
+		raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT"
+		raven:repository="raven.repository"
+		class="net.sf.taverna.t2.reference.impl.HibernateErrorDocumentDao">
+		<property name="sessionFactory">
+			<ref local="t2reference.orm.h3.sessionFactory" />
+		</property>
+	</bean>
+
+	<bean id="t2reference.dao.listDao"
+		raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT"
+		raven:repository="raven.repository"
+		class="net.sf.taverna.t2.reference.impl.HibernateListDao">
+		<property name="sessionFactory">
+			<ref local="t2reference.orm.h3.sessionFactory" />
+		</property>
+	</bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-test-utils/src/main/resources/context-parts/dao_hibernate_transactional.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-test-utils/src/main/resources/context-parts/dao_hibernate_transactional.xml b/taverna-activity-test-utils/src/main/resources/context-parts/dao_hibernate_transactional.xml
new file mode 100644
index 0000000..4823cf8
--- /dev/null
+++ b/taverna-activity-test-utils/src/main/resources/context-parts/dao_hibernate_transactional.xml
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- Dao implementations backed by full hibernate transaction manager support -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:raven="http://taverna.sf.net/schema/artifact-support"
+	xmlns:aop="http://www.springframework.org/schema/aop"
+	xmlns:tx="http://www.springframework.org/schema/tx"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans 
+	http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+	http://www.springframework.org/schema/context
+    http://www.springframework.org/schema/context/spring-context-2.5.xsd
+    http://www.springframework.org/schema/tx 
+    http://www.springframework.org/schema/tx/spring-tx-2.5.xsd 
+	http://taverna.sf.net/schema/artifact-support 
+	http://taverna.sf.net/schema/artifact-support/artifact-support.xsd
+	http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
+
+	<!-- Enable declarative transactions through annotations -->
+	<tx:annotation-driven
+		transaction-manager="t2reference.orm.h3.txManager" />
+
+	<!-- Transaction manager -->
+	<bean id="t2reference.orm.h3.txManager"
+		class="org.springframework.orm.hibernate3.HibernateTransactionManager">
+		<property name="sessionFactory"
+			ref="t2reference.orm.h3.sessionFactory" />
+	</bean>
+
+	<!-- An SPI-enabled hibernate session factory -->
+	<bean id="t2reference.orm.h3.sessionFactory"
+		class="net.sf.taverna.platform.spring.orm.hibernate3.SpiRegistryAwareLocalSessionFactoryBean">
+		<property name="dataSource">
+			<ref bean="t2reference.jdbc.datasource" />
+		</property>
+		<property name="hibernateProperties">
+			<ref bean="t2reference.orm.h3.properties" />
+		</property>
+		<property name="lobHandler">
+			<bean
+				class="org.springframework.jdbc.support.lob.DefaultLobHandler" />
+		</property>
+		<!-- Need to map the abstract superclass for the SPI first, SPI classes -->
+		<!-- are subclasses of this and hibernate can be picky about the order  -->
+		<property name="mappingResources">
+			<list>
+				<value>
+					net/sf/taverna/t2/reference/AbstractExternalReference.hbm.xml
+				</value>
+			</list>
+		</property>
+		<!-- SPI enabled session, uses the linked SPI registry or registries     -->
+		<!-- to gather Class definitions and uses the slightly patched hibernate -->
+		<!-- to ensure that raven is used to fetch these back when required      -->
+		<property name="spiRegistries">
+			<list>
+				<!-- SPI used by the raven-aware hibernate session factory bean -->
+				<!-- This *must* go before the external reference SPI bean or   -->
+				<!-- those beans won't find the mapping for their superclasses  -->
+				<bean
+					class="net.sf.taverna.platform.spring.SpiRegistryFactoryBean">
+					<property name="repository">
+						<ref bean="raven.repository" />
+					</property>
+					<property name="spiClassName"
+						value="net.sf.taverna.t2.reference.h3.HibernateMappedEntity" />
+				</bean>
+				<!-- SPI used by the raven-aware hibernate session factory bean -->
+				<bean
+					class="net.sf.taverna.platform.spring.SpiRegistryFactoryBean">
+					<property name="repository">
+						<ref bean="raven.repository" />
+					</property>
+					<property name="spiClassName"
+						value="net.sf.taverna.t2.reference.ExternalReferenceSPI" />
+				</bean>
+			</list>
+		</property>
+		<property name="preloadRegistries">
+			<list>
+				<bean
+					class="net.sf.taverna.platform.spring.SpiRegistryFactoryBean">
+					<property name="repository">
+						<ref bean="raven.repository" />
+					</property>
+					<property name="spiClassName"
+						value="net.sf.taverna.t2.reference.h3.HibernateComponentClass" />
+				</bean>
+			</list>
+		</property>
+	</bean>
+
+	<bean id="t2reference.dao.referenceSetDao"
+		raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT"
+		raven:repository="raven.repository"
+		class="net.sf.taverna.t2.reference.impl.TransactionalHibernateReferenceSetDao">
+		<property name="sessionFactory">
+			<ref local="t2reference.orm.h3.sessionFactory" />
+		</property>
+	</bean>
+
+	<bean id="t2reference.dao.errorDocumentDao"
+		raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT"
+		raven:repository="raven.repository"
+		class="net.sf.taverna.t2.reference.impl.TransactionalHibernateErrorDocumentDao">
+		<property name="sessionFactory">
+			<ref local="t2reference.orm.h3.sessionFactory" />
+		</property>
+	</bean>
+
+	<bean id="t2reference.dao.listDao"
+		raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT"
+		raven:repository="raven.repository"
+		class="net.sf.taverna.t2.reference.impl.TransactionalHibernateListDao">
+		<property name="sessionFactory">
+			<ref local="t2reference.orm.h3.sessionFactory" />
+		</property>
+	</bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-test-utils/src/main/resources/context-parts/dao_inmemory.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-test-utils/src/main/resources/context-parts/dao_inmemory.xml b/taverna-activity-test-utils/src/main/resources/context-parts/dao_inmemory.xml
new file mode 100644
index 0000000..bb1a790
--- /dev/null
+++ b/taverna-activity-test-utils/src/main/resources/context-parts/dao_inmemory.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- In-memory Dao implementations -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:raven="http://taverna.sf.net/schema/artifact-support"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans 
+	http://www.springframework.org/schema/beans/spring-beans-2.5.xsd 
+	http://taverna.sf.net/schema/artifact-support 
+	http://taverna.sf.net/schema/artifact-support/artifact-support.xsd">
+
+	<bean id="t2reference.dao.referenceSetDao"
+		raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT"
+		raven:repository="raven.repository"
+		class="net.sf.taverna.t2.reference.impl.InMemoryReferenceSetDao">
+	</bean>
+
+	<bean id="t2reference.dao.errorDocumentDao"
+		raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT"
+		raven:repository="raven.repository"
+		class="net.sf.taverna.t2.reference.impl.InMemoryErrorDocumentDao">
+	</bean>
+
+	<bean id="t2reference.dao.listDao"
+		raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT"
+		raven:repository="raven.repository"
+		class="net.sf.taverna.t2.reference.impl.InMemoryListDao">
+	</bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-test-utils/src/main/resources/context-parts/hibernateprops_derby.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-test-utils/src/main/resources/context-parts/hibernateprops_derby.xml b/taverna-activity-test-utils/src/main/resources/context-parts/hibernateprops_derby.xml
new file mode 100644
index 0000000..39e812c
--- /dev/null
+++ b/taverna-activity-test-utils/src/main/resources/context-parts/hibernateprops_derby.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<!-- Full SPI driven test context for the ReferenceService -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:raven="http://taverna.sf.net/schema/artifact-support"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans 
+	http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+	http://taverna.sf.net/schema/artifact-support 
+	http://taverna.sf.net/schema/artifact-support/artifact-support.xsd">
+
+	<!-- Apache Derby rooted at a temporary directory -->
+	<bean id="t2reference.jdbc.temporaryjdbc"
+		class="net.sf.taverna.platform.spring.jdbc.TemporaryJDBC">
+	</bean>
+	<bean id="t2reference.jdbc.url" class="java.lang.String"
+		factory-bean="t2reference.jdbc.temporaryjdbc"
+		factory-method="getTemporaryDerbyJDBC" />
+	<bean id="t2reference.jdbc.datasource"
+		class="net.sf.taverna.platform.spring.jdbc.InterpolatingDriverManagerDataSource">
+		<property name="driverClassName">
+			<value>org.apache.derby.jdbc.EmbeddedDriver</value>
+		</property>
+		<property name="url">
+			<ref bean="t2reference.jdbc.url" />
+		</property>
+		<property name="repository">
+			<ref bean="raven.repository" />
+		</property>
+		<property name="driverArtifact">
+			<value>org.apache.derby:derby:10.4.1.3</value>
+		</property>
+	</bean>
+
+	<!-- Configure hibernate to build schema from scratch, dropping existing -->
+	<bean id="t2reference.orm.h3.properties"
+		class="org.springframework.beans.factory.config.PropertiesFactoryBean">
+		<property name="properties">
+			<props>
+				<prop key="hibernate.hbm2ddl.auto">create</prop>
+				<prop key="hibernate.dialect">
+					org.hibernate.dialect.DerbyDialect
+				</prop>
+				<prop key="hibernate.query.substitutions">
+					true 'T', false 'F'
+				</prop>
+				<prop key="hibernate.show_sql">false</prop>
+				<prop key="hibernate.c3p0.minPoolSize">5</prop>
+				<prop key="hibernate.c3p0.maxPoolSize">20</prop>
+				<prop key="hibernate.c3p0.timeout">600</prop>
+				<prop key="hibernate.c3p0.max_statement">50</prop>
+				<prop key="hibernate.c3p0.testConnectionOnCheckout">
+					false
+				</prop>
+				<prop key="hibernate.cache.use_second_level_cache">
+					false
+				</prop>
+			</props>
+		</property>
+	</bean>
+
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-test-utils/src/main/resources/context-parts/raven_local.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-test-utils/src/main/resources/context-parts/raven_local.xml b/taverna-activity-test-utils/src/main/resources/context-parts/raven_local.xml
new file mode 100644
index 0000000..94238a0
--- /dev/null
+++ b/taverna-activity-test-utils/src/main/resources/context-parts/raven_local.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- Exports raven.repository -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:raven="http://taverna.sf.net/schema/artifact-support"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans 
+	http://www.springframework.org/schema/beans/spring-beans-2.5.xsd 
+	http://taverna.sf.net/schema/artifact-support 
+	http://taverna.sf.net/schema/artifact-support/artifact-support.xsd">
+
+	<repository id="raven.repository"
+		xmlns="http://taverna.sf.net/schema/artifact-support"
+		base="${user.home}/.m2/repository/">
+		<repositories />
+		<system>
+			<!-- T2Reference API -->
+			<sys
+				artifact="net.sf.taverna.t2.core:reference-api:0.8" />
+
+			<!-- T2Platform -->
+			<sys artifact="net.sf.taverna.t2:platform:0.1" />
+			<sys artifact="commons-logging:commons-logging:1.1.1" />
+
+			<!-- Raven -->
+			<sys artifact="uk.org.mygrid.taverna.raven:raven:1.8" />
+
+			<!-- Spring + Essential External Modules -->
+			<sys artifact="org.springframework:spring-orm:2.5.4" />
+			<sys artifact="org.springframework:spring-beans:2.5.4" />
+			<sys artifact="org.springframework:spring-core:2.5.4" />
+			<sys artifact="org.springframework:spring-context:2.5.4" />
+			<sys artifact="org.springframework:spring-tx:2.5.4" />
+			<sys artifact="org.springframework:spring-jdbc:2.5.4" />
+			<sys artifact="aopalliance:aopalliance:1.0" />
+			<sys artifact="geronimo-spec:geronimo-spec-jta:1.0-M1" />
+
+			<!-- Hibernate + Dependencies (minimal) -->
+			<sys artifact="org.hibernate:hibernate:3.2.5.ga.raven" />
+			<sys artifact="dom4j:dom4j:1.6.1" />
+			<sys artifact="cglib:cglib:2.1_3" />
+			<sys artifact="asm:asm:1.5.3" />
+			<sys
+				artifact="commons-collections:commons-collections:2.1.1" />
+		</system>
+	</repository>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-activity-test-utils/src/main/resources/context-parts/referenceservice.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-test-utils/src/main/resources/context-parts/referenceservice.xml b/taverna-activity-test-utils/src/main/resources/context-parts/referenceservice.xml
new file mode 100644
index 0000000..3a37d1b
--- /dev/null
+++ b/taverna-activity-test-utils/src/main/resources/context-parts/referenceservice.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- Context providing a full ReferenceService backed by in-memory Dao implementations -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:raven="http://taverna.sf.net/schema/artifact-support"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans 
+	http://www.springframework.org/schema/beans/spring-beans-2.5.xsd 
+	http://taverna.sf.net/schema/artifact-support 
+	http://taverna.sf.net/schema/artifact-support/artifact-support.xsd">
+
+	<!-- Reference service bean -->
+	<bean id="t2reference.service.referenceService"
+		raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT"
+		raven:repository="raven.repository"
+		class="net.sf.taverna.t2.reference.impl.ReferenceServiceImpl">
+		<property name="referenceSetService">
+			<ref bean="t2reference.service.referenceSetService" />
+		</property>
+		<property name="listService">
+			<ref bean="t2reference.service.listService" />
+		</property>
+		<property name="errorDocumentService">
+			<ref bean="t2reference.service.errorDocumentService" />
+		</property>
+		<property name="converterRegistry">
+			<bean id="converterRegistry"
+				class="net.sf.taverna.platform.spring.InstanceRegistryFactoryBean">
+				<property name="spiRegistry">
+					<bean
+						class="net.sf.taverna.platform.spring.SpiRegistryFactoryBean">
+						<property name="repository">
+							<ref bean="raven.repository" />
+						</property>
+						<property name="spiClassName"
+							value="net.sf.taverna.t2.reference.ValueToReferenceConverterSPI" />
+					</bean>
+				</property>
+			</bean>
+		</property>
+		<property name="valueBuilderRegistry">
+			<bean
+				class="net.sf.taverna.platform.spring.InstanceRegistryFactoryBean">
+				<property name="spiRegistry">
+					<bean
+						class="net.sf.taverna.platform.spring.SpiRegistryFactoryBean">
+						<property name="repository">
+							<ref bean="raven.repository" />
+						</property>
+						<property name="spiClassName"
+							value="net.sf.taverna.t2.reference.StreamToValueConverterSPI" />
+					</bean>
+				</property>
+			</bean>
+		</property>
+	</bean>
+
+</beans>


[06/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/annotations/PutIdentifiedOperation.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/annotations/PutIdentifiedOperation.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/annotations/PutIdentifiedOperation.java
new file mode 100644
index 0000000..d05febe
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/annotations/PutIdentifiedOperation.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.annotations;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Applied to methods in Dao implementations which store or update data in the
+ * backing store.
+ * 
+ * @author Tom Oinn
+ */
+@Retention(RUNTIME)
+@Target(METHOD)
+public @interface PutIdentifiedOperation {
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/annotations/package.html
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/annotations/package.html b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/annotations/package.html
new file mode 100644
index 0000000..0d38e1e
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/annotations/package.html
@@ -0,0 +1,4 @@
+<body>
+Annotations to make methods in the data access object implementations
+for cache injection.
+</body>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/h3/HibernateComponentClass.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/h3/HibernateComponentClass.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/h3/HibernateComponentClass.java
new file mode 100644
index 0000000..f8f2076
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/h3/HibernateComponentClass.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.h3;
+
+/**
+ * A marker used to denote that the class should be pre-loaded into hibernate's
+ * class mapping. Used for component classes which are not going to be mapped to
+ * the RDBMS but which must be loadable for mapped classes to instantiate
+ * correctly. Basically if you refer to a class that isn't itself going to be
+ * mapped in hibernate within a mapping definition you'll need to add that
+ * component class to this SPI or hibernate won't be able to find it as it won't
+ * know that it should associate it with the appropriate class loader.
+ * <p>
+ * This should be used as an SPI marker, and set as the first SPI registry in
+ * the preloadRegistries property of the SpiRegistryAwareLocalSessionFactoryBean
+ * 
+ * @author Tom Oinn
+ */
+public interface HibernateComponentClass {
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/h3/HibernateMappedEntity.java
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/h3/HibernateMappedEntity.java b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/h3/HibernateMappedEntity.java
new file mode 100644
index 0000000..ae77e1d
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/h3/HibernateMappedEntity.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.h3;
+
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ReferenceSet;
+
+/**
+ * A marker interface used to denote that the component should be registered
+ * with the Hibernate ORM system prior to any {@link ExternalReferenceSPI}
+ * implementations. This is here to allow implementations of e.g.
+ * {@link ReferenceSet} to be in the implementation package where they belong
+ * and still guarantee that they are registered before any other plugins.
+ * <p>
+ * This should be used as an SPI marker, and set as the first SPI registry in
+ * the spiRegistries property of the SpiRegistryAwareLocalSessionFactoryBean
+ * 
+ * @author Tom Oinn
+ */
+public interface HibernateMappedEntity {
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/h3/package.html
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/h3/package.html b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/h3/package.html
new file mode 100644
index 0000000..4ffba14
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/h3/package.html
@@ -0,0 +1,8 @@
+<body>
+Contains the marker interfaces used by the implementation package to
+ensure that all appropriate classes are mapped in hibernate
+<em>before</em>
+implementations of classes that depend upon them, and to ensure that
+'static' classes such as the implementations of reference set etc are
+mapped correctly.
+</body>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/package.html
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/package.html b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/package.html
new file mode 100644
index 0000000..503dc3b
--- /dev/null
+++ b/taverna-reference-api/src/main/java/net/sf/taverna/t2/reference/package.html
@@ -0,0 +1,43 @@
+<body>
+<p>Interfaces for the Taverna 2 reference manager. This replaces the
+(badly named) DataManager and is, in effect, a version 2 of that system.
+While these APIs are implementation neutral the intent is heavily
+towards the use of an object relational mapping (ORM) tool such as
+Hibernate backed by a relational database to hold the various
+collection, external reference and error documents managed by the
+reference manager.</p>
+<p>For those familiar with the previous DataManager code the table
+below shows the old class names and the equivalent (where appropriate)
+in the new code:
+</p>
+<table>
+	<tr>
+		<td>DataDocument</td>
+		<td>{@link net.sf.taverna.t2.reference.ReferenceSet}</td>
+	</tr>
+	<tr>
+		<td>ReferenceScheme</td>
+		<td>{@link net.sf.taverna.t2.reference.ExternalReferenceSPI}</td>
+	</tr>
+	<tr>
+		<td>EntityIdentifier</td>
+		<td>{@link net.sf.taverna.t2.reference.T2Reference}</td>
+	</tr>
+	<tr>
+		<td colspan="2">...</td>
+	</tr>
+</table>
+<p>One fundamental change is a move to runtime exceptions rather
+than checked exceptions. This follows the pattern used by Spring and
+Hibernate. The rationale is the same as in those systems - in general
+checked exceptions are not handled properly by client code. The loss of
+compiler level functionality from moving to runtime exceptions is
+countered by much higher readability of code which in itself leads to
+more robust and reliable systems.</p>
+<p>A second change is the availability of asynchronous versions of
+all the critical APIs. Reference construction or translation in
+particular can be a costly process taking substantial time to complete.
+Synchronous versions of the get methods still exist but in general the
+simple callback based asynchronous ones are recommended over them for
+most applications.</p>
+</body>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-api/src/main/resources/net/sf/taverna/t2/reference/AbstractExternalReference.hbm.xml
----------------------------------------------------------------------
diff --git a/taverna-reference-api/src/main/resources/net/sf/taverna/t2/reference/AbstractExternalReference.hbm.xml b/taverna-reference-api/src/main/resources/net/sf/taverna/t2/reference/AbstractExternalReference.hbm.xml
new file mode 100644
index 0000000..e8851e9
--- /dev/null
+++ b/taverna-reference-api/src/main/resources/net/sf/taverna/t2/reference/AbstractExternalReference.hbm.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+                "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+                "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<!-- Hibernate mapping for the abstract superclass of -->
+<!-- ExternalReferenceSPI implementations             -->
+<hibernate-mapping>
+	<class name="net.sf.taverna.t2.reference.AbstractExternalReference"
+		abstract="true">
+		<!-- Let hibernate choose the primary key generation strategy -->
+		<id name="primaryKey" unsaved-value="0" column="bean_id">
+			<generator class="native" />
+		</id>
+	</class>
+</hibernate-mapping>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/.gitignore
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/.gitignore b/taverna-reference-impl/.gitignore
new file mode 100644
index 0000000..1298c5f
--- /dev/null
+++ b/taverna-reference-impl/.gitignore
@@ -0,0 +1 @@
+derby.log

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/pom.xml b/taverna-reference-impl/pom.xml
new file mode 100644
index 0000000..0eb9e8c
--- /dev/null
+++ b/taverna-reference-impl/pom.xml
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.taverna.engine</groupId>
+		<artifactId>taverna-engine</artifactId>
+		<version>3.1.0-incubating-SNAPSHOT</version>
+	</parent>
+	<artifactId>taverna-reference-impl</artifactId>
+	<packaging>bundle</packaging>
+	<name>Apache Taverna Reference Manager Implementation</name>
+	<description>
+		Implementations of the core APIs, not including extension point
+		implementations.
+		This package contains implementations of the data access objects, translator
+		infrastructure etc.
+		The extension point implementations that can be
+		considered as core functionality (files, URLs etc) are held in
+		the taverna-reference-types module.
+    </description>
+
+	<properties>
+		<aspectj.version>1.6.0</aspectj.version>
+	</properties>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-bundle-plugin</artifactId>
+				<extensions>true</extensions>
+				<configuration>
+					<instructions>
+						<Import-Package>
+							org.aspectj.lang,
+							org.springframework.orm.*,
+							org.hibernate.*,
+							org.hibernate.cfg,
+							org.hibernate.proxy, *
+						</Import-Package>
+						<!-- <Import-Package> org.aspectj.lang;resolution:=optional, org.springframework.orm.*;resolution:=optional,
+							org.hibernate.*;resolution:=optional, org.hibernate.proxy;resolution:=optional,
+							org.apache.derby.jdbc, * </Import-Package> -->
+					</instructions>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+	<dependencies>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-reference-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-database-configuration-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>org.springframework.orm</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>org.springframework.transaction</artifactId>
+			<version>${spring.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.aspectj</groupId>
+			<artifactId>com.springsource.org.aspectj.weaver</artifactId>
+			<version>${aspectj.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-reference-testhelpers</artifactId>
+			<version>${project.parent.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.hibernate</groupId>
+			<artifactId>com.springsource.org.hibernate</artifactId>
+			<version>${hibernate.version}</version>
+			<!-- <optional>true</optional> -->
+			<exclusions>
+				<exclusion>
+					<groupId>javax.transaction</groupId>
+					<artifactId>jta</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>net.sf.ehcache</groupId>
+					<artifactId>ehcache</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>asm</groupId>
+					<artifactId>asm-attrs</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>antlr</groupId>
+					<artifactId>antlr</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+		<dependency>
+			<groupId>javax.transaction</groupId>
+			<artifactId>com.springsource.javax.transaction</artifactId>
+			<version>${javax.transaction.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+			<version>${log4j.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+      <version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.derby</groupId>
+			<artifactId>com.springsource.org.apache.derby</artifactId>
+			<version>${derby.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>geronimo-spec</groupId>
+			<artifactId>geronimo-spec-jta</artifactId>
+			<version>${geronimo.spec.jta.version}</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/platform/spring/jdbc/TemporaryJDBC.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/platform/spring/jdbc/TemporaryJDBC.java b/taverna-reference-impl/src/main/java/net/sf/taverna/platform/spring/jdbc/TemporaryJDBC.java
new file mode 100644
index 0000000..d041320
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/platform/spring/jdbc/TemporaryJDBC.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.platform.spring.jdbc;
+
+import static java.io.File.createTempFile;
+
+import java.io.File;
+import java.io.IOException;
+
+/**
+ * Create JDBC connection strings for temporary use (ie. from tests)
+ * <p>
+ * {@link #getTemporaryDerbyJDBC()} creates a temporary directory that is used
+ * to construct the JDBC connection string for a local Derby database.
+ * </p>
+ * <p>
+ * This is most useful from a spring configuration, for example when using
+ * {@link InterpolatingDriverManagerDataSource}:
+ * </p>
+ * 
+ * <pre>
+ * &lt;!-- Apache Derby rooted at a temporary directory --&gt;
+ *  &lt;bean id=&quot;t2reference.jdbc.temporaryjdbc&quot;
+ *  class=&quot;net.sf.taverna.platform.spring.jdbc.TemporaryJDBC&quot;&gt;
+ *  &lt;/bean&gt;
+ *  &lt;bean id=&quot;t2reference.jdbc.url&quot; class=&quot;java.lang.String&quot;
+ *  factory-bean=&quot;t2reference.jdbc.temporaryjdbc&quot;
+ *  factory-method=&quot;getTemporaryDerbyJDBC&quot; /&gt;
+ *  &lt;bean id=&quot;t2reference.jdbc.datasource&quot;
+ *  class=&quot;net.sf.taverna.platform.spring.jdbc.InterpolatingDriverManagerDataSource&quot;&gt;
+ *  &lt;property name=&quot;driverClassName&quot;&gt;
+ *  &lt;value&gt;org.apache.derby.jdbc.EmbeddedDriver&lt;/value&gt;
+ *  &lt;/property&gt;
+ *  &lt;property name=&quot;url&quot;&gt;
+ *  &lt;ref bean=&quot;t2reference.jdbc.url&quot; /&gt;
+ *  &lt;/property&gt;
+ *  &lt;property name=&quot;repository&quot;&gt;
+ *  &lt;ref bean=&quot;raven.repository&quot; /&gt;
+ *  &lt;/property&gt;
+ *  &lt;property name=&quot;driverArtifact&quot;&gt;
+ *  &lt;value&gt;org.apache.derby:derby:10.4.1.3&lt;/value&gt;
+ *  &lt;/property&gt;
+ *  &lt;/bean&gt;
+ * </pre>
+ * 
+ * @author Stian Soiland-Reyes
+ */
+public class TemporaryJDBC {
+	public String getTemporaryDerbyJDBC() throws IOException {
+		File tmpDir = createTempFile("t2platform-", ".db");
+		tmpDir.delete();
+		if (!tmpDir.mkdir())
+			throw new IOException("Could not create temporary directory "
+					+ tmpDir);
+		return "jdbc:derby:" + tmpDir.getPath() + "/database;create=true";
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/platform/spring/jdbc/package.html
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/platform/spring/jdbc/package.html b/taverna-reference-impl/src/main/java/net/sf/taverna/platform/spring/jdbc/package.html
new file mode 100644
index 0000000..2355a14
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/platform/spring/jdbc/package.html
@@ -0,0 +1,6 @@
+<body>
+Extensions to the JDBC parts of Spring, and support for proxying of JDBC 
+drivers so we can load them dynamically from raven artifacts. The proxy 
+approach is inspired by http://www.jroller.com/tackline/entry/dynamically_loading_jdbc_drivers 
+with additions to build from raven rather than from existing jar files.
+</body>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractEntityImpl.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractEntityImpl.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractEntityImpl.java
new file mode 100644
index 0000000..8559607
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractEntityImpl.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import net.sf.taverna.t2.reference.T2Reference;
+
+/**
+ * Abstract superclass of ReferenceSetImpl, IdentifiedArrayList and
+ * ErrorDocumentImpl, manages the T2Reference field for these types and their
+ * hibernate backing.
+ * 
+ * @author Tom Oinn
+ */
+public class AbstractEntityImpl {
+	private T2ReferenceImpl id;
+	private String compactId = null;
+
+	public T2Reference getId() {
+		return id;
+	}
+
+	/**
+	 * This method is only ever called from within Hibernate, and is used to
+	 * initialize the unique ID of this reference set.
+	 */
+	public void setTypedId(T2ReferenceImpl newId) {
+		id = newId;
+	}
+
+	/**
+	 * Used because technically you can't accept and return implementation types
+	 * in the methods on a bean which implements an interface, but Hibernate
+	 * needs to construct concrete input and output types!
+	 */
+	public T2ReferenceImpl getTypedId() {
+		return id;
+	}
+
+	public void setInternalId(String newId) {
+		compactId = newId;
+	}
+
+	public final String getInternalId() {
+		if (compactId == null)
+			compactId = id.getCompactForm();
+		return compactId;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractErrorDocumentServiceImpl.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractErrorDocumentServiceImpl.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractErrorDocumentServiceImpl.java
new file mode 100644
index 0000000..ccabf5a
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractErrorDocumentServiceImpl.java
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import net.sf.taverna.t2.reference.DaoException;
+import net.sf.taverna.t2.reference.ErrorDocument;
+import net.sf.taverna.t2.reference.ErrorDocumentDao;
+import net.sf.taverna.t2.reference.ErrorDocumentService;
+import net.sf.taverna.t2.reference.ErrorDocumentServiceCallback;
+import net.sf.taverna.t2.reference.ErrorDocumentServiceException;
+import net.sf.taverna.t2.reference.ListServiceException;
+import net.sf.taverna.t2.reference.ReferenceContext;
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.reference.T2ReferenceGenerator;
+
+/**
+ * Abstract implementation of ErrorDocumentService, inject with an appropriate
+ * ErrorDocumentDao and T2ReferenceGenerator to enable. Contains injectors for
+ * id generation and dao along with other bookkeeping, leaving the
+ * implementation of the actual service logic to the subclass.
+ * 
+ * @author Tom Oinn
+ */
+public abstract class AbstractErrorDocumentServiceImpl extends
+		AbstractServiceImpl implements ErrorDocumentService {
+	protected ErrorDocumentDao errorDao = null;
+	protected T2ReferenceGenerator t2ReferenceGenerator = null;
+
+	/**
+	 * Inject the error document data access object.
+	 */
+	public final void setErrorDao(ErrorDocumentDao dao) {
+		errorDao = dao;
+	}
+
+	/**
+	 * Inject the T2Reference generator used to allocate new IDs when
+	 * registering ErrorDocuments
+	 */
+	public final void setT2ReferenceGenerator(T2ReferenceGenerator t2rg) {
+		t2ReferenceGenerator = t2rg;
+	}
+
+	/**
+	 * Check that the list dao is configured
+	 * 
+	 * @throws ListServiceException
+	 *             if the dao is still null
+	 */
+	protected final void checkDao() throws ErrorDocumentServiceException {
+		if (errorDao == null)
+			throw new ErrorDocumentServiceException(
+					"ErrorDocumentDao not initialized, error document "
+							+ "service operations are not available");
+	}
+
+	/**
+	 * Check that the t2reference generator is configured
+	 * 
+	 * @throws ListServiceException
+	 *             if the generator is still null
+	 */
+	protected final void checkGenerator() throws ErrorDocumentServiceException {
+		if (t2ReferenceGenerator == null)
+			throw new ErrorDocumentServiceException(
+					"T2ReferenceGenerator not initialized, error document "
+							+ "service operations not available");
+	}
+
+	@Override
+	public final void getErrorAsynch(final T2Reference id,
+			final ErrorDocumentServiceCallback callback)
+			throws ErrorDocumentServiceException {
+		checkDao();
+		Runnable r = new Runnable() {
+			@Override
+			public void run() {
+				try {
+					ErrorDocument e = errorDao.get(id);
+					callback.errorRetrieved(e);
+				} catch (DaoException de) {
+					callback.errorRetrievalFailed(new ErrorDocumentServiceException(
+							de));
+				}
+			}
+		};
+		executeRunnable(r);
+	}
+
+	@Override
+	public final ErrorDocument registerError(String message, int depth,
+			ReferenceContext context) throws ErrorDocumentServiceException {
+		return registerError(message, (Throwable) null, depth, context);
+	}
+
+	@Override
+	public final ErrorDocument registerError(Throwable t, int depth,
+			ReferenceContext context) throws ErrorDocumentServiceException {
+		return registerError("", t, depth, context);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractListServiceImpl.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractListServiceImpl.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractListServiceImpl.java
new file mode 100644
index 0000000..ad564fb
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractListServiceImpl.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import net.sf.taverna.t2.reference.ListDao;
+import net.sf.taverna.t2.reference.ListService;
+import net.sf.taverna.t2.reference.ListServiceCallback;
+import net.sf.taverna.t2.reference.ListServiceException;
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.reference.T2ReferenceGenerator;
+
+/**
+ * Abstract implementation of ListService, inject with an appropriate ListDao
+ * and T2ReferenceGenerator to enable. Contains injectors for id generation and
+ * dao along with other bookkeeping, leaving the implementation of the actual
+ * service logic to the subclass.
+ * 
+ * @author Tom Oinn
+ * 
+ */
+public abstract class AbstractListServiceImpl extends AbstractServiceImpl
+		implements ListService {
+	protected ListDao listDao = null;
+	protected T2ReferenceGenerator t2ReferenceGenerator = null;
+
+	/**
+	 * Inject the list data access object.
+	 */
+	public final void setListDao(ListDao dao) {
+		listDao = dao;
+	}
+
+	/**
+	 * Inject the T2Reference generator used to allocate new IDs when
+	 * registering lists of T2Reference
+	 */
+	public final void setT2ReferenceGenerator(T2ReferenceGenerator t2rg) {
+		t2ReferenceGenerator = t2rg;
+	}
+
+	/**
+	 * Check that the list dao is configured
+	 * 
+	 * @throws ListServiceException
+	 *             if the dao is still null
+	 */
+	protected final void checkDao() throws ListServiceException {
+		if (listDao == null)
+			throw new ListServiceException("ListDao not initialized, list "
+					+ "service operations are not available");
+	}
+
+	/**
+	 * Check that the t2reference generator is configured
+	 * 
+	 * @throws ListServiceException
+	 *             if the generator is still null
+	 */
+	protected final void checkGenerator() throws ListServiceException {
+		if (t2ReferenceGenerator == null)
+			throw new ListServiceException(
+					"T2ReferenceGenerator not initialized, list "
+							+ "service operations not available");
+	}
+
+	@Override
+	public final void getListAsynch(final T2Reference id,
+			final ListServiceCallback callback) throws ListServiceException {
+		checkDao();
+		Runnable r = new Runnable() {
+			@Override
+			public void run() {
+				try {
+					callback.listRetrieved(getList(id));
+				} catch (ListServiceException lse) {
+					callback.listRetrievalFailed(lse);
+				}
+			}
+		};
+		executeRunnable(r);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractReferenceServiceImpl.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractReferenceServiceImpl.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractReferenceServiceImpl.java
new file mode 100644
index 0000000..3ef8e9b
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractReferenceServiceImpl.java
@@ -0,0 +1,171 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import java.util.List;
+import java.util.Set;
+
+import net.sf.taverna.t2.reference.ErrorDocumentService;
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ListService;
+import net.sf.taverna.t2.reference.ReferenceContext;
+import net.sf.taverna.t2.reference.ReferenceService;
+import net.sf.taverna.t2.reference.ReferenceServiceException;
+import net.sf.taverna.t2.reference.ReferenceServiceResolutionCallback;
+import net.sf.taverna.t2.reference.ReferenceSetService;
+import net.sf.taverna.t2.reference.StreamToValueConverterSPI;
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.reference.ValueToReferenceConverterSPI;
+
+/**
+ * Implementation of ReferenceService, inject with ReferenceSetService,
+ * ErrorDocumentService and ListService to enable. Inject with an instance
+ * registry of ValueToReferenceConvertorSPI to enable on the fly registration of
+ * otherwise illegal object types. This class contains the basic injection
+ * functionality and the getters for the sub-services, mostly to isolate these
+ * mundane bits of code from the more interesting actual implementation of the
+ * reference service logic.
+ * 
+ * @author Tom Oinn
+ */
+public abstract class AbstractReferenceServiceImpl extends AbstractServiceImpl
+		implements ReferenceService {
+	protected ErrorDocumentService errorDocumentService = null;
+	protected ReferenceSetService referenceSetService = null;
+	protected ListService listService = null;
+	protected List<ValueToReferenceConverterSPI> converters = null;
+	@SuppressWarnings("rawtypes")
+	protected List<StreamToValueConverterSPI> valueBuilders = null;
+
+	/**
+	 * Inject value to reference convertor SPI
+	 */
+	public final void setConverters(
+			List<ValueToReferenceConverterSPI> converters) {
+		this.converters = converters;
+	}
+
+	/**
+	 * Inject stream to value converter SPI
+	 */
+	@SuppressWarnings("rawtypes")
+	public final void setValueBuilders(
+			List<StreamToValueConverterSPI> valueBuilders) {
+		this.valueBuilders = valueBuilders;
+	}
+
+	/**
+	 * Inject error document service
+	 */
+	public final void setErrorDocumentService(ErrorDocumentService eds) {
+		this.errorDocumentService = eds;
+	}
+
+	/**
+	 * Inject reference set service
+	 */
+	public final void setReferenceSetService(ReferenceSetService rss) {
+		this.referenceSetService = rss;
+	}
+
+	/**
+	 * Inject list service
+	 */
+	public final void setListService(ListService ls) {
+		this.listService = ls;
+	}
+
+	/**
+	 * Throw a ReferenceServiceException if methods in ReferenceService are
+	 * called without the necessary sub-services configured.
+	 */
+	protected final void checkServices() throws ReferenceServiceException {
+		if (errorDocumentService == null)
+			throw new ReferenceServiceException(
+					"Reference service must be configued with an "
+							+ "instance of ErrorDocumentService to function");
+		if (referenceSetService == null)
+			throw new ReferenceServiceException(
+					"Reference service must be configued with an "
+							+ "instance of ReferenceSetService to function");
+		if (listService == null)
+			throw new ReferenceServiceException(
+					"Reference service must be configued with an "
+							+ "instance of ListService to function");
+	}
+
+	/**
+	 * Check whether the converter registry has been defined, throw a
+	 * ReferenceServiceException if not
+	 */
+	protected final void checkConverterRegistry()
+			throws ReferenceServiceException {
+		if (converters == null)
+			throw new ReferenceServiceException(
+					"Reference service must be configued with an "
+							+ "instance registry of ValueToReferenceConvertorSPI "
+							+ "to enable on the fly mapping of arbitrary objects "
+							+ "during compound registration");
+	}
+
+	@Override
+	public final ErrorDocumentService getErrorDocumentService() {
+		checkServices();
+		return this.errorDocumentService;
+	}
+
+	@Override
+	public final ListService getListService() {
+		checkServices();
+		return this.listService;
+	}
+
+	@Override
+	public final ReferenceSetService getReferenceSetService() {
+		checkServices();
+		return this.referenceSetService;
+	}
+
+	/**
+	 * Wraps the synchronous form, using the executeRunnable method to schedule
+	 * it.
+	 */
+	@Override
+	public void resolveIdentifierAsynch(final T2Reference id,
+			final Set<Class<ExternalReferenceSPI>> ensureTypes,
+			final ReferenceContext context,
+			final ReferenceServiceResolutionCallback callback)
+			throws ReferenceServiceException {
+		checkServices();
+		Runnable r = new Runnable() {
+			@Override
+			public void run() {
+				try {
+					callback.identifierResolved(resolveIdentifier(id,
+							ensureTypes, context));
+				} catch (ReferenceServiceException rse) {
+					callback.resolutionFailed(rse);
+				}
+			}
+		};
+		executeRunnable(r);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractReferenceSetServiceImpl.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractReferenceSetServiceImpl.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractReferenceSetServiceImpl.java
new file mode 100644
index 0000000..9c930a5
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractReferenceSetServiceImpl.java
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import java.util.Set;
+
+import net.sf.taverna.t2.reference.DaoException;
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ReferenceContext;
+import net.sf.taverna.t2.reference.ReferenceSet;
+import net.sf.taverna.t2.reference.ReferenceSetAugmentor;
+import net.sf.taverna.t2.reference.ReferenceSetDao;
+import net.sf.taverna.t2.reference.ReferenceSetService;
+import net.sf.taverna.t2.reference.ReferenceSetServiceCallback;
+import net.sf.taverna.t2.reference.ReferenceSetServiceException;
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.reference.T2ReferenceGenerator;
+
+/**
+ * Abstract implementation of ReferenceSetService, inject with an appropriate
+ * ReferenceSetDao to enable. Implements translation functionality as long as an
+ * appropriate ReferenceSetAugmentor implementation is injected. Contains
+ * injectors for id generation and dao along with other bookkeeping, leaving the
+ * implementation of the actual service logic to the subclass.
+ * 
+ * @author Tom Oinn
+ */
+public abstract class AbstractReferenceSetServiceImpl extends
+		AbstractServiceImpl implements ReferenceSetService {
+	protected ReferenceSetDao referenceSetDao = null;
+	protected T2ReferenceGenerator t2ReferenceGenerator = null;
+	protected ReferenceSetAugmentor referenceSetAugmentor = null;
+
+	/**
+	 * Inject the reference set data access object.
+	 */
+	public final void setReferenceSetDao(ReferenceSetDao dao) {
+		this.referenceSetDao = dao;
+	}
+
+	/**
+	 * Inject the T2Reference generator used to allocate new IDs when
+	 * registering sets of ExternalReferenceSPI
+	 */
+	public final void setT2ReferenceGenerator(T2ReferenceGenerator t2rg) {
+		this.t2ReferenceGenerator = t2rg;
+	}
+
+	/**
+	 * Inject the ReferenceSetAugmentor used to translate or construct new
+	 * ExternalReferenceSPI instances within a ReferenceSet
+	 */
+	public final void setReferenceSetAugmentor(ReferenceSetAugmentor rse) {
+		this.referenceSetAugmentor = rse;
+	}
+
+	/**
+	 * Check that the reference set dao is configured
+	 * 
+	 * @throws ReferenceSetServiceException
+	 *             if the dao is still null
+	 */
+	protected final void checkDao() throws ReferenceSetServiceException {
+		if (referenceSetDao == null)
+			throw new ReferenceSetServiceException(
+					"ReferenceSetDao not initialized, reference set "
+							+ "service operations are not available");
+	}
+
+	/**
+	 * Check that the t2reference generator is configured
+	 * 
+	 * @throws ReferenceSetServiceException
+	 *             if the generator is still null
+	 */
+	protected final void checkGenerator() throws ReferenceSetServiceException {
+		if (t2ReferenceGenerator == null)
+			throw new ReferenceSetServiceException(
+					"T2ReferenceGenerator not initialized, reference "
+							+ "set service operations not available");
+	}
+
+	/**
+	 * Check that the reference set augmentor is configured
+	 * 
+	 * @throws ReferenceSetServiceException
+	 *             if the reference set augmentor is still null
+	 */
+	protected final void checkAugmentor() throws ReferenceSetServiceException {
+		if (referenceSetAugmentor == null)
+			throw new ReferenceSetServiceException(
+					"ReferenceSetAugmentor not initialized, reference "
+							+ "set service operations not available");
+	}
+
+	@Override
+	public final void getReferenceSetAsynch(final T2Reference id,
+			final ReferenceSetServiceCallback callback)
+			throws ReferenceSetServiceException {
+		checkDao();
+		Runnable r = new Runnable() {
+			@Override
+			public void run() {
+				try {
+					ReferenceSet rs = referenceSetDao.get(id);
+					callback.referenceSetRetrieved(rs);
+				} catch (DaoException de) {
+					callback.referenceSetRetrievalFailed(new ReferenceSetServiceException(
+							de));
+				}
+			}
+		};
+		executeRunnable(r);
+	}
+
+	/**
+	 * {@inheritDoc}
+	 */
+	@Override
+	public final void getReferenceSetWithAugmentationAsynch(
+			final T2Reference id,
+			final Set<Class<ExternalReferenceSPI>> ensureTypes,
+			final ReferenceContext context,
+			final ReferenceSetServiceCallback callback)
+			throws ReferenceSetServiceException {
+		checkDao();
+		checkAugmentor();
+		Runnable r = new Runnable() {
+			@Override
+			public void run() {
+				try {
+					callback.referenceSetRetrieved(getReferenceSetWithAugmentation(
+							id, ensureTypes, context));
+				} catch (ReferenceSetServiceException rsse) {
+					callback.referenceSetRetrievalFailed(rsse);
+				}
+			}
+		};
+		executeRunnable(r);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractServiceImpl.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractServiceImpl.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractServiceImpl.java
new file mode 100644
index 0000000..c24981e
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractServiceImpl.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+/**
+ * Abstract superclass for all service implementation objects, will be used to
+ * allow injection of thread pooling logic as and when we implement it.
+ * 
+ * @author Tom Oinn
+ */
+public class AbstractServiceImpl {
+	/**
+	 * Schedule a runnable for execution - current naive implementation uses a
+	 * new thread and executes immediately, but this is where any thread pool
+	 * logic would go if we wanted to add that.
+	 * 
+	 * @param r
+	 */
+	protected void executeRunnable(Runnable r) {
+		makeExecutionThread(r).start();
+	}
+
+	protected Thread makeExecutionThread(Runnable r) {
+		return new Thread(r);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractT2ReferenceGenerator.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractT2ReferenceGenerator.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractT2ReferenceGenerator.java
new file mode 100644
index 0000000..dedcc67
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/AbstractT2ReferenceGenerator.java
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import static net.sf.taverna.t2.reference.T2ReferenceType.ErrorDocument;
+import static net.sf.taverna.t2.reference.T2ReferenceType.IdentifiedList;
+import static net.sf.taverna.t2.reference.T2ReferenceType.ReferenceSet;
+
+import java.util.List;
+
+import net.sf.taverna.t2.reference.ReferenceContext;
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.reference.T2ReferenceGenerator;
+import net.sf.taverna.t2.reference.WorkflowRunIdEntity;
+
+/**
+ * An abstract class for implementing simple {@link T2ReferenceGenerator}s.
+ * 
+ * @author Stian Soiland-Reyes
+ */
+public abstract class AbstractT2ReferenceGenerator implements
+		T2ReferenceGenerator {
+	public AbstractT2ReferenceGenerator() {
+		super();
+	}
+
+	private void initReferenceNamespace(T2ReferenceImpl r, ReferenceContext context) {
+		if (context == null) {
+			// this is not good, just use the default namespace
+			r.setNamespacePart(getNamespace());
+			return;
+		}
+
+		List<WorkflowRunIdEntity> workflowRunIdEntities = context
+				.getEntities(WorkflowRunIdEntity.class);
+		if (workflowRunIdEntities == null || workflowRunIdEntities.isEmpty()) {
+			// this is not good, just use the default namespace
+			r.setNamespacePart(getNamespace());
+			return;
+		}
+
+		// there should be only one wf run id entity
+		String workflowRunId = ((WorkflowRunIdEntity) workflowRunIdEntities
+				.get(0)).getWorkflowRunId();
+		r.setNamespacePart(workflowRunId);
+	}
+
+	@Override
+	public synchronized T2Reference nextReferenceSetReference(
+			ReferenceContext context) {
+		T2ReferenceImpl r = new T2ReferenceImpl();
+		initReferenceNamespace(r, context);
+		r.setLocalPart(getNextLocalPart());
+		r.setReferenceType(ReferenceSet);
+		r.setDepth(0);
+		r.setContainsErrors(false);
+		return r;
+	}
+
+	/**
+	 * Generate a new local part for a new {@link T2Reference reference}. The
+	 * local part should be unique within this
+	 * {@link T2ReferenceGenerator#getNamespace() namespace}.
+	 * 
+	 * @return A new, unique local part to identify a new reference.
+	 */
+	protected abstract String getNextLocalPart();
+
+	@Override
+	public T2Reference nextListReference(boolean containsErrors, int listDepth,
+			ReferenceContext context) {
+		T2ReferenceImpl r = new T2ReferenceImpl();
+		initReferenceNamespace(r, context);
+		r.setLocalPart(getNextLocalPart());
+		r.setReferenceType(IdentifiedList);
+		r.setDepth(listDepth);
+		r.setContainsErrors(containsErrors);
+		return r;
+	}
+
+	@Override
+	public T2Reference nextErrorDocumentReference(int depth,
+			ReferenceContext context) {
+		T2ReferenceImpl r = new T2ReferenceImpl();
+		initReferenceNamespace(r, context);
+		r.setLocalPart(getNextLocalPart());
+		r.setReferenceType(ErrorDocument);
+		r.setDepth(depth);
+		// This is an error document, it contains errors by definition
+		r.setContainsErrors(true);
+		return r;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/CacheAspect.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/CacheAspect.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/CacheAspect.java
new file mode 100644
index 0000000..59b5e04
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/CacheAspect.java
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import net.sf.taverna.t2.reference.DaoException;
+import net.sf.taverna.t2.reference.Identified;
+import net.sf.taverna.t2.reference.ReferenceServiceCacheProvider;
+import net.sf.taverna.t2.reference.T2Reference;
+
+import org.aspectj.lang.ProceedingJoinPoint;
+
+/**
+ * An aspect used to intercept calls to the various data access objects and
+ * divert through a write-through cache provider
+ * 
+ * @author Tom Oinn
+ */
+public class CacheAspect {
+	private ReferenceServiceCacheProvider cacheProvider;
+
+	/**
+	 * Return an injected ReferenceServiceCacheProvider
+	 */
+	private final ReferenceServiceCacheProvider getCacheProvider() {
+		return cacheProvider;
+	}
+
+	/**
+	 * Inject an instance of ReferenceServiceCacheProvider
+	 * 
+	 * @param cacheProvider
+	 *            the cache provider to use
+	 */
+	public final void setCacheProvider(
+			final ReferenceServiceCacheProvider cacheProvider) {
+		this.cacheProvider = cacheProvider;
+	}
+
+	/**
+	 * Handle a 'get by T2Reference' operation on a Dao
+	 * 
+	 * @param pjp
+	 *            the join point representing the ongoing method call to the dao
+	 * @return the entity identified by the T2Reference supplied to the method
+	 *         to which this advice applies
+	 * @throws DaoException
+	 *             if anything goes wrong
+	 */
+	public final Identified getObject(final ProceedingJoinPoint pjp)
+			throws DaoException {
+		Identified result = null;
+
+		// Get the T2Reference from the argument to the get method
+		T2Reference id = (T2Reference) pjp.getArgs()[0];
+		if (id != null) {
+			result = getCacheProvider().get(id);
+			if (result != null)
+				return result;
+		}
+		// If we miss the cache then call the method as usual
+		try {
+			result = (Identified) pjp.proceed();
+		} catch (DaoException e) {
+			throw e;
+		} catch (Throwable e) {
+			throw new DaoException("Unexpected exception type during aspect "
+					+ "based invocation", e);
+		}
+
+		// Write back to the cache
+		if (result != null)
+			getCacheProvider().put(result);
+
+		return result;
+	}
+
+	/**
+	 * Called around a write or update operation on the backing store, writes
+	 * through to the cache after modifying the state of the backing store and
+	 * before returning from the dao method
+	 * 
+	 * @param pjp
+	 *            join point representing the ongoing method invocation to cache
+	 * @throws DaoException
+	 *             if anything goes wrong
+	 */
+	public void putObject(final ProceedingJoinPoint pjp) throws DaoException {
+		// Get the Identified being stored by the method we're advising
+		Identified storedObject = (Identified) pjp.getArgs()[0];
+
+		try {
+			// Run the store or update method
+			pjp.proceed();
+		} catch (DaoException e) {
+			throw e;
+		} catch (Throwable e) {
+			throw new DaoException("Unexpected exception type during aspect "
+					+ "based invocation", e);
+		}
+
+		/*
+		 * Assuming the method isn't null and has an identifier (which it will
+		 * if we haven't thrown an exception before now) write it back to the
+		 * cache provider
+		 */
+		if (storedObject != null && storedObject.getId() != null)
+			getCacheProvider().put(storedObject);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ContextualizedT2ReferenceImpl.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ContextualizedT2ReferenceImpl.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ContextualizedT2ReferenceImpl.java
new file mode 100644
index 0000000..30d8492
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ContextualizedT2ReferenceImpl.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import net.sf.taverna.t2.reference.ContextualizedT2Reference;
+import net.sf.taverna.t2.reference.T2Reference;
+
+/**
+ * Simple implementation of ContextualizedT2Reference
+ * 
+ * @author Tom Oinn
+ */
+public class ContextualizedT2ReferenceImpl implements ContextualizedT2Reference {
+	private T2Reference reference;
+	private int[] index;
+
+	public ContextualizedT2ReferenceImpl(T2Reference ref, int[] context) {
+		this.reference = ref;
+		this.index = context;
+	}
+
+	@Override
+	public int[] getIndex() {
+		return this.index;
+	}
+
+	@Override
+	public T2Reference getReference() {
+		return this.reference;
+	}
+
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder("[");
+		String sep = "";
+		for (int idx : index) {
+			sb.append(sep).append(idx);
+			sep = ",";
+		}
+		return sb.append("]").append(reference).toString();
+	}
+	
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/EmptyReferenceContext.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/EmptyReferenceContext.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/EmptyReferenceContext.java
new file mode 100644
index 0000000..6af0430
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/EmptyReferenceContext.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sf.taverna.t2.reference.ReferenceContext;
+
+/**
+ * A trivial implementation of ReferenceContext, used if the context parameter
+ * to any service method is null.
+ * 
+ * @author Tom Oinn
+ */
+public class EmptyReferenceContext implements ReferenceContext {
+	/**
+	 * Return an empty entity set for all queries.
+	 */
+	@Override
+	public <T> List<T> getEntities(Class<T> arg0) {
+		return new ArrayList<>();
+	}
+
+	@Override
+	public void addEntity(Object entity) {
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ErrorDocumentImpl.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ErrorDocumentImpl.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ErrorDocumentImpl.java
new file mode 100644
index 0000000..da00d59
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ErrorDocumentImpl.java
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import net.sf.taverna.t2.reference.ErrorDocument;
+import net.sf.taverna.t2.reference.StackTraceElementBean;
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.reference.h3.HibernateMappedEntity;
+
+/**
+ * Simple bean implementation of ErrorDocument
+ * 
+ * @author Tom Oinn
+ */
+public class ErrorDocumentImpl extends AbstractEntityImpl implements
+		ErrorDocument, HibernateMappedEntity {
+	private String exceptionMessage = "";
+	private String message = "";
+	List<StackTraceElementBean> stackTrace;
+	Set<T2Reference> errorReferences = new HashSet<>();
+	
+	public ErrorDocumentImpl() {
+		this.stackTrace = new ArrayList<>();
+	}
+
+	@Override
+	public String getExceptionMessage() {
+		return this.exceptionMessage;
+	}
+
+	public void setExceptionMessage(String exceptionMessage) {
+		this.exceptionMessage = exceptionMessage;
+	}
+
+	@Override
+	public String getMessage() {
+		return this.message;
+	}
+
+	public void setMessage(String message) {
+		this.message = message;
+	}
+
+	/**
+	 * From interface, not used by hibernate internally
+	 */
+	@Override
+	public List<StackTraceElementBean> getStackTraceStrings() {
+		return this.stackTrace;
+	}
+
+	/**
+	 * Used by Hibernate to bodge around problems with interface types in the
+	 * API
+	 */
+	@SuppressWarnings({ "unchecked", "rawtypes" })
+	public void setStackTraceList(List newList) {
+		this.stackTrace = newList;
+	}
+
+	/**
+	 * Used by Hibernate to bodge around problems with interface types in the
+	 * API
+	 */
+	@SuppressWarnings("rawtypes")
+	public List getStackTraceList() {
+		return this.stackTrace;
+	}
+
+	@Override
+	public Set<T2Reference> getErrorReferences() {
+		return errorReferences;
+	}
+
+	/**
+	 * Used by Hibernate to bodge around problems with interface types in the
+	 * API
+	 */
+	@SuppressWarnings({ "unchecked", "rawtypes" })
+	public void setErrorReferenceSet(Set errorReferenceSet) {
+		this.errorReferences = errorReferenceSet;
+	}
+	
+	/**
+	 * Used by Hibernate to bodge around problems with interface types in the
+	 * API
+	 */
+	@SuppressWarnings("rawtypes")
+	public Set getErrorReferenceSet() {
+		return this.errorReferences;
+	}
+	
+	@Override
+	public String toString() {
+		return getMessage();
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ErrorDocumentServiceImpl.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ErrorDocumentServiceImpl.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ErrorDocumentServiceImpl.java
new file mode 100644
index 0000000..1e78f92
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/ErrorDocumentServiceImpl.java
@@ -0,0 +1,163 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import static net.sf.taverna.t2.reference.impl.T2ReferenceImpl.getAsImpl;
+
+import java.util.Set;
+
+import net.sf.taverna.t2.reference.ErrorDocument;
+import net.sf.taverna.t2.reference.ErrorDocumentService;
+import net.sf.taverna.t2.reference.ErrorDocumentServiceException;
+import net.sf.taverna.t2.reference.ReferenceContext;
+import net.sf.taverna.t2.reference.ReferenceServiceException;
+import net.sf.taverna.t2.reference.T2Reference;
+
+/**
+ * Implementation of ErrorDocumentService, inject with an appropriate
+ * ErrorDocumentDao and T2ReferenceGenerator to enable.
+ * 
+ * @author Tom Oinn
+ */
+public class ErrorDocumentServiceImpl extends AbstractErrorDocumentServiceImpl
+		implements ErrorDocumentService {
+	@Override
+	public ErrorDocument getError(T2Reference id)
+			throws ErrorDocumentServiceException {
+		checkDao();
+		try {
+			return errorDao.get(id);
+		} catch (Throwable t) {
+			throw new ErrorDocumentServiceException(t);
+		}
+	}
+
+	/**
+	 * Register the specified error and any child errors (which have the same
+	 * namespace and local part but a lower depth, down to depth of zero
+	 */
+	@Override
+	public ErrorDocument registerError(String message, Throwable t, int depth,
+			ReferenceContext context) throws ErrorDocumentServiceException {
+		checkDao();
+		checkGenerator();
+
+		T2Reference ref = t2ReferenceGenerator.nextErrorDocumentReference(
+				depth, context);
+		T2ReferenceImpl typedId = getAsImpl(ref);
+
+		ErrorDocument docToReturn = null;
+		for (; depth >= 0; depth--) {
+			ErrorDocumentImpl edi = new ErrorDocumentImpl();
+			if (docToReturn == null)
+				docToReturn = edi;
+			edi.setTypedId(typedId);
+			if (message != null)
+				edi.setMessage(message);
+			else
+				edi.setMessage("");
+			if (t != null) {
+				edi.setExceptionMessage(t.toString());
+				for (StackTraceElement ste : t.getStackTrace()) {
+					StackTraceElementBeanImpl stebi = new StackTraceElementBeanImpl();
+					stebi.setClassName(ste.getClassName());
+					stebi.setFileName(ste.getFileName());
+					stebi.setLineNumber(ste.getLineNumber());
+					stebi.setMethodName(ste.getMethodName());
+					edi.stackTrace.add(stebi);
+				}
+			} else
+				edi.setExceptionMessage("");
+			try {
+				errorDao.store(edi);
+			} catch (Throwable t2) {
+				throw new ErrorDocumentServiceException(t2);
+			}
+			if (depth > 0)
+				typedId = typedId.getDeeperErrorReference();
+		}
+		return docToReturn;
+	}
+
+	@Override
+	public ErrorDocument registerError(String message, Set<T2Reference> errors,
+			int depth, ReferenceContext context)
+			throws ErrorDocumentServiceException {
+		checkDao();
+		checkGenerator();
+
+		T2Reference ref = t2ReferenceGenerator.nextErrorDocumentReference(
+				depth, context);
+		T2ReferenceImpl typedId = T2ReferenceImpl.getAsImpl(ref);
+
+		ErrorDocument docToReturn = null;
+		for (; depth >= 0; depth--) {
+			ErrorDocumentImpl edi = new ErrorDocumentImpl();
+			if (docToReturn == null)
+				docToReturn = edi;
+			edi.setTypedId(typedId);
+			if (message != null)
+				edi.setMessage(message);
+			else
+				edi.setMessage("");
+			if (errors != null)
+				edi.setErrorReferenceSet(errors);
+			edi.setExceptionMessage("");
+
+			try {
+				errorDao.store(edi);
+			} catch (Throwable t2) {
+				throw new ErrorDocumentServiceException(t2);
+			}
+			if (depth > 0)
+				typedId = typedId.getDeeperErrorReference();
+		}
+		return docToReturn;
+	}
+
+	@Override
+	public T2Reference getChild(T2Reference errorId)
+			throws ErrorDocumentServiceException {
+		T2ReferenceImpl refImpl = getAsImpl(errorId);
+		try {
+			return refImpl.getDeeperErrorReference();
+		} catch (Throwable t) {
+			throw new ErrorDocumentServiceException(t);
+		}
+	}
+
+	@Override
+	public boolean delete(T2Reference reference)
+			throws ReferenceServiceException {
+		checkDao();
+		ErrorDocument doc = errorDao.get(reference);
+		if (doc == null)
+			return false;
+		return errorDao.delete(doc);
+	}
+
+	@Override
+	public void deleteErrorDocumentsForWorkflowRun(String workflowRunId)
+			throws ReferenceServiceException {
+		checkDao();
+		errorDao.deleteErrorDocumentsForWFRun(workflowRunId);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/HibernateErrorDocumentDao.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/HibernateErrorDocumentDao.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/HibernateErrorDocumentDao.java
new file mode 100644
index 0000000..470a82e
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/HibernateErrorDocumentDao.java
@@ -0,0 +1,154 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import static net.sf.taverna.t2.reference.T2ReferenceType.ErrorDocument;
+
+import java.util.List;
+
+import net.sf.taverna.t2.reference.DaoException;
+import net.sf.taverna.t2.reference.ErrorDocument;
+import net.sf.taverna.t2.reference.ErrorDocumentDao;
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.reference.annotations.DeleteIdentifiedOperation;
+import net.sf.taverna.t2.reference.annotations.GetIdentifiedOperation;
+import net.sf.taverna.t2.reference.annotations.PutIdentifiedOperation;
+
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
+
+/**
+ * An implementation of ErrorDocumentDao based on Spring's HibernateDaoSupport.
+ * To use this in spring inject a property 'sessionFactory' with either a
+ * {@link org.springframework.orm.hibernate3.LocalSessionFactoryBean
+ * LocalSessionFactoryBean} or the equivalent class from the T2Platform module
+ * to add SPI based implementation discovery and mapping. To use outside of
+ * Spring ensure you call the setSessionFactory(..) method before using this
+ * (but really, use it from Spring, so much easier).
+ * 
+ * @author Tom Oinn
+ */
+public class HibernateErrorDocumentDao extends HibernateDaoSupport implements
+		ErrorDocumentDao {
+	private static final String GET_ERRORS_FOR_RUN = "FROM ErrorDocumentImpl WHERE namespacePart = :workflow_run_id";
+
+	/**
+	 * Fetch an ErrorDocument list by id
+	 * 
+	 * @param ref
+	 *            the T2Reference to fetch
+	 * @return a retrieved identified list of T2 references
+	 * @throws DaoException
+	 *             if the supplied reference is of the wrong type or if
+	 *             something goes wrong fetching the data or connecting to the
+	 *             database
+	 */
+	@Override
+	@GetIdentifiedOperation
+	public ErrorDocument get(T2Reference ref) throws DaoException {
+		if (ref == null)
+			throw new DaoException(
+					"Supplied reference is null, can't retrieve.");
+		if (!ref.getReferenceType().equals(ErrorDocument))
+			throw new DaoException(
+					"This dao can only retrieve reference of type T2Reference.ErrorDocument");
+		if (!(ref instanceof T2ReferenceImpl))
+			throw new DaoException(
+					"Reference must be an instance of T2ReferenceImpl");
+
+		try {
+			return (ErrorDocumentImpl) getHibernateTemplate().get(
+					ErrorDocumentImpl.class,
+					((T2ReferenceImpl) ref).getCompactForm());
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+
+	@Override
+	@PutIdentifiedOperation
+	public void store(ErrorDocument theDocument) throws DaoException {
+		if (theDocument.getId() == null)
+			throw new DaoException(
+					"Supplied error document set has a null ID, allocate "
+							+ "an ID before calling the store method in the dao.");
+		if (!theDocument.getId().getReferenceType().equals(ErrorDocument))
+			throw new DaoException("Strangely the list ID doesn't have type "
+					+ "T2ReferenceType.ErrorDocument, something has probably "
+					+ "gone badly wrong somewhere earlier!");
+		if (!(theDocument instanceof ErrorDocumentImpl))
+			throw new DaoException(
+					"Supplied ErrorDocument not an instance of ErrorDocumentImpl");
+
+		try {
+			getHibernateTemplate().save(theDocument);
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+
+	@Override
+	@DeleteIdentifiedOperation
+	public boolean delete(ErrorDocument theDocument) throws DaoException {
+		if (theDocument.getId() == null)
+			throw new DaoException(
+					"Supplied error document set has a null ID, allocate "
+							+ "an ID before calling the store method in the dao.");
+		if (!theDocument.getId().getReferenceType()
+				.equals(ErrorDocument))
+			throw new DaoException("Strangely the list ID doesn't have type "
+					+ "T2ReferenceType.ErrorDocument, something has probably "
+					+ "gone badly wrong somewhere earlier!");
+		if (!(theDocument instanceof ErrorDocumentImpl))
+			throw new DaoException(
+					"Supplied ErrorDocument not an instance of ErrorDocumentImpl");
+
+		try {
+			getHibernateTemplate().delete(theDocument);
+			return true;
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+
+	@Override
+	@SuppressWarnings("unchecked")
+	@DeleteIdentifiedOperation
+	public synchronized void deleteErrorDocumentsForWFRun(String workflowRunId)
+			throws DaoException {
+		try {
+			// Select all ErrorDocuments for this wf run
+			Session session = getSession();
+			Query selectQuery = session.createQuery(GET_ERRORS_FOR_RUN);
+			selectQuery.setString("workflow_run_id", workflowRunId);
+			List<ErrorDocument> errorDocuments = selectQuery.list();
+			session.close();
+			/*
+			 * need to close before we do delete otherwise hibernate complains
+			 * that two sessions are accessing collection
+			 */
+			getHibernateTemplate().deleteAll(errorDocuments);
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/HibernateListDao.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/HibernateListDao.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/HibernateListDao.java
new file mode 100644
index 0000000..62ba83f
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/HibernateListDao.java
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import static net.sf.taverna.t2.reference.T2ReferenceType.IdentifiedList;
+
+import java.util.List;
+
+import net.sf.taverna.t2.reference.DaoException;
+import net.sf.taverna.t2.reference.IdentifiedList;
+import net.sf.taverna.t2.reference.ListDao;
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.reference.annotations.DeleteIdentifiedOperation;
+import net.sf.taverna.t2.reference.annotations.GetIdentifiedOperation;
+import net.sf.taverna.t2.reference.annotations.PutIdentifiedOperation;
+
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
+
+/**
+ * An implementation of ListDao based on Spring's HibernateDaoSupport. To use
+ * this in spring inject a property 'sessionFactory' with either a
+ * {@link org.springframework.orm.hibernate3.LocalSessionFactoryBean
+ * LocalSessionFactoryBean} or the equivalent class from the T2Platform module
+ * to add SPI based implementation discovery and mapping. To use outside of
+ * Spring ensure you call the setSessionFactory(..) method before using this
+ * (but really, use it from Spring, so much easier).
+ * 
+ * @author Tom Oinn
+ */
+public class HibernateListDao extends HibernateDaoSupport implements ListDao {
+	private static final String GET_LISTS_FOR_RUN = "FROM T2ReferenceListImpl WHERE namespacePart = :workflow_run_id";
+
+	/**
+	 * Fetch a t2reference list by id
+	 * 
+	 * @param ref
+	 *            the T2Reference to fetch
+	 * @return a retrieved identified list of T2 references
+	 * @throws DaoException
+	 *             if the supplied reference is of the wrong type or if
+	 *             something goes wrong fetching the data or connecting to the
+	 *             database
+	 */
+	@Override
+	@GetIdentifiedOperation
+	public IdentifiedList<T2Reference> get(T2Reference ref) throws DaoException {
+		if (ref == null)
+			throw new DaoException(
+					"Supplied reference is null, can't retrieve.");
+		if (!ref.getReferenceType().equals(IdentifiedList))
+			throw new DaoException(
+					"This dao can only retrieve reference of type T2Reference.IdentifiedList");
+		if (!(ref instanceof T2ReferenceImpl))
+			throw new DaoException(
+					"Reference must be an instance of T2ReferenceImpl");
+
+		try {
+			return (T2ReferenceListImpl) getHibernateTemplate().get(
+					T2ReferenceListImpl.class,
+					((T2ReferenceImpl) ref).getCompactForm());
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+
+	@Override
+	@PutIdentifiedOperation
+	public void store(IdentifiedList<T2Reference> theList) throws DaoException {
+		if (theList.getId() == null)
+			throw new DaoException("Supplied list set has a null ID, allocate "
+					+ "an ID before calling the store method in the dao.");
+		if (!theList.getId().getReferenceType().equals(IdentifiedList))
+			throw new DaoException("Strangely the list ID doesn't have type "
+					+ "T2ReferenceType.IdentifiedList, something has probably "
+					+ "gone badly wrong somewhere earlier!");
+		if (!(theList instanceof T2ReferenceListImpl))
+			throw new DaoException(
+					"Supplied identifier list not an instance of T2ReferenceList");
+
+		try {
+			getHibernateTemplate().save(theList);
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+
+	@Override
+	public boolean delete(IdentifiedList<T2Reference> theList)
+			throws DaoException {
+		if (theList.getId() == null)
+			throw new DaoException("Supplied list set has a null ID, allocate "
+					+ "an ID before calling the store method in the dao.");
+		if (!theList.getId().getReferenceType().equals(IdentifiedList))
+			throw new DaoException("Strangely the list ID doesn't have type "
+					+ "T2ReferenceType.IdentifiedList, something has probably "
+					+ "gone badly wrong somewhere earlier!");
+		if (!(theList instanceof T2ReferenceListImpl))
+			throw new DaoException(
+					"Supplied identifier list not an instance of T2ReferenceList");
+
+		try {
+			getHibernateTemplate().delete(theList);
+			return true;
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+
+	@Override
+	@SuppressWarnings("unchecked")
+	@DeleteIdentifiedOperation
+	public synchronized void deleteIdentifiedListsForWFRun(String workflowRunId)
+			throws DaoException {
+		try {
+			// Select all T2Reference lists for this wf run
+			Session session = getSession();
+			Query selectQuery = session.createQuery(GET_LISTS_FOR_RUN);
+			selectQuery.setString("workflow_run_id", workflowRunId);
+			List<IdentifiedList<T2Reference>> identifiedLists = selectQuery
+					.list();
+			session.close();
+			/*
+			 * need to close before we do delete otherwise hibernate complains
+			 * that two sessions are accessing collection
+			 */
+			getHibernateTemplate().deleteAll(identifiedLists);
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+}


[17/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov/example/test.sparql
----------------------------------------------------------------------
diff --git a/taverna-prov/example/test.sparql b/taverna-prov/example/test.sparql
new file mode 100644
index 0000000..834e332
--- /dev/null
+++ b/taverna-prov/example/test.sparql
@@ -0,0 +1,25 @@
+PREFIX prov: <http://www.w3.org/ns/prov#> 
+PREFIX wfdesc: <http://purl.org/wf4ever/wfdesc#> 
+PREFIX wfprov: <http://purl.org/wf4ever/wfprov#> 
+PREFIX tavernaprov: <http://ns.taverna.org.uk/2012/tavernaprov/>
+PREFIX cnt:  <http://www.w3.org/2011/content#> 
+PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
+PREFIX wf4ever: <http://purl.org/wf4ever/wf4ever#> 
+
+
+SELECT DISTINCT ?paramName ?name ?value ?ended ?script
+WHERE {
+    ?greeting tavernaprov:content <outputs/greeting.txt> .
+    ?greeting prov:wasGeneratedBy ?concatenate .
+    ?concatenate prov:endedAtTime ?ended ;
+        wfprov:wasPartOfWorkflowRun ?run ;
+	wfprov:describedByProcess ?plan .
+    ?concatenate wfprov:usedInput ?input .
+    ?input tavernaprov:content ?name .
+    OPTIONAL { ?name cnt:chars ?value }  .
+    OPTIONAL { ?plan wf4ever:script ?script } .
+    ?input wfprov:describedByParameter ?param .
+    ?plan wfdesc:hasInput ?param .
+    OPTIONAL { ?param rdfs:label ?paramName } .  
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-prov/pom.xml b/taverna-prov/pom.xml
new file mode 100644
index 0000000..2eebd56
--- /dev/null
+++ b/taverna-prov/pom.xml
@@ -0,0 +1,81 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+      <groupId>org.apache.taverna.engine</groupId>
+      <artifactId>taverna-engine</artifactId>
+      <version>3.1.0-incubating-SNAPSHOT</version>
+    </parent>
+    <artifactId>taverna-prov</artifactId>
+    <name>Apache Taverna PROV support</name>
+    <dependencies>
+        <dependency>
+            <groupId>${project.parent.groupId}</groupId>
+            <artifactId>taverna-database-configuration-api</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+
+<!--
+        <dependency>
+            <groupId>net.sf.taverna.t2.results</groupId>
+            <artifactId>results</artifactId>
+            <version>${t2.results.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>com.sun</groupId>
+                    <artifactId>tools</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+      -->
+        <dependency>
+            <groupId>${project.parent.groupId}</groupId>
+            <artifactId>taverna-provenanceconnector</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.taverna.language</groupId>
+            <artifactId>taverna-scufl2-api</artifactId>
+            <version>${taverna.language.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.taverna.language</groupId>
+            <artifactId>taverna-scufl2-rdfxml</artifactId>
+            <version>${taverna.language.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.taverna.language</groupId>
+            <artifactId>taverna-scufl2-wfdesc</artifactId>
+            <version>${taverna.language.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.taverna.language</groupId>
+            <artifactId>taverna-databundle</artifactId>
+            <version>${taverna.language.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>jcl-over-slf4j</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>${project.parent.groupId}</groupId>
+            <artifactId>taverna-prov-owl-bindings</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tika</groupId>
+            <artifactId>tika-core</artifactId>
+            <version>1.4</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils-core</artifactId>
+            <version>1.8.3</version>
+        </dependency>
+
+    </dependencies>
+
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/SafeFileOutputStream.java
----------------------------------------------------------------------
diff --git a/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/SafeFileOutputStream.java b/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/SafeFileOutputStream.java
new file mode 100644
index 0000000..3731c76
--- /dev/null
+++ b/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/SafeFileOutputStream.java
@@ -0,0 +1,119 @@
+package org.purl.wf4ever.provtaverna.export;
+
+/**
+ * Copied out from net.sf.taverna.t2.workbench.file.impl.SafeFileOutputStream
+ * to avoid dependency on file-impl.  
+ * 
+ * TODO: Move to taverna utils!
+ * 
+ */
+
+import java.io.FileNotFoundException;
+import java.io.FilterOutputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.StandardCopyOption;
+
+public class SafeFileOutputStream extends FilterOutputStream {
+
+    private final Path desiredFile;
+    private Path tempFile;
+    boolean desiredAlreadyExisted;
+
+    public SafeFileOutputStream(Path file) throws IOException {
+        this(file, tempFile(file));
+    }
+
+    public SafeFileOutputStream(Path desiredFile, Path tempFile)
+            throws IOException {
+
+        super(Files.newOutputStream(tempFile));
+        this.desiredFile = desiredFile;
+        this.tempFile = tempFile;
+        // Some useful things to check that we preferably don't want to fail on
+        // close()
+        desiredAlreadyExisted = Files.exists(desiredFile);
+        Path desiredFolder = this.desiredFile.getParent();
+        if (desiredAlreadyExisted) {
+            if (!Files.isWritable(desiredFile)) {
+                throw new FileNotFoundException("Can't write to " + desiredFile);
+            }
+        } else {
+            if (!Files.exists(desiredFolder)) {
+                throw new FileNotFoundException("Folder does not exist: "
+                        + desiredFolder);
+            }
+            if (!Files.isDirectory(desiredFolder)) {
+                throw new FileNotFoundException("Not a directory: "
+                        + desiredFolder);
+            }
+        }
+        if (!Files.isWritable(desiredFolder)) {
+            throw new FileNotFoundException("Can't modify folder "
+                    + desiredFolder);
+        }
+    }
+
+    private static Path tempFile(Path file) throws IOException {
+        return Files.createTempFile(file.getParent(), file.getFileName()
+                .toString(), ".tmp");
+    }
+
+    @Override
+    public void close() throws IOException {
+        // If super.close fails - we leave the tempfiles behind
+        super.close();
+        if (!Files.exists(tempFile)) {
+            // Probably something went wrong before close called,
+            // like rollback()
+            return;
+        }
+        Path beforeDeletion = null;
+        try {
+            if (desiredAlreadyExisted) {
+                // In case renaming goes wrong, we don't want to have already
+                // deleted the
+                // desired file. So we'll rename it to another temporary file
+                // instead which
+                // we can delete on successful rename.
+                beforeDeletion = tempFile(desiredFile);
+                if (!Files.deleteIfExists(beforeDeletion)) {
+                    // Should not happen, we just made it!
+                    throw new IOException("Can't delete temporary file "
+                            + beforeDeletion);
+                }
+                Files.move(desiredFile, beforeDeletion,
+                        StandardCopyOption.ATOMIC_MOVE);
+            }
+            try {
+                Files.move(tempFile, desiredFile,
+                        StandardCopyOption.ATOMIC_MOVE);
+            } catch (IOException e) {
+                // We'll leave our tempFiles for recovery.
+                tempFile = null;
+                beforeDeletion = null;
+
+                if (Files.exists(desiredFile)) {
+                    // Someone else added or replaced the file afterwards,
+                    // kind-a OK
+                    return;
+                }
+                throw e;
+            }
+        } finally {
+            if (beforeDeletion != null) {
+                Files.deleteIfExists(beforeDeletion);
+            }
+            if (tempFile != null) {
+                Files.deleteIfExists(tempFile);
+            }
+        }
+    }
+
+    public void rollback() throws IOException {
+        super.close();
+        Files.deleteIfExists(tempFile);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/Saver.java
----------------------------------------------------------------------
diff --git a/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/Saver.java b/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/Saver.java
new file mode 100644
index 0000000..c903e98
--- /dev/null
+++ b/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/Saver.java
@@ -0,0 +1,388 @@
+package org.purl.wf4ever.provtaverna.export;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.ProtocolException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.security.DigestOutputStream;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import net.sf.taverna.t2.invocation.InvocationContext;
+import net.sf.taverna.t2.provenance.api.ProvenanceAccess;
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ReferenceService;
+import net.sf.taverna.t2.reference.ReferenceSet;
+import net.sf.taverna.t2.reference.ReferenceSetService;
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.reference.ValueCarryingExternalReference;
+import net.sf.taverna.t2.spi.SPIRegistry;
+import net.sf.taverna.t2.workbench.reference.config.DataManagementConfiguration;
+
+import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.commons.codec.binary.Hex;
+import org.apache.commons.io.IOUtils;
+import org.apache.log4j.Logger;
+import org.apache.tika.Tika;
+import org.apache.tika.mime.MimeTypeException;
+import org.apache.tika.mime.MimeTypes;
+import org.openrdf.rio.RDFParserFactory;
+import org.openrdf.rio.RDFParserRegistry;
+import org.openrdf.rio.RDFWriterFactory;
+import org.openrdf.rio.RDFWriterRegistry;
+import org.purl.wf4ever.robundle.Bundle;
+
+import uk.org.taverna.databundle.DataBundles;
+
+public class Saver {
+
+    private static final String APPLICATION_OCTET_STREAM = "application/octet-stream";
+
+    private static Logger logger = Logger.getLogger(Saver.class);
+
+    /**
+     * @param saveProvAction
+     */
+    public Saver(ReferenceService referenceService, InvocationContext context,
+            String runId, Map<String, T2Reference> chosenReferences) {
+        this.setReferenceService(referenceService);
+        this.setContext(context);
+        this.setRunId(runId);
+        this.setChosenReferences(chosenReferences);
+        prepareSesame();
+    }
+
+    /**
+     * Load
+     */
+    protected void prepareSesame() {
+        RDFParserRegistry parserReg = RDFParserRegistry.getInstance();
+        SPIRegistry<RDFParserFactory> parserSPI = new SPIRegistry<>(
+                RDFParserFactory.class);
+        for (RDFParserFactory service : parserSPI.getInstances()) {
+            parserReg.add(service);
+        }
+
+        RDFWriterRegistry writerReg = RDFWriterRegistry.getInstance();
+        SPIRegistry<RDFWriterFactory> writerSPI = new SPIRegistry<>(
+                RDFWriterFactory.class);
+        for (RDFWriterFactory service : writerSPI.getInstances()) {
+            writerReg.add(service);
+        }
+
+    }
+
+    private Map<Path, T2Reference> fileToId = new HashMap<>();
+
+    private Map<Path, String> sha1sums = new HashMap<>();
+    private Map<Path, String> sha512sums = new HashMap<>();
+
+    private ReferenceService referenceService;
+
+    private InvocationContext context;
+
+    private String runId;
+
+    private Map<String, T2Reference> chosenReferences;
+
+    private Bundle bundle;
+
+    private Map<T2Reference, String> mediaTypes = new HashMap<>();
+
+    /**
+     * @return the bundle
+     */
+    public Bundle getBundle() {
+        return bundle;
+    }
+
+    public void saveData(Path bundlePath) throws FileNotFoundException,
+            IOException {
+        Bundle bundle = DataBundles.createBundle();
+        // String folderName = bundlePath.getFileName().toString();
+        // if (folderName.endsWith(".")) {
+        // bundlePath = bundlePath.resolveSibling(folderName.substring(0,
+        // folderName.length() - 1));
+        // }
+        setBundle(bundle);
+        saveToFolder(bundle.getRoot(), getChosenReferences(),
+                getReferenceService());
+        DataBundles.closeAndSaveBundle(bundle, bundlePath);
+    }
+
+    private void setBundle(Bundle bundle) {
+        this.bundle = bundle;
+    }
+
+    protected static Tika tika = new Tika();
+
+    public Path saveReference(T2Reference t2Ref, Path file) throws IOException {
+        ReferenceSetService refSet = getReferenceService()
+                .getReferenceSetService();
+        ReferenceSet referenceSet = refSet.getReferenceSet(t2Ref);
+        List<ExternalReferenceSPI> externalReferences = new ArrayList<ExternalReferenceSPI>(
+                referenceSet.getExternalReferences());
+        Collections.sort(externalReferences,
+                new Comparator<ExternalReferenceSPI>() {
+                    public int compare(ExternalReferenceSPI o1,
+                            ExternalReferenceSPI o2) {
+                        return (int) (o1.getResolutionCost() - o2
+                                .getResolutionCost());
+                    }
+                });
+        String mimeType = findMimeType(externalReferences);
+        getMediaTypes().put(t2Ref, mimeType);
+
+        Path targetFile = writeIfLocal(externalReferences, file, mimeType);
+        if (targetFile == null) {
+            URI uri = referenceAsURI(externalReferences);
+            if (uri != null) {
+                targetFile = DataBundles.setReference(file, uri);
+            }
+        }
+
+        if (targetFile != null) {
+            getFileToId().put(targetFile, t2Ref);
+        } else {
+            logger.warn("Could not write out reference " + t2Ref);
+        }
+
+        return targetFile;
+
+    }
+
+    private Path writeIfLocal(List<ExternalReferenceSPI> externalReferences,
+            Path file, String mimeType) throws IOException {
+
+        ValueCarryingExternalReference<?> valRef = null;
+        for (ExternalReferenceSPI ref : externalReferences) {
+            if (ref instanceof ValueCarryingExternalReference) {
+                valRef = (ValueCarryingExternalReference<?>) ref;
+                break;
+            }
+        }
+
+        if (valRef == null) {
+            return null;
+        }
+
+        String fileExtension;
+        try {
+            fileExtension = MimeTypes.getDefaultMimeTypes().forName(mimeType)
+                    .getExtension();
+        } catch (MimeTypeException e1) {
+            fileExtension = "";
+        }
+        Path targetFile = file.resolveSibling(file.getFileName()
+                + fileExtension);
+
+        MessageDigest sha = null;
+        MessageDigest sha512 = null;
+        OutputStream output = Files.newOutputStream(targetFile);
+        try {
+            try {
+                sha = MessageDigest.getInstance("SHA");
+                output = new DigestOutputStream(output, sha);
+
+                sha512 = MessageDigest.getInstance("SHA-512");
+                output = new DigestOutputStream(output, sha512);
+            } catch (NoSuchAlgorithmException e) {
+                logger.info("Could not find digest", e);
+            }
+
+            IOUtils.copyLarge(valRef.openStream(getContext()), output);
+        } finally {
+            output.close();
+        }
+
+        if (sha != null) {
+            getSha1sums().put(targetFile.toRealPath(), hexOfDigest(sha));
+        }
+        if (sha512 != null) {
+            sha512.digest();
+            getSha512sums().put(targetFile.toRealPath(), hexOfDigest(sha512));
+        }
+
+        return targetFile;
+    }
+
+    private URI referenceAsURI(List<ExternalReferenceSPI> externalReferences) {
+        for (ExternalReferenceSPI ref : externalReferences) {
+            String className = ref.getClass().getName();
+            if (className
+                    .equals("net.sf.taverna.t2.reference.impl.external.http.HttpReference")) {
+                URL url = (URL) getProperty(ref, "httpUrl");
+                try {
+                    return url.toURI();
+                } catch (URISyntaxException e) {
+                    logger.warn("Can't convert HttpReference to URI: " + url, e);
+                    continue;
+                }
+            } else if (className
+                    .equals("net.sf.taverna.t2.reference.impl.external.file.FileReference")) {
+                File file = (File) getProperty(ref, "file");
+                return file.toURI();
+            } else if (className
+                    .equals("de.uni_luebeck.inb.knowarc.usecases.invocation.ssh.SshReference")) {
+                String host = (String) getProperty(ref, "host");
+                int port = (int) getProperty(ref, "port");
+                String path = (String) getProperty(ref, "fullPath");
+                try {
+                    return new URI("sftp", null, host, port, path, null, null);
+                } catch (URISyntaxException e) {
+                    logger.warn("Can't convert SshReference to URI: sftp://"
+                            + host + ":" + port + path, e);
+                    continue;
+                }
+            }
+        }
+        return null;
+    }
+
+    protected Object getProperty(ExternalReferenceSPI ref, String propertyName) {
+        try {
+            return PropertyUtils.getSimpleProperty(ref, propertyName);
+        } catch (Exception ex) {
+            throw new IllegalArgumentException("Can't look up " + propertyName
+                    + " in bean " + ref, ex);
+        }
+    }
+
+    private String findMimeType(List<ExternalReferenceSPI> externalReferences)
+            throws IOException, ProtocolException {
+        String mimeType = null;
+        for (ExternalReferenceSPI externalReference : externalReferences) {
+            String className = externalReference.getClass().getName();
+            if (className
+                    .equals("net.sf.taverna.t2.reference.impl.external.http.HttpReference")) {
+                URL url = (URL) getProperty(externalReference, "httpUrl");
+                mimeType = tika.detect(url);
+            } else if (className
+                    .equals("net.sf.taverna.t2.reference.impl.external.file.FileReference")) {
+                File file = (File) getProperty(externalReference, "file");
+                mimeType = tika.detect(file);
+            } else if (className
+                    .equals("de.uni_luebeck.inb.knowarc.usecases.invocation.ssh.SshReference")) {
+                String filename = (String) getProperty(externalReference,
+                        "fileName");
+                try (InputStream instream = externalReference
+                        .openStream(context)) {
+                    mimeType = tika.detect(instream, filename);
+                }
+            } else if (className
+                    .equals("net.sf.taverna.t2.reference.impl.external.object.VMObjectReference")) {
+                mimeType = "application/x-java-serialized-object";
+            } else {
+                try (InputStream instream = externalReference
+                        .openStream(context)) {
+                    mimeType = tika.detect(instream);
+                }
+            }
+            if (mimeType != null && !mimeType.equals(APPLICATION_OCTET_STREAM)) {
+                break;
+            }
+        }
+        if (mimeType == null || mimeType.isEmpty()) {
+            return APPLICATION_OCTET_STREAM;
+        }
+        return mimeType;
+    }
+
+    protected void saveToFolder(Path folder,
+            Map<String, T2Reference> chosenReferences,
+            ReferenceService referenceService) throws IOException,
+            FileNotFoundException {
+        logger.info("Saving provenance and outputs to " + folder.toRealPath());
+        Files.createDirectories(folder);
+        String connectorType = DataManagementConfiguration.getInstance()
+                .getConnectorType();
+        ProvenanceAccess provenanceAccess = new ProvenanceAccess(connectorType,
+                getContext());
+        W3ProvenanceExport export = new W3ProvenanceExport(provenanceAccess,
+                getRunId(), this);
+        export.setFileToT2Reference(getFileToId());
+        export.setBundle(bundle);
+
+        try {
+            logger.debug("Saving provenance");
+            export.exportAsW3Prov();
+            logger.info("Saved provenance");
+        } catch (Exception e) {
+            logger.error("Failed to save the provenance graph", e);
+        }
+    }
+
+    private String hexOfDigest(MessageDigest sha) {
+        return new String(Hex.encodeHex(sha.digest()));
+    }
+
+    public ReferenceService getReferenceService() {
+        return referenceService;
+    }
+
+    public void setReferenceService(ReferenceService referenceService) {
+        this.referenceService = referenceService;
+    }
+
+    public InvocationContext getContext() {
+        return context;
+    }
+
+    public void setContext(InvocationContext context) {
+        this.context = context;
+    }
+
+    public String getRunId() {
+        return runId;
+    }
+
+    public void setRunId(String runId) {
+        this.runId = runId;
+    }
+
+    public Map<String, T2Reference> getChosenReferences() {
+        return chosenReferences;
+    }
+
+    public void setChosenReferences(Map<String, T2Reference> chosenReferences) {
+        this.chosenReferences = chosenReferences;
+    }
+
+    public Map<Path, T2Reference> getFileToId() {
+        return fileToId;
+    }
+
+    public void setFileToId(Map<Path, T2Reference> fileToId) {
+        this.fileToId = fileToId;
+    }
+
+    public Map<Path, String> getSha1sums() {
+        return sha1sums;
+    }
+
+    public Map<T2Reference, String> getMediaTypes() {
+        return mediaTypes;
+    }
+
+    public Map<Path, String> getSha512sums() {
+        return sha512sums;
+    }
+
+    public void setMediaTypes(Map<T2Reference, String> mediaTypes) {
+        this.mediaTypes = mediaTypes;
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/W3ProvenanceExport.java
----------------------------------------------------------------------
diff --git a/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/W3ProvenanceExport.java b/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/W3ProvenanceExport.java
new file mode 100644
index 0000000..110ff72
--- /dev/null
+++ b/taverna-prov/src/main/java/org/purl/wf4ever/provtaverna/export/W3ProvenanceExport.java
@@ -0,0 +1,1008 @@
+package org.purl.wf4ever.provtaverna.export;
+
+import static uk.org.taverna.scufl2.translator.t2flow.T2FlowParser.ravenURI;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.math.BigDecimal;
+import java.net.URI;
+import java.nio.charset.Charset;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.GregorianCalendar;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.UUID;
+
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+import net.sf.taverna.raven.appconfig.ApplicationConfig;
+import net.sf.taverna.t2.provenance.api.ProvenanceAccess;
+import net.sf.taverna.t2.provenance.lineageservice.URIGenerator;
+import net.sf.taverna.t2.provenance.lineageservice.utils.DataflowInvocation;
+import net.sf.taverna.t2.provenance.lineageservice.utils.Port;
+import net.sf.taverna.t2.provenance.lineageservice.utils.ProcessorEnactment;
+import net.sf.taverna.t2.provenance.lineageservice.utils.ProvenanceProcessor;
+import net.sf.taverna.t2.provenance.lineageservice.utils.WorkflowRun;
+import net.sf.taverna.t2.reference.ErrorDocument;
+import net.sf.taverna.t2.reference.IdentifiedList;
+import net.sf.taverna.t2.reference.StackTraceElementBean;
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.reference.T2ReferenceType;
+import net.sf.taverna.t2.spi.SPIRegistry;
+
+import org.apache.commons.beanutils.BeanUtils;
+import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.jena.riot.RDFDataMgr;
+import org.apache.jena.riot.RDFFormat;
+import org.apache.jena.riot.WriterGraphRIOT;
+import org.apache.jena.riot.system.RiotLib;
+import org.apache.log4j.Logger;
+import org.purl.wf4ever.provtaverna.owl.TavernaProvModel;
+import org.purl.wf4ever.robundle.Bundle;
+import org.purl.wf4ever.robundle.manifest.Agent;
+import org.purl.wf4ever.robundle.manifest.Manifest;
+import org.purl.wf4ever.robundle.manifest.PathAnnotation;
+import org.purl.wf4ever.robundle.manifest.PathMetadata;
+
+import uk.org.taverna.databundle.DataBundles;
+import uk.org.taverna.scufl2.api.common.URITools;
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+import uk.org.taverna.scufl2.api.io.ReaderException;
+import uk.org.taverna.scufl2.api.io.WorkflowBundleIO;
+import uk.org.taverna.scufl2.api.io.WorkflowBundleReader;
+import uk.org.taverna.scufl2.api.io.WorkflowBundleWriter;
+import uk.org.taverna.scufl2.translator.t2flow.T2FlowReader;
+
+import com.hp.hpl.jena.datatypes.xsd.XSDDatatype;
+import com.hp.hpl.jena.ontology.Individual;
+import com.hp.hpl.jena.ontology.OntModel;
+import com.hp.hpl.jena.rdf.model.Literal;
+import com.hp.hpl.jena.rdf.model.Model;
+import com.hp.hpl.jena.rdf.model.ModelFactory;
+import com.hp.hpl.jena.sparql.util.Context;
+import com.hp.hpl.jena.sparql.vocabulary.FOAF;
+
+public class W3ProvenanceExport {
+
+    private static URITools uriTools = new URITools();
+    
+    private static final URI osgiURI = URI.create("http://ns.taverna.org.uk/2013/osgibundle/");
+    private static final String TEXT = "text/";
+    private static final String WORKFLOW_BUNDLE = "application/vnd.taverna.scufl2.workflow-bundle";
+    // TODO: Avoid this Taverna 2 dependency
+    private static SPIRegistry<WorkflowBundleReader> readerSpi = new SPIRegistry<>(
+            WorkflowBundleReader.class);
+    private static SPIRegistry<WorkflowBundleWriter> writerSpi = new SPIRegistry<>(
+            WorkflowBundleWriter.class);
+
+    private static final String EN = "en";
+
+    private static final int EMBEDDED_MAX_FILESIZE = 1024;
+
+    private static final Charset UTF8 = Charset.forName("UTF-8");
+
+    private static ApplicationConfig applicationConfig = ApplicationConfig
+            .getInstance();
+
+    private static Logger logger = Logger.getLogger(W3ProvenanceExport.class);
+
+    protected Map<T2Reference, Path> seenReferences = new HashMap<>();
+
+    private static final int NANOSCALE = 9;
+
+    private ProvenanceAccess provenanceAccess;
+
+    private DatatypeFactory datatypeFactory;
+
+    private ProvenanceURIGenerator uriGenerator = new ProvenanceURIGenerator();
+
+    private String workflowRunId;
+
+    private Map<Path, T2Reference> fileToT2Reference = Collections.emptyMap();
+
+    private Saver saver;
+
+    private Map<URI, Individual> describedEntities = new HashMap<URI, Individual>();
+
+    private TavernaProvModel provModel = new TavernaProvModel();
+
+    public Path getBaseFolder() {
+        return bundle.getRoot();
+    }
+
+    public Map<Path, T2Reference> getFileToT2Reference() {
+        return fileToT2Reference;
+    }
+
+    // protected <I> void repopulateRegistry(ServiceRegistry<?, I> registry,
+    // Class<I> spi) {
+    // ClassLoader cl = classLoaderForServiceLoader(spi);
+    // logger.info("Selected classloader " + cl + " for registry of " + spi);
+    // for (I service : ServiceLoader.load(spi, cl)) {
+    // registry.add(service);
+    // }
+    // }
+
+    // private ClassLoader classLoaderForServiceLoader(Class<?> mustHave) {
+    // List<ClassLoader> possibles = Arrays.asList(Thread.currentThread()
+    // .getContextClassLoader(), getClass().getClassLoader(), mustHave
+    // .getClassLoader());
+    //
+    // for (ClassLoader cl : possibles) {
+    // if (cl == null) {
+    // continue;
+    // }
+    // try {
+    // if (cl.loadClass(mustHave.getCanonicalName()) == mustHave) {
+    // return cl;
+    // }
+    // } catch (ClassNotFoundException e) {
+    // }
+    // }
+    // // Final fall-back, the old..
+    // return ClassLoader.getSystemClassLoader();
+    // }
+
+    public W3ProvenanceExport(ProvenanceAccess provenanceAccess,
+            String workflowRunId, Saver saver) {
+        this.saver = saver;
+        this.setWorkflowRunId(workflowRunId);
+        this.setProvenanceAccess(provenanceAccess);
+
+        try {
+            datatypeFactory = DatatypeFactory.newInstance();
+        } catch (DatatypeConfigurationException e) {
+            throw new IllegalStateException(
+                    "Can't find a DatatypeFactory implementation", e);
+        }
+        prepareScufl2();
+
+    }
+
+    protected void prepareScufl2() {
+        Thread.currentThread().setContextClassLoader(
+                getClass().getClassLoader());
+        wfBundleIO = new WorkflowBundleIO();
+        DataBundles.setWfBundleIO(wfBundleIO);
+        wfBundleIO.setReaders(readerSpi.getInstances());
+        wfBundleIO.setWriters(writerSpi.getInstances());
+    }
+
+    private final class ProvenanceURIGenerator extends URIGenerator {
+
+        // Make URIs match with Scufl2
+        @Override
+        public String makeWorkflowURI(String workflowID) {
+            return makeWorkflowBundleURI(workflowRunId) + "workflow/"
+                    + provenanceAccess.getWorkflowNameByWorkflowID(workflowID)
+                    + "/";
+        }
+
+        public String makeWorkflowBundleURI(String workflowRunId) {
+
+            return "http://ns.taverna.org.uk/2010/workflowBundle/"
+                    + provenanceAccess.getTopLevelWorkflowID(workflowRunId)
+                    + "/";
+        }
+
+        public String makePortURI(String wfId, String pName, String vName,
+                boolean inputPort) {
+            String base;
+            if (pName == null) {
+                base = makeWorkflowURI(wfId);
+            } else {
+                base = makeProcessorURI(pName, wfId);
+            }
+            return base + (inputPort ? "in/" : "out/") + escape(vName);
+        }
+
+        // public String makeDataflowInvocationURI(String workflowRunId,
+        // String dataflowInvocationId) {
+        // return makeWFInstanceURI(workflowRunId) + "workflow/"
+        // + dataflowInvocationId + "/";
+        // }
+
+        public String makeProcessExecution(String workflowRunId,
+                String processEnactmentId) {
+            return makeWFInstanceURI(workflowRunId) + "process/"
+                    + processEnactmentId + "/";
+        }
+    }
+
+    enum Direction {
+        INPUTS("in"), OUTPUTS("out");
+        private final String path;
+
+        Direction(String path) {
+            this.path = path;
+
+        }
+
+        public String getPath() {
+            return path;
+        }
+    }
+
+    public void exportAsW3Prov() throws IOException {
+
+        Path provFile = DataBundles.getWorkflowRunProvenance(bundle);
+
+        // TODO: Make this thread safe using contexts?
+
+        GregorianCalendar startedProvExportAt = new GregorianCalendar();
+
+        runURI = URI.create(uriGenerator.makeWFInstanceURI(getWorkflowRunId()));
+
+        URI provFileUri = toURI(provFile);
+        Individual bundle = provModel.createBundle(provFileUri);
+
+        // Mini-provenance about this provenance trace. Unkown URI for
+        // agent/activity
+
+        Individual storeProvenance = provModel.createActivity(provFileUri
+                .resolve("#taverna-prov-export"));
+        storeProvenance.setLabel(
+                "taverna-prov export of workflow run provenance", EN);
+
+        provModel.setStartedAtTime(storeProvenance, startedProvExportAt);
+
+        // The agent is an execution of the Taverna software (e.g. also an
+        // Activity)
+        Individual tavernaAgent = provModel.createTavernaEngine(provFileUri
+                .resolve("#taverna-engine"));
+
+        Individual plan = provModel
+                .createPlan(getTavernaVersion());
+        plan.setLabel(applicationConfig.getTitle(), EN);
+
+        provModel.setWasAssociatedWith(storeProvenance, tavernaAgent, plan);
+        provModel.setWasGeneratedBy(bundle, storeProvenance);
+
+        Individual wfProcess = provModel.createWorkflowRun(runURI);
+
+        bundle.setPropertyValue(FOAF.primaryTopic, wfProcess);
+
+        DataflowInvocation dataflowInvocation = provenanceAccess
+                .getDataflowInvocation(getWorkflowRunId());
+
+        // TODO: Should we go through all of getDataflowInvocations() in order
+        // to find
+        // the plans etc. for the nested workflow executions and also cover
+        // empty
+        // nested workflow runs?
+
+        String workflowName = provenanceAccess
+                .getWorkflowNameByWorkflowID(dataflowInvocation.getWorkflowId());
+        label(wfProcess, "Workflow run of " + workflowName);
+
+        provModel.setWasInformedBy(storeProvenance, wfProcess);
+        String wfUri = uriGenerator.makeWorkflowURI(dataflowInvocation
+                .getWorkflowId());
+        Individual wfPlan = provModel.createWorkflow(URI.create(wfUri));
+        provModel.setWasEnactedBy(wfProcess, tavernaAgent, wfPlan);
+        provModel.setDescribedByWorkflow(wfProcess, wfPlan);
+
+        provModel.setStartedAtTime(wfProcess,
+                timestampToLiteral(dataflowInvocation.getInvocationStarted()));
+        provModel.setEndedAtTime(wfProcess,
+                timestampToLiteral(dataflowInvocation.getInvocationEnded()));
+
+        // Workflow inputs and outputs
+        storeEntitities(dataflowInvocation.getInputsDataBindingId(), wfProcess,
+                Direction.INPUTS, true);
+        // FIXME: These entities come out as "generated" by multiple processes
+        storeEntitities(dataflowInvocation.getOutputsDataBindingId(),
+                wfProcess, Direction.OUTPUTS, true);
+        List<ProcessorEnactment> processorEnactments = provenanceAccess
+                .getProcessorEnactments(getWorkflowRunId());
+        // This will also include processor enactments in nested workflows
+        for (ProcessorEnactment pe : processorEnactments) {
+            String parentId = pe.getParentProcessorEnactmentId();
+            URI parentURI;
+            if (parentId == null) {
+                // Top-level workflow
+                parentURI = runURI;
+            } else {
+                // inside nested wf - this will be parent processenactment
+                parentURI = URI.create(uriGenerator.makeProcessExecution(
+                        pe.getWorkflowRunId(),
+                        pe.getParentProcessorEnactmentId()));
+
+                // TODO: Find plan for nested workflow!
+                // String wfUri = uriGenerator.makeWorkflowURI(nestedWfId);
+                // Individual wfPlan =
+                // provModel.createWorkflow(URI.create(wfUri));
+                // provModel.setDescribedByWorkflow(wfProcess, wfPlan);
+                // provModel.setWasEnactedBy(wfProcess, tavernaAgent, wfPlan);
+            }
+
+            URI processURI = URI.create(uriGenerator.makeProcessExecution(
+                    pe.getWorkflowRunId(), pe.getProcessEnactmentId()));
+
+            Individual process = provModel.createProcessRun(processURI);
+            Individual parentProcess = provModel.createWorkflowRun(parentURI);
+            provModel.setWasPartOfWorkflowRun(process, parentProcess);
+
+            provModel.setStartedAtTime(process,
+                    timestampToLiteral(pe.getEnactmentStarted()));
+            provModel.setEndedAtTime(process,
+                    timestampToLiteral(pe.getEnactmentEnded()));
+
+            ProvenanceProcessor provenanceProcessor = provenanceAccess
+                    .getProvenanceProcessor(pe.getProcessorId());
+
+            URI processorURI = URI.create(uriGenerator.makeProcessorURI(
+                    provenanceProcessor.getProcessorName(),
+                    provenanceProcessor.getWorkflowId()));
+
+            label(process,
+                    "Processor execution "
+                            + provenanceProcessor.getProcessorName());
+            // The facade identifier is a bit too techie!
+            // + " ("
+            // + pe.getProcessIdentifier() + ")");
+            Individual procPlan = provModel.createProcess(processorURI);
+            label(procPlan,
+                    "Processor " + provenanceProcessor.getProcessorName());
+            provModel.setWasEnactedBy(process, tavernaAgent, procPlan);
+            provModel.setDescribedByProcess(process, procPlan);
+
+            URI parentWfUri = URI.create(uriGenerator
+                    .makeWorkflowURI(provenanceProcessor.getWorkflowId()));
+
+            Individual parentWf = provModel.createWorkflow(parentWfUri);
+            provModel.addSubProcess(parentWf, procPlan);
+
+            // TODO: How to link together iterations on a single processor and
+            // the collections
+            // they are iterating over and creating?
+            // Need 'virtual' ProcessExecution for iteration?
+
+            // TODO: Activity/service details from definition?
+
+            // Inputs and outputs
+            storeEntitities(pe.getInitialInputsDataBindingId(), process,
+                    Direction.INPUTS, false);
+            storeEntitities(pe.getFinalOutputsDataBindingId(), process,
+                    Direction.OUTPUTS, false);
+        }
+
+        storeFileReferences();
+
+        provModel.setEndedAtTime(storeProvenance, new GregorianCalendar());
+
+        // provModel.model.write(outStream, "TURTLE",
+        // provFileUri.toASCIIString());
+
+        OntModel model = provModel.model;
+        try (OutputStream outStream = Files.newOutputStream(provFile)) {
+            WriterGraphRIOT writer = RDFDataMgr
+                    .createGraphWriter(RDFFormat.TURTLE_BLOCKS);
+            writer.write(outStream, model.getBaseModel().getGraph(),
+                    RiotLib.prefixMap(model.getGraph()),
+                    provFileUri.toString(), new Context());
+        } finally {
+            // Avoid registering the RIOT readers/writers from ARQ, as that
+            // won't
+            // work within Raven or OSGi
+            provModel.resetJena();
+            logger.warn("Reset Jena readers and writers");
+        }
+
+        byte[] dataflow = getDataflow(dataflowInvocation);
+        try {
+            WorkflowBundle wfBundle = wfBundleIO.readBundle(
+                    new ByteArrayInputStream(dataflow),
+                    T2FlowReader.APPLICATION_VND_TAVERNA_T2FLOW_XML);
+            writeBundle(wfBundle);
+        } catch (ReaderException e) {
+            logger.warn("Could not write bundle", e);
+        }
+
+    }
+
+    private URI getTavernaVersion() {
+        String versionName = applicationConfig.getName();
+        URI tavernaVersion = URI
+                .create("http://ns.taverna.org.uk/2011/software/" + versionName);
+        return tavernaVersion;
+    }
+
+    private byte[] getDataflow(DataflowInvocation dataflowInvocation) {
+        // you are not going to believe this...!
+        for (final WorkflowRun run : provenanceAccess.listRuns(
+                dataflowInvocation.getWorkflowId(), null)) {
+            if (getWorkflowRunId().equals(run.getWorkflowRunId())) {
+                return run.getDataflowBlob();
+            }
+        }
+        throw new IllegalStateException("Can't find dataflow blob for run "
+                + getWorkflowRunId());
+    }
+
+    protected void label(Individual obj, String label) {
+        obj.setLabel(label, EN);
+    }
+
+    protected Literal timestampToLiteral(Timestamp timestamp) {
+        if (timestamp == null) {
+            return null;
+        }
+        GregorianCalendar cal = new GregorianCalendar();
+        cal.setTime(timestamp);
+        XMLGregorianCalendar xmlCal = datatypeFactory
+                .newXMLGregorianCalendar(cal);
+        // Chop of the trailing 0-s of non-precission
+        xmlCal.setFractionalSecond(BigDecimal.valueOf(
+                timestamp.getNanos() / 1000000, NANOSCALE - 6));
+        return provModel.model.createTypedLiteral(xmlCal.toXMLFormat(),
+                XSDDatatype.XSDdateTime);
+    }
+
+    private static Map<URI, String> mediaTypes = new HashMap<>();
+
+    protected void storeFileReferences() {
+
+        for (Entry<Path, T2Reference> entry : getFileToT2Reference().entrySet()) {
+            Path file = entry.getKey();
+
+            try {
+                T2Reference t2Ref = entry.getValue();
+                URI dataURI = URI.create(uriGenerator.makeT2ReferenceURI(t2Ref
+                        .toUri().toASCIIString()));
+
+                Individual entity = provModel.createArtifact(dataURI);
+
+                String mediaType = saver.getMediaTypes().get(t2Ref);
+
+                if (!Files.exists(file)) {
+                    continue;
+                }
+                URI contentUri;
+                if (DataBundles.isReference(file)) {
+                    // TODO: Do we really need to read this back again from the
+                    // file?
+                    contentUri = DataBundles.getReference(file);
+                } else {
+                    contentUri = toURI(file);
+                }
+
+                Individual content = provModel.setContent(entity, contentUri);
+                if (mediaType != null) {
+                    mediaTypes.put(contentUri, mediaType);
+                }
+                if (!DataBundles.isValue(file)) {
+                    // Don't capture the checksum and content of references and
+                    // lists
+                    continue;
+                }
+
+                // Add checksums
+                String sha1 = saver.getSha1sums().get(file.toRealPath());
+                if (sha1 != null) {
+                    content.addLiteral(provModel.sha1, sha1);
+                }
+                String sha512 = saver.getSha512sums().get(file.toRealPath());
+                if (sha512 != null) {
+                    content.addLiteral(provModel.sha512, sha512);
+                }
+                long byteCount = Files.size(file);
+                content.addLiteral(provModel.byteCount, byteCount);
+
+                if (byteCount < EMBEDDED_MAX_FILESIZE) {
+                    // Add content if it's "tiny"
+                    byte[] bytes = Files.readAllBytes(file);
+                    if (mediaType != null && mediaType.startsWith(TEXT)) {
+                        // as string - assuming UTF8 (and declaring so)
+                        String str = new String(bytes, UTF8);
+                        content.addLiteral(provModel.chars, str);
+                        content.addLiteral(provModel.characterEncoding,
+                                UTF8.name());
+                        content.addRDFType(provModel.ContentAsText);
+                    } else {
+                        // Or base64-encoded bytes
+                        content.addRDFType(provModel.ContentAsBase64);
+                        content.addLiteral(provModel.bytes, bytes);
+                    }
+                }
+            } catch (IOException e) {
+                logger.warn("Could not read " + file + " as " + UTF8, e);
+            }
+        }
+    }
+
+    protected URI toURI(Path file) {
+        return file.toUri();
+    }
+
+    protected void storeEntitities(String dataBindingId, Individual activity,
+            Direction direction, boolean isTopLevel) throws IOException {
+
+        Map<Port, T2Reference> bindings = provenanceAccess
+                .getDataBindings(dataBindingId);
+
+        for (Entry<Port, T2Reference> binding : bindings.entrySet()) {
+            Port port = binding.getKey();
+            T2Reference t2Ref = binding.getValue();
+
+            Individual entity = describeEntity(t2Ref);
+
+            if (isTopLevel) {
+                Path ports;
+                if (direction == Direction.INPUTS) {
+                    ports = DataBundles.getInputs(bundle);
+                } else {
+                    ports = DataBundles.getOutputs(bundle);
+                }
+                Path portPath = DataBundles.getPort(ports, port.getPortName());
+                saveValue(t2Ref, portPath);
+            } else if (!seenReference(t2Ref)) {
+                saveIntermediate(t2Ref);
+            }
+
+            // String id = t2Ref.getLocalPart();
+            // String prefix = id.substring(0, 2);
+            Individual involvement;
+            if (direction == Direction.INPUTS) {
+                involvement = provModel.setUsedInput(activity, entity);
+            } else {
+                involvement = provModel.setWasOutputFrom(entity, activity);
+            }
+
+            String processorName = null;
+            if (port.getProcessorId() != null) {
+                // Not a workflow port
+                ProvenanceProcessor p = provenanceAccess
+                        .getProvenanceProcessor(port.getProcessorId());
+                processorName = p.getProcessorName();
+            }
+            URI portURI = URI.create(uriGenerator.makePortURI(
+                    port.getWorkflowId(), processorName, port.getPortName(),
+                    port.isInputPort()));
+
+            Individual portRole;
+            if (port.isInputPort()) {
+                portRole = provModel.createInputParameter(portURI);
+            } else {
+                portRole = provModel.createOutputParameter(portURI);
+            }
+
+            portRole.setLabel(port.getPortName(), "");
+            if (processorName == null) {
+                portRole.setComment(
+                        "Workflow"
+                                + (port.isInputPort() ? " input " : " output ")
+                                + port.getPortName(), EN);
+            } else {
+                portRole.setComment(
+                        processorName
+                                + (port.isInputPort() ? " input " : " output ")
+                                + port.getPortName(), EN);
+            }
+            provModel.setDescribedByParameter(entity, portRole, involvement);
+
+        }
+
+    }
+
+    protected Individual describeEntity(T2Reference t2Ref) throws IOException {
+        URI dataURI = URI.create(uriGenerator.makeT2ReferenceURI(t2Ref.toUri()
+                .toASCIIString()));
+
+        Individual artifact = describedEntities.get(dataURI);
+        if (artifact != null) {
+            return artifact;
+        }
+        artifact = provModel.createArtifact(dataURI);
+        describedEntities.put(dataURI, artifact);
+
+        if (t2Ref.getReferenceType() == T2ReferenceType.ErrorDocument) {
+            Individual error = provModel.createError(dataURI);
+            ErrorDocument errorDoc = saver.getReferenceService()
+                    .getErrorDocumentService().getError(t2Ref);
+            addMessageIfNonEmpty(error, errorDoc.getMessage());
+            // getExceptionMEssage added by addStackTrace
+            addStackTrace(error, errorDoc);
+        } else if (t2Ref.getReferenceType() == T2ReferenceType.IdentifiedList) {
+            IdentifiedList<T2Reference> list = saver.getReferenceService()
+                    .getListService().getList(t2Ref);
+            Individual dictionary = provModel.createDictionary(dataURI);
+
+            int pos = 0;
+            for (T2Reference ref : list) {
+                URI itemURI = URI.create(uriGenerator.makeT2ReferenceURI(ref
+                        .toUri().toASCIIString()));
+                Individual listItem = provModel.createArtifact(itemURI);
+                provModel.addKeyPair(dictionary, pos++, listItem);
+                describeEntity(ref);
+            }
+            if (list.isEmpty()) {
+                artifact.addRDFType(provModel.EmptyCollection);
+                artifact.addRDFType(provModel.EmptyDictionary);
+            }
+        }
+
+        return artifact;
+    }
+
+    private boolean seenReference(T2Reference t2Ref) {
+        return seenReferences.containsKey(t2Ref);
+    }
+
+    private Path saveIntermediate(T2Reference t2Ref) throws IOException {
+        // Avoid double-saving
+        Path f = seenReferences.get(t2Ref);
+        if (f != null) {
+            return f;
+        }
+        Path file = referencePath(t2Ref);
+
+        if (t2Ref.getReferenceType() == T2ReferenceType.IdentifiedList) {
+            IdentifiedList<T2Reference> list = saver.getReferenceService()
+                    .getListService().getList(t2Ref);
+            for (T2Reference ref : list) {
+                saveIntermediate(ref);
+            }
+            seenReference(t2Ref, file);
+            return file;
+        } else {
+            return saveValue(t2Ref, file);
+        }
+
+    }
+
+    private Path saveValue(T2Reference t2Ref, Path file) throws IOException {
+        Path parent = file.getParent();
+
+        switch (t2Ref.getReferenceType()) {
+
+        case IdentifiedList:
+            DataBundles.createList(file);
+            IdentifiedList<T2Reference> list = saver.getReferenceService()
+                    .getListService().getList(t2Ref);
+            long position = 0;
+            for (T2Reference ref : list) {
+                saveValue(ref, DataBundles.getListItem(file, position++));
+            }
+            break;
+        case ErrorDocument:
+            Files.createDirectories(parent);
+            file = saveError(t2Ref, file);
+            break;
+        case ReferenceSet:
+            Files.createDirectories(parent);
+            file = saver.saveReference(t2Ref, file);
+        }
+        seenReference(t2Ref, file);
+        return file;
+    }
+
+    private Path saveError(T2Reference t2Ref, Path file) throws IOException {
+        ErrorDocument errorDoc = saver.getReferenceService()
+                .getErrorDocumentService().getError(t2Ref);
+
+        StringBuilder trace = new StringBuilder();
+        addStackTrace(trace, errorDoc);
+
+        List<Path> causes = new ArrayList<>();
+        for (T2Reference cause : errorDoc.getErrorReferences()) {
+            causes.add(saveIntermediate(cause));
+        }
+        file = DataBundles.setError(file, errorDoc.getMessage(),
+                trace.toString(), causes.toArray(new Path[causes.size()]));
+        return file;
+    }
+
+    protected void addStackTrace(Individual error, ErrorDocument errorDoc)
+            throws IOException {
+        StringBuilder sb = new StringBuilder();
+        addStackTrace(sb, errorDoc);
+        if (sb.length() > 0) {
+            error.addLiteral(provModel.stackTrace, sb.toString());
+        }
+
+        for (T2Reference errRef : errorDoc.getErrorReferences()) {
+            URI errorURI = URI.create(uriGenerator.makeT2ReferenceURI(errRef
+                    .toUri().toASCIIString()));
+            Individual nestedErr = provModel.createError(errorURI);
+            provModel.setWasDerivedFrom(error, nestedErr);
+            describeEntity(errRef);
+        }
+    }
+
+    protected void addStackTrace(StringBuilder sb, ErrorDocument errorDoc) {
+        if (errorDoc.getExceptionMessage() != null
+                && !errorDoc.getExceptionMessage().isEmpty()) {
+            sb.append(errorDoc.getExceptionMessage());
+            sb.append("\n");
+        }
+        if (errorDoc.getStackTraceStrings() == null) {
+            return;
+        }
+        if (sb.length() == 0) {
+            sb.append("Stack trace:\n");
+        }
+        // Attempt to recreate Java stacktrace style
+        for (StackTraceElementBean trace : errorDoc.getStackTraceStrings()) {
+            sb.append("        at ");
+            sb.append(trace.getClassName());
+            sb.append(".");
+            sb.append(trace.getMethodName());
+            sb.append("(");
+            sb.append(trace.getFileName());
+            sb.append(":");
+            sb.append(trace.getLineNumber());
+            sb.append(")");
+            sb.append("\n");
+        }
+    }
+
+    protected void addMessageIfNonEmpty(Individual error, String message) {
+        if (message == null || message.isEmpty()) {
+            return;
+        }
+        error.addLiteral(provModel.errorMessage, message);
+    }
+
+    private Path referencePath(T2Reference t2Ref) throws IOException {
+        String local = t2Ref.getLocalPart();
+        try {
+            return DataBundles.getIntermediate(bundle, UUID.fromString(local));
+        } catch (IllegalArgumentException ex) {
+            return DataBundles.getIntermediates(bundle)
+                    .resolve(t2Ref.getNamespacePart())
+                    .resolve(t2Ref.getLocalPart());
+        }
+
+    }
+
+    private boolean seenReference(T2Reference t2Ref, Path file) {
+        getFileToT2Reference().put(file, t2Ref);
+        if (seenReference(t2Ref)) {
+            return true;
+        }
+        return seenReferences.put(t2Ref, file) != null;
+    }
+
+    public ProvenanceAccess getProvenanceAccess() {
+        return provenanceAccess;
+    }
+
+    public void setProvenanceAccess(ProvenanceAccess provenanceAccess) {
+        this.provenanceAccess = provenanceAccess;
+    }
+
+    public String getWorkflowRunId() {
+        return workflowRunId;
+    }
+
+    public void setWorkflowRunId(String workflowRunId) {
+        this.workflowRunId = workflowRunId;
+    }
+
+    public void setFileToT2Reference(Map<Path, T2Reference> fileToT2Reference) {
+        this.fileToT2Reference = new HashMap<>();
+        for (Entry<Path, T2Reference> entry : fileToT2Reference.entrySet()) {
+            seenReference(entry.getValue(), entry.getKey());
+        }
+    }
+
+    private static final String WFDESC = "http://purl.org/wf4ever/wfdesc#";
+    private static WorkflowBundleIO wfBundleIO;
+    private Bundle bundle;
+    private URI runURI;
+
+    /**
+     * @return the bundle
+     */
+    public Bundle getBundle() {
+        return bundle;
+    }
+
+    public void writeBundle(WorkflowBundle wfBundle) throws IOException {
+
+        Bundle dataBundle = getBundle();
+
+        // Workflow
+        DataBundles.setWorkflowBundle(dataBundle, wfBundle);
+
+        // Generate Manifest
+        // TODO: This should be done automatically on close/save
+        Manifest manifest = new Manifest(dataBundle);
+        manifest.populateFromBundle();
+
+        Path workflowRunProvenance = DataBundles
+                .getWorkflowRunProvenance(dataBundle);
+        // Additional metadata
+        manifest.getAggregation(workflowRunProvenance).setMediatype(
+                "text/turtle");
+
+        Agent provPlugin = new Agent();
+        provPlugin.setName("Taverna-PROV plugin, " + applicationConfig.getTitle() + " " + applicationConfig.getName());
+        provPlugin.setUri(getPluginIdentifier(getClass()));
+        manifest.getAggregation(workflowRunProvenance).setCreatedBy(
+                provPlugin);        
+        manifest.setCreatedBy(provPlugin);
+        
+        
+        // Media types:
+        for (Entry<URI, String> e : mediaTypes.entrySet()) {
+            URI uri = e.getKey();
+            String mediatype = e.getValue();
+            PathMetadata aggregation = manifest.getAggregation(uri);
+            if (aggregation == null) {
+                // An external reference? Add it.
+		aggregation = manifest.getAggregation(uri);
+                //aggregation = new PathMetadata();
+                //aggregation.setUri(uri);
+                //manifest.getAggregates().add(aggregation);
+            }
+            aggregation.setMediatype(mediatype);
+        }
+
+        // Add annotations
+
+        // This RO Bundle is about a run
+        PathAnnotation bundleAboutRun = new PathAnnotation();
+        bundleAboutRun.setAbout(runURI);
+        bundleAboutRun.setContent(URI.create("/"));
+        manifest.getAnnotations().add(bundleAboutRun);
+        
+        // Also aggregate the run by ID, and that it was done by taverna
+		Agent taverna = new Agent();
+		taverna.setName(applicationConfig.getTitle());
+		taverna.setUri(getTavernaVersion());
+        manifest.getAggregation(runURI).setCreatedBy(taverna);
+
+        // TODO: Do we need both the "history" link and the annotation below?
+        manifest.setHistory(Arrays.asList(workflowRunProvenance));
+
+        // This RO Bundle is described in the provenance file
+        PathAnnotation provenanceAboutBundle = new PathAnnotation();
+        provenanceAboutBundle.setAbout(URI.create("/"));
+        provenanceAboutBundle.setContent(URI.create(workflowRunProvenance
+                .toUri().getPath()));
+        manifest.getAnnotations().add(provenanceAboutBundle);
+
+        // The wfdesc is about the workflow definition
+        Path workflow = DataBundles.getWorkflow(dataBundle);
+        // String workflowType = Files.probeContentType(workflow);
+        manifest.getAggregation(workflow).setMediatype(WORKFLOW_BUNDLE);
+        Path wfdesc = DataBundles.getWorkflowDescription(dataBundle);
+        if (Files.exists(wfdesc)) {
+            PathAnnotation wfdescAboutWfBundle = new PathAnnotation();
+            wfdescAboutWfBundle
+                    .setAbout(URI.create(workflow.toUri().getPath()));
+            wfdescAboutWfBundle
+                    .setContent(URI.create(wfdesc.toUri().getPath()));
+            manifest.getAnnotations().add(wfdescAboutWfBundle);
+        }
+
+        // And the workflow definition is about the workflow
+        PathAnnotation wfBundleAboutWf = new PathAnnotation();
+        URITools uriTools = new URITools();
+        URI mainWorkflow = uriTools.uriForBean(wfBundle.getMainWorkflow());
+        wfBundleAboutWf.setAbout(mainWorkflow);
+        URI wfBundlePath = URI.create(workflow.toUri().getPath());
+        wfBundleAboutWf.setContent(wfBundlePath);
+        manifest.getAnnotations().add(wfBundleAboutWf);
+        manifest.getAggregation(mainWorkflow);
+
+        // hasWorkflowDefinition
+        PathAnnotation hasWorkflowDefinition = new PathAnnotation();
+        hasWorkflowDefinition.setAbout(wfBundlePath);
+        UUID uuid = UUID.randomUUID();
+        hasWorkflowDefinition.setUri(URI.create("urn:uuid:" + uuid));
+        Path annotationBody = DataBundles.getAnnotations(dataBundle).resolve(
+                uuid + ".ttl");
+        hasWorkflowDefinition.setContent(URI.create(annotationBody.toUri()
+                .getPath()));
+        Model model = ModelFactory.createDefaultModel();
+        URI relPathToWfBundle = uriTools.relativePath(annotationBody.toUri(),
+                workflow.toUri());
+        model.setNsPrefix("wfdesc", WFDESC);
+        model.add(model.createResource(mainWorkflow.toASCIIString()),
+                model.createProperty(WFDESC + "hasWorkflowDefinition"),
+                model.createResource(relPathToWfBundle.toASCIIString()));
+        try (OutputStream out = Files.newOutputStream(annotationBody)) {
+            model.write(out, "TURTLE", annotationBody.toUri().toASCIIString());
+        }
+        manifest.getAnnotations().add(hasWorkflowDefinition);
+
+        PathAnnotation wfBundleAboutWfB = new PathAnnotation();
+        wfBundleAboutWfB.setAbout(wfBundle.getGlobalBaseURI());
+        wfBundleAboutWfB.setContent(URI.create(workflow.toUri().getPath()));
+        manifest.getAnnotations().add(wfBundleAboutWfB);
+
+        manifest.writeAsJsonLD();
+
+        // // Saving a data bundle:
+        // Path bundleFile = runPath.getParent().resolve(runPath.getFileName() +
+        // ".bundle.zip");
+        // DataBundles.closeAndSaveBundle(dataBundle, bundleFile);
+        // NOTE: From now dataBundle and its Path's are CLOSED
+        // and can no longer be accessed
+
+    }
+
+    /** Extract our own plugin version - if running within Raven */
+    protected static URI getPluginIdentifier(Class<?> pluginClass) {
+        ClassLoader classLoader = pluginClass.getClassLoader();
+        String className = pluginClass.getCanonicalName();
+        
+        try {
+//            org.osgi.framework.Bundle osgiBundle = FrameworkUtil
+//                    .getBundle(pluginClass);
+//            if (osgiBundle != null) {
+//                String symbolicName = osgiBundle.getSymbolicName();
+//                Version version = osgiBundle.getVersion();
+//            }
+
+            // equivalent as above without OSGi dependency:
+            Object bundle = PropertyUtils.getProperty(classLoader, "bundle");
+            String symbolicName = BeanUtils.getProperty(bundle, "symbolicName");
+            String version = BeanUtils.getProperty(bundle, "version")
+                    .toString();
+
+            // NOTE: The above code has not been tested within OSGi as of 2013-12-18
+            
+            return osgiURI.resolve(uriTools.validFilename(symbolicName) + "/"
+                    + uriTools.validFilename(version));
+        } catch (IllegalAccessException | InvocationTargetException
+                | NullPointerException | NoSuchMethodException e) {
+            // Assume it's not OSGi
+        }
+
+        // Not OSGi, try as Raven:
+        try {
+
+//            Artifact artifact = ((LocalArtifactClassLoader) classLoader)
+//                    .getArtifact();
+//            String groupId = artifact.getGroupId();
+//            String artifactId = artifact.getArtifactId();
+//            String version = artifact.getVersion();
+
+            // Equivalent as above, but without Raven dependency:
+
+            Object artifact = PropertyUtils
+                    .getProperty(classLoader, "artifact");
+            if (artifact == null) {
+                return null;
+            }
+            // If it worked, then we assume it is a
+            // net.sf.taverna.raven.repository.Artifact
+            // implementation
+            String groupId = BeanUtils.getProperty(artifact, "groupId");
+            String artifactId = BeanUtils.getProperty(artifact, "artifactId");
+            String version = BeanUtils.getProperty(artifact, "version");
+            //  mimic scufl2-t2flow
+            return ravenURI.resolve(uriTools.validFilename(groupId) + "/"
+                    + uriTools.validFilename(artifactId) + "/"
+                    + uriTools.validFilename(version) + "/"
+                    + uriTools.validFilename(className));
+        } catch (IllegalAccessException | InvocationTargetException
+                | NullPointerException | NoSuchMethodException e) {
+            // Assume it's not Raven
+        }
+        
+        // Fallback based on the classname - mimic scufl2-t2flow
+        return ravenURI.resolve("undefined/" + uriTools.validFilename(className));
+
+    }
+
+    public void setBundle(Bundle bundle) {
+        this.bundle = bundle;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/javadoc.xml
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/javadoc.xml b/taverna-provenanceconnector/javadoc.xml
new file mode 100644
index 0000000..3d863c6
--- /dev/null
+++ b/taverna-provenanceconnector/javadoc.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project default="javadoc">
+<target name="javadoc">
+<javadoc access="public" author="true" classpath="/Users/paolo/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar:/Users/paolo/.m2/repository/net/sf/taverna/t2/core/reference-api/0.9-SNAPSHOT/reference-api-0.9-SNAPSHOT.jar:/Users/paolo/.m2/repository/net/sf/taverna/t2/infrastructure/launcher-api/1.12-SNAPSHOT/launcher-api-1.12-SNAPSHOT.jar:/Users/paolo/.m2/repository/net/sf/taverna/t2/infrastructure/raven/1.12-SNAPSHOT/raven-1.12-SNAPSHOT.jar:/Users/paolo/.m2/repository/geronimo-spec/geronimo-spec-jta/1.0-M1/geronimo-spec-jta-1.0-M1.jar:/Users/paolo/.m2/repository/org/aspectj/aspectjweaver/1.6.0/aspectjweaver-1.6.0.jar:/Users/paolo/.m2/repository/org/springframework/spring-orm/2.5.4/spring-orm-2.5.4.jar:/Users/paolo/.m2/repository/org/jvnet/jaxb2_commons/runtime/0.2.RC1/runtime-0.2.RC1.jar:/Users/paolo/.m2/repository/asm/asm/1.5.3/asm-1.5.3.jar:/Users/paolo/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar:/Users/paolo/.m2/repository/net/sf/t
 averna/t2/infrastructure/raven-log4j/1.12-SNAPSHOT/raven-log4j-1.12-SNAPSHOT.jar:/Users/paolo/.m2/repository/org/springframework/spring-aop/2.5.4/spring-aop-2.5.4.jar:/Users/paolo/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar:/Users/paolo/.m2/repository/org/openprovenance/tupelo/1.0.3/tupelo-1.0.3.jar:/Users/paolo/.m2/repository/org/springframework/spring-tx/2.5.4/spring-tx-2.5.4.jar:/Users/paolo/.m2/repository/commons-codec/commons-codec/1.2/commons-codec-1.2.jar:/Users/paolo/.m2/repository/org/openprovenance/opm/1.0.3/opm-1.0.3.jar:/Users/paolo/.m2/repository/junit/junit/4.4/junit-4.4.jar:/Users/paolo/.m2/repository/cglib/cglib/2.1_3/cglib-2.1_3.jar:/Users/paolo/.m2/repository/org/springframework/spring-beans/2.5.4/spring-beans-2.5.4.jar:/Users/paolo/.m2/repository/net/sf/taverna/t2/core/reference-core-extensions/0.7-SNAPSHOT/reference-core-extensions-0.7-SNAPSHOT.jar:/Users/paolo/.m2/repository/log4j/log4j/1.2.13/log4j-1.2.13.jar:/Users/paolo/.m2/repository/net/sf/t
 averna/t2/infrastructure/spi-discovery-api/1.12-SNAPSHOT/spi-discovery-api-1.12-SNAPSHOT.jar:/Users/paolo/.m2/repository/commons-lang/commons-lang/2.2/commons-lang-2.2.jar:/Users/paolo/.m2/repository/org/openprovenance/toolbox/1.0.3/toolbox-1.0.3.jar:/Users/paolo/.m2/repository/commons-jxpath/commons-jxpath/1.2/commons-jxpath-1.2.jar:/Users/paolo/.m2/repository/org/tupeloproject/tupelo-kernel/2.4.3/tupelo-kernel-2.4.3.jar:target/test-classes:/Users/paolo/.m2/repository/commons-collections/commons-collections/2.1.1/commons-collections-2.1.1.jar:/Users/paolo/.m2/repository/net/sf/taverna/t2/core/workflowmodel-api/0.9-SNAPSHOT/workflowmodel-api-0.9-SNAPSHOT.jar:/Users/paolo/.m2/repository/commons-io/commons-io/1.3/commons-io-1.3.jar:/Users/paolo/.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar:/Users/paolo/.m2/repository/org/aspectj/aspectjrt/1.6.0/aspectjrt-1.6.0.jar:/Users/paolo/.m2/repository/org/tupeloproject/tupelo-cet/2.4.3/tupelo-cet-2.4.3.jar:/Users/paolo/.m2/reposit
 ory/org/tupeloproject/tupelo-util/2.4.3/tupelo-util-2.4.3.jar:/Users/paolo/.m2/repository/org/hibernate/hibernate/3.2.5.ga.raven/hibernate-3.2.5.ga.raven.jar:/Users/paolo/.m2/repository/net/sf/taverna/t2/infrastructure/appconfig/1.12-SNAPSHOT/appconfig-1.12-SNAPSHOT.jar:/Users/paolo/.m2/repository/commons-pool/commons-pool/1.3/commons-pool-1.3.jar:/Users/paolo/.m2/repository/net/sf/taverna/t2/infrastructure/prelauncher/1.12-SNAPSHOT/prelauncher-1.12-SNAPSHOT.jar:/Users/paolo/.m2/repository/commons-beanutils/commons-beanutils/1.4/commons-beanutils-1.4.jar:/Users/paolo/.m2/repository/jdom/jdom/1.0/jdom-1.0.jar:/Users/paolo/.m2/repository/net/sf/taverna/t2/core/reference-impl/0.9-SNAPSHOT/reference-impl-0.9-SNAPSHOT.jar:/Users/paolo/.m2/repository/net/sf/taverna/t2/lang/observer/0.6-SNAPSHOT/observer-0.6-SNAPSHOT.jar:/Users/paolo/.m2/repository/simple-jndi/simple-jndi/0.11.1/simple-jndi-0.11.1.jar:/Users/paolo/.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar:/Users/pao
 lo/.m2/repository/com/sun/xml/bind/jaxb-impl/2.1.3/jaxb-impl-2.1.3.jar:/Users/paolo/.m2/repository/commons-dbcp/commons-dbcp/1.2.2/commons-dbcp-1.2.2.jar:/Users/paolo/.m2/repository/org/springframework/spring-core/2.5.4/spring-core-2.5.4.jar:/Users/paolo/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar:/Users/paolo/.m2/repository/org/springframework/spring-context/2.5.4/spring-context-2.5.4.jar:/Users/paolo/.m2/repository/org/springframework/spring-jdbc/2.5.4/spring-jdbc-2.5.4.jar:/Users/paolo/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar:/Users/paolo/.m2/repository/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar" destdir="doc" doctitle="ProvenanceConnector and Provenance Access API" nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" source="1.5" sourcefiles="src/main/java/net/sf/taverna/t2/provenance/ProvenanceConnectorRegistry.java,src/main/java/net/sf/taverna/t2/provenance/ProvenanceConnectorFacto
 ry.java,src/main/java/net/sf/taverna/t2/provenance/ProvenanceConnectorFactoryRegistry.java" sourcepath="src/main/java:src/test/java:src/main/resources" splitindex="true" use="true" version="true"/>
+</target>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/pom.xml b/taverna-provenanceconnector/pom.xml
new file mode 100644
index 0000000..7c29589
--- /dev/null
+++ b/taverna-provenanceconnector/pom.xml
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+			<groupId>org.apache.taverna.engine</groupId>
+			<artifactId>taverna-engine</artifactId>
+			<version>3.1.0-incubating-SNAPSHOT</version>
+    </parent>
+    <artifactId>taverna-provenanceconnector</artifactId>
+    <packaging>bundle</packaging>
+    <name>Apache Taverna Provenance Connector</name>
+		<description>Database storage and analysis of provenance info (LEGACY)</description>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-bundle-plugin</artifactId>
+				<extensions>true</extensions>
+				<configuration>
+					<instructions>
+						<Private-Package>org.openprovenance.model.*,org.tupeloproject.*</Private-Package>
+						<Import-Package>!com.sun.xml.bind.marshaller.*,!org.jvnet.jaxb2_commons.lang.*,*</Import-Package>
+					</instructions>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+	<dependencies>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-reference-impl</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-workflowmodel-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-workflowmodel-impl</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.language</groupId>
+			<artifactId>taverna-scufl2-api</artifactId>
+			<version>${taverna.language.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-database-configuration-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.jdom</groupId>
+			<artifactId>com.springsource.org.jdom</artifactId>
+                        <version>${jdom.version}</version>
+		</dependency>
+  		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+                        <version>${log4j.version}</version>
+		</dependency>
+		<dependency>
+      <groupId>commons-dbcp</groupId>
+      <artifactId>commons-dbcp</artifactId>
+      <version>${commons.dbcp.version}</version>
+		</dependency>
+		<!--
+		<dependency>
+			<groupId>commons-io</groupId>
+			<artifactId>commons-io</artifactId>
+                        <version>${commons.io.version}</version>
+		</dependency>
+		 -->
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>com.springsource.org.apache.commons.lang</artifactId>
+                        <version>${commons.lang.version}</version>
+		</dependency>
+                <dependency>
+                        <groupId>org.tupeloproject</groupId>
+                        <artifactId>tupelo-cet</artifactId>
+                        <version>${tupelo.version}</version>
+                        <scope>provided</scope>
+                </dependency>
+                <dependency>
+                        <groupId>org.tupeloproject</groupId>
+                        <artifactId>tupelo-kernel</artifactId>
+                        <version>${tupelo.version}</version>
+                        <scope>provided</scope>
+                </dependency>
+                <dependency>
+                        <groupId>org.openprovenance</groupId>
+                        <artifactId>opm-core</artifactId>
+                        <version>${opm.version}</version>
+                        <scope>provided</scope>
+                </dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+                        <version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+    </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/Provenance.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/Provenance.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/Provenance.java
new file mode 100644
index 0000000..f6009ca
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/Provenance.java
@@ -0,0 +1,316 @@
+package net.sf.taverna.t2.provenance;
+
+import java.sql.SQLException;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import net.sf.taverna.t2.invocation.InvocationContext;
+import net.sf.taverna.t2.provenance.api.Query;
+import net.sf.taverna.t2.provenance.api.QueryAnswer;
+import net.sf.taverna.t2.provenance.connector.AbstractProvenanceConnector;
+import net.sf.taverna.t2.provenance.lineageservice.Dependencies;
+import net.sf.taverna.t2.provenance.lineageservice.LineageQueryResultRecord;
+import net.sf.taverna.t2.provenance.lineageservice.ProvenanceAnalysis;
+import net.sf.taverna.t2.provenance.lineageservice.ProvenanceQuery;
+import net.sf.taverna.t2.provenance.lineageservice.utils.Collection;
+import net.sf.taverna.t2.provenance.lineageservice.utils.DataLink;
+import net.sf.taverna.t2.provenance.lineageservice.utils.DataflowInvocation;
+import net.sf.taverna.t2.provenance.lineageservice.utils.Port;
+import net.sf.taverna.t2.provenance.lineageservice.utils.PortBinding;
+import net.sf.taverna.t2.provenance.lineageservice.utils.ProcessorEnactment;
+import net.sf.taverna.t2.provenance.lineageservice.utils.ProvenanceProcessor;
+import net.sf.taverna.t2.provenance.lineageservice.utils.Workflow;
+import net.sf.taverna.t2.provenance.lineageservice.utils.WorkflowRun;
+import net.sf.taverna.t2.provenance.lineageservice.utils.WorkflowTree;
+import net.sf.taverna.t2.reference.T2Reference;
+
+/**
+ * This API is the single access point into the Taverna provenance database. Its
+ * main functionality is to let clients query the content of the DB, either
+ * using dedicated methods that retrieve specific entity values from the DB, or
+ * through a more general XML-based query language. Examples of XML provenance
+ * queries can be found in the external package
+ * {@link net.sf.taverna.t2.provenance.apic.client.resources}. Class
+ * {@link net.sf.taverna.t2.provenance.api.client.ProvenanceAPISampleClient}
+ * provides an example of API client that third parties would use to interact
+ * with this API.
+ * <p/>
+ * The XML schema for the XML query language is {@code pquery.xsd} in
+ * {@link net.sf.taverna.t2.provenance.apic.client.resources}
+ * 
+ * @author Paolo Missier
+ * @author Stuart Owen
+ */
+public interface Provenance {
+
+	/**
+	 * Initialises a default Reference Service for storing data and their associated references.
+	 * This creates a reference service using the named JNDI Data Source 'jdbc/taverna'.<br/>
+	 * the new Reference Service is associated to the {@link AbstractProvenanceConnector}, enabling data references to be resolved
+	 */
+	InvocationContext initDefaultReferenceService();
+
+	/**
+	 * Initialises the Reference Service for a given hibernate context definition.
+	 * This mapping file must be available in the root of the classpath.
+	 * @see #initDefaultReferenceService()
+	 * @param hibernateContext
+	 */
+	InvocationContext initReferenceService(String hibernateContext);
+
+	void init();
+
+	void init(InvocationContext context);
+
+	/**
+	 * Executes a provenance query. Please see separate doc. for the XML query language schema.
+	 * @throws SQLException
+	 */
+	QueryAnswer executeQuery(Query pq) throws SQLException;
+
+	/**
+	 * Returns individal records from the provenance DB in response to a query
+	 * that specifies specific elements within values associated with a
+	 * processor port, in the context of a specific run of a workflow. <br/>
+	 * This is used in the workbench to retrieve the "intermediate results" at
+	 * various points during workflow execution, as opposed to a set of
+	 * dependencies in response to a full-fledged provenance query.
+	 * 
+	 * @param workflowRunId
+	 *            lineage scope -- a specific instance
+	 * @param processorName
+	 *            for a specific processor [required]
+	 * @param a
+	 *            specific (input or output) variable [optional]
+	 * @param iteration
+	 *            and a specific iteration [optional]
+	 * @return a list of @ LineageQueryResultRecord} , encapsulated in a
+	 *         {@link Dependencies} object
+	 * @throws SQLException
+	 */
+	Dependencies fetchPortData(String workflowRunId, String workflowId,
+			String processorName, String portName, String iteration);
+
+	/**
+	 * @param record a record representing a single value -- possibly within a list hierarchy
+	 * @return the URI for topmost containing collection when the input record is within a list hierarchy, or null otherwise
+	 */
+	String getContainingCollection(LineageQueryResultRecord record);
+
+	/**
+	 * @param workflowId
+	 *            defines the scope of the query - if null then the query runs
+	 *            on all available workflows
+	 * @param conditions
+	 *            additional conditions to be defined. This is a placeholder as
+	 *            conditions are currently ignored
+	 * @return a list of workflowRunId, each representing one run of the input
+	 *         workflowID
+	 */
+	List<WorkflowRun> listRuns(String workflowId, Map<String, String> conditions);
+
+	boolean isTopLevelDataflow(String workflowId);
+
+	boolean isTopLevelDataflow(String workflowId, String workflowRunId);
+
+	String getLatestRunID() throws SQLException;
+
+	/**
+	 * Removes all records that pertain to a specific run (but not the static
+	 * specification of the workflow run)
+	 * 
+	 * @param runID
+	 *            the internal ID of a run. This can be obtained using
+	 *            {@link #listRuns(String, Map)}
+	 * @return the set of data references that pertain to the deleted run. This
+	 *         can be used by the Data Manager to ensure that no dangling
+	 *         references are left in the main Taverna data repositorry
+	 */
+	Set<String> removeRun(String runID);
+
+	/**
+	 * removes all records pertaining to the static structure of a workflow.
+	 * 
+	 * @param workflowId
+	 *            the ID (not the external name) of the workflow whose static
+	 *            structure is to be deleted from the DB
+	 */
+	void removeWorkflow(String workflowId);
+
+	/**
+	 * returns a set of workflowIDs for a given runID. The set is a singleton if
+	 * the workflow has no nesting, but in general the list contains one
+	 * workflowID for each nested workflow involved in the run
+	 * 
+	 * @param runID
+	 *            the internal ID for a specific workflow run
+	 * @return a list of workflow IDs, one for each nested workflow involved in
+	 *         the input run
+	 */
+	List<String> getWorkflowID(String runID);
+
+	/**
+	 * @param runID
+	 *            the internal ID for a specific workflow run
+	 * @return the ID of the top-level workflow that executed during the input
+	 *         run
+	 */
+	String getTopLevelWorkflowID(String runID);
+
+	List<Workflow> getWorkflowsForRun(String runID);
+
+	/**
+	 * @return a list of {@link WorkflowRun} beans, each representing the
+	 *         complete description of a workflow run (note that this is not
+	 *         just the ID of the run)
+	 */
+	List<WorkflowRun> getAllWorkflowIDs();
+
+	/**
+	 * @param workflowID
+	 * @return a Map: workflowID -> [ @ link ProvenanceProcessor} ] Each entry
+	 *         in the list pertains to one composing sub-workflow (if no nesting
+	 *         then this contains only one workflow, namely the top level one)
+	 */
+	Map<String, List<ProvenanceProcessor>> getProcessorsInWorkflow(
+			String workflowID);
+
+	List<Collection> getCollectionsForRun(String wfInstanceID);
+
+	List<PortBinding> getPortBindings(Map<String, String> constraints)
+			throws SQLException;
+
+	/**
+	 * lists all ports for a workflow
+	 * 
+	 * @param workflowID
+	 * @return a list of {@link Port} beans, each representing an input or
+	 *         output port for the workflow
+	 */
+	List<Port> getPortsForDataflow(String workflowID);
+
+	/**
+	 * lists all ports for a workflow
+	 * 
+	 * @param workflowID
+	 * @return a list of {@link Port} beans, each representing an input or
+	 *         output port for the workflow or a processor in the workflow
+	 */
+	List<Port> getAllPortsInDataflow(String workflowID);
+
+	/**
+	 * list all ports for a specific processor within a workflow
+	 * 
+	 * @param workflowID
+	 * @param processorName
+	 * @return a list of {@link Port} beans, each representing an input or
+	 *         output port for the input processor
+	 */
+	List<Port> getPortsForProcessor(String workflowID, String processorName);
+
+	// PM added 5/2010
+	String getWorkflowNameByWorkflowID(String workflowID);
+
+	WorkflowTree getWorkflowNestingStructure(String workflowID)
+			throws SQLException;
+
+	/**
+	 * include valus of output ports in the query result? input port values are
+	 * always included<br>
+	 * default is FALSE
+	 */
+	void toggleIncludeProcessorOutputs(boolean active);
+
+	boolean isIncludeProcessorOutputs();
+
+	/**
+	 * @return an instance of {@link InvocationContext} that can be used by a
+	 *         client to deref a Taverna data reference
+	 */
+	InvocationContext getInvocationContext();
+
+	/**
+	 * should an OPM graph be generated in response to a query?<br>
+	 * default is TRUE
+	 */
+	void toggleOPMGeneration(boolean active);
+
+	/**
+	 * 
+	 * @return true if OPM is set to be generated in response to a query
+	 */
+	boolean isOPMGenerationActive();
+
+	/**
+	 * should actual artifact values be attached to OPM artifact nodes?<br>
+	 * default is FALSE<br/>
+	 * THIS IS CURRENTLY UNSUPPORTED -- DEFAULTS TO FALSE
+	 * 
+	 * @param active
+	 */
+	void toggleAttachOPMArtifactValues(boolean active);
+
+	/**
+	 * @return true if the OPM graph artifacts are annotated with actual values
+	 */
+	boolean isAttachOPMArtifactValues();
+
+	/**
+	 * @deprecated as workflow 'names' are not globally unique, this method
+	 *             should not be used!
+	 * @param workflowName
+	 * @return
+	 */
+	String getWorkflowIDForExternalName(String workflowName);
+
+	List<ProvenanceProcessor> getProcessorsForWorkflowID(String workflowID);
+
+	/**
+	 * @return the singleton {@link AbstractProvenanceConnector} used by the API
+	 *         to operate on the DB. Currently we support MySQL
+	 *         {@link MySQLProvenanceConnector} and Derby
+	 *         {@link DerbyProvenanceConnector} connectors. The set of supported
+	 *         connectors is extensible. The available connectors are discovered
+	 *         automatically by the API upon startup, and it includes all the
+	 *         connectors that are mentioned in the &lt;dependencies> section of
+	 *         pom.xml for Maven module
+	 *         {@code net.sf.taverna.t2.core.provenanceconnector}
+	 */
+	AbstractProvenanceConnector getProvenanceConnector();
+
+	/**
+	 * @return
+	 */
+	ProvenanceAnalysis getAnalysis();
+
+	/**
+	 * @return the pq
+	 */
+	ProvenanceQuery getQuery();
+
+	List<ProcessorEnactment> getProcessorEnactments(String workflowRunId,
+			String... processorPath);
+
+	ProcessorEnactment getProcessorEnactmentByProcessId(String workflowRunId,
+			String processIdentifier, String iteration);
+
+	ProcessorEnactment getProcessorEnactment(String processorEnactmentId);
+
+	ProvenanceProcessor getProvenanceProcessor(String workflowId,
+			String processorNameRef);
+
+	ProvenanceProcessor getProvenanceProcessor(String processorId);
+
+	Map<Port, T2Reference> getDataBindings(String dataBindingId);
+
+	DataflowInvocation getDataflowInvocation(String workflowRunId);
+
+	DataflowInvocation getDataflowInvocation(
+			ProcessorEnactment processorEnactment);
+
+	List<DataflowInvocation> getDataflowInvocations(String workflowRunId);
+
+	List<DataLink> getDataLinks(String workflowId);
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/ProvenanceConnectorFactory.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/ProvenanceConnectorFactory.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/ProvenanceConnectorFactory.java
new file mode 100644
index 0000000..0de22c2
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/ProvenanceConnectorFactory.java
@@ -0,0 +1,8 @@
+package net.sf.taverna.t2.provenance;
+
+import net.sf.taverna.t2.provenance.connector.AbstractProvenanceConnector;
+
+public interface ProvenanceConnectorFactory {
+	public AbstractProvenanceConnector getProvenanceConnector();
+	public String getConnectorType();
+}


[29/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/t2flow/secure-digest-authentication-https.t2flow
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/t2flow/secure-digest-authentication-https.t2flow b/taverna-platform-integration-tests/src/test/resources/t2flow/secure-digest-authentication-https.t2flow
new file mode 100644
index 0000000..5d2f893
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/t2flow/secure-digest-authentication-https.t2flow
@@ -0,0 +1,107 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3-SNAPSHOT-20110621T1150"><dataflow id="47ad844e-df8e-4c65-803a-8a20c8197e8e" role="top"><name>Workflow18</name><inputPorts /><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>Service_protected_with_Digest_AuthN_and_HTTPS</name><inputPorts /><outputPorts><port><name>responseBody</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>rest-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.rest.RESTActivity</class><inputMap /><outputMap><map from="responseBody" to="responseBody" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.rest.RESTActivityConfigurationBean xmlns="">
+  <httpMethod>GET</httpMethod>
+  <urlSignature>https://heater.cs.man.ac.uk:7443/examples-digest-authentication/taverna-test-page.html</urlSignature>
+  <acceptsHeaderValue>text/plain</acceptsHeaderValue>
+  <contentTypeForUpdates>application/xml</contentTypeForUpdates>
+  <outgoingDataFormat>String</outgoingDataFormat>
+  <sendHTTPExpectRequestHeader>false</sendHTTPExpectRequestHeader>
+  <showRedirectionOutputPort>false</showRedirectionOutputPort>
+  <escapeParameters>true</escapeParameters>
+  <otherHTTPHeaders />
+  <activityInputs />
+</net.sf.taverna.t2.activities.rest.RESTActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>Service_protected_with_Digest_AuthN_and_HTTPS</processor><port>responseBody</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>b7887959-6d6c-4466-8d15-16b4e20051db</identification>
+      </annotationBean>
+      <date>2010-11-22 14:16:43.484 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>eaff435f-9025-429b-9a12-97fc94d90e73</identification>
+      </annotationBean>
+      <date>2010-11-22 14:18:46.551 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>d9be6132-9d40-43f6-bd0b-8d29dca1163b</identification>
+      </annotationBean>
+      <date>2010-11-22 14:16:58.860 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>1f90ea89-a32f-41c1-b30c-2a5afd622984</identification>
+      </annotationBean>
+      <date>2010-11-22 14:20:41.517 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>e7fb38b1-b3ec-4c47-a584-36c68eeda25e</identification>
+      </annotationBean>
+      <date>2010-11-22 14:19:49.664 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>5b302294-d370-4639-acb1-2a8452cc6d92</identification>
+      </annotationBean>
+      <date>2010-11-29 10:34:55.185 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>837b1710-ff29-4eef-85a0-51fc76139364</identification>
+      </annotationBean>
+      <date>2010-11-22 14:15:20.380 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>47ad844e-df8e-4c65-803a-8a20c8197e8e</identification>
+      </annotationBean>
+      <date>2010-11-29 15:36:29.390 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/t2flow/secure-digest-authentication.t2flow
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/t2flow/secure-digest-authentication.t2flow b/taverna-platform-integration-tests/src/test/resources/t2flow/secure-digest-authentication.t2flow
new file mode 100644
index 0000000..449e9db
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/t2flow/secure-digest-authentication.t2flow
@@ -0,0 +1,129 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3-SNAPSHOT-20110621T1150"><dataflow id="a218f0b5-b675-4eed-b7a8-a5c63181ff3e" role="top"><name>Workflow18</name><inputPorts /><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>Service_protected_with_Digest_AuthN</name><inputPorts /><outputPorts><port><name>responseBody</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>rest-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.rest.RESTActivity</class><inputMap /><outputMap><map from="responseBody" to="responseBody" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.rest.RESTActivityConfigurationBean xmlns="">
+  <httpMethod>GET</httpMethod>
+  <urlSignature>http://heater.cs.man.ac.uk:7070/examples-digest-authentication/taverna-test-page.html</urlSignature>
+  <acceptsHeaderValue>text/plain</acceptsHeaderValue>
+  <contentTypeForUpdates>application/xml</contentTypeForUpdates>
+  <outgoingDataFormat>String</outgoingDataFormat>
+  <sendHTTPExpectRequestHeader>false</sendHTTPExpectRequestHeader>
+  <showRedirectionOutputPort>false</showRedirectionOutputPort>
+  <escapeParameters>true</escapeParameters>
+  <otherHTTPHeaders />
+  <activityInputs />
+</net.sf.taverna.t2.activities.rest.RESTActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>Service_protected_with_Digest_AuthN</processor><port>responseBody</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>b7887959-6d6c-4466-8d15-16b4e20051db</identification>
+      </annotationBean>
+      <date>2010-11-22 14:16:43.484 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>d9be6132-9d40-43f6-bd0b-8d29dca1163b</identification>
+      </annotationBean>
+      <date>2010-11-22 14:16:58.860 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>837b1710-ff29-4eef-85a0-51fc76139364</identification>
+      </annotationBean>
+      <date>2010-11-22 14:15:20.380 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>1f90ea89-a32f-41c1-b30c-2a5afd622984</identification>
+      </annotationBean>
+      <date>2010-11-22 14:20:41.517 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>e7fb38b1-b3ec-4c47-a584-36c68eeda25e</identification>
+      </annotationBean>
+      <date>2010-11-22 14:19:49.664 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>eaff435f-9025-429b-9a12-97fc94d90e73</identification>
+      </annotationBean>
+      <date>2010-11-22 14:18:46.551 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>5b302294-d370-4639-acb1-2a8452cc6d92</identification>
+      </annotationBean>
+      <date>2010-11-29 10:34:55.185 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>fd59d61c-50f8-457b-a183-c162453b026b</identification>
+      </annotationBean>
+      <date>2010-11-29 15:29:08.570 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>435023d5-0063-4914-ae4c-28a7a031ec0d</identification>
+      </annotationBean>
+      <date>2010-11-29 10:40:30.468 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>a218f0b5-b675-4eed-b7a8-a5c63181ff3e</identification>
+      </annotationBean>
+      <date>2010-11-29 15:39:35.589 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/t2flow/secure-ws-https.t2flow
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/t2flow/secure-ws-https.t2flow b/taverna-platform-integration-tests/src/test/resources/t2flow/secure-ws-https.t2flow
new file mode 100644
index 0000000..13637c4
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/t2flow/secure-ws-https.t2flow
@@ -0,0 +1,180 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3-SNAPSHOT-20110621T1150"><dataflow id="c71621ca-196c-46cd-9073-48af82b4bd4f" role="top"><name>Workflow13</name><inputPorts /><outputPorts><port><name>out_plaintext</name><annotations /></port><port><name>out_plaintext_timestamp</name><annotations /></port><port><name>out_digest</name><annotations /></port><port><name>out_digest_timestamp</name><annotations /></port></outputPorts><processors><processor><name>hello_plaintext_password</name><inputPorts><port><name>in0</name><depth>0</depth></port></inputPorts><outputPorts><port><name>helloReturn</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.wsdl.WSDLActivity</class><inputMap><map from="in0" to="in0" /></inputMap><outputMap><m
 ap from="helloReturn" to="helloReturn" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean xmlns="">
+  <wsdl>https://heater.cs.man.ac.uk:7443/axis/services/HelloService-PlaintextPassword?wsdl</wsdl>
+  <operation>hello</operation>
+  <securityProfile>WSSecurityUsernameTokenPlainTextPassword</securityProfile>
+</net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in0" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>in0_value</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="
 value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>Alan</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>hello_plaintext_password_timestamp</name><inputPorts><port><name>in0</name><depth>0</depth></port></inputPorts><outputPorts><port><name>helloReturn</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.wsdl.WSDLActivity</class><inputMap><map from="in0" to="
 in0" /></inputMap><outputMap><map from="helloReturn" to="helloReturn" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean xmlns="">
+  <wsdl>https://heater.cs.man.ac.uk:7443/axis/services/HelloService-PlaintextPassword-Timestamp?wsdl</wsdl>
+  <operation>hello</operation>
+  <securityProfile>WSSecurityTimestampUsernameTokenPlainTextPassword</securityProfile>
+</net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in0" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>in0_value_1</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from
 ="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>Alex</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>hello_digest_password</name><inputPorts><port><name>in0</name><depth>0</depth></port></inputPorts><outputPorts><port><name>helloReturn</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.wsdl.WSDLActivity</class><inputMap><map from="in0" to="in0" /></inpu
 tMap><outputMap><map from="helloReturn" to="helloReturn" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean xmlns="">
+  <wsdl>https://heater.cs.man.ac.uk:7443/axis/services/HelloService-DigestPassword?wsdl</wsdl>
+  <operation>hello</operation>
+  <securityProfile>WSSecurityUsernameTokenDigestPassword</securityProfile>
+</net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in0" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>in0_value_2</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from
 ="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>Stian</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>hello_digest_password_timestamp</name><inputPorts><port><name>in0</name><depth>0</depth></port></inputPorts><outputPorts><port><name>helloReturn</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.wsdl.WSDLActivity</class><inputMap><map from="in0" to="in0
 " /></inputMap><outputMap><map from="helloReturn" to="helloReturn" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean xmlns="">
+  <wsdl>https://heater.cs.man.ac.uk:7443/axis/services/HelloService-DigestPassword-Timestamp?wsdl</wsdl>
+  <operation>hello</operation>
+  <securityProfile>WSSecurityTimestampUsernameTokenDigestPassword</securityProfile>
+</net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in0" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>in0_value_3</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from
 ="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>David</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions><condition control="hello_plaintext_password" target="hello_digest_password" /><condition control="hello_digest_password_timestamp" target="hello_plaintext_password_timestamp" /><condition control="hello_digest_password" target="hello_digest_password_timestamp" /></conditions><datalinks><datalink><sink type="processor"><processor>hello_plaintext_password</processor><port>in0</port></sink><source type="processor"><processor>in0_value</processor><port>value</port>
 </source></datalink><datalink><sink type="processor"><processor>hello_plaintext_password_timestamp</processor><port>in0</port></sink><source type="processor"><processor>in0_value_1</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>hello_digest_password</processor><port>in0</port></sink><source type="processor"><processor>in0_value_2</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>hello_digest_password_timestamp</processor><port>in0</port></sink><source type="processor"><processor>in0_value_3</processor><port>value</port></source></datalink><datalink><sink type="dataflow"><port>out_plaintext</port></sink><source type="processor"><processor>hello_plaintext_password</processor><port>helloReturn</port></source></datalink><datalink><sink type="dataflow"><port>out_plaintext_timestamp</port></sink><source type="processor"><processor>hello_plaintext_password_timestamp</processor><port>helloReturn</port><
 /source></datalink><datalink><sink type="dataflow"><port>out_digest</port></sink><source type="processor"><processor>hello_digest_password</processor><port>helloReturn</port></source></datalink><datalink><sink type="dataflow"><port>out_digest_timestamp</port></sink><source type="processor"><processor>hello_digest_password_timestamp</processor><port>helloReturn</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>c71621ca-196c-46cd-9073-48af82b4bd4f</identification>
+      </annotationBean>
+      <date>2011-06-21 12:11:30.87 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>56cadac0-c944-4b9e-83c3-078f57738405</identification>
+      </annotationBean>
+      <date>2011-01-21 16:02:09.633 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>3d76be4c-83c4-413b-91f2-b0ce69dcbd97</identification>
+      </annotationBean>
+      <date>2010-11-22 13:29:43.282 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>ca8fb5c5-0e8c-4e68-84f0-bdc85a77e2b3</identification>
+      </annotationBean>
+      <date>2010-11-22 13:29:26.400 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>e61023d9-d603-4df6-87e5-175603f106a5</identification>
+      </annotationBean>
+      <date>2010-11-22 13:28:31.68 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>394aced4-ee5d-4355-8ebe-9fc8bcfe5303</identification>
+      </annotationBean>
+      <date>2011-06-21 12:07:46.327 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>8175c97b-6385-460a-98ab-5cf974010d51</identification>
+      </annotationBean>
+      <date>2010-11-22 12:11:59.610 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>a388d568-ca08-43b4-abaf-3744a6801d45</identification>
+      </annotationBean>
+      <date>2010-11-22 13:30:28.898 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>7153a2dd-18bd-4f25-80ab-1efa8afc567d</identification>
+      </annotationBean>
+      <date>2011-01-21 16:02:39.43 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/t2flow/secure-ws.t2flow
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/t2flow/secure-ws.t2flow b/taverna-platform-integration-tests/src/test/resources/t2flow/secure-ws.t2flow
new file mode 100644
index 0000000..764b810
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/t2flow/secure-ws.t2flow
@@ -0,0 +1,180 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3-SNAPSHOT-20110621T1150"><dataflow id="c71621ca-196c-46cd-9073-48af82b4bd4f" role="top"><name>Workflow13</name><inputPorts /><outputPorts><port><name>out_plaintext</name><annotations /></port><port><name>out_plaintext_timestamp</name><annotations /></port><port><name>out_digest</name><annotations /></port><port><name>out_digest_timestamp</name><annotations /></port></outputPorts><processors><processor><name>hello_plaintext_password</name><inputPorts><port><name>in0</name><depth>0</depth></port></inputPorts><outputPorts><port><name>helloReturn</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.wsdl.WSDLActivity</class><inputMap><map from="in0" to="in0" /></inputMap><outputMap><m
 ap from="helloReturn" to="helloReturn" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean xmlns="">
+  <wsdl>http://heater.cs.man.ac.uk:7070/axis/services/HelloService-PlaintextPassword?wsdl</wsdl>
+  <operation>hello</operation>
+  <securityProfile>WSSecurityUsernameTokenPlainTextPassword</securityProfile>
+</net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in0" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>in0_value</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="
 value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>Alan</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>hello_plaintext_password_timestamp</name><inputPorts><port><name>in0</name><depth>0</depth></port></inputPorts><outputPorts><port><name>helloReturn</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.wsdl.WSDLActivity</class><inputMap><map from="in0" to="
 in0" /></inputMap><outputMap><map from="helloReturn" to="helloReturn" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean xmlns="">
+  <wsdl>http://heater.cs.man.ac.uk:7070/axis/services/HelloService-PlaintextPassword-Timestamp?wsdl</wsdl>
+  <operation>hello</operation>
+  <securityProfile>WSSecurityTimestampUsernameTokenPlainTextPassword</securityProfile>
+</net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in0" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>in0_value_1</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from
 ="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>Alex</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>hello_digest_password</name><inputPorts><port><name>in0</name><depth>0</depth></port></inputPorts><outputPorts><port><name>helloReturn</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.wsdl.WSDLActivity</class><inputMap><map from="in0" to="in0" /></inpu
 tMap><outputMap><map from="helloReturn" to="helloReturn" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean xmlns="">
+  <wsdl>http://heater.cs.man.ac.uk:7070/axis/services/HelloService-DigestPassword?wsdl</wsdl>
+  <operation>hello</operation>
+  <securityProfile>WSSecurityUsernameTokenDigestPassword</securityProfile>
+</net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in0" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>in0_value_2</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from
 ="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>Stian</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>hello_digest_password_timestamp</name><inputPorts><port><name>in0</name><depth>0</depth></port></inputPorts><outputPorts><port><name>helloReturn</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.wsdl.WSDLActivity</class><inputMap><map from="in0" to="in0
 " /></inputMap><outputMap><map from="helloReturn" to="helloReturn" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean xmlns="">
+  <wsdl>http://heater.cs.man.ac.uk:7070/axis/services/HelloService-DigestPassword-Timestamp?wsdl</wsdl>
+  <operation>hello</operation>
+  <securityProfile>WSSecurityTimestampUsernameTokenDigestPassword</securityProfile>
+</net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in0" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>in0_value_3</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from
 ="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>David</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch
 .layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3-SNAPSHOT</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions><condition control="hello_plaintext_password" target="hello_digest_password" /><condition control="hello_digest_password_timestamp" target="hello_plaintext_password_timestamp" /><condition control="hello_digest_password" target="hello_digest_password_timestamp" /></conditions><datalinks><datalink><sink type="processor"><processor>hello_plaintext_password</processor><port>in0</port></sink><source type="processor"><processor>in0_value</processor><port>value</port>
 </source></datalink><datalink><sink type="processor"><processor>hello_plaintext_password_timestamp</processor><port>in0</port></sink><source type="processor"><processor>in0_value_1</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>hello_digest_password</processor><port>in0</port></sink><source type="processor"><processor>in0_value_2</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>hello_digest_password_timestamp</processor><port>in0</port></sink><source type="processor"><processor>in0_value_3</processor><port>value</port></source></datalink><datalink><sink type="dataflow"><port>out_plaintext</port></sink><source type="processor"><processor>hello_plaintext_password</processor><port>helloReturn</port></source></datalink><datalink><sink type="dataflow"><port>out_plaintext_timestamp</port></sink><source type="processor"><processor>hello_plaintext_password_timestamp</processor><port>helloReturn</port><
 /source></datalink><datalink><sink type="dataflow"><port>out_digest</port></sink><source type="processor"><processor>hello_digest_password</processor><port>helloReturn</port></source></datalink><datalink><sink type="dataflow"><port>out_digest_timestamp</port></sink><source type="processor"><processor>hello_digest_password_timestamp</processor><port>helloReturn</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>c71621ca-196c-46cd-9073-48af82b4bd4f</identification>
+      </annotationBean>
+      <date>2011-06-21 12:11:30.87 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>56cadac0-c944-4b9e-83c3-078f57738405</identification>
+      </annotationBean>
+      <date>2011-01-21 16:02:09.633 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>3d76be4c-83c4-413b-91f2-b0ce69dcbd97</identification>
+      </annotationBean>
+      <date>2010-11-22 13:29:43.282 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>ca8fb5c5-0e8c-4e68-84f0-bdc85a77e2b3</identification>
+      </annotationBean>
+      <date>2010-11-22 13:29:26.400 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>e61023d9-d603-4df6-87e5-175603f106a5</identification>
+      </annotationBean>
+      <date>2010-11-22 13:28:31.68 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>394aced4-ee5d-4355-8ebe-9fc8bcfe5303</identification>
+      </annotationBean>
+      <date>2011-06-21 12:07:46.327 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>8175c97b-6385-460a-98ab-5cf974010d51</identification>
+      </annotationBean>
+      <date>2010-11-22 12:11:59.610 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>a388d568-ca08-43b4-abaf-3744a6801d45</identification>
+      </annotationBean>
+      <date>2010-11-22 13:30:28.898 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>7153a2dd-18bd-4f25-80ab-1efa8afc567d</identification>
+      </annotationBean>
+      <date>2011-01-21 16:02:39.43 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file


[18/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/test/java/org/purl/wf4ever/provtaverna/owl/TestTavernaProvModel.java
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/test/java/org/purl/wf4ever/provtaverna/owl/TestTavernaProvModel.java b/taverna-prov-owl-bindings/src/test/java/org/purl/wf4ever/provtaverna/owl/TestTavernaProvModel.java
new file mode 100644
index 0000000..cfa5457
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/test/java/org/purl/wf4ever/provtaverna/owl/TestTavernaProvModel.java
@@ -0,0 +1,55 @@
+package org.purl.wf4ever.provtaverna.owl;
+
+import static org.junit.Assert.assertEquals;
+
+import java.net.URI;
+import java.util.UUID;
+
+import org.apache.jena.riot.Lang;
+import org.apache.jena.riot.RDFDataMgr;
+import org.apache.jena.riot.RDFFormat;
+import org.apache.jena.riot.WriterGraphRIOT;
+import org.apache.jena.riot.system.PrefixMapFactory;
+import org.apache.jena.riot.system.RiotLib;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.hp.hpl.jena.ontology.Individual;
+import com.hp.hpl.jena.ontology.OntModel;
+import com.hp.hpl.jena.sparql.util.Context;
+
+public class TestTavernaProvModel {
+
+    private TavernaProvModel provModel;
+
+    @Before
+    public void tavernaProvModel() {
+        provModel = new TavernaProvModel();
+    }
+
+    @Test
+    public void dummy() throws Exception {
+        Individual bundle = provModel.createBundle(uuid());
+        assertEquals("Bundle", bundle.getOntClass().getLocalName());
+
+    }
+
+    private URI uuid() {
+        return URI.create("urn:uuid:" + UUID.randomUUID());
+    }
+
+    
+    @Test
+    public void createEntity() throws Exception {
+        Individual ent = provModel.createEntity(URI
+                .create("http://example.com/fred#test"));
+        provModel.createEntity(URI.create("http://example.com/test"));
+        OntModel model = provModel.model;
+        model.write(System.out, "TURTLE", "http://example.com/fred");
+        model.write(System.out, "RDF/XML", "http://example.com/fred");
+
+        WriterGraphRIOT writer = RDFDataMgr.createGraphWriter(RDFFormat.TURTLE_BLOCKS);
+        writer.write(System.out, model.getBaseModel().getGraph(), RiotLib.prefixMap(model.getGraph()), "http://example.com/fred", new Context());
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/test/java/org/purl/wf4ever/provtaverna/owl/TestWfprovModel.java
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/test/java/org/purl/wf4ever/provtaverna/owl/TestWfprovModel.java b/taverna-prov-owl-bindings/src/test/java/org/purl/wf4ever/provtaverna/owl/TestWfprovModel.java
new file mode 100644
index 0000000..e7c8ae3
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/test/java/org/purl/wf4ever/provtaverna/owl/TestWfprovModel.java
@@ -0,0 +1,24 @@
+package org.purl.wf4ever.provtaverna.owl;
+import static org.junit.Assert.assertEquals;
+
+import java.net.URI;
+import java.util.UUID;
+
+import org.junit.Test;
+
+import com.hp.hpl.jena.ontology.Individual;
+
+
+public class TestWfprovModel {
+    @Test
+    public void dummy() throws Exception {
+        ProvModel provModel = new WfprovModel();
+        Individual bundle = provModel.createBundle(uuid());
+        assertEquals("Bundle", bundle.getOntClass().getLocalName());
+        
+    }
+
+    private URI uuid() {
+        return URI.create("urn:uuid:" + UUID.randomUUID());
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/test/resources/handmade.ttl
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/test/resources/handmade.ttl b/taverna-prov-owl-bindings/src/test/resources/handmade.ttl
new file mode 100644
index 0000000..732f320
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/test/resources/handmade.ttl
@@ -0,0 +1,158 @@
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix prov: <http://www.w3.org/ns/prov#> .
+@prefix wfprov: <http://purl.org/wf4ever/wfprov#> .
+@prefix wfdesc: <http://purl.org/wf4ever/wfdesc#> .
+@prefix tavernaprov: <http://ns.taverna.org.uk/2012/tavernaprov/> .
+@prefix doap: <http://usefulinc.com/ns/doap#> .
+@prefix cnt: <http://www.w3.org/2011/content#> .
+@prefix dcterms: <http://purl.org/dc/terms/> .
+@prefix scufl2: <http://ns.taverna.org.uk/2010/scufl2#> .
+
+<> rdfs:label "Handmade example of 'ideal' tavernaprov output"@en ;
+   rdfs:comment """This is a hand written attempt of how Taverna could output
+workflow provenance of the 'Hello Anyone' workflow. 
+
+Note that this example has been created to help shape the tavernaprov and
+wfprov ontologies, and therefore might not be in compliance with their current
+version.
+
+Note that for brevity, the provenance shown here might not be the complete
+trace, for instance some workflow processors are not shown.  """@en ;
+   prov:wasAttributedTo <http://soiland-reyes.com/stian/#me> .
+
+
+# Normally, this PROV bundle would have this metaprovenance:
+
+<> a prov:Bundle, prov:Entity ;
+    prov:wasGeneratedBy :taverna-prov-export .
+
+:taverna-prov-export a prov:Activity, tavernaprov:ProvExport;
+     rdfs:label "taverna-prov export of workflow run provenance";
+     # Might have been performed days later than the run!
+     prov:startedAtTime "2012-09-14T14:49:59.498+01:00"^^xsd:dateTime;
+     prov:endedAtTime "2012-09-14T14:50:41.216+01:00"^^xsd:dateTime;
+     # But was informed by the run activity 
+     prov:wasInformedBy <http://ns.taverna.org.uk/2011/run/223da554-8b08-4ccd-9247-11c9cedb31de/>  .
+
+
+# 'Trace' of workflow definition included - mainly in wfdesc and prov:Plan/prov:Role terms.
+# 
+# For a complete abstract workflow definition, see the separate wfdesc
+# translation from scufl2. Only minimal typing from scufl2 has been exposed
+# here, hence the use of dcterms:hasPart rather than scufl2:child.
+<http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/> a scufl2:WorkflowBundle ;
+    dcterms:hasPart <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/> .
+# The http://ns.taverna.org.uk/2010/workflowBundle/* and
+# http://ns.taverna.org.uk/2011/run/*  URIs in this document point to
+# non-information resources - attempts to
+# retrieve them will give either a 404 Not Found
+# or a 303 See Other redirection to a 'guessing' service which can only give
+# information on a similar granularity as below based on components of the
+# structured URI.  The reason for this is that the workflow engine is not in
+# control of where the workflow definition or exported provenance is stored and
+# published, and Taverna don't enforce any centralized registry of these.
+<http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/> a scufl2:Workflow, wfdesc:Workflow, prov:Plan ;
+    rdfs:label "Workflow Hello_Anyone";
+    wfdesc:hasSubProcess <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/hello/> ;
+    dcterms:hasPart <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/hello/> .
+
+<http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/hello/> a scufl2:Processor, wfdesc:Process, prov:Plan ;
+    rdfs:label "Processor hello in workflow Hello_Anyone";
+    wfdesc:hasInput <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/in/name> ;
+    dcterms:hasPart <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/in/name> .
+
+<http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/in/name> a wfdesc:Input, wfdesc:Parameter, prov:Role ;
+    rdfs:label "Input name in workflow Hello_Anyone" .
+#
+
+
+# A loose description of the workflow engine.   The validity of this
+# engine across multiple workflow runs is not clear, hence it does not
+# have a proper URI. We do however know some informaton about
+# the software version, which we should include
+:tavernaEngine a tavernaprov:TavernaEngine, wfprov:WorkflowEngine, prov:Agent ;
+    wfprov:software <http://ns.taverna.org.uk/2012/releases/2.4.0/> ;
+    # Can't export this now - operator information not currently recorded by Taverna
+    #wfprov:operator [ a prov:Person; foaf:name "Fred" ] 
+.
+<http://ns.taverna.org.uk/2012/releases/2.4.0/>  a doap:Version ;
+     doap:revision "2.4.0" ;
+     doap:created "2012-04-19"^^xsd:dateTime ;
+     doap:name "Taverna Workbench"@en .
+#
+
+# Description of workflow run
+<http://ns.taverna.org.uk/2011/run/223da554-8b08-4ccd-9247-11c9cedb31de/> a wfprov:WorkflowRun, prov:Activity ;
+    rdfs:label "Workflow run of Hello_Anyone"@en ;
+    wfprov:wasEnactedBy :tavernaEngine ;
+    prov:wasAssociatedWith :tavernaEngine ;
+    prov:qualifiedAssociation [
+        a wfprov:ExecutionOfWorkflow, prov:Associaton ;
+        prov:agent :tavernaEngine ;
+        wfprov:describedByWorkflow <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/> ;
+        prov:hadPlan <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/> ;
+    ] ;
+    prov:startedAtTime "2012-09-12T14:49:45.750+01:00"^^xsd:dateTime;
+    prov:endedAtTime "2012-09-12T14:49:48.829+01:00"^^xsd:dateTime;
+    prov:used <http://ns.taverna.org.uk/2011/data/d3f40bc4-0d96-4c6b-9562-5d27e0c66d7e/ref/2be8d75a-4545-4539-9364-5cfc41ae944a> ;
+    # Deprecated non-prov wfprov style
+    #wfprov:usedInput <http://ns.taverna.org.uk/2011/data/d3f40bc4-0d96-4c6b-9562-5d27e0c66d7e/ref/2be8d75a-4545-4539-9364-5cfc41ae944a> ;
+    prov:qualifiedUsage [
+        a wfprov:InputValue, prov:Usage ;
+        wfprov:inputValue <http://ns.taverna.org.uk/2011/data/d3f40bc4-0d96-4c6b-9562-5d27e0c66d7e/ref/2be8d75a-4545-4539-9364-5cfc41ae944a> ;
+        prov:entity <http://ns.taverna.org.uk/2011/data/d3f40bc4-0d96-4c6b-9562-5d27e0c66d7e/ref/2be8d75a-4545-4539-9364-5cfc41ae944a> ;
+
+        wfprov:asParameter <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/in/name> ;
+        prov:hadRole <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/in/name> ;
+    ] .
+    
+# Description of the used input
+<http://ns.taverna.org.uk/2011/data/d3f40bc4-0d96-4c6b-9562-5d27e0c66d7e/ref/2be8d75a-4545-4539-9364-5cfc41ae944a> a wfprov:Artifact, prov:Entity ;
+    # The file that has the content
+    tavernaprov:content <intermediates/2be8d75a-4545-4539-9364-5cfc41ae944a.txt> ;
+    #wfprov:describedByParameter <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/in/name> .
+    .
+
+# Description of actual content, small values even included here with cnt:chars
+<intermediates/2be8d75a-4545-4539-9364-5cfc41ae944a.txt> a tavernaprov:Content, cnt:ContentAsText ;
+    tavernaprov:sha1 "943a702d06f34599aee1f8da8ef9f7296031d699"^^xsd:hexBinary;
+    tavernaprov:byteCount 13;
+    cnt:chars "Hello, world!";
+    cnt:characterEncoding "UTF-8" . 
+
+    
+# Description of process executions
+<http://ns.taverna.org.uk/2011/run/223da554-8b08-4ccd-9247-11c9cedb31de/process/0347c41e-5998-4015-bdb7-cdd125c14acf/> a wfprov:ProcessRun, prov:Activity ;
+    rdfs:label "Processor execution hello (facade3:Hello_Anyone:hello)" ;
+    prov:startedAtTime "2012-09-12T14:49:47.366+01:00"^^xsd:dateTime ;
+    prov:endedAtTime "2012-09-12T14:49:47.513+01:00"^^xsd:dateTime ;
+
+    wfprov:wasEnactedby :tavernaEngine ;
+    prov:wasAssociatedWith :tavernaEngine ;
+    prov:qualifiedAssociation  [
+        a wfprov:ExecutionOfProcess, prov:Association;
+        prov:agent :tavernaEngine ;
+        wfprov:describedByProcess <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/hello/> ;
+        prov:hadPlan <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/hello/> 
+    ] ;
+    wfprov:wasPartOfWorkflowRun  <http://ns.taverna.org.uk/2011/run/223da554-8b08-4ccd-9247-11c9cedb31de/> ;
+    dcterms:partOf <http://ns.taverna.org.uk/2011/run/223da554-8b08-4ccd-9247-11c9cedb31de/> .
+
+<http://ns.taverna.org.uk/2011/data/d3f40bc4-0d96-4c6b-9562-5d27e0c66d7e/ref/f644d282-dd2d-4cce-8eb2-8429f4cb4c3a> a wfprov:Artifact, prov:Entity ;
+     tavernaprov:content <intermediates/f6/f644d282-dd2d-4cce-8eb2-8429f4cb4c3a.txt>;
+     #wfprov:describedByParameter <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/hello/out/value>;
+     #wfprov:wasOutputFrom <http://ns.taverna.org.uk/2011/run/223da554-8b08-4ccd-9247-11c9cedb31de/process/0347c41e-5998-4015-bdb7-cdd125c14acf/> ;
+     prov:wasGeneratedBy <http://ns.taverna.org.uk/2011/run/223da554-8b08-4ccd-9247-11c9cedb31de/process/0347c41e-5998-4015-bdb7-cdd125c14acf/> ;
+     prov:qualifiedGeneration  [
+         a wfprov:OutputValue, prov:Generation;
+         wfprov:wasOutputFrom  <http://ns.taverna.org.uk/2011/run/223da554-8b08-4ccd-9247-11c9cedb31de/process/0347c41e-5998-4015-bdb7-cdd125c14acf/> ;
+         prov:activity <http://ns.taverna.org.uk/2011/run/223da554-8b08-4ccd-9247-11c9cedb31de/process/0347c41e-5998-4015-bdb7-cdd125c14acf/>;
+
+         wfprov:asParameter <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/hello/out/value>;
+         prov:hadRole <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/hello/out/value>
+     ] .
+    
+# .. Remaining processors and entities not shown
+

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov/README.md
----------------------------------------------------------------------
diff --git a/taverna-prov/README.md b/taverna-prov/README.md
new file mode 100644
index 0000000..b2fc454
--- /dev/null
+++ b/taverna-prov/README.md
@@ -0,0 +1,564 @@
+# Taverna PROV support
+
+[![Build Status](https://travis-ci.org/taverna/taverna-prov.svg?branch=maintenance)](https://travis-ci.org/taverna/taverna-prov)
+
+This is a plugin for the [Taverna](http://www.taverna.org.uk/) Workbench
+and Taverna Command Line which allows export of the provenance of a
+workflow run according to the [W3C PROV-O
+standard](http://www.w3.org/TR/prov-o/).
+
+
+## Source code and license
+This plugin is distributed under the [GNU Lesser General Public License
+2.1](http://www.gnu.org/licenses/lgpl-2.1.html) (LGPL). The source code
+for this plugin is available at https://github.com/taverna/taverna-prov
+
+
+## Installation for Taverna workbench
+Installation of an released version of this plugin does not require
+compilation, but uses Taverna's plugin mechanism.
+
+You need:
+* [Taverna Workbench 2.5](http://www.taverna.org.uk/download/workbench/2-5/)
+* Java 1.7 (now comes included with Taverna)
+* Internet connectivity
+
+Taverna-PROV is included in Taverna 2.5 and later.
+
+To install any updates to the Taverna-PROV plugin:
+
+1.  Start Taverna workbench
+
+2.  In the menu, click **Advanced** -> **Updates and plugins**
+
+3.  If Taverna does not say "An update is available" , click 
+    **Find updates**
+
+4.  For **Taverna-PROV databundle**, click **Update** if shown.
+
+5.  Click **Close**
+
+6. Exit and Restart Taverna workbench
+
+
+## Usage in the Taverna Workbench
+
+In order for PROV export to be possible from the Taverna Workbench,
+click **Preferences** from the **File** or **Taverna** menu, then go to the 
+[Preferences for Data and Provenance](http://dev.mygrid.org.uk/wiki/display24/taverna/Data+and+provenance+preferences).
+Ensure that **Provenance capture** is enabled (this is the default in 2.5).
+
+If you would like Taverna to keep the provenance data between runs
+of the workbench (in order to export at a later time), then you need to
+also untick to *disable* **In memory storage**; note however that this may slow
+down executions of some workflows.
+
+Open and run a workflow to export provenance for. As a quick example,
+try the very simple
+[helloanyone.t2flow](http://www.myexperiment.org/workflows/2649/download/hello_anyone_895936.t2flow)
+from [myExperiment](http://www.myexperiment.org/workflows/2649)
+(included in the `example/` folder of this source code).
+
+To save a Taverna-PROV databundle containing the workflow run
+provenance:
+
+1.  Click **Results** perspective
+2.  Run a workflow, or select an existing run on the left
+3.  Click **Show workflow results** button (in case you are viewing intermediates)
+4.  Click **Save all values**
+5.  Ensure all ports are ticked
+6.  Click **Save Provenance bundle**
+7.  Browse and type the name of the bundle
+8.  Click **OK**
+9.  The provenance and results values is saved to the bundle with the
+    extension `.bundle.zip`
+10. Provide the data bundle to a service that can understand it, such
+    as http://alpha2.myexperiment.org/ or http://sandbox.wf4ever-project.org/portal
+11. You may also open the bundle in your operating system as it is 
+    a ZIP file which contains workflow inputs, outputs, provenance and a
+    copy of the workflow.
+
+
+
+### Usage on command line
+
+The Taverna documentation has general information about [how to use the
+Taverna Command line
+tool](http://dev.mygrid.org.uk/wiki/display/taverna/Command+Line+Tool).
+
+The Taverna-PROV command line does not support all the output options of
+the regular Taverna command line, output has to be saved using
+`-outputdir`. The databundle will be saved in a filename which
+corresponds to the output directory, but with the extension
+`.bundle.zip`.
+
+To enable PROV export for the workflow run, add the parameter
+`-provenance`, which requires the parameter `-embedded` or
+`-clientserver`. 
+
+Note: `-embedded` allows only one concurrent execution at a time due to
+database locking. To support multiple concurrent runs, start
+`executeworkflow -startdb` separately to start the database server, and
+use `executeworkflow -provenance -clientserver` for the workflow
+executions.
+
+
+Example:
+```
+stain@biggie-mint ~/src/taverna-prov/example $ executeworkflow -embedded -provbundle helloanyone.bundle.zip -inputvalue name fred helloanyone.t2flow 
+Provenance bundle zip will be saved to: /home/stain/src/taverna-prov/example/helloanyone.bundle.zip
+
+stain@biggie-mint ~/src/taverna-prov/example $ mkdir helloanyone.bundle ; cd helloanyone.bundle
+stain@biggie-mint ~/src/taverna-prov/example/helloanyone.bundle $ unzip ../helloanyone.bundle.zip 
+Archive:  ../helloanyone.bundle.zip
+ extracting: mimetype                
+   creating: inputs/
+  inflating: inputs/name.txt         
+   creating: outputs/
+  inflating: outputs/greeting.txt    
+   creating: intermediates/
+   creating: intermediates/3a/
+  inflating: intermediates/3a/3a82e39d-a537-40cf-91a0-2c89d4a2e62b.txt  
+  inflating: workflowrun.prov.ttl    
+  inflating: workflow.wfbundle       
+   creating: .ro/
+   creating: .ro/annotations/
+  inflating: .ro/annotations/workflow.wfdesc.ttl  
+  inflating: .ro/annotations/a2f03983-8836-4c36-bfb2-d713d9a1928f.ttl  
+  inflating: .ro/manifest.json   
+```
+
+
+## Structure of exported provenance
+
+The `.bundle.zip` file is a [RO bundle](https://w3id.org/bundle),
+which species a structured ZIP file with a manifest
+(`.ro/manifest.json`). You can explore the bundle by unzipping it or
+browse it with a program like [7-Zip](http://7-zip.org/). 
+
+This source includes an [example
+bundle](example/helloanyone.bundle.zip) and [unzipped
+bundle](example/helloanyone.bundle/) as a folder. This data bundle
+has been saved after running
+a simple [hello world workflow](example/helloanyone.t2flow).
+
+The remaining text of this section describes the content of the RO
+bundle, as if it was unpacked to a folder. Note that many programming
+frameworks include support for working with ZIP files, and so complete
+unpacking might not be necessary for your application. For Java, the
+[Data bundle API](https://github.com/taverna/databundle) gives a
+programmating way to inspect and generate data bundles.
+
+
+### Inputs and outputs
+
+The folders `inputs/` and `outputs/` contain files and folders
+corresponding to the input and output values of the executed
+workflow.  Ports with multiple values are stored as a folder with numbered
+outputs, starting from `0`. Values representing errors have extension
+`.err`, other values have an extension guessed by inspecting the value
+structure, e.g. `.png`. External references have the extension `.url` -
+these files can often be opened as "Internet shortcut" or similar,
+depending on your operating system.
+
+Example listing:
+
+    c:\Users\stain\workspace\taverna-prov\example\helloanyone.bundle>ls
+    inputs  intermediates  mimetype  outputs  workflow.wfbundle  workflowrun.prov.ttl
+
+    c:\Users\stain\workspace\taverna-prov\example\helloanyone.bundle>ls outputs
+    greeting.txt
+
+    c:\Users\stain\workspace\taverna-prov\example\helloanyone.bundle>cat outputs/greeting.txt
+    Hello, John Doe
+
+### Workflow run provenance
+
+The file `workflowrun.prov.ttl` contains the
+[PROV-O](http://www.w3.org/TR/prov-o/) export of the workflow run
+provenance (including nested workflows) in [RDF Turtle
+format](http://www.w3.org/TR/turtle/). 
+
+This log details every intermediate processor invocation in the workflow
+execution, and relates them to inputs, outputs and intermediate values.
+
+Example listing:
+
+    c:\Users\stain\workspace\taverna-prov\example\helloanyone.bundle>cat workflowrun.prov.ttl | head -n 40 | tail -n 8
+
+    <#taverna-prov-export>
+            rdf:type                     prov:Activity ;
+            prov:startedAtTime           "2013-11-22T14:01:02.436Z"^^xsd:dateTime ;
+            prov:qualifiedCommunication  _:b1 ;
+            prov:endedAtTime             "2013-11-22T14:01:03.223Z"^^xsd:dateTime ;
+            rdfs:label                   "taverna-prov export of workflow run provenance"@en ;
+            prov:wasInformedBy           <http://ns.taverna.org.uk/2011/run/385c794c-ba11-4007-a5b5-502ba8d14263/> ;
+
+See the [provenance graph](example/helloanyone.bundle/workflowrun.prov.ttl) for a complete example. The provenance uses the vocabularies [PROV-O](http://www.w3.org/TR/prov-o/), [wfprov](https://w3id.org/ro#wfprov) and [tavernaprov](http://ns.taverna.org.uk/2012/tavernaprov/).
+
+#### Intermediate values
+
+
+Intermediate values are stored in the `intermediates/` folder and
+referenced from `workflowrun.prov.ttl`
+
+Intermediate value from the [example provenance](example/helloanyone.bundle/workflowrun.prov.ttl):
+
+    <http://ns.taverna.org.uk/2011/data/385c794c-ba11-4007-a5b5-502ba8d14263/ref/d588f6ab-122e-4788-ab12-8b6b66a67354>
+            tavernaprov:content          <intermediates/d5/d588f6ab-122e-4788-ab12-8b6b66a67354.txt> ;
+            wfprov:describedByParameter  <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/Concatenate_two_strings/in/string1> ;
+            wfprov:describedByParameter  <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/hello/out/value> ;
+            wfprov:wasOutputFrom         <http://ns.taverna.org.uk/2011/run/385c794c-ba11-4007-a5b5-502ba8d14263/process/bbaedc02-896f-491e-88bc-8dd350fcc73b/> .
+
+Here we see that the bundle file `intermediates/d5/d588f6ab-122e-4788-ab12-8b6b66a67354.txt` contains the output from the "hello" processor, which was also the input to the "Concatenate_two_strings" processor.  Details about processor, ports and parameters can be found in the [workflow definition](#workflow-definition).
+
+Example listing:
+
+    c:\Users\stain\workspace\taverna-prov\example\helloanyone.bundle>ls intermediates/d5
+    d588f6ab-122e-4788-ab12-8b6b66a67354.txt
+    
+    c:\Users\stain\workspace\taverna-prov\example\helloanyone.bundle>cat intermediates/d5/d58*
+    Hello,
+
+Note that "small" textual values are also included as `cnt:chars` in the graph, while the referenced intermediate file within the workflow bundle is always present.
+
+    <intermediates/d5/d588f6ab-122e-4788-ab12-8b6b66a67354.txt>
+            rdf:type               cnt:ContentAsText ;
+            cnt:characterEncoding  "UTF-8"^^xsd:string ;
+            cnt:chars              "Hello, "^^xsd:string ;
+            tavernaprov:byteCount  "7"^^xsd:long ;
+            tavernaprov:sha512     "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e"^^xsd:string ;
+            tavernaprov:sha1       "f52ab57fa51dfa714505294444463ae5a009ae34"^^xsd:string ;
+            rdf:type               tavernaprov:Content .
+    
+
+### Workflow definition
+
+The file `workflow.wfbundle` is a copy of the executed workflow in 
+[SCUFL2 workflow
+bundle](http://dev.mygrid.org.uk/wiki/display/developer/Taverna+Workflow+Bundle)
+format. This is the format which will be used by 
+The file `workflow.wfbundle` contains the executed workflow in [Taverna
+3](http://www.taverna.org.uk/developers/work-in-progress/taverna-3/). 
+
+You can use the [SCUFL2
+API](http://dev.mygrid.org.uk/wiki/display/developer/SCUFL2+API) to inspect the
+workflow definition in detail, or unzip the workflow bundle to access the
+complete workflow definition files as RDF/XML.
+
+#### Workflow structure
+
+Usually it is sufficient to inspect the simpler file
+`.ro/annotations/workflow.wfdesc.ttl`, which contains the abstract structure
+(but not all the implementation details) of the executed
+workflow, in [RDF Turtle](http://www.w3.org/TR/turtle/)
+according to the [wfdesc ontology](https://w3id.org/ro/#wfdesc).
+
+    c:\Users\stain\workspace\taverna-prov\example\helloanyone.bundle>cat .ro/annotations/workflow.wfdesc.ttl | head -n 20
+    @base <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/> .
+    @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+    @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+    @prefix owl: <http://www.w3.org/2002/07/owl#> .
+    @prefix prov: <http://www.w3.org/ns/prov#> .
+    @prefix wfdesc: <http://purl.org/wf4ever/wfdesc#> .
+    @prefix wf4ever: <http://purl.org/wf4ever/wf4ever#> .
+    @prefix roterms: <http://purl.org/wf4ever/roterms#> .
+    @prefix dc: <http://purl.org/dc/elements/1.1/> .
+    @prefix dcterms: <http://purl.org/dc/terms/> .
+    @prefix comp: <http://purl.org/DP/components#> .
+    @prefix dep: <http://scape.keep.pt/vocab/dependencies#> .
+    @prefix biocat: <http://biocatalogue.org/attribute/> .
+    @prefix : <#> .
+
+    <processor/Concatenate_two_strings/> a wfdesc:Process , wfdesc:Description , owl:Thing , wf4ever:BeanshellScript ;
+            rdfs:label "Concatenate_two_strings" ;
+            wfdesc:hasInput <processor/Concatenate_two_strings/in/string1> , <processor/Concatenate_two_strings/in/string2> ;
+            wfdesc:hasOutput <processor/Concatenate_two_strings/out/output> ;
+            wf4ever:script "output = string1 + string2;" .
+
+#### Original t2flow
+
+If the workflow was executed in Taverna 2 (which is the case when using this plugin), 
+then the unzipped `workflow.wfbundle` will contain a copy of the original `.t2flow` within
+its `history` folder:
+
+
+	stain@biggie-mint ~/src/taverna-prov/example/helloanyone.bundle $ mkdir workflow ; cd workflow ; unzip ../workflow.wfbundle
+	Archive:  ../workflow.wfbundle
+	 extracting: mimetype                
+	   creating: META-INF/
+	  inflating: META-INF/manifest.xml   
+	   creating: annotation/
+	  inflating: annotation/705d1f32-ea94-4a5b-b8fb-1cc1a5023427.ttl  
+	  inflating: annotation/0f1641bd-49ef-41bd-9e4b-e20cc2bf37bb.ttl  
+	  inflating: annotation/d007623d-cd94-4888-a583-e8d97953a159.ttl  
+	  inflating: annotation/e9eb11fa-fc63-4ddc-92ca-ec6921af1667.ttl  
+	  inflating: annotation/c5e91716-2f9f-4e7c-a692-8f58dba265e3.ttl  
+	   creating: history/
+	  inflating: history/01348671-5aaa-4cc2-84cc-477329b70b0d.t2flow  
+	   creating: workflow/
+	  inflating: workflow/Hello_Anyone.rdf  
+	   creating: profile/
+	   creating: profile/unspecified/
+	   creating: profile/unspecified/configuration/
+	  inflating: profile/unspecified/configuration/Concatenate_two_strings.json  
+	  inflating: profile/unspecified/configuration/Concatenate_two_strings-proc.json  
+	  inflating: profile/unspecified/configuration/hello.json  
+	  inflating: profile/unspecified/configuration/hello-proc.json  
+	  inflating: profile/unspecified.rdf  
+	  inflating: workflowBundle.rdf      
+	  inflating: META-INF/container.xml  
+
+	stain@biggie-mint ~/src/taverna-prov/example/helloanyone.bundle/workflow $ head history/01348671-5aaa-4cc2-84cc-477329b70b0d.t2flow 
+	<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="unspecified"><dataflow id="01348671-5aaa-4cc2-84cc-477329b70b0d" role="top"><name>Hello_Anyone</name><inputPorts><port><name>name</name><depth>0</depth><granularDepth>0</granularDepth><annotations><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+	  <annotationAssertions>
+	    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+
+The UUID in the t2flow filename (`01348671-5aaa-4cc2-84cc-477329b70b0d` above) 
+should match the executed wfbundle URI as seen in the provenance
+
+    http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/
+
+_Not yet implemented: a specific link to the `history/*.t2flow` file within the wfbundle._
+
+
+## Querying provenance
+
+Example [SPARQL query](http://www.w3.org/TR/sparql11-query/) from [test.sparql](example/test.sparql):
+
+```sparql
+PREFIX prov: <http://www.w3.org/ns/prov#> 
+PREFIX wfdesc: <http://purl.org/wf4ever/wfdesc#> 
+PREFIX wfprov: <http://purl.org/wf4ever/wfprov#> 
+PREFIX tavernaprov: <http://ns.taverna.org.uk/2012/tavernaprov/>
+PREFIX cnt:  <http://www.w3.org/2011/content#> 
+PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
+PREFIX wf4ever: <http://purl.org/wf4ever/wf4ever#> 
+
+
+SELECT DISTINCT ?paramName ?name ?value ?ended ?script
+WHERE {
+    ?greeting tavernaprov:content <outputs/greeting.txt> .
+    ?greeting prov:wasGeneratedBy ?concatenate .
+    ?concatenate prov:endedAtTime ?ended ;
+        wfprov:wasPartOfWorkflowRun ?run ;
+	wfprov:describedByProcess ?plan .
+    ?concatenate wfprov:usedInput ?input .
+    ?input tavernaprov:content ?name .
+    OPTIONAL { ?name cnt:chars ?value }  .
+    OPTIONAL { ?plan wf4ever:script ?script } .
+    ?input wfprov:describedByParameter ?param .
+    ?plan wfdesc:hasInput ?param .
+    OPTIONAL { ?param rdfs:label ?paramName } .  
+}
+```
+
+
+This query will be starting with the data `?greeting` which content is
+represented by the existing output file
+[outputs/greeting.txt](example/helloanyone.bundle/outputs/greeting.txt), and
+the remaining query tries to find which input or upstream values it has
+effectively been derived from.
+
+To do this, we find the `?concatenate` process run that generated
+the greeting, and ask when it `?ended`. We also look up its `?plan`, 
+which should match the [process
+identifier](example/helloanyone.bundle/.ro/annotations/workflow.wfdesc.ttl#L16)
+within the workflow definition.
+
+We then look at the `?input`s used by the `?concatenate` process run (this
+should give two matches as the "Concatenate string" processor takes two
+arguments). We look up their `?content` (a file witin this bundle), in addition
+to its textual `?value` (optionally, as this is only included in the graph for
+small non-binary content).
+
+Now we do a lookup of the
+[`?script`](example/helloanyone.bundle/.ro/annotations/workflow.wfdesc.ttl#L20)
+behind the defined `?plan` - this is optional because not all processors have
+scripts (it might be a web service).
+This information is extracted from the
+[.ro/annotations/workflow.wfdesc.ttl](example/helloanyone.bundle/.ro/annotations/workflow.wfdesc.)
+file which must also be parsed before querying.
+
+Lastly we look up the pararameters which describes `?input`, filtered by
+the ones bound to the processor `?plan` (thus avoiding the workflow inputs
+"name"), and include their `?paramName` - each result should therefore show the 
+input port name and value.
+
+
+Query using [rdfproc](http://librdf.org/utils/rdfproc.html) (`apt-get install redland-utils`):
+
+    stain@biggie-mint ~/src/taverna-prov/example/helloanyone.bundle $ rdfproc test parse workflowrun.prov.ttl turtle
+    rdfproc: Parsing URI file:///home/stain/src/taverna-prov/example/helloanyone.bundle/workflowrun.prov.ttl with turtle parser
+
+    stain@biggie-mint ~/src/taverna-prov/example/helloanyone.bundle $ rdfproc test parse .ro/annotations/workflow.wfdesc.ttl turtle
+    rdfproc: Parsing URI file:///home/stain/src/taverna-prov/example/helloanyone.bundle/.ro/annotations/workflow.wfdesc.ttl with turtle parser
+    
+    stain@biggie-mint ~/src/taverna-prov/example/helloanyone.bundle $ rdfproc test2 query sparql - "$(cat ../test.sparql)"  
+    rdfproc: Warning - URI file:///home/stain/src/taverna-prov/example/helloanyone.bundle/:1: Variable run was bound but is unused in the query
+    rdfproc: Query returned bindings results:
+    result: [, paramName="string2", name=<file:///home/stain/src/taverna-prov/example/helloanyone.bundle/inputs/name.txt>, value="fred"^^<http://www.w3.org/2001/XMLSchema#string>, ended="2014-05-28T11:49:43.711+01:00"^^<http://www.w3.org/2001/XMLSchema#dateTime>, script="output = string1 + string2;"]
+    result: [, paramName="string1", name=<file:///home/stain/src/taverna-prov/example/helloanyone.bundle/intermediates/3a/3a82e39d-a537-40cf-91a0-2c89d4a2e62b.txt>, value="Hello, "^^<http://www.w3.org/2001/XMLSchema#string>, ended="2014-05-28T11:49:43.711+01:00"^^<http://www.w3.org/2001/XMLSchema#dateTime>, script="output = string1 + string2;"]
+    rdfproc: Query returned 2 results
+    
+
+This shows that the `string2` input port was bound to value `"fred"` (content of `inputs/name.txt`) in the process run that generated `outputs/greeting.txt`. Next, `string` was bound to `"Hello, "` (content of `intermediates/3a/3a82..62b.txt`). The executed script was `output = string1 + string2`.
+
+
+
+## Building
+Note - you do not normally need to build from source code; unless you 
+are modifying the source code, the "Taverna Prov" plugin included
+in Taverna's default plugins is the preferred way of using Taverna-PROV.
+
+
+You need:
+* Java JDK 1.7 or newer (tested with OpenJDK 1.7.0\_03)
+  * Note: Do not use the OpenJDK 1.6 (default in Ubuntu), as this is
+   buggy with GUI and File operations, both used by the Taverna Workbench.
+* Maven 2.2 or newer (Tested with [Maven 3.0.4](http://maven.apache.org/download.html))
+
+To compile, run `mvn clean install`
+
+On first run this will download various open-source third-party
+libraries from Maven repositories, including required modules of Taverna 2.4. 
+These JARs, and the compiled JARs from this source code, are
+installed into `$HOME/.m2/repository/` [by
+default](http://maven.apache.org/settings.html#Quick_Overview).
+Depending on your network connection, this first run might take about 5
+minutes to complete.
+
+Example compilation:
+
+    stain@vmint:~/src/taverna-prov$ mvn clean install
+    [INFO] Scanning for projects...
+    [INFO] ------------------------------------------------------------------------
+    [INFO] Reactor Build Order:
+    [INFO] 
+    [INFO] Taverna PROV
+    [INFO] Taverna PROV W3 Provenance ontology Elmo bindings
+    [INFO] Taverna PROV export
+    [INFO] Taverna PROV activity UI bindings
+    [INFO] Taverna PROV plugin
+    [INFO] PROV Taverna command line
+    [INFO]                                                                         
+    [INFO] ------------------------------------------------------------------------
+    [INFO] Building Taverna PROV 2.0.0-SNAPSHOT
+    [INFO] ------------------------------------------------------------------------
+    (..)
+    Downloading: http://www.mygrid.org.uk/maven/repository/net/sf/taverna/t2/taverna-workbench/workbench-dev/2.5.0/workbench-dev-2.5.0.pom
+    Downloaded: http://www.mygrid.org.uk/maven/repository/net/sf/taverna/t2/taverna-workbench/workbench-dev/2.5.0/workbench-dev-2.5.0.pom (3 KB at 5.4 KB/sec)
+    (..)
+    [INFO] Installing /home/stain/src/taverna-prov/prov-taverna-cmdline/target/prov-taverna-cmdline-2.0.0-SNAPSHOT-tests.jar to /home/stain/.m2/repository/org/purl/wf4ever/provtaverna/prov-taverna-cmdline/2.0.0-SNAPSHOT/prov-taverna-cmdline-2.0.0-SNAPSHOT-tests.jar
+    [INFO] ------------------------------------------------------------------------
+    [INFO] Reactor Summary:
+    [INFO] 
+    [INFO] Taverna PROV ...................................... SUCCESS [4.109s]
+    [INFO] Taverna PROV W3 Provenance ontology Elmo bindings . SUCCESS [1.55.270s]
+    [INFO] Taverna PROV export ............................... SUCCESS [45.873s]
+    [INFO] Taverna PROV activity UI bindings ................. SUCCESS [1.56.572s]
+    [INFO] Taverna PROV plugin ............................... SUCCESS [15.028s]
+    [INFO] PROV Taverna command line ......................... SUCCESS [1:12.093s]
+    [INFO] ------------------------------------------------------------------------
+    [INFO] BUILD SUCCESS
+    [INFO] ------------------------------------------------------------------------
+    [INFO] Total time: 5:54.000s
+    [INFO] Finished at: Wed Jul 18 12:08:13 BST 2012
+    [INFO] Final Memory: 72M/274M
+    [INFO] ------------------------------------------------------------------------
+    
+
+
+
+Note that to work with Taverna 2's plugin system, the build is specific
+for a particular Taverna version (but works for any edition). To build this
+plugin for a different version of Taverna, modify the `<parent>` section of
+`pom.xml` to match the Taverna release, e.g. `<version>2.4.0</version>`.
+
+In order for Taverna to find your install of the plugin rather than
+download from the official plugin site, you will need to manually edit
+`plugins/plugins.xml` of the [Taverna home
+directory](http://dev.mygrid.org.uk/wiki/display/tav250/Taverna+home+directory)
+(run Taverna once to create the file) to include this section right
+before the final `</plugins:plugins>`. The 
+
+Note that you will get two copies of the "Save provenance" button, one for the
+official version included from `workbench-plugin`, and one for the one you built.
+
+
+```xml
+     <plugin>
+        <provider>org.purl.wf4ever</provider>
+        <identifier>org.purl.wf4ever.provtaverna.prov-taverna-plugin</identifier>
+        <version>2.0.0-SNAPSHOT</version>
+        <name>Taverna PROV plugin</name>
+        <description/>
+        <enabled>true</enabled>
+        <repositories>
+            <repository>file:///home/johndoe/.m2/repository/</repository>
+            <repository>http://www.mygrid.org.uk/maven/repository/</repository>
+            <repository>http://uk.maven.org/maven2/</repository>
+            <repository>http://repo.aduna-software.org/maven2/releases/</repository>
+            <repository>http://repo.aduna-software.org/maven2/snapshots/</repository>
+            <repository>http://repo.aduna-software.org/maven2/ext/</repository>
+            <repository>http://repository.aduna-software.org/maven2/</repository>
+            <repository>http://repository.aduna-software.org/maven2-snapshots/</repository>
+            <repository>http://people.apache.org/repo/m2-snapshot-repository/</repository>
+            <repository>http://nexus.codehaus.org/snapshots/</repository>
+            <repository>http://repository.jboss.org/maven2/</repository>
+        </repositories>
+        <profile>
+            <dependency>
+                <groupId>org.purl.wf4ever.provtaverna</groupId>
+                <artifactId>prov-taverna-ui</artifactId>
+                <version>2.0.0-SNAPSHOT</version>
+            </dependency>
+            <dependency>
+                <groupId>junit</groupId>
+                <artifactId>junit</artifactId>
+                <version>4.8.2</version>
+            </dependency>
+        </profile>
+        <compatibility>
+            <application>
+                <version>2.5.0</version>
+            </application>
+        </compatibility>
+    </plugin>
+```
+
+1.  Modify the line:
+    ```xml
+        <repository>file:///home/johndoe/.m2/repository/</repository>
+    ```
+
+    to match your $HOME/.m2/repository. On Windows this path should look like:
+
+    ```xml
+        <repository>file:///C:/Users/johndoe/.m2/repository/</repository>    
+    ```
+
+2.  Take care that the `<version>` of the `<plugin>` and `prov-taverna-ui` matches
+    the `<version>` specified in the `pom.xml` of this source code (typically `1.x-SNAPSHOT`).
+
+3.  If you are building for a different Taverna, check that the `<application><version>`
+    matches the Taverna version (compare with the existing plugins)
+
+4.  Start Taverna Workbench.    
+
+You only need to do this plugin installation once - if you later
+recompile the source code without changing the version numbers, next
+start of Taverna will use the newer JARs from `mvn clean install` as 
+Taverna will prefer accessing `$HOME/.m2/repository`. You might however need to delete
+the `repository/org/purl/wf4ever` folder of the  
+[Taverna home directory](http://dev.mygrid.org.uk/wiki/display/tav250/Taverna+home+directory)
+if Taverna has downloaded the SNAPSHOT versions from the myGrid repository
+instead (for instance because you used the wrong `<repository>` path or
+did not update `<version>`).
+
+To make the plugin installation system-side (ie. multiple UNIX users or
+to make a customized Taverna distribution), copy `plugins/`
+and `repository` with overwrite onto the Taverna installation directory.
+(See _Installation for Taverna Command Line_ above)
+
+

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov/example/helloanyone.bundle.zip
----------------------------------------------------------------------
diff --git a/taverna-prov/example/helloanyone.bundle.zip b/taverna-prov/example/helloanyone.bundle.zip
new file mode 100644
index 0000000..641c8bd
Binary files /dev/null and b/taverna-prov/example/helloanyone.bundle.zip differ

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov/example/helloanyone.bundle/.ro/annotations/a2f03983-8836-4c36-bfb2-d713d9a1928f.ttl
----------------------------------------------------------------------
diff --git a/taverna-prov/example/helloanyone.bundle/.ro/annotations/a2f03983-8836-4c36-bfb2-d713d9a1928f.ttl b/taverna-prov/example/helloanyone.bundle/.ro/annotations/a2f03983-8836-4c36-bfb2-d713d9a1928f.ttl
new file mode 100644
index 0000000..b610cd2
--- /dev/null
+++ b/taverna-prov/example/helloanyone.bundle/.ro/annotations/a2f03983-8836-4c36-bfb2-d713d9a1928f.ttl
@@ -0,0 +1,5 @@
+@prefix wfdesc:  <http://purl.org/wf4ever/wfdesc#> .
+
+<http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/>
+      wfdesc:hasWorkflowDefinition
+              <../../workflow.wfbundle> .

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov/example/helloanyone.bundle/.ro/annotations/workflow.wfdesc.ttl
----------------------------------------------------------------------
diff --git a/taverna-prov/example/helloanyone.bundle/.ro/annotations/workflow.wfdesc.ttl b/taverna-prov/example/helloanyone.bundle/.ro/annotations/workflow.wfdesc.ttl
new file mode 100644
index 0000000..a0d1a4b
--- /dev/null
+++ b/taverna-prov/example/helloanyone.bundle/.ro/annotations/workflow.wfdesc.ttl
@@ -0,0 +1,66 @@
+@base <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix owl: <http://www.w3.org/2002/07/owl#> .
+@prefix prov: <http://www.w3.org/ns/prov#> .
+@prefix wfdesc: <http://purl.org/wf4ever/wfdesc#> .
+@prefix wf4ever: <http://purl.org/wf4ever/wf4ever#> .
+@prefix roterms: <http://purl.org/wf4ever/roterms#> .
+@prefix dc: <http://purl.org/dc/elements/1.1/> .
+@prefix dcterms: <http://purl.org/dc/terms/> .
+@prefix comp: <http://purl.org/DP/components#> .
+@prefix dep: <http://scape.keep.pt/vocab/dependencies#> .
+@prefix biocat: <http://biocatalogue.org/attribute/> .
+@prefix : <#> .
+
+<processor/Concatenate_two_strings/> a wfdesc:Process , wfdesc:Description , owl:Thing , wf4ever:BeanshellScript ;
+	rdfs:label "Concatenate_two_strings" ;
+	wfdesc:hasInput <processor/Concatenate_two_strings/in/string1> , <processor/Concatenate_two_strings/in/string2> ;
+	wfdesc:hasOutput <processor/Concatenate_two_strings/out/output> ;
+	wf4ever:script "output = string1 + string2;" .
+
+<datalink?from=in/name&to=processor/Concatenate_two_strings/in/string2> a wfdesc:DataLink ;
+	wfdesc:hasSource <in/name> ;
+	wfdesc:hasSink <processor/Concatenate_two_strings/in/string2> .
+
+<datalink?from=processor/Concatenate_two_strings/out/output&to=out/greeting> a wfdesc:DataLink ;
+	wfdesc:hasSource <processor/Concatenate_two_strings/out/output> ;
+	wfdesc:hasSink <out/greeting> .
+
+<datalink?from=processor/hello/out/value&to=processor/Concatenate_two_strings/in/string1> a wfdesc:DataLink ;
+	wfdesc:hasSource <processor/hello/out/value> ;
+	wfdesc:hasSink <processor/Concatenate_two_strings/in/string1> .
+
+<> a wfdesc:Workflow , wfdesc:Description , wfdesc:Process ;
+	dcterms:description "An extension to helloworld.t2flow - this workflow takes a workflow input \"name\" which is combined with the string constant \"Hello, \" using the local worker \"Concatenate two strings\", and outputs the produced string to the workflow output \"greeting\"." ;
+	dc:creator "Stian Soiland-Reyes" ;
+	dcterms:title "Hello Anyone" ;
+	rdfs:label "Hello_Anyone" ;
+	wfdesc:hasInput <in/name> ;
+	wfdesc:hasOutput <out/greeting> ;
+	wfdesc:hasSubProcess <processor/Concatenate_two_strings/> , <processor/hello/> ;
+	wfdesc:hasDataLink <datalink?from=processor/Concatenate_two_strings/out/output&to=out/greeting> , <datalink?from=processor/hello/out/value&to=processor/Concatenate_two_strings/in/string1> , <datalink?from=in/name&to=processor/Concatenate_two_strings/in/string2> .
+
+<in/name> a wfdesc:Input , wfdesc:Description , wfdesc:Output ;
+	dcterms:description "Your name for the greeting" ;
+	biocat:exampleData "World!" ;
+	rdfs:label "name" .
+
+<out/greeting> a wfdesc:Output , wfdesc:Description , wfdesc:Input ;
+	rdfs:label "greeting" .
+
+<processor/Concatenate_two_strings/in/string1> a wfdesc:Input , wfdesc:Description ;
+	rdfs:label "string1" .
+
+<processor/Concatenate_two_strings/in/string2> a wfdesc:Input , wfdesc:Description ;
+	rdfs:label "string2" .
+
+<processor/Concatenate_two_strings/out/output> a wfdesc:Output , wfdesc:Description ;
+	rdfs:label "output" .
+
+<processor/hello/> a wfdesc:Process , wfdesc:Description ;
+	rdfs:label "hello" ;
+	wfdesc:hasOutput <processor/hello/out/value> .
+
+<processor/hello/out/value> a wfdesc:Output , wfdesc:Description ;
+	rdfs:label "value" .

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov/example/helloanyone.bundle/.ro/manifest.json
----------------------------------------------------------------------
diff --git a/taverna-prov/example/helloanyone.bundle/.ro/manifest.json b/taverna-prov/example/helloanyone.bundle/.ro/manifest.json
new file mode 100644
index 0000000..6d17907
--- /dev/null
+++ b/taverna-prov/example/helloanyone.bundle/.ro/manifest.json
@@ -0,0 +1,68 @@
+{
+  "@context" : [ "https://w3id.org/bundle/context" ],
+  "id" : "/",
+  "manifest" : [ "/.ro/manifest.json" ],
+  "createdOn" : "2014-05-28T10:49:48.072Z",
+  "createdBy" : [ {
+    "uri" : "http://ns.taverna.org.uk/2010/xml/t2flow/raven/org.purl.wf4ever.provtaverna/prov-taverna-export/2.2.0/org.purl.wf4ever.provtaverna.export.W3ProvenanceExport",
+    "name" : "Taverna-PROV plugin"
+  } ],
+  "aggregates" : [ {
+    "file" : "/workflow.wfbundle",
+    "folder" : "/",
+    "mediatype" : "application/vnd.taverna.scufl2.workflow-bundle",
+    "createdOn" : "2014-05-28T10:49:46.586Z",
+    "proxy" : "urn:uuid:1494a65e-5b3a-4ddb-8818-c74f968aa332"
+  }, {
+    "file" : "/intermediates/3a/3a82e39d-a537-40cf-91a0-2c89d4a2e62b.txt",
+    "folder" : "/intermediates/3a/",
+    "mediatype" : "text/plain",
+    "createdOn" : "2014-05-28T10:49:45.655Z",
+    "proxy" : "urn:uuid:3d4a1129-e6f7-456a-9332-eee30cf4182e"
+  }, {
+    "file" : "/inputs/name.txt",
+    "folder" : "/inputs/",
+    "mediatype" : "text/plain",
+    "createdOn" : "2014-05-28T10:49:45.606Z",
+    "proxy" : "urn:uuid:c2677561-6885-4085-8502-6a3c9072e402"
+  }, {
+    "file" : "/workflowrun.prov.ttl",
+    "folder" : "/",
+    "mediatype" : "text/turtle",
+    "createdOn" : "2014-05-28T10:49:45.769Z",
+    "createdBy" : [ {
+      "uri" : "http://ns.taverna.org.uk/2011/software/taverna-cmd-core-2.5.0",
+      "name" : "Taverna command line core 2.5.0"
+    }, {
+      "uri" : "http://ns.taverna.org.uk/2010/xml/t2flow/raven/org.purl.wf4ever.provtaverna/prov-taverna-export/2.2.0/org.purl.wf4ever.provtaverna.export.W3ProvenanceExport",
+      "name" : "Taverna-PROV plugin"
+    } ],
+    "proxy" : "urn:uuid:78b482dd-407f-4334-b620-b0cff550c601"
+  }, {
+    "file" : "/outputs/greeting.txt",
+    "folder" : "/outputs/",
+    "mediatype" : "text/plain",
+    "createdOn" : "2014-05-28T10:49:45.614Z",
+    "proxy" : "urn:uuid:e5b9333d-d82d-4bcd-96e5-74fbf87e6225"
+  } ],
+  "annotations" : [ {
+    "annotation" : "urn:uuid:a2f03983-8836-4c36-bfb2-d713d9a1928f",
+    "about" : "/workflow.wfbundle",
+    "content" : "/.ro/annotations/a2f03983-8836-4c36-bfb2-d713d9a1928f.ttl"
+  }, {
+    "about" : "http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/",
+    "content" : "/workflow.wfbundle"
+  }, {
+    "about" : "http://ns.taverna.org.uk/2011/run/a85ef801-3db0-4c56-93a7-532d1b4afbf1/",
+    "content" : "/"
+  }, {
+    "about" : "http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/",
+    "content" : "/workflow.wfbundle"
+  }, {
+    "about" : "/workflow.wfbundle",
+    "content" : "/.ro/annotations/workflow.wfdesc.ttl"
+  }, {
+    "about" : "/",
+    "content" : "/workflowrun.prov.ttl"
+  } ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov/example/helloanyone.bundle/inputs/name.txt
----------------------------------------------------------------------
diff --git a/taverna-prov/example/helloanyone.bundle/inputs/name.txt b/taverna-prov/example/helloanyone.bundle/inputs/name.txt
new file mode 100644
index 0000000..86654dd
--- /dev/null
+++ b/taverna-prov/example/helloanyone.bundle/inputs/name.txt
@@ -0,0 +1 @@
+fred
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov/example/helloanyone.bundle/intermediates/3a/3a82e39d-a537-40cf-91a0-2c89d4a2e62b.txt
----------------------------------------------------------------------
diff --git a/taverna-prov/example/helloanyone.bundle/intermediates/3a/3a82e39d-a537-40cf-91a0-2c89d4a2e62b.txt b/taverna-prov/example/helloanyone.bundle/intermediates/3a/3a82e39d-a537-40cf-91a0-2c89d4a2e62b.txt
new file mode 100644
index 0000000..444ac36
--- /dev/null
+++ b/taverna-prov/example/helloanyone.bundle/intermediates/3a/3a82e39d-a537-40cf-91a0-2c89d4a2e62b.txt
@@ -0,0 +1 @@
+Hello, 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov/example/helloanyone.bundle/mimetype
----------------------------------------------------------------------
diff --git a/taverna-prov/example/helloanyone.bundle/mimetype b/taverna-prov/example/helloanyone.bundle/mimetype
new file mode 100644
index 0000000..bfd43b6
--- /dev/null
+++ b/taverna-prov/example/helloanyone.bundle/mimetype
@@ -0,0 +1 @@
+application/vnd.wf4ever.robundle+zip
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov/example/helloanyone.bundle/outputs/greeting.txt
----------------------------------------------------------------------
diff --git a/taverna-prov/example/helloanyone.bundle/outputs/greeting.txt b/taverna-prov/example/helloanyone.bundle/outputs/greeting.txt
new file mode 100644
index 0000000..8658be5
--- /dev/null
+++ b/taverna-prov/example/helloanyone.bundle/outputs/greeting.txt
@@ -0,0 +1 @@
+Hello, fred
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov/example/helloanyone.bundle/workflow.wfbundle
----------------------------------------------------------------------
diff --git a/taverna-prov/example/helloanyone.bundle/workflow.wfbundle b/taverna-prov/example/helloanyone.bundle/workflow.wfbundle
new file mode 100644
index 0000000..5879efa
Binary files /dev/null and b/taverna-prov/example/helloanyone.bundle/workflow.wfbundle differ

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov/example/helloanyone.bundle/workflowrun.prov.ttl
----------------------------------------------------------------------
diff --git a/taverna-prov/example/helloanyone.bundle/workflowrun.prov.ttl b/taverna-prov/example/helloanyone.bundle/workflowrun.prov.ttl
new file mode 100644
index 0000000..126047d
--- /dev/null
+++ b/taverna-prov/example/helloanyone.bundle/workflowrun.prov.ttl
@@ -0,0 +1,270 @@
+@prefix dc:  <http://purl.org/dc/elements/1.1/> .
+@prefix prov:  <http://www.w3.org/ns/prov#> .
+@prefix cnt:  <http://www.w3.org/2011/content#> .
+@prefix foaf:  <http://xmlns.com/foaf/0.1/> .
+@prefix dcmitype:  <http://purl.org/dc/dcmitype/> .
+@prefix wfprov:  <http://purl.org/wf4ever/wfprov#> .
+@prefix dcam:  <http://purl.org/dc/dcam/> .
+@prefix xml:  <http://www.w3.org/XML/1998/namespace> .
+@prefix vs:  <http://www.w3.org/2003/06/sw-vocab-status/ns#> .
+@prefix dcterms:  <http://purl.org/dc/terms/> .
+@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix wot:  <http://xmlns.com/wot/0.1/> .
+@prefix wfdesc:  <http://purl.org/wf4ever/wfdesc#> .
+@prefix dct:  <http://purl.org/dc/terms/> .
+@prefix tavernaprov:  <http://ns.taverna.org.uk/2012/tavernaprov/> .
+@prefix owl:  <http://www.w3.org/2002/07/owl#> .
+@prefix xsd:  <http://www.w3.org/2001/XMLSchema#> .
+@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix skos:  <http://www.w3.org/2004/02/skos/core#> .
+@prefix scufl2:  <http://ns.taverna.org.uk/2010/scufl2#> .
+
+<http://ns.taverna.org.uk/2011/data/a85ef801-3db0-4c56-93a7-532d1b4afbf1/ref/3a82e39d-a537-40cf-91a0-2c89d4a2e62b>
+        tavernaprov:content          <intermediates/3a/3a82e39d-a537-40cf-91a0-2c89d4a2e62b.txt> ;
+        wfprov:describedByParameter  <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/Concatenate_two_strings/in/string1> ;
+        wfprov:describedByParameter  <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/hello/out/value> ;
+        wfprov:wasOutputFrom         <http://ns.taverna.org.uk/2011/run/a85ef801-3db0-4c56-93a7-532d1b4afbf1/process/2c72b19f-c6d6-4fae-88ab-f96ec0b11fb7/> ;
+        prov:qualifiedGeneration     _:b0 ;
+        prov:wasGeneratedBy          <http://ns.taverna.org.uk/2011/run/a85ef801-3db0-4c56-93a7-532d1b4afbf1/process/2c72b19f-c6d6-4fae-88ab-f96ec0b11fb7/> ;
+        rdf:type                     wfprov:Artifact ;
+        rdf:type                     prov:Entity .
+
+_:b1    prov:atTime  "2014-05-28T11:49:43.601+01:00"^^xsd:dateTime ;
+        rdf:type     prov:Start .
+
+_:b0    prov:hadRole   <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/hello/out/value> ;
+        prov:activity  <http://ns.taverna.org.uk/2011/run/a85ef801-3db0-4c56-93a7-532d1b4afbf1/process/2c72b19f-c6d6-4fae-88ab-f96ec0b11fb7/> ;
+        rdf:type       prov:Generation .
+
+<http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/Concatenate_two_strings/in/string2>
+        rdfs:comment  "Concatenate_two_strings input string2"@en ;
+        rdfs:label    "string2" ;
+        rdf:type      wfdesc:Input ;
+        rdf:type      prov:Role .
+
+_:b2    prov:atTime  "2014-05-28T10:49:45.524Z"^^xsd:dateTime ;
+        rdf:type     prov:Start .
+
+<intermediates/3a/3a82e39d-a537-40cf-91a0-2c89d4a2e62b.txt>
+        rdf:type               cnt:ContentAsText ;
+        cnt:characterEncoding  "UTF-8"^^xsd:string ;
+        cnt:chars              "Hello, "^^xsd:string ;
+        tavernaprov:byteCount  "7"^^xsd:long ;
+        tavernaprov:sha512     "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e"^^xsd:string ;
+        tavernaprov:sha1       "f52ab57fa51dfa714505294444463ae5a009ae34"^^xsd:string ;
+        rdf:type               tavernaprov:Content .
+
+_:b3    prov:hadRole  <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/in/name> ;
+        prov:entity   <http://ns.taverna.org.uk/2011/data/a85ef801-3db0-4c56-93a7-532d1b4afbf1/ref/d3d2e008-af7f-4c8c-9369-85d2d71c8121> ;
+        rdf:type      prov:Usage .
+
+_:b4    prov:atTime  "2014-05-28T11:49:43.711+01:00"^^xsd:dateTime ;
+        rdf:type     prov:End .
+
+<http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/Concatenate_two_strings/in/string1>
+        rdfs:comment  "Concatenate_two_strings input string1"@en ;
+        rdfs:label    "string1" ;
+        rdf:type      wfdesc:Input ;
+        rdf:type      prov:Role .
+
+<outputs/greeting.txt>
+        rdf:type               cnt:ContentAsText ;
+        cnt:characterEncoding  "UTF-8"^^xsd:string ;
+        cnt:chars              "Hello, fred"^^xsd:string ;
+        tavernaprov:byteCount  "11"^^xsd:long ;
+        tavernaprov:sha512     "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e"^^xsd:string ;
+        tavernaprov:sha1       "83577aa951bee185cc0d094e63af25f3d5d433d4"^^xsd:string ;
+        rdf:type               tavernaprov:Content .
+
+<http://ns.taverna.org.uk/2011/data/a85ef801-3db0-4c56-93a7-532d1b4afbf1/ref/d3d2e008-af7f-4c8c-9369-85d2d71c8121>
+        tavernaprov:content          <inputs/name.txt> ;
+        wfprov:describedByParameter  <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/Concatenate_two_strings/in/string2> ;
+        wfprov:describedByParameter  <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/in/name> ;
+        rdf:type                     wfprov:Artifact ;
+        rdf:type                     prov:Entity .
+
+_:b5    prov:hadPlan  <http://ns.taverna.org.uk/2011/software/taverna-cmd-core-2.5.0> ;
+        prov:agent    <#taverna-engine> ;
+        rdf:type      prov:Association .
+
+_:b6    prov:hadRole   <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/out/greeting> ;
+        prov:activity  <http://ns.taverna.org.uk/2011/run/a85ef801-3db0-4c56-93a7-532d1b4afbf1/> ;
+        rdf:type       prov:Generation .
+
+_:b7    prov:hadPlan  <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/Concatenate_two_strings/> ;
+        prov:agent    <#taverna-engine> ;
+        rdf:type      prov:Association .
+
+<http://ns.taverna.org.uk/2011/run/a85ef801-3db0-4c56-93a7-532d1b4afbf1/process/2c72b19f-c6d6-4fae-88ab-f96ec0b11fb7/>
+        rdfs:label                   "Processor execution hello"@en ;
+        wfprov:describedByProcess    <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/hello/> ;
+        prov:qualifiedStart          _:b8 ;
+        rdf:type                     wfprov:ProcessRun ;
+        wfprov:wasEnactedBy          <#taverna-engine> ;
+        prov:qualifiedAssociation    _:b9 ;
+        prov:qualifiedEnd            _:b10 ;
+        prov:startedAtTime           "2014-05-28T11:49:43.409+01:00"^^xsd:dateTime ;
+        wfprov:wasPartOfWorkflowRun  <http://ns.taverna.org.uk/2011/run/a85ef801-3db0-4c56-93a7-532d1b4afbf1/> ;
+        prov:wasAssociatedWith       <#taverna-engine> ;
+        prov:endedAtTime             "2014-05-28T11:49:43.461+01:00"^^xsd:dateTime .
+
+_:b11   prov:activity  <#taverna-prov-export> ;
+        rdf:type       prov:Generation .
+
+_:b12   prov:activity  <http://ns.taverna.org.uk/2011/run/a85ef801-3db0-4c56-93a7-532d1b4afbf1/> ;
+        rdf:type       prov:Communication .
+
+_:b8    prov:atTime  "2014-05-28T11:49:43.409+01:00"^^xsd:dateTime ;
+        rdf:type     prov:Start .
+
+_:b13   prov:hadRole  <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/Concatenate_two_strings/in/string2> ;
+        prov:entity   <http://ns.taverna.org.uk/2011/data/a85ef801-3db0-4c56-93a7-532d1b4afbf1/ref/d3d2e008-af7f-4c8c-9369-85d2d71c8121> ;
+        rdf:type      prov:Usage .
+
+<http://ns.taverna.org.uk/2011/software/taverna-cmd-core-2.5.0>
+        rdfs:label  "Taverna command line core 2.5.0"@en ;
+        rdf:type    prov:Plan .
+
+<http://ns.taverna.org.uk/2011/run/a85ef801-3db0-4c56-93a7-532d1b4afbf1/>
+        prov:qualifiedUsage         _:b3 ;
+        wfprov:describedByWorkflow  <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/> ;
+        prov:qualifiedEnd           _:b14 ;
+        wfprov:usedInput            <http://ns.taverna.org.uk/2011/data/a85ef801-3db0-4c56-93a7-532d1b4afbf1/ref/d3d2e008-af7f-4c8c-9369-85d2d71c8121> ;
+        prov:endedAtTime            "2014-05-28T11:49:43.736+01:00"^^xsd:dateTime ;
+        rdfs:label                  "Workflow run of Hello_Anyone"@en ;
+        dct:hasPart                 <http://ns.taverna.org.uk/2011/run/a85ef801-3db0-4c56-93a7-532d1b4afbf1/process/2c72b19f-c6d6-4fae-88ab-f96ec0b11fb7/> ;
+        prov:wasAssociatedWith      <#taverna-engine> ;
+        prov:qualifiedAssociation   _:b15 ;
+        prov:qualifiedStart         _:b16 ;
+        wfprov:wasEnactedBy         <#taverna-engine> ;
+        rdf:type                    wfprov:WorkflowRun ;
+        dct:hasPart                 <http://ns.taverna.org.uk/2011/run/a85ef801-3db0-4c56-93a7-532d1b4afbf1/process/682e212e-242d-4b4d-999b-e6ea4757f595/> ;
+        prov:used                   <http://ns.taverna.org.uk/2011/data/a85ef801-3db0-4c56-93a7-532d1b4afbf1/ref/d3d2e008-af7f-4c8c-9369-85d2d71c8121> ;
+        prov:startedAtTime          "2014-05-28T11:49:43.166+01:00"^^xsd:dateTime .
+
+<>      foaf:primaryTopic         <http://ns.taverna.org.uk/2011/run/a85ef801-3db0-4c56-93a7-532d1b4afbf1/> ;
+        prov:qualifiedGeneration  _:b11 ;
+        prov:wasGeneratedBy       <#taverna-prov-export> ;
+        rdf:type                  prov:Bundle .
+
+<http://ns.taverna.org.uk/2011/data/a85ef801-3db0-4c56-93a7-532d1b4afbf1/ref/d97338ab-e6c8-4513-a305-a237c70ee63e>
+        tavernaprov:content          <outputs/greeting.txt> ;
+        wfprov:describedByParameter  <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/Concatenate_two_strings/out/output> ;
+        wfprov:wasOutputFrom         <http://ns.taverna.org.uk/2011/run/a85ef801-3db0-4c56-93a7-532d1b4afbf1/process/682e212e-242d-4b4d-999b-e6ea4757f595/> ;
+        prov:qualifiedGeneration     _:b17 ;
+        wfprov:wasOutputFrom         <http://ns.taverna.org.uk/2011/run/a85ef801-3db0-4c56-93a7-532d1b4afbf1/> ;
+        prov:wasGeneratedBy          <http://ns.taverna.org.uk/2011/run/a85ef801-3db0-4c56-93a7-532d1b4afbf1/process/682e212e-242d-4b4d-999b-e6ea4757f595/> ;
+        wfprov:describedByParameter  <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/out/greeting> ;
+        rdf:type                     wfprov:Artifact ;
+        rdf:type                     prov:Entity .
+
+_:b15   prov:hadPlan  <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/> ;
+        prov:agent    <#taverna-engine> ;
+        rdf:type      prov:Association .
+
+<http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/Concatenate_two_strings/out/output>
+        rdfs:comment  "Concatenate_two_strings output output"@en ;
+        rdfs:label    "output" ;
+        rdf:type      wfdesc:Output ;
+        rdf:type      prov:Role .
+
+<#taverna-prov-export>
+        rdfs:label                   "taverna-prov export of workflow run provenance"@en ;
+        prov:startedAtTime           "2014-05-28T10:49:45.524Z"^^xsd:dateTime ;
+        prov:qualifiedStart          _:b2 ;
+        prov:wasInformedBy           <http://ns.taverna.org.uk/2011/run/a85ef801-3db0-4c56-93a7-532d1b4afbf1/> ;
+        rdf:type                     prov:Activity ;
+        prov:qualifiedEnd            _:b18 ;
+        prov:qualifiedAssociation    _:b5 ;
+        prov:qualifiedCommunication  _:b12 ;
+        prov:endedAtTime             "2014-05-28T10:49:45.674Z"^^xsd:dateTime ;
+        prov:wasAssociatedWith       <#taverna-engine> .
+
+<http://ns.taverna.org.uk/2011/run/a85ef801-3db0-4c56-93a7-532d1b4afbf1/process/682e212e-242d-4b4d-999b-e6ea4757f595/>
+        rdf:type                     wfprov:ProcessRun ;
+        wfprov:describedByProcess    <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/Concatenate_two_strings/> ;
+        prov:wasAssociatedWith       <#taverna-engine> ;
+        prov:startedAtTime           "2014-05-28T11:49:43.601+01:00"^^xsd:dateTime ;
+        wfprov:wasPartOfWorkflowRun  <http://ns.taverna.org.uk/2011/run/a85ef801-3db0-4c56-93a7-532d1b4afbf1/> ;
+        wfprov:usedInput             <http://ns.taverna.org.uk/2011/data/a85ef801-3db0-4c56-93a7-532d1b4afbf1/ref/d3d2e008-af7f-4c8c-9369-85d2d71c8121> ;
+        rdfs:label                   "Processor execution Concatenate_two_strings"@en ;
+        prov:used                    <http://ns.taverna.org.uk/2011/data/a85ef801-3db0-4c56-93a7-532d1b4afbf1/ref/d3d2e008-af7f-4c8c-9369-85d2d71c8121> ;
+        prov:qualifiedAssociation    _:b7 ;
+        wfprov:wasEnactedBy          <#taverna-engine> ;
+        prov:endedAtTime             "2014-05-28T11:49:43.711+01:00"^^xsd:dateTime ;
+        prov:qualifiedUsage          _:b19 ;
+        prov:qualifiedEnd            _:b4 ;
+        prov:qualifiedStart          _:b1 ;
+        wfprov:usedInput             <http://ns.taverna.org.uk/2011/data/a85ef801-3db0-4c56-93a7-532d1b4afbf1/ref/3a82e39d-a537-40cf-91a0-2c89d4a2e62b> ;
+        prov:qualifiedUsage          _:b13 ;
+        prov:used                    <http://ns.taverna.org.uk/2011/data/a85ef801-3db0-4c56-93a7-532d1b4afbf1/ref/3a82e39d-a537-40cf-91a0-2c89d4a2e62b> .
+
+<http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/in/name>
+        rdfs:comment  "Workflow input name"@en ;
+        rdfs:label    "name" ;
+        rdf:type      wfdesc:Input ;
+        rdf:type      prov:Role .
+
+_:b10   prov:atTime  "2014-05-28T11:49:43.461+01:00"^^xsd:dateTime ;
+        rdf:type     prov:End .
+
+_:b19   prov:hadRole  <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/Concatenate_two_strings/in/string1> ;
+        prov:entity   <http://ns.taverna.org.uk/2011/data/a85ef801-3db0-4c56-93a7-532d1b4afbf1/ref/3a82e39d-a537-40cf-91a0-2c89d4a2e62b> ;
+        rdf:type      prov:Usage .
+
+<http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/hello/>
+        rdfs:label  "Processor hello"@en ;
+        rdf:type    wfdesc:Process ;
+        rdf:type    prov:Plan .
+
+_:b16   prov:atTime  "2014-05-28T11:49:43.166+01:00"^^xsd:dateTime ;
+        rdf:type     prov:Start .
+
+<http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/>
+        dct:hasPart           <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/Concatenate_two_strings/> ;
+        wfdesc:hasSubProcess  <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/Concatenate_two_strings/> ;
+        dct:hasPart           <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/hello/> ;
+        wfdesc:hasSubProcess  <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/hello/> ;
+        rdf:type              wfdesc:Workflow ;
+        rdf:type              prov:Plan .
+
+<http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/hello/out/value>
+        rdfs:comment  "hello output value"@en ;
+        rdfs:label    "value" ;
+        rdf:type      wfdesc:Output ;
+        rdf:type      prov:Role .
+
+<inputs/name.txt>  rdf:type    cnt:ContentAsText ;
+        cnt:characterEncoding  "UTF-8"^^xsd:string ;
+        cnt:chars              "fred"^^xsd:string ;
+        tavernaprov:byteCount  "4"^^xsd:long ;
+        tavernaprov:sha512     "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e"^^xsd:string ;
+        tavernaprov:sha1       "31017a722665e4afce586950f42944a6d331dabf"^^xsd:string ;
+        rdf:type               tavernaprov:Content .
+
+_:b9    prov:hadPlan  <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/hello/> ;
+        prov:agent    <#taverna-engine> ;
+        rdf:type      prov:Association .
+
+_:b17   prov:hadRole   <http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/Concatenate_two_strings/out/output> ;
+        prov:activity  <http://ns.taverna.org.uk/2011/run/a85ef801-3db0-4c56-93a7-532d1b4afbf1/process/682e212e-242d-4b4d-999b-e6ea4757f595/> ;
+        rdf:type       prov:Generation .
+
+<#taverna-engine>  rdf:type  tavernaprov:TavernaEngine .
+
+<http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/processor/Concatenate_two_strings/>
+        rdfs:label  "Processor Concatenate_two_strings"@en ;
+        rdf:type    wfdesc:Process ;
+        rdf:type    prov:Plan .
+
+<http://ns.taverna.org.uk/2010/workflowBundle/01348671-5aaa-4cc2-84cc-477329b70b0d/workflow/Hello_Anyone/out/greeting>
+        rdfs:comment  "Workflow output greeting"@en ;
+        rdfs:label    "greeting" ;
+        rdf:type      wfdesc:Output ;
+        rdf:type      prov:Role .
+
+_:b18   prov:atTime  "2014-05-28T10:49:45.674Z"^^xsd:dateTime ;
+        rdf:type     prov:End .
+
+_:b14   prov:atTime  "2014-05-28T11:49:43.736+01:00"^^xsd:dateTime ;
+        rdf:type     prov:End .

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov/example/helloanyone.t2flow
----------------------------------------------------------------------
diff --git a/taverna-prov/example/helloanyone.t2flow b/taverna-prov/example/helloanyone.t2flow
new file mode 100644
index 0000000..c691d21
--- /dev/null
+++ b/taverna-prov/example/helloanyone.t2flow
@@ -0,0 +1,177 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.2.0"><dataflow id="01348671-5aaa-4cc2-84cc-477329b70b0d" role="top"><name>Hello_Anyone</name><inputPorts><port><name>name</name><depth>0</depth><granularDepth>0</granularDepth><annotations><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.ExampleValue">
+        <text>World!</text>
+      </annotationBean>
+      <date>2012-01-03 15:13:04.106 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.FreeTextDescription">
+        <text>Your name for the greeting</text>
+      </annotationBean>
+      <date>2012-01-03 15:13:12.530 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain></annotations></port></inputPorts><outputPorts><port><name>greeting</name><annotations /></port></outputPorts><processors><processor><name>hello</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>Hello, </value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>Concatenate_two_strings</name><inputPorts><port><name>string1</name><depth>0</depth></port><port><name>string2</name><depth>0</depth></port></inputPorts><outputPorts><port><name>output</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivi
 ty</class><inputMap><map from="string2" to="string2" /><map from="string1" to="string1" /></inputMap><outputMap><map from="output" to="output" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <localworkerName>org.embl.ebi.escience.scuflworkers.java.StringConcat</localworkerName>
+  <script>output = string1 + string2;</script>
+  <dependencies />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>string1</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>string2</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>0</granularDepth>
+      <name>output</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="string1" depth="0" /><port name="string2" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>Concatenate_two_strings</processor><port>string1</port></sink><source type="processor"><processor>hello</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>Concatenate_two_strings</processor><port>string2</port></sink><source type="dataflow"><port>name</port></source></datalink><datalin
 k><sink type="dataflow"><port>greeting</port></sink><source type="processor"><processor>Concatenate_two_strings</processor><port>output</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>8781d5f4-d0ba-48a8-a1d1-14281bd8a917</identification>
+      </annotationBean>
+      <date>2012-01-03 15:12:21.684 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>ca7dba1d-1fdf-476f-b911-714d09227d70</identification>
+      </annotationBean>
+      <date>2012-01-03 15:14:18.734 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.Author">
+        <text>Stian Soiland-Reyes</text>
+      </annotationBean>
+      <date>2012-01-03 15:10:48.73 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.DescriptiveTitle">
+        <text>Hello Anyone</text>
+      </annotationBean>
+      <date>2012-01-03 15:14:25.703 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.DescriptiveTitle">
+        <text>Hello World</text>
+      </annotationBean>
+      <date>2012-01-03 15:10:54.167 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.FreeTextDescription">
+        <text>One of the simplest workflows possible, outputting the String Constant "Hello world!"</text>
+      </annotationBean>
+      <date>2012-01-03 15:11:14.557 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.FreeTextDescription">
+        <text>An extension to helloworld.t2flow - this workflow takes a workflow input "name" which is combined with the string constant "Hello, " using the local worker "Concatenate two strings", and outputs the produced string to the workflow output "greeting".</text>
+      </annotationBean>
+      <date>2012-01-03 15:14:13.847 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.FreeTextDescription">
+        <text>One of the simplest workflows possible. No workflow input ports, a single workflow output port "greeting",  outputting "Hello, world!" as produced by the String Constant "hello".</text>
+      </annotationBean>
+      <date>2012-01-03 15:12:15.643 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>01348671-5aaa-4cc2-84cc-477329b70b0d</identification>
+      </annotationBean>
+      <date>2012-01-03 15:14:30.45 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file


[31/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/t2flow/apiconsumer.t2flow
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/t2flow/apiconsumer.t2flow b/taverna-platform-integration-tests/src/test/resources/t2flow/apiconsumer.t2flow
new file mode 100644
index 0000000..66ef4ac
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/t2flow/apiconsumer.t2flow
@@ -0,0 +1,178 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3.0"><dataflow id="8bf2b5e5-a3e0-4fbd-bfd2-aefc7b2a6b8a" role="top"><name>Workflow4</name><inputPorts><port><name>in</name><depth>0</depth><granularDepth>0</granularDepth><annotations /></port></inputPorts><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>String</name><inputPorts><port><name>string</name><depth>0</depth></port></inputPorts><outputPorts><port><name>object</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>apiconsumer-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.apiconsumer.ApiConsumerActivity</class><inputMap><map from="string" to="string" /></inputMap><outputMap><map from="object" to="object" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.apic
 onsumer.ApiConsumerActivityConfigurationBean xmlns="">
+  <inputs />
+  <outputs />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <apiConsumerName>No name</apiConsumerName>
+  <apiConsumerDescription>No description</apiConsumerDescription>
+  <description />
+  <className>java.lang.String</className>
+  <methodName>String</methodName>
+  <parameterNames>
+    <string>string</string>
+  </parameterNames>
+  <parameterDimensions>
+    <int>0</int>
+  </parameterDimensions>
+  <parameterTypes>
+    <string>java.lang.String</string>
+  </parameterTypes>
+  <returnType>java.lang.String</returnType>
+  <returnDimension>0</returnDimension>
+  <isMethodStatic>false</isMethodStatic>
+  <isMethodConstructor>true</isMethodConstructor>
+</net.sf.taverna.t2.activities.apiconsumer.ApiConsumerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="string" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>toUpperCase</name><inputPorts><port><name>object</name><depth>0</depth></port></inputPorts><outputPorts><port><name>result</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>apiconsumer-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.apiconsumer.ApiConsumerActivity</cl
 ass><inputMap><map from="object" to="object" /></inputMap><outputMap><map from="result" to="result" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.apiconsumer.ApiConsumerActivityConfigurationBean xmlns="">
+  <inputs />
+  <outputs />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <apiConsumerName>No name</apiConsumerName>
+  <apiConsumerDescription>No description</apiConsumerDescription>
+  <description />
+  <className>java.lang.String</className>
+  <methodName>toUpperCase</methodName>
+  <parameterNames />
+  <parameterDimensions />
+  <parameterTypes />
+  <returnType>java.lang.String</returnType>
+  <returnDimension>0</returnDimension>
+  <isMethodStatic>false</isMethodStatic>
+  <isMethodConstructor>false</isMethodConstructor>
+</net.sf.taverna.t2.activities.apiconsumer.ApiConsumerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="object" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>String</processor><port>string</port></sink><source type="dataflow"><port>in</port></source></datalink><datalink><sink type="processor"><processor>toUpperCase</processor><port>object</port></sink><source type="processor"><processor>String</processor><port>object</port></source></datalink><datalink><sink type="dataflow"><port>out</port></sink><source type="proc
 essor"><processor>toUpperCase</processor><port>result</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>483d65c6-98c1-4b94-b628-d5bcbf351e97</identification>
+      </annotationBean>
+      <date>2011-05-16 13:07:03.385 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>d460e60a-43bb-47fc-a9f4-89e15274b100</identification>
+      </annotationBean>
+      <date>2011-11-02 12:43:09.911 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>0d977496-aa5d-4274-9827-85400d5f13a2</identification>
+      </annotationBean>
+      <date>2011-05-16 13:06:33.69 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>8bf2b5e5-a3e0-4fbd-bfd2-aefc7b2a6b8a</identification>
+      </annotationBean>
+      <date>2011-11-02 12:46:41.313 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>58f30a52-57df-46ce-b1bb-b9533984f8dd</identification>
+      </annotationBean>
+      <date>2011-11-02 12:29:15.575 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>c2693c41-1373-48cf-afbe-d8bbe0ea9e35</identification>
+      </annotationBean>
+      <date>2011-11-02 12:31:01.678 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>1ce7f3a0-71f4-4794-8bbd-dbb6de42442d</identification>
+      </annotationBean>
+      <date>2011-05-16 12:57:01.975 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>4c2b6995-eecb-47a7-b72c-63cfb96b6852</identification>
+      </annotationBean>
+      <date>2011-11-02 12:43:51.355 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>225db881-4e07-4cdb-920c-343dc1536edc</identification>
+      </annotationBean>
+      <date>2011-05-16 13:10:54.588 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>404e203c-ce51-4a9f-907c-1dab7f2eaaa2</identification>
+      </annotationBean>
+      <date>2011-05-16 12:44:02.533 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>0b6881f1-aa8d-483e-a7bb-7ad38b1da778</identification>
+      </annotationBean>
+      <date>2011-05-16 12:26:38.721 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/t2flow/beanshell.t2flow
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/t2flow/beanshell.t2flow b/taverna-platform-integration-tests/src/test/resources/t2flow/beanshell.t2flow
new file mode 100644
index 0000000..8c5968c
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/t2flow/beanshell.t2flow
@@ -0,0 +1,137 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.2.0"><dataflow id="78cb1427-d57f-42c2-a385-1d20c1580f3b" role="top"><name>Workflow13</name><inputPorts><port><name>in</name><depth>0</depth><granularDepth>0</granularDepth><annotations /></port></inputPorts><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>Echo</name><inputPorts><port><name>in</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>beanshell-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.beanshell.BeanshellActivity</class><inputMap><map from="in" to="in" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfi
 gurationBean xmlns="">
+  <script>out=in;</script>
+  <dependencies />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>0</granularDepth>
+      <name>out</name>
+      <depth>0</depth>
+      <mimeTypes />
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>ListGenerator</name><inputPorts><port><name>in</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>1</depth><granularDepth>1</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>beanshell-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.beanshell.BeanshellActivity</class><inputMap><
 map from="in" to="in" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean xmlns="">
+  <script>out = new ArrayList();
+
+for (int i = 0; i &lt; 1000; i++) {
+  out.add(in + ":" + i);
+}</script>
+  <dependencies />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>1</granularDepth>
+      <name>out</name>
+      <depth>1</depth>
+      <mimeTypes />
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>Echo</processor><port>in</port></sink><source type="processor"><processor>ListGenerator</processor><port>out</port></source></datalink><datalink><sink type="processor"><processor>ListGenerator</processor><port>in</port></sink><source type="dataflow"><port>in</port></source></datalink><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><
 processor>Echo</processor><port>out</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>13c70169-dfaa-4ea6-b6ab-3551dae7fa84</identification>
+      </annotationBean>
+      <date>2010-08-19 12:28:57.881 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>7ef10e93-7376-41a9-9255-552149094142</identification>
+      </annotationBean>
+      <date>2010-08-31 13:06:57.536 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>3b7c0b9c-572d-466b-af6d-0fb40699e8a5</identification>
+      </annotationBean>
+      <date>2010-08-31 12:50:40.306 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>eb6a550d-f34e-4de9-b0fc-1b3df8ab36c4</identification>
+      </annotationBean>
+      <date>2010-08-31 14:32:44.634 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>78cb1427-d57f-42c2-a385-1d20c1580f3b</identification>
+      </annotationBean>
+      <date>2010-08-31 14:36:00.297 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>ad638364-a6e0-4852-abca-9f609c9553d2</identification>
+      </annotationBean>
+      <date>2010-08-19 13:43:43.797 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/t2flow/biomart.t2flow
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/t2flow/biomart.t2flow b/taverna-platform-integration-tests/src/test/resources/t2flow/biomart.t2flow
new file mode 100644
index 0000000..f82f340
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/t2flow/biomart.t2flow
@@ -0,0 +1,30 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3.0"><dataflow id="4a959e22-8166-4e8b-ae94-6e85c8807e35" role="top"><name>Workflow1</name><inputPorts /><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>btaurus_gene_ensembl</name><inputPorts /><outputPorts><port><name>btaurus_gene_ensembl.ensembl_gene_id</name><depth>1</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>biomart-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.biomart.BiomartActivity</class><inputMap /><outputMap><map from="btaurus_gene_ensembl.ensembl_gene_id" to="btaurus_gene_ensembl.ensembl_gene_id" /></outputMap><configBean encoding="jdomxml"><MartQuery xmlns=""><MartService location="http://www.biomart.org/biomart/martservice" /><MartDataset displayName="Bos taurus genes (UMD3.1)" nam
 e="btaurus_gene_ensembl" type="TableSet" initialBatchSize="200" maximumBatchSize="50000" visible="false" interface="default" modified="2011-09-07 22:16:01"><MartURLLocation database="ensembl_mart_64" default="1" displayName="ENSEMBL GENES 64 (SANGER UK)" host="www.biomart.org" includeDatasets="" martUser="" name="ensembl" path="/biomart/martservice" port="80" serverVirtualSchema="default" virtualSchema="default" visible="1" redirect="0" /></MartDataset><Query virtualSchemaName="default" count="0" uniqueRows="1" softwareVersion="0.6" requestId="taverna"><Dataset name="btaurus_gene_ensembl"><Attribute name="ensembl_gene_id" /><Filter name="chromosome_name" value="1" /><Filter name="with_affy_bovine" excluded="0" /><Filter name="go_evidence_code" value="IDA" /></Dataset></Query></MartQuery></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><cla
 ss>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>btaurus_gene_ensembl</processor><port>btaurus_gene_ensembl.ensembl_gene_id</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>4a959e22-8166-4e8b-ae94-6e85c8807e35</identification>
+      </annotationBean>
+      <date>2011-10-27 14:33:16.228 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>5859741c-a0ba-4dae-8b81-1dd7c928562f</identification>
+      </annotationBean>
+      <date>2011-10-27 14:32:47.106 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/t2flow/dataflow.t2flow
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/t2flow/dataflow.t2flow b/taverna-platform-integration-tests/src/test/resources/t2flow/dataflow.t2flow
new file mode 100644
index 0000000..c9366c2
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/t2flow/dataflow.t2flow
@@ -0,0 +1,217 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3.0"><dataflow id="ac4ce40a-57b9-486c-bb4c-eb8609c6cc48" role="top"><name>Workflow1</name><inputPorts><port><name>in</name><depth>0</depth><granularDepth>0</granularDepth><annotations /></port></inputPorts><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>Nested_workflow</name><inputPorts><port><name>in</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>dataflow-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.dataflow.DataflowActivity</class><inputMap><map from="in" to="in" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="dataflow"><dataflow ref="c6b258ac-3588-4828-b71c-207bad8b63c4" /
 ></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>echo</name><inputPorts><port><name>in</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>beanshell-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.beanshell.BeanshellActivity</class><inputMap><map from=
 "in" to="in" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>in</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>out</name>
+      <depth>0</depth>
+      <mimeTypes />
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>out = in;</script>
+  <dependencies />
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>echo_2</name><inputPorts><port><name>in</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>beanshell-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.beanshell.BeanshellActivity</class><inputMap><map fro
 m="in" to="in" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>in</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>out</name>
+      <depth>0</depth>
+      <mimeTypes />
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>out = in;</script>
+  <dependencies />
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>Nested_workflow</processor><port>in</port></sink><source type="processor"><processor>echo</processor><port>out</port></source></datalink><datalink><sink type="processor"><processor>echo</processor><port>in</port></sink><source type="dataflow"><port>in</port></source></datalink><datalink><sink type="processor"><processor>echo_2</processor><port>in</port></sink><sou
 rce type="processor"><processor>Nested_workflow</processor><port>out</port></source></datalink><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>echo_2</processor><port>out</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>437a237a-03a0-489f-97c6-fd5acc5db18e</identification>
+      </annotationBean>
+      <date>2011-11-09 10:59:10.221 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>ae7626c8-13a4-4560-9496-59a8cc0693be</identification>
+      </annotationBean>
+      <date>2011-02-16 11:57:10.514 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>96d450ff-aaf8-473b-91a1-4acce7371c3b</identification>
+      </annotationBean>
+      <date>2011-02-16 11:55:55.618 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>ac4ce40a-57b9-486c-bb4c-eb8609c6cc48</identification>
+      </annotationBean>
+      <date>2011-11-09 11:02:29.60 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>9f957cde-a7ad-4453-a09f-7231c8c8c4f3</identification>
+      </annotationBean>
+      <date>2011-02-16 11:52:40.88 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>f847ed6f-2834-4861-a8af-73ab737c6a91</identification>
+      </annotationBean>
+      <date>2011-11-09 11:00:41.783 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow><dataflow id="c6b258ac-3588-4828-b71c-207bad8b63c4" role="nested"><name>Workflow4</name><inputPorts><port><name>in</name><depth>0</depth><granularDepth>0</granularDepth><annotations /></port></inputPorts><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>echo</name><inputPorts><port><name>in</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>beanshell-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.beanshell.BeanshellActivity</class><inputMap><map from="in" to="in" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivit
 yConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>in</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>out</name>
+      <depth>0</depth>
+      <mimeTypes />
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>out = "nested dataflow : " + in;</script>
+  <dependencies />
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>echo</processor><port>in</port></sink><source type="dataflow"><port>in</port></source></datalink><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>echo</processor><port>out</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>f8dd3fb7-7051-4242-a3af-d82056934cf6</identification>
+      </annotationBean>
+      <date>2011-02-16 11:55:01.559 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>0a0b6f17-8ebf-4017-ad4c-0719a9d44806</identification>
+      </annotationBean>
+      <date>2011-11-09 11:00:37.241 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>c6b258ac-3588-4828-b71c-207bad8b63c4</identification>
+      </annotationBean>
+      <date>2011-11-09 11:02:26.99 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>eaa8b2a0-e71b-4d6a-b8ad-c299a8ad6e18</identification>
+      </annotationBean>
+      <date>2011-02-16 11:53:12.59 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/t2flow/in-out.t2flow
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/t2flow/in-out.t2flow b/taverna-platform-integration-tests/src/test/resources/t2flow/in-out.t2flow
new file mode 100644
index 0000000..8901a8d
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/t2flow/in-out.t2flow
@@ -0,0 +1,23 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3-SNAPSHOT-20100817"><dataflow id="ad638364-a6e0-4852-abca-9f609c9553d2" role="top"><name>Workflow13</name><inputPorts><port><name>in</name><depth>0</depth><granularDepth>0</granularDepth><annotations /></port></inputPorts><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors /><conditions /><datalinks><datalink><sink type="dataflow"><port>out</port></sink><source type="dataflow"><port>in</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.impl.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.impl.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.impl.annotationbeans.IdentificationAssertion">
+        <identification>13c70169-dfaa-4ea6-b6ab-3551dae7fa84</identification>
+      </annotationBean>
+      <date>2010-08-19 12:28:57.881 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.impl.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.impl.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.impl.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.impl.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.impl.annotationbeans.IdentificationAssertion">
+        <identification>ad638364-a6e0-4852-abca-9f609c9553d2</identification>
+      </annotationBean>
+      <date>2010-08-19 13:43:43.797 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.impl.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.impl.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/t2flow/input.txt
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/t2flow/input.txt b/taverna-platform-integration-tests/src/test/resources/t2flow/input.txt
new file mode 100644
index 0000000..aa3bc42
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/t2flow/input.txt
@@ -0,0 +1 @@
+test input value
\ No newline at end of file


[36/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/resources/t2flow/soaplab.t2flow
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/resources/t2flow/soaplab.t2flow b/taverna-integration-tests/src/test/resources/t2flow/soaplab.t2flow
new file mode 100644
index 0000000..994883d
--- /dev/null
+++ b/taverna-integration-tests/src/test/resources/t2flow/soaplab.t2flow
@@ -0,0 +1,95 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.4.0"><dataflow id="3b0501ac-876a-4f53-b172-4cc259e591e7" role="top"><name>Retrieve_sequence_in_EMBL_format</name><inputPorts /><outputPorts><port><name>sequence</name><annotations /></port></outputPorts><processors><processor><name>sequence_feature</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>true</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>sequence_id</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" to="value" /></outputMap><configBean encoding="xstream"><net.s
 f.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>embl:x52524</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>sequence_format</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" to="value" /></outputMap><configBean encoding="xstream"><n
 et.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>embl</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>seqret</name><inputPorts><port><name>feature</name><depth>0</depth></port><port><name>osformat_outseq</name><depth>0</depth></port><port><name>sequence_usa</name><depth>0</depth></port></inputPorts><outputPorts><port><name>outseq</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>soaplab-activity</artifact><version>1.4</version></raven><class>net.sf.taverna.t2
 .activities.soaplab.SoaplabActivity</class><inputMap><map from="osformat_outseq" to="osformat_outseq" /><map from="feature" to="feature" /><map from="sequence_usa" to="sequence_usa" /></inputMap><outputMap><map from="outseq" to="outseq" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.soaplab.SoaplabActivityConfigurationBean xmlns="">
+  <endpoint>http://wsembnet.vital-it.ch/soaplab2-axis/services/data_retrieval.seqret</endpoint>
+  <pollingInterval>0</pollingInterval>
+  <pollingBackoff>1.0</pollingBackoff>
+  <pollingIntervalMax>0</pollingIntervalMax>
+</net.sf.taverna.t2.activities.soaplab.SoaplabActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.4</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="feature" depth="0" /><port name="osformat_outseq" depth="0" /><port name="sequence_usa" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>seqret</processor><port>feature</port></sink><source type="processor"><processor>sequence_feature</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>seqret</processor><port>osformat_outseq</port></sink><source type="processor"><processor>se
 quence_format</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>seqret</processor><port>sequence_usa</port></sink><source type="processor"><processor>sequence_id</processor><port>value</port></source></datalink><datalink><sink type="dataflow"><port>sequence</port></sink><source type="processor"><processor>seqret</processor><port>outseq</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>db8053e3-1837-42cc-ba27-5fd0a83f119e</identification>
+      </annotationBean>
+      <date>2010-07-04 16:49:51.364 UTC</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.Author">
+        <text>Franck Tanoh</text>
+      </annotationBean>
+      <date>2009-12-15 20:21:20.965 UTC</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.FreeTextDescription">
+        <text>This workflow retrieves a sequence associated with its features in embl format</text>
+      </annotationBean>
+      <date>2009-12-15 20:21:39.30 UTC</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.DescriptiveTitle">
+        <text>Retrieve sequence in EMBL format</text>
+      </annotationBean>
+      <date>2009-12-15 20:21:29.202 UTC</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>3b0501ac-876a-4f53-b172-4cc259e591e7</identification>
+      </annotationBean>
+      <date>2013-10-03 13:08:21.76 UTC</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/resources/t2flow/spreadsheetimport.t2flow
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/resources/t2flow/spreadsheetimport.t2flow b/taverna-integration-tests/src/test/resources/t2flow/spreadsheetimport.t2flow
new file mode 100644
index 0000000..7360186
--- /dev/null
+++ b/taverna-integration-tests/src/test/resources/t2flow/spreadsheetimport.t2flow
@@ -0,0 +1,646 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3.0"><dataflow id="fa4ef38e-fa3f-4662-97e5-59c3b51aa322" role="top"><name>Spreadsheet_Import_Example</name><inputPorts /><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>SpreadsheetImport</name><inputPorts><port><name>fileurl</name><depth>0</depth></port></inputPorts><outputPorts><port><name>other</name><depth>1</depth><granularDepth>1</granularDepth></port><port><name>other_industry</name><depth>1</depth><granularDepth>1</granularDepth></port><port><name>year</name><depth>1</depth><granularDepth>1</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>spreadsheet-import-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.spreadsheet.SpreadsheetImportActivity</class><inputMap><map from="fileurl" to="fileurl" /></inputMap><outputMap><ma
 p from="other" to="other" /><map from="year" to="year" /><map from="other_industry" to="other_industry" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.spreadsheet.SpreadsheetImportConfiguration xmlns="">
+  <columnRange>
+    <start>1</start>
+    <end>6</end>
+    <excludes />
+  </columnRange>
+  <rowRange>
+    <start>7</start>
+    <end>41</end>
+    <excludes />
+  </rowRange>
+  <emptyCellValue />
+  <columnNames>
+    <entry>
+      <string>D</string>
+      <string>other</string>
+    </entry>
+    <entry>
+      <string>E</string>
+      <string>fish_farming</string>
+    </entry>
+    <entry>
+      <string>F</string>
+      <string>other_industry</string>
+    </entry>
+    <entry>
+      <string>G</string>
+      <string>public_water_supply</string>
+    </entry>
+    <entry>
+      <string>A</string>
+      <string>over</string>
+    </entry>
+    <entry>
+      <string>B</string>
+      <string>year</string>
+    </entry>
+    <entry>
+      <string>C</string>
+      <string>electricity</string>
+    </entry>
+    <entry>
+      <string>L</string>
+      <string>2001</string>
+    </entry>
+    <entry>
+      <string>N</string>
+      <string>2002</string>
+    </entry>
+    <entry>
+      <string>H</string>
+      <string>1999</string>
+    </entry>
+    <entry>
+      <string>J</string>
+      <string>2000</string>
+    </entry>
+    <entry>
+      <string>T</string>
+      <string>2005</string>
+    </entry>
+    <entry>
+      <string>V</string>
+      <string>2006</string>
+    </entry>
+    <entry>
+      <string>P</string>
+      <string>2003</string>
+    </entry>
+    <entry>
+      <string>R</string>
+      <string>2004</string>
+    </entry>
+    <entry>
+      <string>X</string>
+      <string>2007</string>
+    </entry>
+    <entry>
+      <string>Z</string>
+      <string>2008</string>
+    </entry>
+  </columnNames>
+  <allRows>false</allRows>
+  <excludeFirstRow>false</excludeFirstRow>
+  <ignoreBlankRows>false</ignoreBlankRows>
+  <emptyCellPolicy>EMPTY_STRING</emptyCellPolicy>
+  <outputFormat>PORT_PER_COLUMN</outputFormat>
+  <csvDelimiter>,</csvDelimiter>
+</net.sf.taverna.t2.activities.spreadsheet.SpreadsheetImportConfiguration></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="fileurl" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>url_value</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" to="val
 ue" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>http://www.myexperiment.org/files/410/download/WaterUse.xlsx</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>SpreadsheetImport</processor><port>fileurl</port></sink><source type="processor"><processor>url_value</processor><port>value</port></source></datalink><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>SpreadsheetImport</processor><port>year</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChai
 nImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>41265789-c464-4ee2-b145-95ece9388305</identification>
+      </annotationBean>
+      <date>2010-07-07 22:34:29.364 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>b4363407-ef56-4cf3-998f-8e780a8dc816</identification>
+      </annotationBean>
+      <date>2010-07-07 16:41:31.230 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>486a5356-0f3e-424d-b14e-249295875f2d</identification>
+      </annotationBean>
+      <date>2010-07-13 12:31:34.664 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.Author">
+        <text>David Withers</text>
+      </annotationBean>
+      <date>2010-07-13 11:09:24.988 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>cf60043b-e08a-49d7-a150-711f413d3d18</identification>
+      </annotationBean>
+      <date>2010-07-07 22:52:10.583 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>812e7abc-4866-43dc-b9d4-44370a399e4e</identification>
+      </annotationBean>
+      <date>2010-07-07 17:23:44.739 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>cca71cbe-6d97-4896-90c2-d91016f12882</identification>
+      </annotationBean>
+      <date>2010-07-07 22:45:31.148 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>e28f14b3-e4ae-4d0b-893d-3a8400625069</identification>
+      </annotationBean>
+      <date>2010-07-07 16:10:13.994 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>e263e793-b394-4a57-855e-13e69b8780c2</identification>
+      </annotationBean>
+      <date>2010-07-07 17:00:11.782 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>14724df6-fee6-4b24-8fbc-eeeeb3dc4e61</identification>
+      </annotationBean>
+      <date>2010-07-07 16:38:21.137 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>6622310c-9440-45a1-a051-729487b00b46</identification>
+      </annotationBean>
+      <date>2010-07-13 12:32:33.863 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>d8b96d03-8431-4cc0-b032-51e0c32092d3</identification>
+      </annotationBean>
+      <date>2010-07-07 17:27:09.166 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>cee35c36-afaf-4093-bcc5-eaac292207f5</identification>
+      </annotationBean>
+      <date>2010-07-07 16:02:30.469 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>64b51b72-af09-4842-b034-293dee7a03ff</identification>
+      </annotationBean>
+      <date>2010-07-07 22:40:56.858 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>4462bd43-bcec-4aaf-83e5-64e111668a64</identification>
+      </annotationBean>
+      <date>2010-07-07 23:00:20.619 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>58b3ac31-cfb3-418a-85ae-1990b2883c35</identification>
+      </annotationBean>
+      <date>2010-07-07 22:57:04.585 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>980d729b-1ec7-492c-9dfd-ccb19f9e81a7</identification>
+      </annotationBean>
+      <date>2010-07-07 22:59:09.755 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>6d9b5609-37c3-4fb1-9eea-e6b70209427e</identification>
+      </annotationBean>
+      <date>2010-07-07 14:05:03.421 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>9a2e5f63-ee29-42f3-810e-dc54fa9dfe3c</identification>
+      </annotationBean>
+      <date>2010-07-07 16:59:16.81 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>fa4ef38e-fa3f-4662-97e5-59c3b51aa322</identification>
+      </annotationBean>
+      <date>2011-11-02 15:41:32.280 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>6f16e5e6-7e90-44af-9e7a-f63785e5408e</identification>
+      </annotationBean>
+      <date>2010-07-07 22:53:58.943 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>d533c230-a40d-4f9b-9ad4-f4389d4a6f1f</identification>
+      </annotationBean>
+      <date>2010-07-07 16:00:00.482 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>7d1166bd-dfa5-4675-918c-a880314302cb</identification>
+      </annotationBean>
+      <date>2010-07-07 16:04:08.606 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>23eec6e0-9a32-461c-bd90-ba03bdc49d41</identification>
+      </annotationBean>
+      <date>2010-07-07 17:25:28.613 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>464013e1-0699-4e1a-bac7-047576261b33</identification>
+      </annotationBean>
+      <date>2010-07-07 23:07:59.655 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>8af7971d-f944-4f27-b62a-437be1b99d3c</identification>
+      </annotationBean>
+      <date>2010-07-07 16:07:29.140 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>a5bbe32f-ad20-4411-bc0e-d8f693e95493</identification>
+      </annotationBean>
+      <date>2010-07-07 22:55:54.366 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>30c2f2c6-dbd5-4e7a-9620-f6e8526fb9bc</identification>
+      </annotationBean>
+      <date>2010-07-07 23:04:59.33 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>9c2e4b9c-5f25-4416-8653-cd9198a9271e</identification>
+      </annotationBean>
+      <date>2010-07-13 11:19:30.143 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>c0753ab7-cd9d-400e-b483-048dcbaad5f9</identification>
+      </annotationBean>
+      <date>2010-07-07 16:36:44.391 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>99e82825-40e1-4fa9-8cf4-5348a8ff7b82</identification>
+      </annotationBean>
+      <date>2010-07-07 22:38:24.439 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>2c1532f6-0ba4-48ea-9bf4-3fd3e39c6289</identification>
+      </annotationBean>
+      <date>2010-07-07 14:00:56.585 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>92d8fa84-2553-4de1-bff5-7d2a9b53c58d</identification>
+      </annotationBean>
+      <date>2010-07-07 17:31:19.499 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>f0fe1955-23d6-41b7-b1af-b36d641429b4</identification>
+      </annotationBean>
+      <date>2010-07-07 17:24:52.98 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>47de0484-f703-40ab-b1f7-b0826495a00d</identification>
+      </annotationBean>
+      <date>2010-07-07 23:09:23.782 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>7ca4b117-111d-4605-826e-868d7d159b52</identification>
+      </annotationBean>
+      <date>2010-07-13 11:16:32.697 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>99c992df-d200-4cda-a973-c60be723e784</identification>
+      </annotationBean>
+      <date>2010-07-07 17:14:16.5 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>58a4da02-d1f0-41ce-9ace-8a62b49b62d7</identification>
+      </annotationBean>
+      <date>2010-07-13 11:22:26.72 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>a752e401-77c5-42ef-9bf8-a60aa8af73f5</identification>
+      </annotationBean>
+      <date>2010-07-07 22:50:42.557 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.DescriptiveTitle">
+        <text>Spreadsheet Import Example</text>
+      </annotationBean>
+      <date>2010-07-13 11:22:34.496 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>dfa2cd09-f53d-47f4-91cd-207ec2dc2c34</identification>
+      </annotationBean>
+      <date>2010-07-07 16:51:22.4 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>31ac21d6-7c10-48ff-b9b2-82cac03f55c9</identification>
+      </annotationBean>
+      <date>2010-07-07 22:43:05.458 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>70c23010-0b47-424e-a1ce-73c040c3d3c6</identification>
+      </annotationBean>
+      <date>2010-07-07 16:43:47.690 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.FreeTextDescription">
+        <text>Example using the SpreadsheetImport service to import data from an Excel spreadsheet.
+The workflow imports the file spreadsheet file WaterUse.xlsx and generates a graph from the date.
+The source data is from http://data.gov.uk/</text>
+      </annotationBean>
+      <date>2010-07-13 11:16:31.908 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>27965b7c-1a89-46ac-8c9b-a4c6bf9144f0</identification>
+      </annotationBean>
+      <date>2010-07-13 11:22:36.27 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>6c2a0ecf-5d91-4722-adf6-607c912ed54c</identification>
+      </annotationBean>
+      <date>2010-07-07 16:54:20.460 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>808e3725-2a08-4907-9706-fb7f0f08f62f</identification>
+      </annotationBean>
+      <date>2010-07-13 11:20:05.749 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>6e069c36-8d88-4017-96cf-c1fa87007777</identification>
+      </annotationBean>
+      <date>2010-07-07 16:20:48.694 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>73ce4e99-6b83-45d0-8605-896d6d48b7f0</identification>
+      </annotationBean>
+      <date>2010-07-07 17:01:14.713 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/resources/t2flow/stringconstant.t2flow
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/resources/t2flow/stringconstant.t2flow b/taverna-integration-tests/src/test/resources/t2flow/stringconstant.t2flow
new file mode 100644
index 0000000..41266d0
--- /dev/null
+++ b/taverna-integration-tests/src/test/resources/t2flow/stringconstant.t2flow
@@ -0,0 +1,32 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.2.0"><dataflow id="48c5c70e-ffde-4ff0-8508-015577ab263c" role="top"><name>Workflow1</name><inputPorts /><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>String_constant</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>Test Value</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>String_constant</processor><port>value</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>48c5c70e-ffde-4ff0-8508-015577ab263c</identification>
+      </annotationBean>
+      <date>2010-12-14 11:57:31.126 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>186f09f7-d9a7-4ae2-bf84-8ee83f41f4e3</identification>
+      </annotationBean>
+      <date>2010-12-14 11:56:50.253 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/resources/t2flow/tool.t2flow
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/resources/t2flow/tool.t2flow b/taverna-integration-tests/src/test/resources/t2flow/tool.t2flow
new file mode 100644
index 0000000..d77a851
--- /dev/null
+++ b/taverna-integration-tests/src/test/resources/t2flow/tool.t2flow
@@ -0,0 +1,158 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3.0"><dataflow id="82a5216a-8b82-41db-a114-ece396f9b85c" role="top"><name>Workflow4</name><inputPorts /><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>Tool</name><inputPorts><port><name>in1</name><depth>0</depth></port><port><name>in2</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>external-tool-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.externaltool.ExternalToolActivity</class><inputMap><map from="in2" to="in2" /><map from="in1" to="in1" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.externaltool.ExternalToolActivityConfigurationBean
  xmlns="">
+  <mechanismType>789663B8-DA91-428A-9F7D-B3F3DA185FD4</mechanismType>
+  <mechanismName>default local</mechanismName>
+  <mechanismXML>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&#xD;
+&lt;localInvocation&gt;&lt;shellPrefix&gt;/bin/sh -c&lt;/shellPrefix&gt;&lt;linkCommand&gt;/bin/ln -s %%PATH_TO_ORIGINAL%% %%TARGET_NAME%%&lt;/linkCommand&gt;&lt;/localInvocation&gt;&#xD;
+</mechanismXML>
+  <externaltoolid>607ceaee-59ba-4cbb-a650-84e51d8498e3</externaltoolid>
+  <useCaseDescription>
+    <usecaseid />
+    <description />
+    <command>cat in1 &gt; out; echo %%in2%% &gt;&gt; out
+ </command>
+    <preparingTimeoutInSeconds>1200</preparingTimeoutInSeconds>
+    <executionTimeoutInSeconds>1800</executionTimeoutInSeconds>
+    <tags>
+      <string>in2</string>
+    </tags>
+    <REs />
+    <queue__preferred />
+    <queue__deny />
+    <static__inputs>
+      <de.uni__luebeck.inb.knowarc.usecases.ScriptInputStatic>
+        <tag>hi</tag>
+        <file>true</file>
+        <tempFile>false</tempFile>
+        <binary>false</binary>
+        <charsetName>MacRoman</charsetName>
+        <forceCopy>false</forceCopy>
+        <content class="string">hi</content>
+      </de.uni__luebeck.inb.knowarc.usecases.ScriptInputStatic>
+      <de.uni__luebeck.inb.knowarc.usecases.ScriptInputStatic>
+        <tag>google</tag>
+        <file>true</file>
+        <tempFile>false</tempFile>
+        <binary>false</binary>
+        <charsetName>MacRoman</charsetName>
+        <forceCopy>false</forceCopy>
+        <url>http://www.google.com/</url>
+      </de.uni__luebeck.inb.knowarc.usecases.ScriptInputStatic>
+    </static__inputs>
+    <inputs>
+      <entry>
+        <string>in2</string>
+        <de.uni__luebeck.inb.knowarc.usecases.ScriptInputUser>
+          <tag>in2</tag>
+          <file>false</file>
+          <tempFile>false</tempFile>
+          <binary>false</binary>
+          <charsetName>MacRoman</charsetName>
+          <forceCopy>false</forceCopy>
+          <list>false</list>
+          <concatenate>false</concatenate>
+          <mime />
+        </de.uni__luebeck.inb.knowarc.usecases.ScriptInputUser>
+      </entry>
+      <entry>
+        <string>in1</string>
+        <de.uni__luebeck.inb.knowarc.usecases.ScriptInputUser>
+          <tag>in1</tag>
+          <file>true</file>
+          <tempFile>false</tempFile>
+          <binary>false</binary>
+          <charsetName>MacRoman</charsetName>
+          <forceCopy>false</forceCopy>
+          <list>false</list>
+          <concatenate>false</concatenate>
+          <mime />
+        </de.uni__luebeck.inb.knowarc.usecases.ScriptInputUser>
+      </entry>
+    </inputs>
+    <outputs>
+      <entry>
+        <string>out</string>
+        <de.uni__luebeck.inb.knowarc.usecases.ScriptOutput>
+          <path>out</path>
+          <binary>false</binary>
+          <mime />
+        </de.uni__luebeck.inb.knowarc.usecases.ScriptOutput>
+      </entry>
+    </outputs>
+    <includeStdIn>false</includeStdIn>
+    <includeStdOut>true</includeStdOut>
+    <includeStdErr>true</includeStdErr>
+    <validReturnCodes>
+      <int>0</int>
+    </validReturnCodes>
+  </useCaseDescription>
+  <edited>false</edited>
+</net.sf.taverna.t2.activities.externaltool.ExternalToolActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in1" depth="0" /><port name="in2" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>in_value</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><
 map from="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>Hello</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>in2_value</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.
 taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>World</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>Tool</processor><port>in1</port></sink><source type="processor"><processor>in_value</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>Tool</processor><port>in2</port></sink><source type="processor"><processor>in2_value</processor><port>value</port></source></datalink><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>Tool</processor>
 <port>out</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>6090defe-8eba-4775-8dd6-ab48813d23ab</identification>
+      </annotationBean>
+      <date>2011-10-27 18:50:36.777 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>8312a5c9-b291-4a20-a468-0cdd8888115b</identification>
+      </annotationBean>
+      <date>2011-10-27 18:46:58.794 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>82a5216a-8b82-41db-a114-ece396f9b85c</identification>
+      </annotationBean>
+      <date>2011-11-10 17:19:20.269 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>436555c3-0df8-4e5c-93f3-313124bf045c</identification>
+      </annotationBean>
+      <date>2011-10-27 18:52:22.981 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file


[48/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/main/java/net/sf/taverna/t2/security/credentialmanager/impl/CredentialManagerImpl.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/main/java/net/sf/taverna/t2/security/credentialmanager/impl/CredentialManagerImpl.java b/taverna-credential-manager-impl/src/main/java/net/sf/taverna/t2/security/credentialmanager/impl/CredentialManagerImpl.java
new file mode 100644
index 0000000..3d66c1a
--- /dev/null
+++ b/taverna-credential-manager-impl/src/main/java/net/sf/taverna/t2/security/credentialmanager/impl/CredentialManagerImpl.java
@@ -0,0 +1,2657 @@
+/*******************************************************************************
+ * Copyright (C) 2008-2014 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.security.credentialmanager.impl;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.lang.reflect.Method;
+import java.math.BigInteger;
+import java.net.Authenticator;
+import java.net.Socket;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.security.Key;
+import java.security.KeyManagementException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.Principal;
+import java.security.PrivateKey;
+import java.security.SecureRandom;
+import java.security.Security;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import javax.crypto.spec.SecretKeySpec;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.KeyManager;
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSocketFactory;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactory;
+import javax.net.ssl.X509ExtendedKeyManager;
+import javax.net.ssl.X509KeyManager;
+import javax.net.ssl.X509TrustManager;
+import static javax.security.auth.x500.X500Principal.RFC2253;
+import net.sf.taverna.t2.lang.observer.MultiCaster;
+import net.sf.taverna.t2.lang.observer.Observable;
+import net.sf.taverna.t2.lang.observer.Observer;
+import net.sf.taverna.t2.security.credentialmanager.CMException;
+import net.sf.taverna.t2.security.credentialmanager.CredentialManager;
+import static net.sf.taverna.t2.security.credentialmanager.CredentialManager.KeystoreType.KEYSTORE;
+import static net.sf.taverna.t2.security.credentialmanager.CredentialManager.KeystoreType.TRUSTSTORE;
+import net.sf.taverna.t2.security.credentialmanager.DistinguishedNameParser;
+import net.sf.taverna.t2.security.credentialmanager.JavaTruststorePasswordProvider;
+import net.sf.taverna.t2.security.credentialmanager.KeystoreChangedEvent;
+import net.sf.taverna.t2.security.credentialmanager.MasterPasswordProvider;
+import net.sf.taverna.t2.security.credentialmanager.ParsedDistinguishedName;
+import net.sf.taverna.t2.security.credentialmanager.ServiceUsernameAndPasswordProvider;
+import net.sf.taverna.t2.security.credentialmanager.TrustConfirmationProvider;
+import net.sf.taverna.t2.security.credentialmanager.UsernamePassword;
+import org.apache.commons.io.FileUtils;
+import org.apache.log4j.Logger;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import uk.org.taverna.configuration.app.ApplicationConfiguration;
+
+/**
+ * Provides an implementation of {@link #CredentialManagerService}.
+ * 
+ * @author Alex Nenadic
+ * @author Stian Soiland-Reyes
+ */
+
+public class CredentialManagerImpl implements CredentialManager,
+		Observable<KeystoreChangedEvent> {
+	/** Various passwords to try for the Java's default truststore. */
+	public static List<String> defaultTrustStorePasswords = Arrays.asList(
+			System.getProperty(PROPERTY_TRUSTSTORE_PASSWORD, ""), "changeit",
+			"changeme", "");
+
+	// For Taverna 2.2 and older - Keystore was BC-type with user-set password
+	// and Truststore was JKS-type with the default password
+	public static final String OLD_TRUSTSTORE_PASSWORD = "Tu/Ap%2_$dJt6*+Rca9v";
+	public static final String OLD_T2TRUSTSTORE_FILE = "t2truststore.jks";
+
+	private static Logger logger = Logger
+			.getLogger(CredentialManagerImpl.class);
+
+	// Multicaster of KeystoreChangedEventS
+	private MultiCaster<KeystoreChangedEvent> multiCaster = new MultiCaster<>(
+			this);
+
+	/**
+	 * A directory containing Credential Manager's Keystore/Truststore/etc.
+	 * files.
+	 */
+	private File credentialManagerDirectory = null;
+
+	/**
+	 * Master password for Credential Manager - used to create/access the
+	 * Keystore and Truststore.
+	 */
+	private String masterPassword;
+
+	// Keystore file
+	private File keystoreFile = null;
+
+	// Truststore file
+	private File truststoreFile = null;
+
+	/**
+	 * Keystore containing user's passwords and private keys with corresponding
+	 * public key certificate chains.
+	 */
+	private KeyStore keystore;
+
+	/**
+	 * Truststore containing trusted certificates of CA authorities and services
+	 * (servers).
+	 */
+	private KeyStore truststore;
+
+	/**
+	 * Has the Credential Manager been initialized (i.e. the Keystore/Truststore
+	 * loaded, etc.)
+	 */
+	private boolean isInitialized = false;
+
+	/*
+	 * Whether SSLSocketFactory has been initialised with Taverna's
+	 * Keystore/Truststore. Actually tavernaSSLSocketFactory==null? check tells
+	 * us if Taverna's SSLSocketFactory has been initialised
+	 */
+	// private static boolean sslInitialized = false;
+
+	private static SSLSocketFactory tavernaSSLSocketFactory;
+
+	/**
+	 * Observer of changes to the Keystore and Truststore that updates the
+	 * default SSLContext and SSLSocketFactory at the single location rather
+	 * than all over the code when changes to the keystores occur.
+	 */
+	private KeystoreChangedObserver keystoresChangedObserver = new KeystoreChangedObserver();
+
+	/**
+	 * Cached list of all services that have a username/password entry in the
+	 * Keystore
+	 */
+	private List<URI> cachedServiceURIsList = null;
+
+	/**
+	 * Cached map of all URI fragments to their original URIs for services that
+	 * have a username/password entry in the Keystore. This is normally used to
+	 * recursively discover the realm of the service for HTTP authentication so
+	 * we do not have to ask user for their username and password for every
+	 * service in the same realm.
+	 */
+	private HashMap<URI, URI> cachedServiceURIsMap = null;
+
+	// Observer that clears the above list and map on any change to the Keystore
+	private ClearCachedServiceURIsObserver clearCachedServiceURIsObserver = new ClearCachedServiceURIsObserver();
+
+	/** A list of master password providers */
+	private List<MasterPasswordProvider> masterPasswordProviders;
+
+	/**
+	 * A list of Java truststore password (used to encrypt/decrypt the Java's
+	 * default truststore) providers
+	 */
+	private List<JavaTruststorePasswordProvider> javaTruststorePasswordProviders;
+
+	/** A list of providers of usernames and passwords for services */
+	private List<ServiceUsernameAndPasswordProvider> serviceUsernameAndPasswordProviders;
+
+	/** A list of providers of trust confirmation for services */
+	private List<TrustConfirmationProvider> trustConfirmationProviders;
+
+	private ApplicationConfiguration applicationConfiguration;
+
+	private File certificatesRevokedIndicatorFile;
+	
+        private DistinguishedNameParser dnParser = new DistinguishedNameParserImpl();
+
+	/**
+	 * Return an array of URLs for 'special' trusted CAs' certificates contained in
+	 * the resources folder that need to be loaded into Truststore, so that we can establish trust 
+	 * into services such as BioCatalogue, BiodiversityCatalogue, heater, etc. by default.
+	 * */
+	private static List<URL> getSpecialTrustedCertificates() {
+		List<URL> urls = new ArrayList<>();
+		Class<?> c = CredentialManager.class;
+		urls.add(c.getResource("/trusted-certificates/TERENASSLCA.crt"));
+		urls.add(c.getResource("/trusted-certificates/UTNAddTrustServer_CA.crt"));
+		urls.add(c.getResource("/trusted-certificates/AddTrustExternalCARoot.crt"));
+		return urls;
+	}
+
+	/**
+	 * Connects this credential manager to the Java {@linkplain Authenticator HTTP authenticator mechanism}.
+	 */
+	public void installAuthenticator() {
+		Authenticator.setDefault(new CredentialManagerAuthenticator(this));
+	}
+
+	public void deleteRevokedCertificates(){
+		
+		if (truststore != null){
+			// Delete the old revoked or unnecessary BioCatalogue,
+			// BiodiversityCatalogue and heater's certificates, if present
+			
+			if (certificatesRevokedIndicatorFile == null){
+				certificatesRevokedIndicatorFile = new File(credentialManagerDirectory, CERTIFICATES_REVOKED_INDICATOR_FILE_NAME);
+			}
+			
+			if (!certificatesRevokedIndicatorFile.exists()) {
+				
+				List<URL> certURLsToDelete = new ArrayList<>();
+				Class<?> c = CredentialManager.class;
+				certURLsToDelete.add(c.getResource("/trusted-certificates/www.biocatalogue.org-revoked.pem"));
+				certURLsToDelete.add(c.getResource("/trusted-certificates/www.biodiversitycatalogue.org-revoked.pem"));
+				certURLsToDelete.add(c.getResource("/trusted-certificates/heater.cs.man.ac.uk-not-needed.pem"));
+
+				for (URL certURLToDelete : certURLsToDelete){
+					try (InputStream certStreamToDelete = certURLToDelete.openStream()) {					
+						// We know there will be only one cert in the chain
+						CertificateFactory cf = CertificateFactory
+								.getInstance("X.509");
+						Certificate certToDelete = cf.generateCertificates(certStreamToDelete).toArray(new Certificate[0])[0];
+						String aliasToDelete = truststore
+								.getCertificateAlias(certToDelete);						
+						if (aliasToDelete != null) {
+							truststore.deleteEntry(aliasToDelete);
+							logger.warn("Deleting revoked/unnecessary certificate "
+									+ aliasToDelete);
+						}
+					} catch (Exception ex) {
+						logger.info("Can't delete revoked certificate " + certURLToDelete, ex);
+					}
+				}
+				
+				// Touch the file
+				try {
+					FileUtils
+							.touch(certificatesRevokedIndicatorFile);
+				} catch (IOException ioex) {
+					// Hmmm, ignore this?
+					logger.error("Failed to touch " + certificatesRevokedIndicatorFile.getAbsolutePath(), ioex);
+				}
+			}
+			
+			//Save changes
+			try{
+				FileOutputStream fos = new FileOutputStream(truststoreFile);
+				truststore.store(fos, masterPassword.toCharArray());
+			}
+			catch(Exception ex){
+				String exMessage = "Failed to save Truststore after deleting revoked certificates.";
+				logger.error(exMessage, ex);
+			}
+		}
+	}
+
+	public CredentialManagerImpl() throws CMException {
+		/*
+		 * Make sure we have BouncyCastle provider installed, just in case
+		 * (needed for some tests and reading PKCS#12 keystores)
+		 */
+		Security.addProvider(new BouncyCastleProvider());
+
+		/*
+		 * Open the files stored in the (DEFAULT!!!) Credential Manager's
+		 * directory
+		 */
+		// loadDefaultConfigurationFiles();
+		// FIXME
+		/*
+		 * Get the location of the directory containing the Keystore and
+		 * Truststore somehow - from OSGi's Configuration Service
+		 */
+
+		// initialize();
+	}
+
+	/**
+	 * Initialize Credential Manager - load the Keystore and Truststore.
+	 */
+	private void initialize() throws CMException {
+		/*
+		 * Only do this if the Credential Manager has not been initialized so
+		 * far
+		 */
+		if (!isInitialized) {
+			masterPassword = getMasterPassword();
+
+			this.addObserver(clearCachedServiceURIsObserver);
+			this.addObserver(keystoresChangedObserver);
+
+			// Load the Keystore
+			try {
+				loadKeystore();
+				logger.info("loaded the Keystore");
+			} catch (CMException cme) {
+				isInitialized = false;
+				masterPassword = null; // just in case we need to try again
+				// logger.error(cme.getMessage(), cme);
+				throw cme;
+			}
+
+			// Load the Truststore
+			try {
+				loadTruststore();
+				logger.info("loaded the Truststore");
+			} catch (CMException cme) {
+				isInitialized = false;
+				masterPassword = null; // just in case we need to try again
+				// logger.error(cme.getMessage(), cme);
+				throw cme;
+			}
+
+			isInitialized = true;
+		}
+	}
+
+	/**
+	 * Get the master password from the available providers.
+	 * 
+	 * @return master password
+	 * @throws CMException
+	 *             if none of the providers can provide a non-null master
+	 *             password
+	 */
+	private String getMasterPassword() throws CMException {
+		if (masterPassword != null)
+			return masterPassword;
+
+		if (keystoreFile == null)
+			loadDefaultSecurityFiles();
+
+		boolean firstTime = !keystoreFile.exists();
+
+		/**
+		 * Master password providers are already sorted by their priority by the
+		 * OSGi framework
+		 */
+		for (MasterPasswordProvider masterPasswordProvider : masterPasswordProviders) {
+			// FIXME how to handle default password providers!?
+			String password = masterPasswordProvider
+					.getMasterPassword(firstTime);
+			if (password != null)
+				return password;
+		}
+
+		/*
+		 * We are in big trouble - we do not have a single master password
+		 * provider.
+		 */
+		String exMessage = "Failed to obtain master password from providers: "
+				+ masterPasswordProviders;
+		logger.error(exMessage);
+		throw new CMException(exMessage);
+	}
+
+	/**
+	 * Load Taverna's Keystore from a file on the disk.
+	 */
+	private void loadKeystore() throws CMException {
+		if (keystore == null) {
+			try {
+				// Try to create Taverna's Keystore as Bouncy Castle UBER-type
+				// keystore.
+				keystore = KeyStore.getInstance("UBER", "BC");
+			} catch (Exception ex) {
+				// The requested keystore type is not available from security
+				// providers.
+				throw new CMException("Failed to instantiate Taverna's Keystore.", ex);
+			}
+
+			if (keystoreFile.exists()) { // If the file exists, open it
+				// Try to load the Keystore
+				try (FileInputStream fis = new FileInputStream(keystoreFile)) {
+					// Load the Keystore from the file
+					keystore.load(fis, masterPassword.toCharArray());
+				} catch (Exception ex) {
+					keystore = null; // make it null as it was just created but
+										// failed to load so it is not null
+					masterPassword = null; // it is probably the wrong password
+											// so do not remember it just in
+											// case
+					String exMessage = "Failed to load Taverna's Keystore from "
+							+ keystoreFile.getAbsolutePath()
+							+ ". Possible reason: incorrect password or corrupted file.";
+					logger.error(exMessage, ex);
+					throw new CMException(exMessage, ex);
+				}
+			} else {
+				// Otherwise create a new empty Keystore
+				try (FileOutputStream fos = new FileOutputStream(keystoreFile)) {
+					keystore.load(null, null);
+					// Immediately save the new (empty) Keystore to the file
+					keystore.store(fos, masterPassword.toCharArray());
+				} catch (Exception ex) {
+					String exMessage = "Failed to generate a new empty Keystore.";
+					// logger.error(exMessage, ex);
+					throw new CMException(exMessage, ex);
+				}
+			}
+
+			/*
+			 * Taverna distro for MAC contains info.plist file with some Java
+			 * system properties set to use the Keychain which clashes with what
+			 * we are setting here so we need to clear them
+			 */
+			System.clearProperty(PROPERTY_KEYSTORE_TYPE);
+			System.clearProperty(PROPERTY_KEYSTORE_PROVIDER);
+
+			/*
+			 * Not quite sure why we still need to set these two properties
+			 * since we are creating our own SSLSocketFactory with our own
+			 * KeyManager that uses Taverna's Keystore, but seem like after
+			 * Taverna starts up and the first time it needs SSLSocketFactory
+			 * for HTTPS connection it is still using the default Java's
+			 * keystore unless these properties are set. Set the system property
+			 * "javax.net.ssl.keystore" to use Taverna's keystore.
+			 *
+			 * Axis 1 likes reading from these properties but seems to work as
+			 * well with Taverna's SSLSocetFactory as well. We do not want to
+			 * expose these as they can be read from Beanshells.
+			 */
+			// System.setProperty(PROPERTY_KEYSTORE, keystoreFile.getAbsolutePath());
+			// System.setProperty(PROPERTY_KEYSTORE_PASSWORD, masterPassword);
+			System.clearProperty(PROPERTY_KEYSTORE);
+			System.clearProperty(PROPERTY_KEYSTORE_PASSWORD);
+		}
+	}
+
+	/**
+	 * Load Taverna's Truststore from a file on a disk. If the Truststore does
+	 * not already exist, a new empty one will be created and contents of Java's
+	 * truststore located in <JAVA_HOME>/lib/security/cacerts will be copied
+	 * over to the Truststore.
+	 */
+	private void loadTruststore() throws CMException {
+		if (truststore == null) {
+			try {
+				// Try to create Taverna's Truststore as Bouncy Castle UBER-type
+				// keystore.
+				truststore = KeyStore.getInstance("UBER", "BC");
+			} catch (Exception ex) {
+				// The requested keystore type is not available from security
+				// providers.
+				throw new CMException("Failed to instantiate Taverna's Truststore", ex);
+			}
+
+			if (truststoreFile.exists()) {
+				// If the Truststore file already exists, open it and load the
+				// Truststore
+				try (FileInputStream fis = new FileInputStream(truststoreFile)) {
+					// Load the Truststore from the file
+					truststore.load(fis, masterPassword.toCharArray());
+					
+					// Delete the old revoked or unnecessary BioCatalogue,
+					// BiodiversityCatalogue and heater's certificates, if present
+					deleteRevokedCertificates();
+					
+				} catch (Exception ex) {
+					/* Clear out things that are useless/hindering now */
+					truststore = null;
+					masterPassword = null;
+					String exMessage = "Failed to load Taverna's Truststore from "
+							+ truststoreFile.getAbsolutePath()
+							+ ". Possible reason: incorrect password or corrupted file.";
+					logger.error(exMessage, ex);
+					throw new CMException(exMessage, ex);
+				}
+			} else {
+				/*
+				 * Otherwise create a new empty Truststore and load it with
+				 * certs from Java's truststore.
+				 */
+				File javaTruststoreFile = new File(
+						System.getProperty("java.home"), "lib/security/cacerts");
+				KeyStore javaTruststore = null;
+
+				// Java's truststore is of type "JKS" - try to load it
+				try {
+					javaTruststore = KeyStore.getInstance("JKS");
+				} catch (Exception ex) {
+					// The requested keystore type is not available from the
+					// provider
+					throw new CMException("Failed to instantiate a 'JKS'-type keystore "
+							+ "for reading Java's truststore.", ex);
+				}
+
+				boolean loadedJavaTruststore = false;
+				/*
+				 * Load Java's truststore from the file - try with the default
+				 * Java truststore passwords.
+				 */
+				for (String password : defaultTrustStorePasswords) {
+					logger.info("Trying to load Java truststore using password: "
+							+ password);
+					try (FileInputStream fis = new FileInputStream(
+							javaTruststoreFile)) {
+						javaTruststore.load(fis, password.toCharArray());
+						loadedJavaTruststore = true;
+						break;
+					} catch (IOException ioex) {
+						/*
+						 * If there is an I/O or format problem with the
+						 * keystore data, or if the given password was incorrect
+						 * (Thank you Sun, now I can't know if it is the file or
+						 * the password..)
+						 */
+						logger.info(String
+								.format("Failed to load the Java truststore to copy "
+										+ "over certificates using default password: "
+										+ "%s from %s", password,
+										javaTruststoreFile));
+					} catch (NoSuchAlgorithmException e) {
+						logger.error("Unknown encryption algorithm "
+								+ "while loading Java truststore from "
+								+ javaTruststoreFile, e);
+						break;
+					} catch (CertificateException e) {
+						logger.error("Certificate error while "
+								+ "loading Java truststore from "
+								+ javaTruststoreFile, e);
+						break;
+					}
+				}
+
+				/*
+				 * Default Java truststore passwords failed - possibly the user
+				 * has changed it. Ask the Java truststore password providers if
+				 * they can help - this will typically pop up a dialog to ask
+				 * the user if we are in a graphical environment. If not, we
+				 * will simply not copy the default truststore certificates into
+				 * Credential Manager's Truststore.
+				 */
+				if (!loadedJavaTruststore)
+					if (!(loadJavaTruststoreUsingPasswordProviders(
+							javaTruststore, javaTruststoreFile))) {
+						String error = "Credential manager failed to load"
+								+ " certificates from Java's truststore.";
+						String help = "Try using the system property -D"
+								+ PROPERTY_TRUSTSTORE_PASSWORD
+								+ "=TheTrustStorePassword";
+						logger.error(error + " " + help);
+						// FIXME Writes to standard error!
+						System.err.println(error);
+						System.err.println(help);
+					}
+
+				// Create a new empty Truststore for Taverna
+				try (FileOutputStream fos = new FileOutputStream(truststoreFile)) {
+					truststore.load(null, null);
+					if (loadedJavaTruststore) {
+						// Copy certificates into Taverna's Truststore from
+						// Java's truststore.
+						Enumeration<String> aliases = javaTruststore.aliases();
+						while (aliases.hasMoreElements()) {
+							Certificate certificate = javaTruststore
+									.getCertificate(aliases.nextElement());
+							if (certificate instanceof X509Certificate)
+								truststore
+										.setCertificateEntry(
+												createTrustedCertificateAlias((X509Certificate) certificate),
+												certificate);
+						}
+					}
+
+					// Insert special trusted CA certificates
+					logger.info("Loading certificates of trusted CAs so as to establish trust into our services such as BioCatalogue, BiodiversityCatalogue, heater, etc.");	
+					CertificateFactory cf = CertificateFactory
+							.getInstance("X.509");
+					for (URL trustedCertURL : getSpecialTrustedCertificates())
+						// Load the certificate (possibly a chain) from the
+						// stream
+						try (InputStream stream = trustedCertURL.openStream()) {
+							for (Certificate c : cf
+									.generateCertificates(stream))
+								truststore
+										.setCertificateEntry(
+												createTrustedCertificateAlias((X509Certificate) c),
+												c);
+						} catch (Exception cex) {
+							logger.error("Failed to insert trusted certificate entry in the Truststore", cex);
+						}
+
+					// Immediately save the new Truststore to the file
+					truststore.store(fos, masterPassword.toCharArray());
+				} catch (Exception ex) {
+					/*
+					 * make truststore null as it was just created but failed to
+					 * save so we should retry next time
+					 */
+					truststore = null;
+					throw new CMException("Failed to generate new empty Taverna's Truststore", ex);
+				}
+			}
+
+			/*
+			 * Taverna distro for MAC contains info.plist file with some Java
+			 * system properties set to use the Keychain which clashes with what
+			 * we are setting here so we need to clear them.
+			 */
+			System.clearProperty(PROPERTY_TRUSTSTORE_TYPE);
+			System.clearProperty(PROPERTY_TRUSTSTORE_PROVIDER);
+
+			/*
+			 * Not quite sure why we still need to set these two properties
+			 * since we are creating our own SSLSocketFactory with our own
+			 * TrustManager that uses Taverna's Truststore, but seem like after
+			 * Taverna starts up and the first time it needs SSLSocketFactory
+			 * for HTTPS connection it is still using the default Java's
+			 * truststore unless these properties are set. Set the system
+			 * property "javax.net.ssl.Truststore" to use Taverna's truststore.
+			 */
+
+			/*
+			 * Axis 1 likes reading from these properties but seems to work as
+			 * well with Taverna's SSLSocetFactory as well. We do not want to
+			 * expose these as they can be read from Beanshells.
+			 */
+			// System.setProperty(PROPERTY_TRUSTSTORE, truststoreFile.getAbsolutePath());
+			// System.setProperty(PROPERTY_TRUSTSTORE_PASSWORD, masterPassword);
+			System.clearProperty(PROPERTY_TRUSTSTORE);
+			System.clearProperty(PROPERTY_TRUSTSTORE_PASSWORD);
+		}
+	}
+
+	/**
+	 * Load the given keystore (which is Java's default truststore) from the
+	 * given file (pointing to the Java's default truststore) using the
+	 * {@link JavaTruststorePasswordProvider}s lookup to obtain the password for
+	 * the keytore.
+	 * 
+	 * @param javaTruststore
+	 *            Java's default truststore
+	 * @param javaTruststoreFile
+	 *            Java's default truststore file
+	 * @return true if managed to load the keystore using the provided
+	 *         passwords; false otherwise
+	 */
+	private boolean loadJavaTruststoreUsingPasswordProviders(
+			KeyStore javaTruststore, File javaTruststoreFile) {
+		String javaTruststorePassword = null;
+		for (JavaTruststorePasswordProvider provider : javaTruststorePasswordProviders) {
+			javaTruststorePassword = provider.getJavaTruststorePassword();
+			if (javaTruststorePassword == null)
+				continue;
+			try (FileInputStream fis = new FileInputStream(javaTruststoreFile)) {
+				javaTruststore.load(fis, javaTruststorePassword.toCharArray());
+				return true;
+			} catch (Exception ex) {
+				String exMessage = "Failed to load the Java truststore to copy over certificates"
+						+ " using user-provided password from password provider "
+						+ provider;
+				logger.warn(exMessage, ex);
+				return false;
+			}
+		}
+		String exMessage = "No Java truststore password provider could unlock "
+				+ "Java's truststore. Creating a new empty "
+				+ "Truststore for Taverna.";
+		logger.error(exMessage);
+		return false;
+	}
+
+	/**
+	 * Get a username and password pair for the given service, or null if it
+	 * does not exit. The returned array contains username as the first element
+	 * and password as the second.
+	 * 
+	 * @deprecated Use
+	 *             {@link #getUsernameAndPasswordForService(URI, boolean, String)}
+	 *             instead
+	 */
+	@Deprecated
+	public String[] getUsernameAndPasswordForService(String serviceURL)
+			throws CMException {
+		// Need to make sure we are initialized before we do anything else
+		// as Credential Manager can be created but not initialized
+		initialize();
+
+		UsernamePassword usernamePassword = getUsernameAndPasswordForService(
+				URI.create(serviceURL), false, null);
+		if (usernamePassword == null)
+			return null;
+
+		String[] pair = new String[2];
+		pair[0] = usernamePassword.getUsername();
+		pair[1] = String.valueOf(usernamePassword.getPassword());
+		usernamePassword.resetPassword();
+		return pair;
+	}
+
+	/**
+	 * Get a username and password pair for the given service's URI, or null if
+	 * it does not exit.
+	 * <p>
+	 * If the username and password are not available in the Keystore, it will
+	 * invoke implementations of the {@link ServiceUsernameAndPasswordProvider}
+	 * interface asking the user (typically through the UI) or resolving
+	 * hard-coded credentials.
+	 * <p>
+	 * If the parameter <code>useURIPathRecursion</code> is true, then the
+	 * Credential Manager will also attempt to look for stored credentials for
+	 * each of the parent fragments of the URI.
+	 * 
+	 * @param serviceURI
+	 *            The URI of the service for which we are providing the username
+	 *            and password
+	 * @param useURIPathRecursion
+	 *            Whether to look for any username and passwords stored in the
+	 *            Keystore for the parent fragments of the service URI (for
+	 *            example, we are looking for the credentials for service
+	 *            http://somehost/some-fragment but we already have credentials
+	 *            stored for http://somehost which can be reused)
+	 * @param requestingMessage
+	 *            The message to be presented to the user when asking for the
+	 *            username and password, normally useful for UI providers that
+	 *            pop up dialogs, can be ignored otherwise
+	 * @return username and password pair for the given service
+	 * @throws CMException
+	 *             if anything goes wrong during Keystore lookup, etc.
+	 */
+	@Override
+	public UsernamePassword getUsernameAndPasswordForService(URI serviceURI,
+			boolean usePathRecursion, String requestingMessage)
+			throws CMException {
+		// Need to make sure we are initialized before we do anything else
+		// as Credential Manager can be created but not initialized
+		initialize();
+
+		synchronized (keystore) {
+			SecretKeySpec passwordKey = null;
+			LinkedHashSet<URI> possibleServiceURIsToLookup = getPossibleServiceURIsToLookup(
+					serviceURI, usePathRecursion);
+			Map<URI, URI> allServiceURIs = getFragmentMappedURIsForAllUsernameAndPasswordPairs();
+
+			try {
+				for (URI lookupURI : possibleServiceURIsToLookup) {
+					URI mappedURI = allServiceURIs.get(lookupURI);
+					if (mappedURI == null)
+						continue;
+
+					// We found it - get the username and password in the
+					// Keystore associated with this service URI
+					String alias = null;
+					alias = "password#" + mappedURI.toASCIIString();
+					passwordKey = (((SecretKeySpec) keystore.getKey(alias,
+							masterPassword.toCharArray())));
+					if (passwordKey == null) {
+						// Unexpected, it was just there in the map!
+						logger.warn("Could not find alias " + alias
+								+ " for known uri " + lookupURI
+								+ ", just deleted?");
+						// Remember we went outside synchronized(keystore) while
+						// looping
+						continue;
+					}
+					String unpasspair = new String(passwordKey.getEncoded(),
+							UTF_8);
+					/*
+					 * decoded key contains string
+					 * <USERNAME><SEPARATOR_CHARACTER><PASSWORD>
+					 */
+
+					int separatorAt = unpasspair
+							.indexOf(USERNAME_AND_PASSWORD_SEPARATOR_CHARACTER);
+					if (separatorAt < 0)
+						throw new CMException("Invalid credentials stored for "
+								+ lookupURI);
+
+					String username = unpasspair.substring(0, separatorAt);
+					String password = unpasspair.substring(separatorAt + 1);
+
+					UsernamePassword usernamePassword = new UsernamePassword();
+					usernamePassword.setUsername(username);
+					usernamePassword.setPassword(password.toCharArray());
+					return usernamePassword;
+				}
+
+				// Nothing found in the Keystore, let's lookup using the service
+				// username and password providers
+				for (ServiceUsernameAndPasswordProvider provider : serviceUsernameAndPasswordProviders) {
+					UsernamePassword usernamePassword = provider
+							.getServiceUsernameAndPassword(serviceURI,
+									requestingMessage);
+					if (usernamePassword == null)
+						continue;
+					if (usernamePassword.isShouldSave()) {
+						URI uri = serviceURI;
+						if (usePathRecursion)
+							uri = normalizeServiceURI(serviceURI);
+						addUsernameAndPasswordForService(usernamePassword, uri);
+					}
+					return usernamePassword;
+				}
+				// Giving up
+				return null;
+			} catch (Exception ex) {
+				String exMessage = "Failed to get the username and password pair for service "
+						+ serviceURI + " from the Keystore";
+				logger.error(exMessage, ex);
+				throw new CMException(exMessage, ex);
+			}
+		}
+	}
+
+	protected Map<URI, URI> getFragmentMappedURIsForAllUsernameAndPasswordPairs()
+			throws CMException {
+		synchronized (Security.class) {// FIXME synchonization on strange thing!
+			if (cachedServiceURIsMap == null) {
+				HashMap<URI, URI> map = new HashMap<>();
+				// Get all service URIs that have username and password in the
+				// Keystore
+				for (URI serviceURI : getServiceURIsForAllUsernameAndPasswordPairs()) {
+					// Always store 1-1, with or without fragment
+					map.put(serviceURI, serviceURI);
+					if (serviceURI.getFragment() == null)
+						continue;
+
+					// Look up the no-fragment uri as an additional mapping
+					URI noFragment;
+					try {
+						noFragment = dnParser
+								.setFragmentForURI(serviceURI, null);
+					} catch (URISyntaxException e) {
+						logger.warn("Could not reset fragment for service URI "
+								+ serviceURI);
+						continue;
+					}
+					if (map.containsKey(noFragment)) {
+						if (map.get(noFragment).getFragment() != null) {
+							// No mapping for duplicates
+							map.remove(noFragment);
+							continue;
+						} // else it's noFragment -> noFragment, which is OK
+					} else {
+						// Brand new, put it in
+						map.put(noFragment, serviceURI);
+					}
+				}
+				cachedServiceURIsMap = map;
+			}
+			return cachedServiceURIsMap;
+		}
+	}
+
+	/*
+	 * Creates a list of possible URIs to look up when searching for username
+	 * and password for a service with a given URI. This is mainly useful for
+	 * HTTP AuthN when we save the realm URI rather than the exact service URI
+	 * as we want that username and password pair to be used for the whole realm
+	 * and not bother user for credentials every time them access a URL from
+	 * that realm.
+	 */
+	protected LinkedHashSet<URI> getPossibleServiceURIsToLookup(URI serviceURI,
+			boolean usePathRecursion) {
+		try {
+			serviceURI = serviceURI.normalize();
+			serviceURI = dnParser.setUserInfoForURI(serviceURI, null);
+		} catch (URISyntaxException ex) {
+			logger.warn("Could not strip userinfo from " + serviceURI, ex);
+		}
+
+		/*
+		 * We'll use a LinkedHashSet to avoid checking for duplicates, like if
+		 * serviceURI.equals(withoutQuery) Only the first hit should be added to
+		 * the set.
+		 */
+		LinkedHashSet<URI> possibles = new LinkedHashSet<URI>();
+
+		possibles.add(serviceURI);
+		if (!usePathRecursion || !serviceURI.isAbsolute())
+			return possibles;
+
+		/*
+		 * We'll preserve the fragment, as it is used to indicate the realm
+		 */
+		String rawFragment = serviceURI.getRawFragment();
+		if (rawFragment == null)
+			rawFragment = "";
+
+		URI withoutQuery = serviceURI.resolve(serviceURI.getRawPath());
+		addFragmentedURI(possibles, withoutQuery, rawFragment);
+
+		// Immediate parent
+		URI parent = withoutQuery.resolve(".");
+		addFragmentedURI(possibles, parent, rawFragment);
+		URI oldParent = null;
+		// Top parent (to be added later)
+		URI root = parent.resolve("/");
+		while (!parent.equals(oldParent) && !parent.equals(root)
+				&& parent.getPath().length() > 0) {
+			// Intermediate parents, but not for "http://bla.org" as we would
+			// find "http://bla.org.."
+			oldParent = parent;
+			parent = parent.resolve("..");
+			addFragmentedURI(possibles, parent, rawFragment);
+		}
+		// In case while-loop did not do so, also include root
+		addFragmentedURI(possibles, root, rawFragment);
+		if (rawFragment.length() > 0)
+			// Add the non-fragment versions in the bottom of the list
+			for (URI withFragment : new ArrayList<>(possibles))
+				try {
+					possibles
+							.add(dnParser.setFragmentForURI(withFragment, null));
+				} catch (URISyntaxException e) {
+					logger.warn("Could not non-fragment URI " + withFragment);
+				}
+		return possibles;
+	}
+
+	public void addFragmentedURI(LinkedHashSet<URI> possibles, URI uri,
+			String rawFragment) {
+		if (rawFragment != null && rawFragment.length() > 0)
+			uri = uri.resolve("#" + rawFragment);
+		possibles.add(uri);
+	}
+
+	/**
+	 * Get service URLs associated with all username/password pairs currently in
+	 * the Keystore.
+	 * 
+	 * @deprecated
+	 * @see #getServiceURIsForAllUsernameAndPasswordPairs()
+	 */
+	@Deprecated
+	public ArrayList<String> getServiceURLsforAllUsernameAndPasswordPairs()
+			throws CMException {
+		// Need to make sure we are initialized before we do anything else
+		// as Credential Manager can be created but not initialized
+		initialize();
+
+		List<URI> uris = getServiceURIsForAllUsernameAndPasswordPairs();
+		ArrayList<String> serviceURLs = new ArrayList<>();
+		for (URI uri : uris)
+			serviceURLs.add(uri.toASCIIString());
+		return serviceURLs;
+	}
+
+	/**
+	 * Insert a username and password pair for the given service URI in the
+	 * Keystore.
+	 * <p>
+	 * Effectively, this method inserts a new secret key entry in the Keystore,
+	 * where key contains <USERNAME>"\000"<PASSWORD> string, i.e. password is
+	 * prepended with the username and separated by a \000 character (which
+	 * hopefully will not appear in the username).
+	 * <p>
+	 * Username and password string is saved in the Keystore as byte array using
+	 * SecretKeySpec (which constructs a secret key from the given byte array
+	 * but does not check if the given bytes indeed specify a secret key of the
+	 * specified algorithm).
+	 * <p>
+	 * An alias used to identify the username and password entry is constructed
+	 * as "password#"<SERVICE_URL> using the service URL this username/password
+	 * pair is to be used for.
+	 * 
+	 * @param usernamePassword
+	 *            The {@link UsernamePassword} to store
+	 * @param serviceURI
+	 *            The (possibly normalized) URI to store the credentials under
+	 * @throws CMException
+	 *             If the credentials could not be stored
+	 * @return the alias under which this username and password entry was saved
+	 *         in the Keystore
+	 */
+	@Override
+	public String addUsernameAndPasswordForService(
+			UsernamePassword usernamePassword, URI serviceURI)
+			throws CMException {
+		// Need to make sure we are initialized before we do anything else
+		// as Credential Manager can be created but not initialized
+		initialize();
+
+		String uriString = serviceURI.toASCIIString();
+		String alias = saveUsernameAndPasswordForService(
+				usernamePassword.getUsername(),
+				String.valueOf(usernamePassword.getPassword()), uriString);
+		return alias;
+	}
+
+	/**
+	 * Insert a new username and password pair in the Keystore for the given
+	 * service URL string.
+	 * <p>
+	 * Effectively, this method inserts a new secret key entry in the Keystore,
+	 * where key contains <USERNAME>"\000"<PASSWORD> string, i.e. password is
+	 * prepended with the username and separated by a \000 character.
+	 * <p>
+	 * Username and password string is saved in the Keystore as byte array using
+	 * SecretKeySpec (which constructs a secret key from the given byte array
+	 * but does not check if the given bytes indeed specify a secret key of the
+	 * specified algorithm).
+	 * <p>
+	 * An alias used to identify the username and password entry is constructed
+	 * as "password#"<SERVICE_URL> using the service URL this username/password
+	 * pair is to be used for.
+	 * <p>
+	 * 
+	 * @return the alias under which this username and password entry was saved
+	 *         in the Keystore
+	 * @deprecated Use
+	 *             {@link #addUsernameAndPasswordForService(UsernamePassword, URI)}
+	 *             instead
+	 */
+	@Deprecated
+	public String saveUsernameAndPasswordForService(String username,
+			String password, String serviceURL) throws CMException {
+		// Need to make sure we are initialized before we do anything else
+		// as Credential Manager can be created but not initialized
+		initialize();
+
+		String alias = null;
+
+		// Alias for the username and password entry
+		synchronized (keystore) {
+			alias = "password#" + serviceURL;
+			/*
+			 * Password (together with its related username) is wrapped as a
+			 * SecretKeySpec that implements SecretKey and constructs a secret
+			 * key from the given password as a byte array. The reason for this
+			 * is that we can only save instances of Key objects in the
+			 * Keystore, and SecretKeySpec class is useful for raw secret keys
+			 * (i.e. username and passwords concats) that can be represented as
+			 * a byte array and have no key or algorithm parameters associated
+			 * with them, e.g., DES or Triple DES. That is why we create it with
+			 * the name "DUMMY" for algorithm name, as this is not checked for
+			 * anyway.
+			 * 
+			 * Use a separator character that will not appear in the username or
+			 * password.
+			 */
+			String keyToSave = username
+					+ USERNAME_AND_PASSWORD_SEPARATOR_CHARACTER + password;
+
+			SecretKeySpec passwordKey;
+			try {
+				passwordKey = new SecretKeySpec(keyToSave.getBytes(UTF_8),
+						"DUMMY");
+			} catch (UnsupportedEncodingException e) {
+				throw new RuntimeException("Could not find encoding " + UTF_8);
+			}
+			try {
+				keystore.setKeyEntry(alias, passwordKey,
+						masterPassword.toCharArray(), null);
+				saveKeystore(KEYSTORE);
+				multiCaster.notify(new KeystoreChangedEvent(KEYSTORE));
+			} catch (Exception ex) {
+				String exMessage = "Failed to insert username and password pair for service "
+						+ serviceURL + " in the Keystore";
+				logger.error(exMessage, ex);
+				throw new CMException(exMessage, ex);
+			}
+		}
+
+		return alias;
+	}
+
+	/**
+	 * Delete a username and password pair for the given service URI from the
+	 * Keystore.
+	 */
+	@Override
+	public void deleteUsernameAndPasswordForService(URI serviceURI)
+			throws CMException {
+		// Need to make sure we are initialized before we do anything else
+		// as Credential Manager can be created but not initialized
+		initialize();
+
+		String uriString = serviceURI.toASCIIString();
+		deleteUsernameAndPasswordForService(uriString);
+	}
+
+	/**
+	 * Delete a username and password pair for the given service URL string from
+	 * the Keystore.
+	 * 
+	 * @deprecated Use
+	 *             {@link #deleteUsernameAndPasswordForService(URI serviceURI)}
+	 *             instead.
+	 */
+	@Deprecated
+	public void deleteUsernameAndPasswordForService(String serviceURL)
+			throws CMException {
+		// Need to make sure we are initialized before we do anything else
+		// as Credential Manager can be created but not initialized
+		initialize();
+
+		synchronized (keystore) {
+			deleteEntry(KEYSTORE, "password#" + serviceURL);
+			saveKeystore(KEYSTORE);
+			multiCaster.notify(new KeystoreChangedEvent(KEYSTORE));
+		}
+	}
+
+	/**
+	 * Insert a new key entry containing private key and the corresponding
+	 * public key certificate chain in the Keystore.
+	 * 
+	 * An alias used to identify the keypair entry is constructed as:
+	 * "keypair#"<CERT_SUBJECT_COMMON_NAME>"#"<CERT_ISSUER_COMMON_NAME>"#"<
+	 * CERT_SERIAL_NUMBER>
+	 * 
+	 * @return the alias under which this key entry was saved in the Keystore
+	 */
+	@Override
+	public String addKeyPair(Key privateKey, Certificate[] certs)
+			throws CMException {
+		// Need to make sure we are initialized before we do anything else
+		// as Credential Manager can be created but not initialized
+		initialize();
+
+		String alias = null;
+
+		synchronized (keystore) {
+			// Create an alias for the new key pair entry in the Keystore as
+			// "keypair#"<CERT_SUBJECT_COMMON_NAME>"#"<CERT_ISSUER_COMMON_NAME>"#"<CERT_SERIAL_NUMBER>
+			String ownerDN = ((X509Certificate) certs[0])
+					.getSubjectX500Principal().getName(RFC2253);
+			ParsedDistinguishedName parsedDN = dnParser.parseDN(ownerDN);
+			String ownerCN = parsedDN.getCN(); // owner's common name
+
+			// Get the hexadecimal representation of the certificate's serial
+			// number
+			String serialNumber = new BigInteger(1,
+					((X509Certificate) certs[0]).getSerialNumber()
+							.toByteArray()).toString(16).toUpperCase();
+
+			String issuerDN = ((X509Certificate) certs[0])
+					.getIssuerX500Principal().getName(RFC2253);
+			parsedDN = dnParser.parseDN(issuerDN);
+			String issuerCN = parsedDN.getCN(); // issuer's common name
+
+			alias = "keypair#" + ownerCN + "#" + issuerCN + "#" + serialNumber;
+
+			try {
+				keystore.setKeyEntry(alias, privateKey,
+						masterPassword.toCharArray(), certs);
+				saveKeystore(KEYSTORE);
+				multiCaster.notify(new KeystoreChangedEvent(KEYSTORE));
+
+				/*
+				 * This is now done from the KeystoresChangedObserver's notify
+				 * method. Update the default SSLSocketFactory used by the
+				 * HttpsURLConnectionS
+				 */
+				// HttpsURLConnection.setDefaultSSLSocketFactory(createTavernaSSLSocketFactory());
+				logger.debug("updating SSLSocketFactory after inserting a key pair");
+			} catch (Exception ex) {
+				throw new CMException("failed to insert "
+						+ "the key pair entry in the Keystore", ex);
+			}
+		}
+		return alias;
+	}
+
+	/**
+	 * Checks if the Keystore contains the given key pair entry (private key and
+	 * its corresponding public key certificate chain).
+	 */
+	@Override
+	public boolean hasKeyPair(Key privateKey, Certificate[] certs)
+			throws CMException {
+		// Create an alias for the new key pair entry in the Keystore as
+		// "keypair#"<CERT_SUBJECT_COMMON_NAME>"#"<CERT_ISSUER_COMMON_NAME>"#"<CERT_SERIAL_NUMBER>
+
+		String alias = createKeyPairAlias(privateKey, certs);
+		return hasEntryWithAlias(KEYSTORE, alias);
+	}
+
+	/**
+	 * Delete a key pair entry from the Keystore given its alias.
+	 */
+	@Override
+	public void deleteKeyPair(String alias) throws CMException {
+		// Need to make sure we are initialized before we do anything else
+		// as Credential Manager can be created but not initialized
+		initialize();
+
+		synchronized (keystore) {
+			deleteEntry(KEYSTORE, alias);
+			saveKeystore(KEYSTORE);
+			multiCaster.notify(new KeystoreChangedEvent(KEYSTORE));
+
+			/*
+			 * This is now done from the KeyManager's nad TrustManager's notify
+			 * methods. Update the default SSLSocketFactory used by the
+			 * HttpsURLConnectionS
+			 */
+			// HttpsURLConnection.setDefaultSSLSocketFactory(createTavernaSSLSocketFactory());
+
+			logger.info("updating SSLSocketFactory after deleting a keypair");
+		}
+	}
+
+	/**
+	 * Delete a key pair entry from the Keystore given its private and public
+	 * key parts.
+	 */
+	@Override
+	public void deleteKeyPair(Key privateKey, Certificate[] certs)
+			throws CMException {
+		deleteKeyPair(createKeyPairAlias(privateKey, certs));
+	}
+
+	/**
+	 * Export a key entry containing private key and public key certificate
+	 * chain from the Keystore to a PKCS #12 file.
+	 */
+	@Override
+	public void exportKeyPair(String alias, File exportFile,
+			String pkcs12Password) throws CMException {
+		// Need to make sure we are initialized before we do anything else
+		// as Credential Manager can be created but not initialized
+		initialize();
+
+		synchronized (keystore) {
+			// Export the key pair
+			try {
+				// Get the private key for the alias
+				PrivateKey privateKey = (PrivateKey) keystore.getKey(alias,
+						masterPassword.toCharArray());
+
+				// Get the related public key's certificate chain
+				Certificate[] certChain = getKeyPairsCertificateChain(alias);
+
+				// Create a new PKCS #12 keystore
+				KeyStore newPkcs12 = KeyStore.getInstance("PKCS12", "BC");
+				newPkcs12.load(null, null);
+
+				// Place the private key and certificate chain into the PKCS #12
+				// keystore. Construct a new alias as
+				// "<SUBJECT_COMMON_NAME>'s <ISSUER_ORGANISATION> ID"
+
+				String sDN = ((X509Certificate) certChain[0])
+						.getSubjectX500Principal().getName(RFC2253);
+                                
+                                ParsedDistinguishedName parsedDN = dnParser.parseDN(sDN);
+				String sCN = parsedDN.getCN();
+
+				String iDN = ((X509Certificate) certChain[0])
+						.getIssuerX500Principal().getName(RFC2253);
+                                parsedDN = dnParser.parseDN(iDN);
+				String iCN = parsedDN.getCN();
+
+				String pkcs12Alias = sCN + "'s " + iCN + " ID";
+				newPkcs12.setKeyEntry(pkcs12Alias, privateKey, new char[0],
+						certChain);
+
+				// Store the new PKCS #12 keystore on the disk
+				try (FileOutputStream fos = new FileOutputStream(exportFile)) {
+					newPkcs12.store(fos, pkcs12Password.toCharArray());
+				}
+			} catch (Exception ex) {
+				String exMessage = "Failed to export the key pair from the Keystore";
+				logger.error(exMessage, ex);
+				throw new CMException(exMessage, ex);
+			}
+		}
+	}
+
+	/**
+	 * Get certificate entry from the Keystore or Truststore. If the given alias
+	 * name identifies a trusted certificate entry, the certificate associated
+	 * with that entry is returned from the Truststore. If the given alias name
+	 * identifies a key pair entry, the first element of the certificate chain
+	 * of that entry is returned from the Keystore.
+	 */
+	@Override
+	public Certificate getCertificate(KeystoreType ksType, String alias)
+			throws CMException {
+		// Need to make sure we are initialized before we do anything else
+		// as Credential Manager can be created but not initialized
+		initialize();
+
+		try {
+			switch (ksType) {
+			case KEYSTORE:
+				synchronized (keystore) {
+					return keystore.getCertificate(alias);
+				}
+			case TRUSTSTORE:
+				synchronized (truststore) {
+					return truststore.getCertificate(alias);
+				}
+			default:
+				return null;
+			}
+		} catch (Exception ex) {
+			String exMessage = "Failed to fetch certificate from the " + ksType;
+			logger.error(exMessage, ex);
+			throw new CMException(exMessage, ex);
+		}
+	}
+
+	/**
+	 * Get certificate chain for the key pair entry from the Keystore. This
+	 * method works for the Keystore only as the Truststore does not contain key
+	 * pair entries, but trusted certificate entries only.
+	 */
+	@Override
+	public Certificate[] getKeyPairsCertificateChain(String alias)
+			throws CMException {
+		// Need to make sure we are initialized before we do anything else
+		// as Credential Manager can be created but not initialized
+		initialize();
+
+		try {
+			synchronized (keystore) {
+				return keystore.getCertificateChain(alias);
+			}
+		} catch (Exception ex) {
+			String exMessage = "Failed to fetch certificate chain for the keypair from the Keystore";
+			logger.error(exMessage, ex);
+			throw new CMException(exMessage, ex);
+		}
+	}
+
+	/**
+	 * Get the private key part of a key pair entry from the Keystore given its
+	 * alias.
+	 * <p>
+	 * This method works for the Keystore only as the Truststore does not
+	 * contain key pair entries, but trusted certificate entries only.
+	 * 
+	 * @throws CMException
+	 */
+	@Override
+	public Key getKeyPairsPrivateKey(String alias) throws CMException {
+		// Need to make sure we are initialized before we do anything else
+		// as Credential Manager can be created but not initialized
+		initialize();
+
+		try {
+			synchronized (keystore) {
+				return keystore.getKey(alias, masterPassword.toCharArray());
+			}
+		} catch (Exception ex) {
+			String exMessage = "Failed to fetch private key for the keypair from the Keystore";
+			logger.error(exMessage, ex);
+			throw new CMException(exMessage, ex);
+		}
+	}
+
+	/**
+	 * Insert a trusted certificate entry in the Truststore with an alias
+	 * constructed as:
+	 * 
+	 * "trustedcert#<CERT_SUBJECT_COMMON_NAME>"#"<CERT_ISSUER_COMMON_NAME>"#
+	 * "<CERT_SERIAL_NUMBER>
+	 * 
+	 * @return the alias under which this trusted certificate entry was saved in
+	 *         the Keystore
+	 */
+	@Override
+	public String addTrustedCertificate(X509Certificate cert)
+			throws CMException {
+		// Need to make sure we are initialized before we do anything else
+		// as Credential Manager can be created but not initialized
+		initialize();
+
+		String alias = null;
+
+		synchronized (truststore) {
+			// Create an alias for the new trusted certificate entry in the
+			// Truststore as
+			// "trustedcert#"<CERT_SUBJECT_COMMON_NAME>"#"<CERT_ISSUER_COMMON_NAME>"#"<CERT_SERIAL_NUMBER>
+			alias = createTrustedCertificateAlias(cert);
+			try {
+				truststore.setCertificateEntry(alias, cert);
+				saveKeystore(TRUSTSTORE);
+				multiCaster.notify(new KeystoreChangedEvent(TRUSTSTORE));
+
+				/*
+				 * This is now done from the KeystoresChangedObserver's notify
+				 * method. Update the default SSLSocketFactory used by the
+				 * HttpsURLConnectionS
+				 */
+				// HttpsURLConnection.setDefaultSSLSocketFactory(createTavernaSSLSocketFactory());
+
+				logger.debug("Updating SSLSocketFactory after inserting a trusted certificate");
+			} catch (Exception ex) {
+				throw new CMException(
+						"failed to insert trusted certificate entry in the Truststore",
+						ex);
+			}
+		}
+
+		return alias;
+	}
+
+	/**
+	 * Create a Keystore alias that would be used for adding the given key pair
+	 * (private and public key) entry to the Keystore. The alias is cretaed as
+	 * "keypair#"
+	 * &lt;CERT_SUBJECT_COMMON_NAME&gt;"#"&lt;CERT_ISSUER_COMMON_NAME&gt
+	 * ;"#"&lt;CERT_SERIAL_NUMBER&gt;
+	 * 
+	 * @param privateKey
+	 *            private key
+	 * @param certs
+	 *            public key's certificate chain
+	 * @return
+	 */
+	@Override
+	public String createKeyPairAlias(Key privateKey, Certificate certs[]) {
+		String ownerDN = ((X509Certificate) certs[0]).getSubjectX500Principal()
+				.getName(RFC2253);
+                ParsedDistinguishedName parsedDN = dnParser.parseDN(ownerDN);
+		String ownerCN = parsedDN.getCN(); // owner's common name
+
+		/*
+		 * Get the hexadecimal representation of the certificate's serial number
+		 */
+		String serialNumber = new BigInteger(1, ((X509Certificate) certs[0])
+				.getSerialNumber().toByteArray()).toString(16).toUpperCase();
+
+		String issuerDN = ((X509Certificate) certs[0]).getIssuerX500Principal()
+				.getName(RFC2253);
+		parsedDN = dnParser.parseDN(issuerDN);
+		String issuerCN = parsedDN.getCN(); // issuer's common name
+
+		String alias = "keypair#" + ownerCN + "#" + issuerCN + "#"
+				+ serialNumber;
+		return alias;
+	}
+
+	/**
+	 * Create a Truststore alias that would be used for adding the given trusted
+	 * X509 certificate to the Truststore. The alias is cretaed as
+	 * "trustedcert#"<CERT_SUBJECT_COMMON_NAME>"#"<CERT_ISSUER_COMMON_NAME>"#"<
+	 * CERT_SERIAL_NUMBER>
+	 * 
+	 * @param cert
+	 *            certificate to generate the alias for
+	 * @return the alias for the given certificate
+	 */
+	@Override
+	public String createTrustedCertificateAlias(X509Certificate cert) {
+		String ownerDN = cert.getSubjectX500Principal().getName(RFC2253);
+		ParsedDistinguishedName parsedDN = dnParser.parseDN(ownerDN);
+		String owner;
+		String ownerCN = parsedDN.getCN(); // owner's common name
+		String ownerOU = parsedDN.getOU();
+		String ownerO = parsedDN.getO();
+		if (!ownerCN.equals("none")) { // try owner's CN first
+			owner = ownerCN;
+		} // try owner's OU
+		else if (!ownerOU.equals("none")) {
+			owner = ownerOU;
+		} else if (!ownerO.equals("none")) { // finally use owner's Organisation
+			owner = ownerO;
+		} else {
+			owner = "<Not Part of Certificate>";
+		}
+
+		/* Get the hexadecimal representation of the certificate's serial number */
+		String serialNumber = new BigInteger(1, cert.getSerialNumber()
+				.toByteArray()).toString(16).toUpperCase();
+
+		String issuerDN = cert.getIssuerX500Principal().getName(RFC2253);
+		parsedDN = dnParser.parseDN(issuerDN);
+		String issuer;
+		String issuerCN = parsedDN.getCN(); // issuer's common name
+		String issuerOU = parsedDN.getOU();
+		String issuerO = parsedDN.getO();
+		if (!issuerCN.equals("none")) { // try issuer's CN first
+			issuer = issuerCN;
+		} // try issuer's OU
+		else if (!issuerOU.equals("none")) {
+			issuer = issuerOU;
+		} else if (!issuerO.equals("none")) { // finally use issuer's
+			// Organisation
+			issuer = issuerO;
+		} else {
+			issuer = "<Not Part of Certificate>";
+		}
+
+		String alias = "trustedcert#" + owner + "#" + issuer + "#"
+				+ serialNumber;
+		return alias;
+	}
+
+	/**
+	 * Checks if the Truststore contains the given public key certificate.
+	 */
+	@Override
+	public boolean hasTrustedCertificate(Certificate cert) throws CMException {
+		// Create an alias for the new trusted certificate entry in the
+		// Truststore as
+		// "trustedcert#"<CERT_SUBJECT_COMMON_NAME>"#"<CERT_ISSUER_COMMON_NAME>"#"<CERT_SERIAL_NUMBER>
+		String alias = createTrustedCertificateAlias((X509Certificate) cert);
+		return hasEntryWithAlias(TRUSTSTORE, alias);
+	}
+
+	/**
+	 * Delete a trusted certificate entry from the Truststore given its alias.
+	 */
+	@Override
+	public void deleteTrustedCertificate(String alias) throws CMException {
+		// Need to make sure we are initialized before we do anything else
+		// as Credential Manager can be created but not initialized
+		initialize();
+
+		synchronized (truststore) {
+			deleteEntry(TRUSTSTORE, alias);
+			saveKeystore(TRUSTSTORE);
+			multiCaster.notify(new KeystoreChangedEvent(TRUSTSTORE));
+
+			/*
+			 * This is now done from the KeyManager's nad TrustManager's notify
+			 * methods Update the default SSLSocketFactory used by the
+			 * HttpsURLConnectionS
+			 */
+			// HttpsURLConnection.setDefaultSSLSocketFactory(createTavernaSSLSocketFactory());
+
+			logger.info("Updating SSLSocketFactory "
+					+ "after deleting a trusted certificate");
+		}
+	}
+
+	/**
+	 * Delete a trusted certificate entry from the Truststore given the
+	 * certificate.
+	 */
+	@Override
+	public void deleteTrustedCertificate(X509Certificate cert)
+			throws CMException {
+		String alias = createTrustedCertificateAlias(cert);
+		deleteTrustedCertificate(alias);
+	}
+
+	/**
+	 * Check if the given alias identifies is a key entry in the Keystore.
+	 */
+	@Override
+	public boolean isKeyEntry(String alias) throws CMException {
+		// Need to make sure we are initialized before we do anything else
+		// as Credential Manager can be created but not initialized
+		initialize();
+
+		try {
+			synchronized (keystore) {
+				return keystore.isKeyEntry(alias);
+			}
+		} catch (Exception ex) {
+			String exMessage = "failed to access the key entry in the Keystore";
+			logger.error(exMessage, ex);
+			throw new CMException(exMessage, ex);
+		}
+	}
+
+	/**
+	 * Delete an entry from the Keystore or the Truststore.
+	 */
+	private void deleteEntry(KeystoreType ksType, String alias)
+			throws CMException {
+		// Need to make sure we are initialized before we do anything else
+		// as Credential Manager can be created but not initialized
+		initialize();
+
+		try {
+			switch (ksType) {
+			case KEYSTORE:
+				synchronized (keystore) {
+					if (keystore.containsAlias(alias))
+						keystore.deleteEntry(alias);
+					return;
+				}
+			case TRUSTSTORE:
+				synchronized (truststore) {
+					if (truststore.containsAlias(alias))
+						truststore.deleteEntry(alias);
+					return;
+				}
+			}
+		} catch (Exception ex) {
+			String exMessage = "failed to delete the entry with alias " + alias
+					+ " from the " + ksType;
+			logger.error(exMessage, ex);
+			throw new CMException(exMessage, ex);
+		}
+	}
+
+	/**
+	 * Check if the Keystore/Truststore contains an entry with the given alias.
+	 */
+	@Override
+	public boolean hasEntryWithAlias(KeystoreType ksType, String alias)
+			throws CMException {
+		// Need to make sure we are initialized before we do anything else
+		// as Credential Manager can be created but not initialized
+		initialize();
+
+		try {
+			switch (ksType) {
+			case KEYSTORE:
+				synchronized (keystore) {
+					return keystore.containsAlias(alias);
+				}
+			case TRUSTSTORE:
+				synchronized (truststore) {
+					return truststore.containsAlias(alias);
+				}
+			default:
+				return false;
+			}
+		} catch (Exception ex) {
+			String exMessage = "failed to access the " + ksType
+					+ " to check if an alias exists";
+			logger.error(exMessage, ex);
+			throw new CMException(exMessage, ex);
+		}
+	}
+
+	/**
+	 * Get all the aliases from the Keystore/Truststore or null if there was
+	 * some error while accessing it.
+	 */
+	@Override
+	public ArrayList<String> getAliases(KeystoreType ksType) throws CMException {
+		// Need to make sure we are initialized before we do anything else
+		// as Credential Manager can be created but not initialized
+		initialize();
+
+		try {
+			switch (ksType) {
+			case KEYSTORE:
+				synchronized (keystore) {
+					return Collections.list(keystore.aliases());
+				}
+			case TRUSTSTORE:
+				synchronized (truststore) {
+					return Collections.list(truststore.aliases());
+				}
+			default:
+				return null;
+			}
+		} catch (Exception ex) {
+			String exMessage = "failed to access the " + ksType
+					+ " to get the aliases";
+			logger.error(exMessage, ex);
+			throw new CMException(exMessage, ex);
+		}
+	}
+
+	/**
+	 * Get service URIs associated with all username/password pairs currently in
+	 * the Keystore.
+	 * 
+	 * @see #hasUsernamePasswordForService(URI)
+	 */
+	@Override
+	public List<URI> getServiceURIsForAllUsernameAndPasswordPairs()
+			throws CMException {
+		// Need to make sure we are initialized before we do anything else
+		// as Credential Manager can be created but not initialized
+		initialize();
+
+		synchronized (keystore) {
+			if (cachedServiceURIsList == null) {
+				List<URI> serviceURIs = new ArrayList<>();
+				for (String alias : getAliases(KEYSTORE)) {
+					/*
+					 * We are only interested in username/password entries here.
+					 * Alias for such entries is constructed as
+					 * "password#"<SERVICE_URI> where SERVICE_URI is the service
+					 * this username/password pair is to be used for.
+					 */
+					if (!alias.startsWith("password#"))
+						continue;
+					String[] split = alias.split("#", 2);
+					if (split.length != 2) {
+						logger.warn("Invalid alias " + alias);
+						continue;
+					}
+					String uriStr = split[1];
+					URI uri = URI.create(uriStr);
+					serviceURIs.add(uri);
+				}
+				cachedServiceURIsList = serviceURIs;
+			}
+			return cachedServiceURIsList;
+		}
+	}
+
+	/**
+	 * Load a PKCS12-type keystore from a file using the supplied password.
+	 */
+	@Override
+	public KeyStore loadPKCS12Keystore(File pkcs12File, String pkcs12Password)
+			throws CMException {
+		// Load the PKCS #12 keystore from the file
+		try (InputStream input = new FileInputStream(pkcs12File)) {
+			KeyStore pkcs12 = KeyStore.getInstance("PKCS12", "BC");
+			pkcs12.load(input, pkcs12Password.toCharArray());
+			return pkcs12;
+		} catch (Exception ex) {
+			String exMessage = "failed to open a PKCS12-type keystore";
+			logger.error(exMessage, ex);
+			throw new CMException(exMessage, ex);
+		}
+	}
+
+	/**
+	 * Add an observer of the changes to the Keystore or Truststore.
+	 */
+	@Override
+	public void addObserver(Observer<KeystoreChangedEvent> observer) {
+		multiCaster.addObserver(observer);
+	}
+
+	/**
+	 * Get all current observers of changes to the Keystore or Truststore.
+	 */
+	@Override
+	public List<Observer<KeystoreChangedEvent>> getObservers() {
+		return multiCaster.getObservers();
+	}
+
+	/**
+	 * Remove an observer of the changes to the Keystore or Truststore.
+	 */
+	@Override
+	public void removeObserver(Observer<KeystoreChangedEvent> observer) {
+		multiCaster.removeObserver(observer);
+	}
+
+	// /**
+	// * Checks if Credential Manager has been initialised.
+	// */
+	// public boolean isInitialized() {
+	// return isInitialized;
+	// }
+
+	// /**
+	// * Check if Keystore/Truststore file already exists on disk.
+	// */
+	// private boolean exists(KeystoreType ksType) {
+	//
+	// if (ksType.equals(KEYSTORE))
+	// return keystoreFile.exists();
+	// else if (ksType.equals(TRUSTSTORE)) {
+	// return truststoreFile.exists();
+	// } else
+	// return false;
+	// }
+
+	/**
+	 * Save the Keystore back to the file it was originally loaded from.
+	 */
+	private void saveKeystore(KeystoreType ksType) throws CMException {
+		// Need to make sure we are initialized before we do anything else
+		// as Credential Manager can be created but not initialized
+		initialize();
+
+		try {
+			switch (ksType) {
+			case KEYSTORE:
+				synchronized (keystore) {
+					try (FileOutputStream fos = new FileOutputStream(
+							keystoreFile)) {
+						keystore.store(fos, masterPassword.toCharArray());
+						return;
+					}
+				}
+			case TRUSTSTORE:
+				synchronized (truststore) {
+					try (FileOutputStream fos = new FileOutputStream(
+							truststoreFile)) {
+						// Hard-coded trust store password
+						truststore.store(fos, masterPassword.toCharArray());
+						return;
+					}
+				}
+			}
+		} catch (Exception ex) {
+			String exMessage = "failed to save the " + ksType;
+			logger.error(exMessage, ex);
+			throw new CMException(exMessage, ex);
+		}
+	}
+
+	/**
+	 * Checks if Keystore's master password is the same as the one provided.
+	 */
+	@Override
+	public boolean confirmMasterPassword(String password) throws CMException {
+		// Need to make sure we are initialized before we do anything else
+		// as Credential Manager can be created but not initialized
+		initialize();
+
+		return (masterPassword != null) && masterPassword.equals(password);
+	}
+
+	private static final boolean REALLY_DISABLED = false;
+	/**
+	 * Change the Keystore and the Truststore's master password to the one
+	 * provided. The Keystore and Truststore both use the same password.
+	 */
+	@Override
+	public void changeMasterPassword(String newMasterPassword)
+			throws CMException {
+		// Need to make sure we are initialized before we do anything else
+		// as Credential Manager can be created but not initialized
+		initialize();
+
+		String oldMasterPassword = masterPassword;
+		KeyStore oldKeystore = keystore;
+		KeyStore oldTruststore = truststore;
+
+		try {
+			synchronized (keystore) {
+				// Create a new keystore and copy all items from the current
+				// one, encrypting them with the new password
+				KeyStore newKeystore = null;
+				try {
+					// Try to create Taverna's Keystore as Bouncy Castle
+					// UBER-type keystore.
+					newKeystore = KeyStore.getInstance("UBER", "BC");
+				} catch (Exception ex) {
+					// The requested keystore type is not available from
+					// security providers.
+					String exMessage = "Failed to instantiate a new Bouncy Castle Keystore when changing master password.";
+					throw new CMException(exMessage, ex);
+				}
+				try {
+					// Initialize a new empty keystore
+					newKeystore.load(null, null);
+				} catch (Exception ex) {
+					String exMessage = "Failed to create a new empty Keystore to copy over the entries from the current one.";
+					throw new CMException(exMessage, ex);
+				}
+
+				Enumeration<String> aliases = keystore.aliases();
+				while (aliases.hasMoreElements()) {
+					String alias = aliases.nextElement();
+					if (REALLY_DISABLED) {
+						if (alias.startsWith("password#")) { // a password entry
+							SecretKeySpec passwordKey = (((SecretKeySpec) keystore
+									.getKey(alias, masterPassword.toCharArray())));
+							newKeystore.setKeyEntry(alias, passwordKey,
+									newMasterPassword.toCharArray(), null);
+						} else if (alias.startsWith("keypair#")) { // a private key entry
+							// Get the private key for the alias
+							PrivateKey privateKey = (PrivateKey) keystore
+									.getKey(alias, masterPassword.toCharArray());
+							// Get the related public key's certificate chain
+							Certificate[] certChain = keystore
+									.getCertificateChain(alias);
+							newKeystore.setKeyEntry(alias, privateKey,
+									newMasterPassword.toCharArray(), certChain);
+						}
+					}
+					// Do all entries at once, not reason to separate password &
+					// key pair entries
+					newKeystore.setEntry(
+							alias,
+							keystore.getEntry(alias,
+									new KeyStore.PasswordProtection(
+											masterPassword.toCharArray())),
+							new KeyStore.PasswordProtection(newMasterPassword
+									.toCharArray()));
+				}
+				try (FileOutputStream fos = new FileOutputStream(keystoreFile)) {
+					newKeystore.store(fos, newMasterPassword.toCharArray());
+				}
+				keystore = newKeystore;
+			}
+
+			// Truststore does not need to be re-encrypeted item by item as
+			// entries there are not encrypted, just the whole truststore
+			synchronized (truststore) {
+				try (FileOutputStream fos = new FileOutputStream(truststoreFile)) {
+					truststore.store(fos, newMasterPassword.toCharArray());
+				}
+			}
+
+			// Set the new master password as well
+			masterPassword = newMasterPassword;
+		} catch (Exception ex) {
+			// rollback
+			keystore = oldKeystore;
+			truststore = oldTruststore;
+			masterPassword = oldMasterPassword;
+			saveKeystore(KEYSTORE);
+			saveKeystore(TRUSTSTORE);
+
+			String exMessage = "Failed to change maaster password - reverting to the old one";
+			logger.error(exMessage, ex);
+			throw (new CMException(exMessage));
+		}
+	}
+
+	@Override
+	public void initializeSSL() throws CMException {
+		/*
+		 * We use the lazy initialization of Credential Manager from inside the
+		 * Taverna's SSLSocketFactory (i.e. KeyManager's and TrustManager's
+		 * init() methods) when it is actually needed so do not initialize it
+		 * here. These init() methods will not be called unledd a SSL connection
+		 * is attempted somewhere from Taverna and it is inside them that we
+		 * actually call the initialize() method on Credential Manager (and not
+		 * from the Credential Manager's constructor - hence lazy).
+		 * 
+		 * Create Taverna's SSLSocketFactory and set the SSL socket factory from
+		 * HttpsURLConnectionS to use it
+		 */
+		if (tavernaSSLSocketFactory == null)
+			HttpsURLConnection
+					.setDefaultSSLSocketFactory(createSSLSocketFactory());
+	}
+
+	/**
+	 * Creates SSLSocketFactory based on Credential Manager's Keystore and
+	 * Truststore but only initalizes Credential Manager when one of the methods
+	 * needed for creating an HTTPS connection is invoked.
+	 */
+	private SSLSocketFactory createSSLSocketFactory() throws CMException {
+		SSLContext sc = null;
+		try {
+			sc = SSLContext.getInstance("SSLv3");
+		} catch (NoSuchAlgorithmException e1) {
+			throw new CMException(
+					"Failed to create SSL socket factory: "
+							+ "the SSL algorithm was not available from any crypto provider",
+					e1);
+		}
+
+		KeyManager[] keyManagers = null;
+		try {
+			// Create our own KeyManager with (possibly not yet initialised)
+			// Taverna's Keystore
+			keyManagers = new KeyManager[] { new TavernaKeyManager() };
+		} catch (Exception e) {
+			throw new CMException("Failed to create SSL socket factory: "
+					+ "could not initiate SSL Key Manager", e);
+		}
+
+		TrustManager[] trustManagers = null;
+		try {
+			// Create our own TrustManager with (possibly not yet initialised)
+			// Taverna's Truststore
+			trustManagers = new TrustManager[] { new TavernaTrustManager() };
+		} catch (Exception e) {
+			throw new CMException("Failed to create SSL socket factory: "
+					+ "could not initiate SSL Trust Manager", e);
+		}
+
+		try {
+			sc.init(keyManagers, trustManagers, new SecureRandom());
+		} catch (KeyManagementException kmex) {
+			throw new CMException("Failed to initiate the SSL socet factory",
+					kmex);
+		}
+
+		/*
+		 * Set the default SSLContext to be used for subsequent SSL sockets from
+		 * Java
+		 */
+		SSLContext.setDefault(sc);
+
+		/*
+		 * Create SSL socket to be used for HTTPS connections from the JVM e.g.
+		 * REST activity that uses Apache HTTP client library
+		 */
+		tavernaSSLSocketFactory = sc.getSocketFactory();
+
+		return tavernaSSLSocketFactory;
+	}
+
+	@Override
+	public SSLSocketFactory getTavernaSSLSocketFactory() throws CMException {
+		if (tavernaSSLSocketFactory == null)
+			return createSSLSocketFactory();
+		return tavernaSSLSocketFactory;
+	}
+
+        @Override
+        public Authenticator getAuthenticator() {
+            return new CredentialManagerAuthenticator(this);
+        }
+
+	/**
+	 * Taverna's Key Manager is a customised X509KeyManager that initilises
+	 * Credential Manager only if certain methods on it are invoked, i.e. if
+	 * acces to Keystore is actually needed to authenticate the user.
+	 */
+	private class TavernaKeyManager extends X509ExtendedKeyManager {
+		/**
+		 * The X509KeyManager as returned by the SunX509 provider, initialised
+		 * with the Keystore.
+		 */
+		private X509KeyManager sunJSSEX509KeyManager = null;
+
+		/**
+		 * Lazy initialisation - unless we are actually asked to do some SSL
+		 * stuff - do not initialise Credential Manager as it will most probably
+		 * result in popping the master password window, which we want to avoid
+		 * early on while Taverna is starting, unless we need to contact a
+		 * secure service early, e.g. to populate the Service Panel.
+		 */
+		private void init() throws Exception {
+			logger.debug("inside TavernaKeyManager.init()");
+
+			// Create a "default" JSSE X509KeyManager.
+			KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509",
+					"SunJSSE");
+
+			if (!isInitialized)
+				// If we have not initialised the Credential Manager so far -
+				// now is the time to do it
+				try {
+					logger.debug("Credential Manager has not been instantiated yet");
+					initialize();
+					logger.debug("Credential Manager instantiated");
+				} catch (CMException cme) {
+					throw new Exception(
+							"Could not initialize Taverna's KeyManager for SSLSocketFactory:"
+									+ " failed to initialise Credential Manager.");
+				}
+
+			// Keystore and master password should not be null as we have just
+			// initalised Credential Manager
+			synchronized (keystore) {
+				logger.debug("Reinitialising the KeyManager.");
+
+				kmf.init(keystore, masterPassword.toCharArray());
+
+				/*
+				 * Iterate over the KeyManagers, look for an instance of
+				 * X509KeyManager. If found, use that as our "default" key
+				 * manager.
+				 */
+				for (KeyManager km : kmf.getKeyManagers())
+					if (km instanceof X509KeyManager) {
+						sunJSSEX509KeyManager = (X509KeyManager) km;
+						return;
+					}
+
+				// X509KeyManager not found - we have to fail the constructor.
+				throw new Exception(
+						"Could not initialize Taverna's KeyManager for SSLSocketFactory:"
+								+ " could not find a SunJSSE X509 KeyManager.");
+			}
+		}
+
+		@Override
+		public String chooseClientAlias(String[] keyType, Principal[] issuers,
+				Socket socket) {
+			logger.info("inside chooseClientAlias()");
+
+			// We have postponed initialization until we are actually asked to
+			// do something
+			try {
+				if (sunJSSEX509KeyManager == null)
+					init();
+			} catch (Exception e) {
+				logger.error(e);
+				return null;
+			}
+			// Delegate the decision to the default key manager
+			return sunJSSEX509KeyManager.chooseClientAlias(keyType, issuers,
+					socket);
+		}
+
+		@Override
+		public String chooseServerAlias(String keyType, Principal[] issuers,
+				Socket socket) {
+			// TODO Auto-generated method stub
+			return null;
+		}
+
+		@Override
+		public X509Certificate[] getCertificateChain(String alias) {
+			logger.debug("inside getCertificateChain()");
+			// We have postponed initialisation until we are actually asked to
+			// do something
+			try {
+				if (sunJSSEX509KeyManager == null)
+					init();
+			} catch (Exception e) {
+				logger.error(e);
+				return null;
+			}
+			// Delegate the decision to the default key manager
+			return sunJSSEX509KeyManager.getCertificateChain(alias);
+		}
+
+		@Override
+		public String[] getClientAliases(String keyType, Principal[] issuers) {
+			logger.debug("inside getClientAliases()");
+			// We have postponed initialisation until we are actually asked to
+			// do something
+			try {
+				if (sunJSSEX509KeyManager == null)
+					init();
+			} catch (Exception e) {
+				logger.error(e);
+				return null;
+			}
+			// Delegate the decision to the default key manager
+			return sunJSSEX509KeyManager.getClientAliases(keyType, issuers);
+		}
+
+		@Override
+		public PrivateKey getPrivateKey(String alias) {
+			logger.debug("inside getPrivateKey()");
+			// We have postponed initialisation until we are actually asked to
+			// do something
+			try {
+				if (sunJSSEX509KeyManager == null)
+					init();
+			} catch (Exception e) {
+				logger.error(e);
+				return null;
+			}
+			// Delegate the decision to the default key manager
+			return sunJSSEX509KeyManager.getPrivateKey(alias);
+		}
+
+		@Override
+		public String[] getServerAliases(String keyType, Principal[] issuers) {
+			// TODO Auto-generated method stub
+			return null;
+		}
+	}
+
+	/**
+	 * Taverna's Trust Manager is a customised X509TrustManager that initilizes
+	 * Credential Manager only if certain methods on it are invoked, i.e. if
+	 * acces to Truststore is actually needed to authenticate the remote
+	 * service.
+	 */
+	private class TavernaTrustManager implements X509TrustManager {
+		/**
+		 * The default X509TrustManager as returned by SunX509 provider,
+		 * initialised with the Truststore. We delegate decisions to it, and
+		 * fall back to ask the user if the default X509TrustManager does not
+		 * trust the server's certificate.
+		 */
+		private X509TrustManager sunJSSEX509TrustManager = null;
+
+		/**
+		 * Lazy initialization - unless we are actually asked to do some SSL
+		 * stuff - do not initialise Credential Manager as it will most probably
+		 * result in popping the master password window, which we want to avoid
+		 * early on while Taverna is starting, unless we need to contact a
+		 * secure service early, e.g. to populate Service Panel.
+		 */
+		private void init() throws Exception {
+			logger.debug("inside TavernaTrustManager.init()");
+
+			// Create a "default" JSSE X509TrustManager.
+			TrustManagerFactory tmf = TrustManagerFactory.getInstance(
+					"SunX509", "SunJSSE");
+
+			if (!isInitialized) {
+				logger.debug("inside TavernaTrustManager.init() - "
+						+ "Credential Manager has not been instantiated yet.");
+				// If we have not initialised the Credential Manager so far -
+				// now is the time to do it
+				try {
+					initialize();
+					logger.debug("inside Taverna TrustManager.init() - "
+							+ "Credential Manager instantiated.");
+				} catch (CMException cme) {
+					throw new Exception(
+							"Could not initialize Taverna's TrustManager for SSLSocketFactory: "
+									+ "failed to initialise Credential Manager.");
+				}
+			}
+
+			// Truststore should not be null as we have just initalised
+			// Credential Manager above
+			synchronized (truststore) {
+				logger.debug("inside TavernaTrustManager.init() - "
+						+ "Reinitialising the TrustManager.");
+				SSLSocketFactory.getDefault();
+				tmf.init(truststore);
+
+				/*
+				 * Iterate over the TrustManagers, look for an instance of
+				 * X509TrustManager. If found, use that as our "default" trust
+				 * manager.
+				 */
+				for (TrustManager tm : tmf.getTrustManagers())
+					if (tm instanceof X509TrustManager) {
+						sunJSSEX509TrustManager = (X509TrustManager) tm;
+						return;
+					}
+
+				// X509TrustManager not found - we have to fail the constructor.
+				throw new Exception(
+						"Could not initialize Taverna's TrustManager for SSLSocketFactory.");
+			}
+		}
+
+		/*
+		 * This method is called on the server-side for establishing trust with
+		 * a client.
+		 */
+		@Override
+		public void checkClientTrusted(X509Certificate[] chain, String authType)
+				throws CertificateException {
+		}
+
+		/*
+		 * This method is called on the client-side for establishing trust with
+		 * a server. We first try to delegate to the default trust manager that
+		 * uses Taverna's Truststore. If that falls through we ask the user if
+		 * they want to trust the certificate.
+		 */
+		@Override
+		public void checkServerTrusted(X509Certificate[] chain, String authType)
+				throws CertificateException {
+			// We have postponed initialisation until we are actually asked to
+			// do something
+			try {
+				if (sunJSSEX509TrustManager == null)
+					init();
+			} catch (Exception e) {
+				logger.error(e);
+				throw new CertificateException(e);
+			}
+			// Delegate the decision to the default trust manager
+			try {
+				sunJSSEX509TrustManager.checkServerTrusted(chain, authType);
+			} catch (CertificateException excep) {
+				// Pop up a dialog box asking whether to trust the server's
+				// certificate chain.
+				if (!shouldTrust(chain))
+					throw excep;
+			}
+		}
+
+		@Override
+		public X509Certificate[] getAcceptedIssuers() {
+			// We have postponed initialisation until we are actually asked to
+			// do something
+			try {
+				if (sunJSSEX509TrustManager == null)
+					init();
+			} catch (Exception e) {
+				logger.error(e);
+				return null;
+			}
+			return sunJSSEX509TrustManager.getAcceptedIssuers();
+		}
+	}
+
+	/**
+	 * Checks if a service is trusted and if not - asks user if they want to
+	 * trust it.
+	 */
+	private boolean shouldTrust(final X509Certificate[] chain)
+			throws IllegalArgumentException {
+		if (chain == null || chain.length == 0)
+			throw new IllegalArgumentException(
+					"At least one certificate needed in chain");
+
+		/*
+		 * If the certificate already exists in the truststore, it is implicitly
+		 * trusted. This will try to avoid prompting user twice as
+		 * checkServerTrusted() method gets called twice.
+		 * 
+		 * Well, this is not working - checkServerTrusted() is still called
+		 * twice.
+		 */
+		String alias = createTrustedCertificateAlias(chain[0]);
+		try {
+			if (truststore.containsAlias(alias))
+				return true;
+		} catch (KeyStoreException e) {
+			// Ignore
+		}
+
+		String name = chain[0].getSubjectX500Principal().getName();
+		for (TrustConfirmationProvider trustConfirmationProvider : trustConfirmationProviders) {
+			Boolean trustConfirmation = trustConfirmationProvider
+					.shouldTrustCertificate(chain);
+			if (trustConfirmation == null)
+				// SPI can't say yes or no, try next one
+				continue;
+
+			try {
+				if (trustConfirmation) {
+					// initialize(); // init the Credential Manager if needed
+					addTrustedCertificate((X509Certificate) chain[0]);
+					// this will initialize Cred. Manager
+					logger.info("Stored trusted certificate " + name);
+				}
+			} catch (CMException ex) {
+				logger.error("Credential Manager failed to "
+						+ "save trusted certificate " + name, ex);
+			}
+			if (logger.isDebugEnabled()) {
+				if (trustConfirmation) {
+					logger.debug("Trusting " + name + " according to "
+							+ trustConfirmationProvider);
+				} else {
+					logger.debug("Not trusting " + name + " according to "
+							+ trustConfirmationProvider);
+				}
+			}
+			return trustConfirmation.booleanValue();
+		}
+		logger.warn("No TrustConfirmationProvider instances could confirm or deny the trust in "
+				+ name);
+		// None of the trust confirmation providers (if there were any at all)
+		// could confirm
+		return false;
+	}
+
+	/**
+	 * Normalize an URI for insertion as the basis for path-recursive lookups,
+	 * ie. strip query and filename. For example:
+	 * 
+	 * <pre>
+	 * URI uri = URI.create("http://foo.org/dir1/dirX/../dir2/filename.html?q=x")
+	 * System.out.println(CredentialManager.normalizeServiceURI(uri));
+	 * >>> http://foo.org/dir1/dir2/
+	 * uri = URI.create("http://foo.org/dir1/dir2/");
+	 * System.out.println(CredentialManager.normalizeServiceURI(uri));
+	 * >>> http://foo.org/dir1/dir2/
+	 * </pre>
+	 * <p>
+	 * Note that #fragments are preserved, as these are used to indicate HTTP
+	 * Basic Auth realms
+	 * 
+	 * @param serviceURI
+	 *            URI for a service that is to be normalized
+	 * @return A normalized URI without query, userinfo or filename, ie. where
+	 *         uri.resolve(".").equals(uri).
+	 */
+	public URI normalizeServiceURI(URI serviceURI) {
+		try {
+			// Strip userinfo, keep fragment
+			URI normalized = dnParser.setUserInfoForURI(serviceURI, null)
+					.normalize();
+			return dnParser.setFragmentForURI(normalized.resolve("."),
+					serviceURI.getFragment());
+		} catch (URISyntaxException ex) {
+			return serviceURI;
+		}
+	}
+
+	/**
+	 * Reset the JVMs cache for authentication like HTTP Basic Auth.
+	 * <p>
+	 * Note that this method uses undocumented calls to
+	 * <code>sun.net.www.protocol.http.AuthCacheValue</code> which might not be
+	 * valid in virtual machines other than Sun Java 6. If these calls fail,
+	 * this method will log the error and return <code>false</code>.
+	 * 
+	 * @return <code>true</code> if the JVMs cache could be reset, or
+	 *         <code>false</code> otherwise.
+	 */
+	@Override
+	public boolean resetAuthCache() {
+		// Sun should expose an official API to do this
+		try {
+			Class<?> AuthCacheValue = Class
+					.forName("sun.net.www.protocol.http.AuthCacheValue");
+			Class<?> AuthCacheImpl = Class
+					.forName("sun.net.www.protocol.http.AuthCacheImpl");
+			Class<?> AuthCache = Class
+					.forName("sun.net.www.protocol.http.AuthCache");
+			Method setAuthCache = AuthCacheValue.getMethod("setAuthCache",
+					AuthCache);
+			setAuthCache.invoke(null, AuthCacheImpl.newInstance());
+			return true;
+		} catch (Exception ex) {
+			logger.warn(
+					"Could not reset authcache, non-Sun JVM or internal Sun classes changed",
+					ex);
+			return false;
+		}
+	}
+
+	/**
+	 * Checks if the Keystore contains a username and password for the given
+	 * service URI.
+	 */
+	@Override
+	public boolean hasUsernamePasswordForService(URI serviceURI)
+			throws CMException {
+		Map<URI, URI> mappedServiceURIs = getFragmentMappedURIsForAllUsernameAndPasswordPairs();
+		for (URI possible : getPossibleServiceURIsToLookup(serviceURI, true))
+			if (mappedServiceURIs.containsKey(possible))
+				return true;
+		return false;
+	}
+
+	private void loadDefaultSecurityFiles() {
+		if (credentialManagerDirectory == null)
+			credentialManagerDirectory = dnParser
+					.getCredentialManagerDefaultDirectory(applicationConfiguration);
+		if (keystoreFile == null)
+			keystoreFile = new File(credentialManagerDirectory,
+					KEYSTORE_FILE_NAME);
+		if (truststoreFile == null)
+			truststoreFile = new File(credentialManagerDirectory,
+					TRUSTSTORE_FILE_NAME);
+	}
+
+	/**
+	 * Set the directory where Credential Manager's Keystore and Truststore
+	 * files will be read from. If this method is not used, the directory will
+	 * default to <TAVERNA_HOME>/security somewhere in user's home directory.
+	 * 
+	 * If you want to use this method to change the location of Credential
+	 * Manager's configuration directory then make sure you call it before any
+	 * other method on Credential Manager.
+	 * 
+	 * This was supposed to be done through OSGi services.
+	 * 
+	 * @param credentialManagerDirectory
+	 * @throws CMException
+	 */
+	@Override
+	public void setConfigurationDirectoryPath(File credentialManagerDirectory)
+			throws CMException {
+		if (credentialManagerDirectory == null)
+			throw new CMException(
+					"Credential Manager's configuration directory cannot be null.");
+
+		try {
+			if (!credentialManagerDirectory.exists())
+				credentialManagerDirectory.mkdir();
+		} catch (Exception e) {
+			throw new CMException(
+					"Failed to open Credential Manager's directory "
+							+ credentialManagerDirectory
+							+ " to load the security files: " + e.getMessage(),
+					e);
+		}
+
+		keystoreFile = new File(credentialManagerDirectory, KEYSTORE_FILE_NAME);
+		truststoreFile = new File(credentialManagerDirectory,
+				TRUSTSTORE_FILE_NAME);
+
+		// Are we resetting the directory? Has stuff been initialized yet?
+		// Then we need to reset everything else.
+		if (isInitialized) {
+			masterPassword = null;
+			keystore = null;
+			truststore = null;
+			isInitialized = false;
+		}
+	}
+
+	// private void loadSecurityFiles(String credentialManagerDirPath)
+	// throws CMException {
+	//
+	// // If credentialManagerDirPath is null (e.g. user did not specify -cmdir
+	// on the command line)
+	// // - try with Taverna's default one
+	// if (credentialManagerDirPath == null){
+	// credentialManagerDirectory =
+	// CMUtils.getCredentialManagerDefaultDirectory();
+	// }
+	//
+	// if (credentialManagerDirectory == null) {
+	// try {
+	// credentialManagerDirectory = new File(credentialManagerDirPath);
+	// } catch (Exception e) {
+	// throw new CMException(
+	// "Failed to open Credential Manager's directory to load the security files: "
+	// + e.getMessage(),
+	// e);
+	// }
+	// }
+	// if (keystoreFile == null){
+	// keystoreFile = new File(credentialManagerDirectory, KEYSTORE_FILE_NAME);
+	// }
+	// if (truststoreFile == null){
+	// truststoreFile = new File(cre

<TRUNCATED>

[04/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/SimpleCacheProviderImpl.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/SimpleCacheProviderImpl.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/SimpleCacheProviderImpl.java
new file mode 100644
index 0000000..ccbf67b
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/SimpleCacheProviderImpl.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import net.sf.taverna.t2.reference.Identified;
+import net.sf.taverna.t2.reference.ReferenceServiceCacheProvider;
+import net.sf.taverna.t2.reference.T2Reference;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Completely naive cache provider that just stores everything in a map. This
+ * <em>will</em> run out of memory as it makes no attempt to evict old items,
+ * it's really just here as a test!
+ * 
+ * @author Tom Oinn
+ */
+public class SimpleCacheProviderImpl implements ReferenceServiceCacheProvider {
+	private final Logger log = Logger.getLogger(SimpleCacheProviderImpl.class);
+	private Map<T2Reference, Identified> cache = new HashMap<>();
+
+	@Override
+	public Identified get(T2Reference id) {
+		if (log.isDebugEnabled())
+			log.debug("Get " + id.toString() + " (" + cache.containsKey(id)
+					+ ")");
+		return cache.get(id);
+	}
+
+	@Override
+	public void put(Identified i) {
+		if (log.isDebugEnabled())
+			log.debug("Put " + i.getId().toString());
+		cache.put(i.getId(), i);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/SimpleT2ReferenceGenerator.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/SimpleT2ReferenceGenerator.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/SimpleT2ReferenceGenerator.java
new file mode 100644
index 0000000..897fc96
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/SimpleT2ReferenceGenerator.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import net.sf.taverna.t2.reference.T2ReferenceGenerator;
+
+/**
+ * Simple implementation of T2ReferenceGenerator intended to be injected into
+ * the service layers for integration testing. Exposes a namespace property
+ * which can be configured through spring and allocates local parts based on an
+ * integer counter - this is only guaranteed to be unique within a single
+ * instance of this object so isn't suitable for real production use. For proper
+ * usage use an implementation tied to the backing store you're putting t2
+ * reference objects into.
+ * 
+ * @author Tom Oinn
+ */
+public class SimpleT2ReferenceGenerator extends AbstractT2ReferenceGenerator implements T2ReferenceGenerator {
+	private String namespace = "testNS";
+	private String localPrefix = "test";
+	private int counter = 0;
+
+	/**
+	 * Set the namespace for identifiers generated by this class as a string
+	 * 
+	 * @param newNamespace
+	 *            the namespace to use
+	 */
+	public void setNamespace(String newNamespace) {
+		this.namespace = newNamespace;
+	}
+
+	/**
+	 * Get the namespace for identifiers generated by this class
+	 */
+	@Override
+	public String getNamespace() {
+		return namespace;
+	}
+
+	@Override
+	protected synchronized String getNextLocalPart() {
+		return localPrefix + (counter++);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/StackTraceElementBeanImpl.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/StackTraceElementBeanImpl.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/StackTraceElementBeanImpl.java
new file mode 100644
index 0000000..6943127
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/StackTraceElementBeanImpl.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import net.sf.taverna.t2.reference.StackTraceElementBean;
+import net.sf.taverna.t2.reference.h3.HibernateComponentClass;
+
+/**
+ * Simple bean implementation of StackTraceElement for Hibernate
+ * 
+ * @author Tom Oinn
+ */
+public class StackTraceElementBeanImpl implements StackTraceElementBean,
+		HibernateComponentClass {
+	private String className;
+	private String fileName;
+	private String methodName;
+	private int lineNumber;
+
+	public StackTraceElementBeanImpl() {
+		//
+	}
+
+	@Override
+	public String getClassName() {
+		return this.className;
+	}
+
+	public void setClassName(String className) {
+		this.className = className;
+	}
+
+	@Override
+	public String getFileName() {
+		return this.fileName;
+	}
+
+	public void setFileName(String fileName) {
+		this.fileName = fileName;
+	}
+
+	@Override
+	public int getLineNumber() {
+		return lineNumber;
+	}
+
+	public void setLineNumber(int lineNumber) {
+		this.lineNumber = lineNumber;
+	}
+
+	@Override
+	public String getMethodName() {
+		return this.methodName;
+	}
+
+	public void setMethodName(String methodName) {
+		this.methodName = methodName;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/T2ReferenceImpl.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/T2ReferenceImpl.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/T2ReferenceImpl.java
new file mode 100644
index 0000000..f5f00d3
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/T2ReferenceImpl.java
@@ -0,0 +1,288 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import static net.sf.taverna.t2.reference.T2ReferenceType.ErrorDocument;
+
+import java.io.Serializable;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.UUID;
+
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.reference.T2ReferenceType;
+import net.sf.taverna.t2.reference.h3.HibernateComponentClass;
+
+import org.apache.log4j.Logger;
+
+/**
+ * An implementation of T2Reference specific to the ReferenceSetImpl. This is
+ * needed because ReferenceSetImpl uses a component based primary key driven
+ * from the namespace and local parts of T2Reference. This in turn means we can
+ * query hibernate directly with a T2Reference instance in the data access
+ * object. Because this is only used as a component (i.e. a value type) we don't
+ * need to define a hibernate mapping file for it.
+ * 
+ * @author Tom Oinn
+ * @author David Withers
+ */
+public class T2ReferenceImpl implements T2Reference, Serializable, HibernateComponentClass {
+	private static Logger logger = Logger.getLogger(T2ReferenceImpl.class);
+
+	private static final long serialVersionUID = 8363330461158750319L;
+	private String localPart;
+	private String namespacePart;
+	private long localMostSigBits, localLeastSigBits;
+	private boolean containsErrors = false;
+	private T2ReferenceType referenceType = T2ReferenceType.ReferenceSet;
+	private int depth = 0;
+	private transient URI cachedURI;
+
+	public T2ReferenceImpl() {
+		// Default constructor for Hibernate et al
+	}
+
+	/**
+	 * Construct a deep copy of the given T2Reference
+	 * 
+	 * @param source
+	 *            T2Reference to copy
+	 */
+	private T2ReferenceImpl(T2Reference source) {
+		super();
+		setNamespacePart(source.getNamespacePart());
+		setLocalPart(source.getLocalPart());
+		setContainsErrors(source.containsErrors());
+		setReferenceType(source.getReferenceType());
+		setDepth(source.getDepth());
+	}
+
+	public static T2ReferenceImpl getAsImpl(T2Reference source) {
+		if (source instanceof T2ReferenceImpl)
+			return (T2ReferenceImpl) source;
+		return new T2ReferenceImpl(source);
+	}
+
+	/**
+	 * Return whether the identified entity either is or contains errors
+	 */
+	@Override
+	public boolean containsErrors() {
+		return this.containsErrors;
+	}
+
+	/**
+	 * Property accessor for Hibernate, complies with java bean spec
+	 */
+	public boolean getContainsErrors() {
+		return this.containsErrors;
+	}
+
+	/**
+	 * Get the depth of the entity referred to by this reference
+	 */
+	@Override
+	public int getDepth() {
+		return this.depth;
+	}
+
+	/**
+	 * Get the local part of the URI for this reference
+	 */
+	@Override
+	public String getLocalPart() {
+		if (localPart == null) {
+			UUID localPartUUID = new UUID(localMostSigBits, localLeastSigBits);
+			return localPartUUID.toString();
+		}
+		return localPart;
+	}
+
+	/**
+	 * Get the namespace part of the URI for this reference
+	 */
+	@Override
+	public String getNamespacePart() {
+		return namespacePart;
+	}
+
+	/**
+	 * Get the type of the entity to which this reference refers
+	 */
+	@Override
+	public T2ReferenceType getReferenceType() {
+		return referenceType;
+	}
+
+	/**
+	 * This method is only ever called from within Hibernate when
+	 * re-constructing the identifier component to set the namespace part of the
+	 * identifier.
+	 */
+	public synchronized void setNamespacePart(String namespacePart) {
+		this.namespacePart = namespacePart;
+	}
+
+	/**
+	 * This method is only ever called from within Hibernate when
+	 * re-constructing the identifier component to set the local part of the
+	 * identifier.
+	 */
+	public synchronized void setLocalPart(String localPart) {
+		try {
+			UUID namespacePartUUID = UUID.fromString(localPart);
+			localMostSigBits = namespacePartUUID.getMostSignificantBits();
+			localLeastSigBits = namespacePartUUID.getLeastSignificantBits();
+			this.localPart = null;
+		} catch (IllegalArgumentException e) {
+			this.localPart = localPart;
+		}
+	}
+
+	/**
+	 * This method is only ever called from within Hibernate when
+	 * re-constructing the identifier component to set the depth of the
+	 * identifier.
+	 */
+	public synchronized void setDepth(int depth) {
+		this.depth = depth;
+	}
+
+	/**
+	 * This method is only ever called from within Hibernate when
+	 * re-constructing the identifier component to set the error property of the
+	 * identifier.
+	 */
+	public synchronized void setContainsErrors(boolean containsErrors) {
+		this.containsErrors = containsErrors;
+	}
+
+	/**
+	 * This method is only ever called from within Hibernate when
+	 * re-constructing the identifier component to set the reference type
+	 * property of the identifier.
+	 */
+	public synchronized void setReferenceType(T2ReferenceType type) {
+		this.referenceType = type;
+	}
+
+	/**
+	 * By default when printing an identifier we use {@link #toUri()}.
+	 * {@link java.net.URI#toASCIIString() toASCIIString()}
+	 */
+	@Override
+	public String toString() {
+		return toUri().toASCIIString();
+	}
+
+	/**
+	 * Drill inside an error document reference to get the error one deeper than
+	 * this as long as it is at least depth 1.
+	 */
+	T2ReferenceImpl getDeeperErrorReference() {
+		if (!getReferenceType().equals(ErrorDocument))
+			throw new AssertionError(
+					"Attempt to get a deeper reference on something that isn't an error ref");
+		if (getDepth() == 0)
+			throw new AssertionError(
+					"Error identifier already has depth 0, cannot decrease");
+
+		T2ReferenceImpl result = new T2ReferenceImpl();
+		result.setContainsErrors(true);
+		result.setDepth(getDepth() - 1);
+		result.setLocalPart(getLocalPart());
+		result.setNamespacePart(getNamespacePart());
+		result.setReferenceType(ErrorDocument);
+		return result;
+	}
+
+	/**
+	 * Returns the identifier expressed as a {@link java.net.URI URI},
+	 * constructed based on the reference type. For references to ReferenceSet
+	 * this is
+	 * <code>new URI("t2:ref//" + namespacePart + "?" + localPart)</code>
+	 * leading to URIs of the form <code>t2:ref//namespace?local</code>
+	 */
+	@Override
+	public synchronized URI toUri() {
+		try {
+			if (cachedURI == null)
+				switch (referenceType) {
+				case ReferenceSet:
+					cachedURI = new URI("t2:ref//" + getNamespacePart() + "?"
+							+ getLocalPart());
+				case IdentifiedList:
+					cachedURI = new URI("t2:list//" + getNamespacePart() + "?"
+							+ getLocalPart() + "/" + containsErrors + "/"
+							+ depth);
+				case ErrorDocument:
+					cachedURI = new URI("t2:error//" + getNamespacePart() + "?"
+							+ getLocalPart() + "/" + depth);
+				}
+		} catch (URISyntaxException e) {
+			logger.error("Unable to create URI", e);
+		}
+		return cachedURI;
+	}
+
+	@Override
+	public int hashCode() {
+		int result = 1;
+		result = 31 * result + depth;
+		result = 31 * result + (int) (localLeastSigBits ^ (localLeastSigBits >>> 32));
+		result = 31 * result + (int) (localMostSigBits ^ (localMostSigBits >>> 32));
+		result = 31 * result + ((localPart == null) ? 0 : localPart.hashCode());
+		result = 31 * result + ((namespacePart == null) ? 0 : namespacePart.hashCode());
+		return result;
+	}
+
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		T2ReferenceImpl other = (T2ReferenceImpl) obj;
+		if (depth != other.depth)
+			return false;
+		if (localLeastSigBits != other.localLeastSigBits)
+			return false;
+		if (localMostSigBits != other.localMostSigBits)
+			return false;
+		if (localPart == null) {
+			if (other.localPart != null)
+				return false;
+		} else if (!localPart.equals(other.localPart))
+			return false;
+		if (namespacePart == null) {
+			if (other.namespacePart != null)
+				return false;
+		} else if (!namespacePart.equals(other.namespacePart))
+			return false;
+		return true;
+	}
+
+	public synchronized String getCompactForm() {
+		return getNamespacePart() + ":" + getLocalPart() + ":" + getDepth();
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/T2ReferenceListImpl.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/T2ReferenceListImpl.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/T2ReferenceListImpl.java
new file mode 100644
index 0000000..3b865dd
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/T2ReferenceListImpl.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import java.util.List;
+
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.reference.h3.HibernateMappedEntity;
+
+/**
+ * Simple extension of
+ * <code>{@link IdentifiedArrayList IdentifiedArrayList&lt;T2Reference&gt;}</code>
+ * exposing get and set methods for the list contents so we can map it in
+ * hibernate.
+ * 
+ * @author Tom Oinn
+ */
+public class T2ReferenceListImpl extends IdentifiedArrayList<T2Reference>
+		implements HibernateMappedEntity {
+	public T2ReferenceListImpl() {
+		super();
+	}
+
+	/**
+	 * This is only called from Hibernate, outside of test code, so is
+	 * relatively safe to leave unchecked.
+	 */
+	@SuppressWarnings("rawtypes")
+	public List getListContents() {
+		return this.listDelegate;
+	}
+
+	/**
+	 * This is only called from Hibernate, outside of test code, so is
+	 * relatively safe to leave unchecked.
+	 */
+	@SuppressWarnings({ "unchecked", "rawtypes" })
+	public void setListContents(List newList) {
+		this.listDelegate = newList;
+	}
+
+	/**
+	 * Print the contents of this list for vaguely human readable debug
+	 * purposes.
+	 */
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder();
+		sb.append(getId()).append("\n");
+		int counter = 0;
+		for (T2Reference ref : listDelegate)
+			sb.append("  ").append(++counter).append(") ").append(ref)
+					.append("\n");
+		return sb.toString();
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/TransactionalHibernateErrorDocumentDao.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/TransactionalHibernateErrorDocumentDao.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/TransactionalHibernateErrorDocumentDao.java
new file mode 100644
index 0000000..987facb
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/TransactionalHibernateErrorDocumentDao.java
@@ -0,0 +1,155 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import static net.sf.taverna.t2.reference.T2ReferenceType.ErrorDocument;
+
+import java.util.List;
+
+import net.sf.taverna.t2.reference.DaoException;
+import net.sf.taverna.t2.reference.ErrorDocument;
+import net.sf.taverna.t2.reference.ErrorDocumentDao;
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.reference.annotations.DeleteIdentifiedOperation;
+import net.sf.taverna.t2.reference.annotations.GetIdentifiedOperation;
+import net.sf.taverna.t2.reference.annotations.PutIdentifiedOperation;
+
+import org.hibernate.Query;
+import org.hibernate.SessionFactory;
+
+/**
+ * An implementation of ErrorDocumentDao based on raw hibernate session factory
+ * injection and running within a spring managed context through auto-proxy
+ * generation. To use this in spring inject a property 'sessionFactory' with
+ * either a {@link org.springframework.orm.hibernate3.LocalSessionFactoryBean
+ * LocalSessionFactoryBean} or the equivalent class from the T2Platform module
+ * to add SPI based implementation discovery and mapping. To use outside of
+ * Spring ensure you call the setSessionFactory(..) method before using this
+ * (but really, use it from Spring, so much easier).
+ * <p>
+ * Methods in this Dao require transactional support
+ * 
+ * @author Tom Oinn
+ */
+public class TransactionalHibernateErrorDocumentDao implements ErrorDocumentDao {
+	private static final String GET_ERRORS_FOR_RUN = "FROM ErrorDocumentImpl WHERE namespacePart = :workflow_run_id";
+	private SessionFactory sessionFactory;
+
+	public void setSessionFactory(SessionFactory sessionFactory) {
+		this.sessionFactory = sessionFactory;
+	}
+
+	/**
+	 * Fetch an ErrorDocument list by id
+	 * 
+	 * @param ref
+	 *            the T2Reference to fetch
+	 * @return a retrieved identified list of T2 references
+	 * @throws DaoException
+	 *             if the supplied reference is of the wrong type or if
+	 *             something goes wrong fetching the data or connecting to the
+	 *             database
+	 */
+	@Override
+	@GetIdentifiedOperation
+	public ErrorDocument get(T2Reference ref) throws DaoException {
+		if (ref == null)
+			throw new DaoException(
+					"Supplied reference is null, can't retrieve.");
+		if (!ref.getReferenceType().equals(ErrorDocument))
+			throw new DaoException(
+					"This dao can only retrieve reference of type T2Reference.ErrorDocument");
+		if (!(ref instanceof T2ReferenceImpl))
+			throw new DaoException(
+					"Reference must be an instance of T2ReferenceImpl");
+
+		try {
+			return (ErrorDocumentImpl) sessionFactory.getCurrentSession().get(
+					ErrorDocumentImpl.class,
+					((T2ReferenceImpl) ref).getCompactForm());
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+
+	@Override
+	@PutIdentifiedOperation
+	public void store(ErrorDocument theDocument) throws DaoException {
+		if (theDocument.getId() == null)
+			throw new DaoException(
+					"Supplied error document set has a null ID, allocate "
+							+ "an ID before calling the store method in the dao.");
+		if (!theDocument.getId().getReferenceType().equals(ErrorDocument))
+			throw new DaoException("Strangely the list ID doesn't have type "
+					+ "T2ReferenceType.ErrorDocument, something has probably "
+					+ "gone badly wrong somewhere earlier!");
+		if (!(theDocument instanceof ErrorDocumentImpl))
+			throw new DaoException(
+					"Supplied ErrorDocument not an instance of ErrorDocumentImpl");
+
+		try {
+			sessionFactory.getCurrentSession().save(theDocument);
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+
+	@Override
+	@DeleteIdentifiedOperation
+	public boolean delete(ErrorDocument theDocument) throws DaoException {
+		if (theDocument.getId() == null)
+			throw new DaoException(
+					"Supplied error document set has a null ID, allocate "
+							+ "an ID before calling the store method in the dao.");
+		if (!theDocument.getId().getReferenceType().equals(ErrorDocument))
+			throw new DaoException("Strangely the list ID doesn't have type "
+					+ "T2ReferenceType.ErrorDocument, something has probably "
+					+ "gone badly wrong somewhere earlier!");
+		if (!(theDocument instanceof ErrorDocumentImpl))
+			throw new DaoException(
+					"Supplied ErrorDocument not an instance of ErrorDocumentImpl");
+
+		try {
+			sessionFactory.getCurrentSession().delete(theDocument);
+			return true;
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+
+	@Override
+	@SuppressWarnings("unchecked")
+	@DeleteIdentifiedOperation
+	public synchronized void deleteErrorDocumentsForWFRun(String workflowRunId)
+			throws DaoException {
+		try {
+			// Select all ErrorDocuments for this wf run
+			Query selectQuery = sessionFactory.getCurrentSession().createQuery(
+					GET_ERRORS_FOR_RUN);
+			selectQuery.setString("workflow_run_id", workflowRunId);
+			List<ErrorDocument> errorDocuments = selectQuery.list();
+			for (ErrorDocument errorDocument : errorDocuments)
+				delete(errorDocument);
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/TransactionalHibernateListDao.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/TransactionalHibernateListDao.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/TransactionalHibernateListDao.java
new file mode 100644
index 0000000..1a57041
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/TransactionalHibernateListDao.java
@@ -0,0 +1,154 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import static net.sf.taverna.t2.reference.T2ReferenceType.IdentifiedList;
+
+import java.util.List;
+
+import net.sf.taverna.t2.reference.DaoException;
+import net.sf.taverna.t2.reference.IdentifiedList;
+import net.sf.taverna.t2.reference.ListDao;
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.reference.annotations.DeleteIdentifiedOperation;
+import net.sf.taverna.t2.reference.annotations.GetIdentifiedOperation;
+import net.sf.taverna.t2.reference.annotations.PutIdentifiedOperation;
+
+import org.hibernate.Query;
+import org.hibernate.SessionFactory;
+
+/**
+ * An implementation of ListDao based on based on raw hibernate session factory
+ * injection and running within a spring managed context through auto-proxy
+ * generation. To use this in spring inject a property 'sessionFactory' with
+ * either a {@link org.springframework.orm.hibernate3.LocalSessionFactoryBean
+ * LocalSessionFactoryBean} or the equivalent class from the T2Platform module
+ * to add SPI based implementation discovery and mapping. To use outside of
+ * Spring ensure you call the setSessionFactory(..) method before using this
+ * (but really, use it from Spring, so much easier).
+ * <p>
+ * Methods in this Dao require transactional support
+ * 
+ * @author Tom Oinn
+ */
+public class TransactionalHibernateListDao implements ListDao {
+	private static final String GET_REFLISTS_FOR_RUN = "FROM T2ReferenceListImpl WHERE namespacePart = :workflow_run_id";
+	private SessionFactory sessionFactory;
+
+	public void setSessionFactory(SessionFactory sessionFactory) {
+		this.sessionFactory = sessionFactory;
+	}
+
+	/**
+	 * Fetch a t2reference list by id
+	 * 
+	 * @param ref
+	 *            the T2Reference to fetch
+	 * @return a retrieved identified list of T2 references
+	 * @throws DaoException
+	 *             if the supplied reference is of the wrong type or if
+	 *             something goes wrong fetching the data or connecting to the
+	 *             database
+	 */
+	@Override
+	@GetIdentifiedOperation
+	public IdentifiedList<T2Reference> get(T2Reference ref) throws DaoException {
+		if (ref == null)
+			throw new DaoException(
+					"Supplied reference is null, can't retrieve.");
+		if (!ref.getReferenceType().equals(IdentifiedList))
+			throw new DaoException(
+					"This dao can only retrieve reference of type T2Reference.IdentifiedList");
+		if (!(ref instanceof T2ReferenceImpl))
+			throw new DaoException(
+					"Reference must be an instance of T2ReferenceImpl");
+
+		try {
+			return (T2ReferenceListImpl) sessionFactory.getCurrentSession()
+					.get(T2ReferenceListImpl.class,
+							((T2ReferenceImpl) ref).getCompactForm());
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+
+	@Override
+	@PutIdentifiedOperation
+	public void store(IdentifiedList<T2Reference> theList) throws DaoException {
+		if (theList.getId() == null)
+			throw new DaoException("Supplied list set has a null ID, allocate "
+					+ "an ID before calling the store method in the dao.");
+		if (!theList.getId().getReferenceType().equals(IdentifiedList))
+			throw new DaoException("Strangely the list ID doesn't have type "
+					+ "T2ReferenceType.IdentifiedList, something has probably "
+					+ "gone badly wrong somewhere earlier!");
+		if (!(theList instanceof T2ReferenceListImpl))
+			throw new DaoException(
+					"Supplied identifier list not an instance of T2ReferenceList");
+
+		try {
+			sessionFactory.getCurrentSession().save(theList);
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+
+	@Override
+	public boolean delete(IdentifiedList<T2Reference> theList)
+			throws DaoException {
+		if (theList.getId() == null)
+			throw new DaoException("Supplied list set has a null ID, allocate "
+					+ "an ID before calling the store method in the dao.");
+		if (!theList.getId().getReferenceType().equals(IdentifiedList))
+			throw new DaoException("Strangely the list ID doesn't have type "
+					+ "T2ReferenceType.IdentifiedList, something has probably "
+					+ "gone badly wrong somewhere earlier!");
+		if (!(theList instanceof T2ReferenceListImpl))
+			throw new DaoException(
+					"Supplied identifier list not an instance of T2ReferenceList");
+
+		try {
+			sessionFactory.getCurrentSession().delete(theList);
+			return true;
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+
+	@Override
+	@SuppressWarnings("unchecked")
+	@DeleteIdentifiedOperation
+	public synchronized void deleteIdentifiedListsForWFRun(String workflowRunId)
+			throws DaoException {
+		try {
+			// Select all T2Reference lists for this wf run
+			Query selectQuery = sessionFactory.getCurrentSession().createQuery(
+					GET_REFLISTS_FOR_RUN);
+			selectQuery.setString("workflow_run_id", workflowRunId);
+			List<IdentifiedList<T2Reference>> referenceLists = selectQuery
+					.list();
+			for (IdentifiedList<T2Reference> referenceList : referenceLists)
+				delete(referenceList);
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/TransactionalHibernateReferenceSetDao.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/TransactionalHibernateReferenceSetDao.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/TransactionalHibernateReferenceSetDao.java
new file mode 100644
index 0000000..2fc1edd
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/TransactionalHibernateReferenceSetDao.java
@@ -0,0 +1,198 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import static net.sf.taverna.t2.reference.T2ReferenceType.ReferenceSet;
+
+import java.util.List;
+
+import net.sf.taverna.t2.reference.DaoException;
+import net.sf.taverna.t2.reference.ReferenceSet;
+import net.sf.taverna.t2.reference.ReferenceSetDao;
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.reference.annotations.DeleteIdentifiedOperation;
+import net.sf.taverna.t2.reference.annotations.GetIdentifiedOperation;
+import net.sf.taverna.t2.reference.annotations.PutIdentifiedOperation;
+
+import org.hibernate.Query;
+import org.hibernate.SessionFactory;
+
+/**
+ * An implementation of ReferenceSetDao based on raw hibernate session factory
+ * injection and running within a spring managed context through auto-proxy
+ * generation. To use this in spring inject a property 'sessionFactory' with
+ * either a {@link org.springframework.orm.hibernate3.LocalSessionFactoryBean
+ * LocalSessionFactoryBean} or the equivalent class from the T2Platform module
+ * to add SPI based implementation discovery and mapping. To use outside of
+ * Spring ensure you call the setSessionFactory(..) method before using this
+ * (but really, use it from Spring, so much easier).
+ * <p>
+ * Methods in this Dao require transactional support
+ * 
+ * @author Tom Oinn
+ */
+public class TransactionalHibernateReferenceSetDao implements ReferenceSetDao {
+	private static final String GET_REFSETS_FOR_RUN = "FROM ReferenceSetImpl WHERE namespacePart=:workflow_run_id";
+	private SessionFactory sessionFactory;
+
+	public void setSessionFactory(SessionFactory sessionFactory) {
+		this.sessionFactory = sessionFactory;
+	}
+
+	/**
+	 * Store the specified new reference set
+	 * 
+	 * @param rs
+	 *            a reference set, must not already exist in the database.
+	 * @throws DaoException
+	 *             if the entry already exists in the database, if the supplied
+	 *             reference set isn't an instance of ReferenceSetImpl or if
+	 *             something else goes wrong connecting to the database
+	 */
+	@Override
+	@PutIdentifiedOperation
+	public void store(ReferenceSet rs) throws DaoException {
+		if (rs.getId() == null)
+			throw new DaoException(
+					"Supplied reference set has a null ID, allocate "
+							+ "an ID before calling the store method in the dao.");
+		if (!rs.getId().getReferenceType().equals(ReferenceSet))
+			throw new DaoException(
+					"Strangely the reference set ID doesn't have type "
+							+ "T2ReferenceType.ReferenceSet, something has probably "
+							+ "gone badly wrong somewhere earlier!");
+		if (!(rs instanceof ReferenceSetImpl))
+			throw new DaoException(
+					"Supplied reference set not an instance of ReferenceSetImpl");
+
+		try {
+			sessionFactory.getCurrentSession().save(rs);
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+
+	/**
+	 * Update a pre-existing entry in the database
+	 * 
+	 * @param rs
+	 *            the reference set to update. This must already exist in the
+	 *            database
+	 * @throws DaoException
+	 */
+	@Override
+	@PutIdentifiedOperation
+	public void update(ReferenceSet rs) throws DaoException {
+		if (rs.getId() == null)
+			throw new DaoException(
+					"Supplied reference set has a null ID, allocate "
+							+ "an ID before calling the store method in the dao.");
+		if (!rs.getId().getReferenceType().equals(ReferenceSet))
+			throw new DaoException(
+					"Strangely the reference set ID doesn't have type "
+							+ "T2ReferenceType.ReferenceSet, something has probably "
+							+ "gone badly wrong somewhere earlier!");
+		if (!(rs instanceof ReferenceSetImpl))
+			throw new DaoException(
+					"Supplied reference set not an instance of ReferenceSetImpl");
+
+		try {
+			sessionFactory.getCurrentSession().update(rs);
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+
+	/**
+	 * Fetch a reference set by id
+	 * 
+	 * @param ref
+	 *            the ReferenceSetT2ReferenceImpl to fetch
+	 * @return a retrieved ReferenceSetImpl
+	 * @throws DaoException
+	 *             if the supplied reference is of the wrong type or if
+	 *             something goes wrong fetching the data or connecting to the
+	 *             database
+	 */
+	@Override
+	@GetIdentifiedOperation
+	public ReferenceSetImpl get(T2Reference ref) throws DaoException {
+		if (ref == null)
+			throw new DaoException(
+					"Supplied reference is null, can't retrieve.");
+		if (!ref.getReferenceType().equals(ReferenceSet))
+			throw new DaoException(
+					"This dao can only retrieve reference of type T2Reference.ReferenceSet");
+		if (!(ref instanceof T2ReferenceImpl))
+			throw new DaoException(
+					"Reference must be an instance of T2ReferenceImpl");
+
+		try {
+			return (ReferenceSetImpl) sessionFactory.getCurrentSession().get(
+					ReferenceSetImpl.class,
+					((T2ReferenceImpl) ref).getCompactForm());
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+
+	@Override
+	@DeleteIdentifiedOperation
+	public boolean delete(ReferenceSet rs) throws DaoException {
+		if (rs.getId() == null)
+			throw new DaoException(
+					"Supplied reference set has a null ID, allocate "
+							+ "an ID before calling the store method in the dao.");
+		if (!rs.getId().getReferenceType().equals(ReferenceSet))
+			throw new DaoException(
+					"Strangely the reference set ID doesn't have type "
+							+ "T2ReferenceType.ReferenceSet, something has probably "
+							+ "gone badly wrong somewhere earlier!");
+		if (!(rs instanceof ReferenceSetImpl))
+			throw new DaoException(
+					"Supplied reference set not an instance of ReferenceSetImpl");
+
+		try {
+			sessionFactory.getCurrentSession().delete(rs);
+			return true;
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+
+	@Override
+	@SuppressWarnings("unchecked")
+	@DeleteIdentifiedOperation
+	public synchronized void deleteReferenceSetsForWFRun(String workflowRunId)
+			throws DaoException {
+		try {
+			// Select all ReferenceSets for this wf run
+			Query selectQuery = sessionFactory.getCurrentSession().createQuery(
+					GET_REFSETS_FOR_RUN);
+			selectQuery.setString("workflow_run_id", workflowRunId);
+			List<ReferenceSet> referenceSets = selectQuery.list();
+			for (ReferenceSet referenceSet : referenceSets)
+				delete(referenceSet);
+		} catch (Exception ex) {
+			throw new DaoException(ex);
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/TranslationPath.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/TranslationPath.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/TranslationPath.java
new file mode 100644
index 0000000..bd4a1f0
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/TranslationPath.java
@@ -0,0 +1,266 @@
+package net.sf.taverna.t2.reference.impl;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import net.sf.taverna.t2.reference.DereferenceException;
+import net.sf.taverna.t2.reference.ExternalReferenceBuilderSPI;
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.ExternalReferenceTranslatorSPI;
+import net.sf.taverna.t2.reference.ReferenceContext;
+import net.sf.taverna.t2.reference.ReferenceSet;
+
+/**
+ * A path from one external reference to another along with a total estimated
+ * path cost through one or more reference translators.
+ */
+public class TranslationPath implements Comparable<TranslationPath>,
+		Iterable<ExternalReferenceTranslatorSPI<?, ?>> {
+	private List<ExternalReferenceTranslatorSPI<?, ?>> translators = new ArrayList<>();
+	private ExternalReferenceBuilderSPI<?> initialBuilder = null;
+	private ExternalReferenceSPI sourceReference = null;
+	private List<ExternalReferenceBuilderSPI<?>> builders;
+
+	public TranslationPath() {
+	}
+
+	/**
+	 * Return a human readable representation of this translation path, used by
+	 * the logging methods to print trace information.
+	 */
+	@SuppressWarnings("rawtypes")
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder();
+		sb.append(getPathCost() + " ");
+		if (getSourceReference() != null && getInitialBuilder() != null) {
+			sb.append(getSourceReference()).append("->bytes(")
+					.append(getSourceReference().getResolutionCost())
+					.append(")->");
+			String builderClassName = getInitialBuilder().getClass()
+					.getSimpleName();
+			String builtType = getInitialBuilder().getReferenceType()
+					.getSimpleName();
+			sb.append("builder:").append(builderClassName).append("(")
+					.append(getInitialBuilder().getConstructionCost())
+					.append("):<").append(builtType).append(">");
+		} else if (!getTranslators().isEmpty())
+			sb.append("<")
+					.append(getTranslators().get(0).getSourceReferenceType()
+							.getSimpleName()).append(">");
+		for (ExternalReferenceTranslatorSPI translator : getTranslators())
+			sb.append("-")
+					.append(translator.getClass().getSimpleName())
+					.append("(")
+					.append(translator.getTranslationCost())
+					.append(")-<")
+					.append(translator.getTargetReferenceType().getSimpleName())
+					.append(">");
+		return sb.toString();
+	}
+
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public Set<ExternalReferenceSPI> doTranslation(ReferenceSet rs,
+			ReferenceContext context) {
+		Set<ExternalReferenceSPI> results = new HashSet<>();
+		/*
+		 * Firstly check whether we have an initial reference and builder
+		 * defined
+		 */
+		ExternalReferenceSPI currentReference = null;
+		if (getInitialBuilder() != null && getSourceReference() != null)
+			try (InputStream stream = getSourceReference().openStream(context)) {
+				ExternalReferenceSPI builtReference = getInitialBuilder()
+						.createReference(stream, context);
+				results.add(builtReference);
+				currentReference = builtReference;
+			} catch (IOException e) {
+				throw new DereferenceException(
+						"Can't create reference from stream", e);
+			}
+		if (!getTranslators().isEmpty() && currentReference == null)
+			/*
+			 * If there are translators in the path (there may not be if this is
+			 * a pure 'dereference and build' type path) and the
+			 * currentReference hasn't been set then search the existing
+			 * references for an appropriate starting point for the translation.
+			 */
+			for (ExternalReferenceSPI er : rs.getExternalReferences())
+				if (er.getClass().equals(
+						getTranslators().get(0).getSourceReferenceType())) {
+					currentReference = er;
+					break;
+				}
+		if (currentReference == null)
+			throw new RuntimeException(
+					"Can't locate a starting reference for the"
+							+ " translation path");
+
+		for (ExternalReferenceTranslatorSPI translator : getTranslators()) {
+			ExternalReferenceSPI translatedReference = translator
+					.createReference(currentReference, context);
+			results.add(translatedReference);
+			currentReference = translatedReference;
+		}
+		return results;
+	}
+
+	/**
+	 * Sum of translation costs of all translators in path
+	 */
+	public float getPathCost() {
+		float cost = 0.0f;
+		for (ExternalReferenceTranslatorSPI<?, ?> ert : this)
+			cost += ert.getTranslationCost();
+		/*
+		 * If the source reference and initial builder are non-null then we're
+		 * going to start this translation path by downloading a byte stream
+		 * from the specified (current) reference and using it to construct the
+		 * starting point for the translation path via the specified builder.
+		 */
+		if (getSourceReference() != null)
+			cost += getSourceReference().getResolutionCost();
+		if (getInitialBuilder() != null)
+			cost += getInitialBuilder().getConstructionCost();
+		return cost;
+	}
+
+	/**
+	 * Return a list of translation paths based on this one but which start at
+	 * an existing reference within the supplied reference set. Will only
+	 * function if there is a reference builder registered that can build the
+	 * initial reference type used by this translation path, otherwise it
+	 * returns an empty list.
+	 * 
+	 * @param rs
+	 * @return
+	 */
+	@SuppressWarnings("rawtypes")
+	public List<TranslationPath> getDereferenceBasedPaths(ReferenceSet rs) {
+		List<TranslationPath> results = new ArrayList<>();
+		for (ExternalReferenceBuilderSPI erb : getBuilders())
+			/*
+			 * Check for each reference builder to see if it can build the
+			 * source type for this path
+			 */
+			if (erb.getReferenceType().equals(this.getSourceType()))
+				/*
+				 * The builder can construct the type used by the start of this
+				 * translation path, so we can in general create a path from a
+				 * fooreference to the target by de-referencing the fooreference
+				 * and building the start type from it.
+				 */
+				for (ExternalReferenceSPI er : rs.getExternalReferences()) {
+					/*
+					 * For each external reference in the existing reference
+					 * set, check whether that type is already going to be
+					 * created in the translation path - if so then there's not
+					 * much point in emiting the modified path, as you'd have
+					 * something like bytes->a->b->a->result which wouldn't make
+					 * any sense
+					 */
+					boolean overlapsExistingType = false;
+					for (ExternalReferenceTranslatorSPI translationStep : this)
+						if (translationStep.getSourceReferenceType().equals(
+								er.getClass())) {
+							overlapsExistingType = true;
+							break;
+						}
+					if (!overlapsExistingType) {
+						/*
+						 * The type wasn't found anywhere within the translation
+						 * path, so we're not generating obviously stupid
+						 * candidate paths.
+						 */
+						TranslationPath newPath = new TranslationPath();
+						newPath.setBuilders(getBuilders());
+						newPath.setTranslators(getTranslators());
+						newPath.setInitialBuilder(erb);
+						newPath.setSourceReference(er);
+						results.add(newPath);
+					}
+				}
+		return results;
+	}
+
+	public List<ExternalReferenceTranslatorSPI<?, ?>> pathSteps() {
+		return getTranslators();
+	}
+
+	/**
+	 * Order by total path cost
+	 */
+	@Override
+	public int compareTo(TranslationPath tp) {
+		float tpCost = tp.getPathCost();
+		float myCost = getPathCost();
+		if (tpCost > myCost)
+			return -1;
+		if (tpCost < myCost)
+			return 1;
+		return 0;
+	}
+
+	/**
+	 * Wrap translator list iterator for convenience
+	 */
+	@Override
+	public Iterator<ExternalReferenceTranslatorSPI<?, ?>> iterator() {
+		return getTranslators().iterator();
+	}
+
+	public Class<? extends ExternalReferenceSPI> getSourceType() {
+		if (!getTranslators().isEmpty())
+			return getTranslators().get(0).getSourceReferenceType();
+		if (getSourceReference() != null)
+			return getSourceReference().getClass();
+		return null;
+	}
+
+	public Class<? extends ExternalReferenceSPI> getTargetType() {
+		if (!getTranslators().isEmpty())
+			return getTranslators().get(getTranslators().size() - 1)
+					.getTargetReferenceType();
+		if (getInitialBuilder() != null)
+			return getInitialBuilder().getReferenceType();
+		return null;
+	}
+
+	public List<ExternalReferenceTranslatorSPI<?, ?>> getTranslators() {
+		return translators;
+	}
+
+	public void setTranslators(
+			List<ExternalReferenceTranslatorSPI<?, ?>> translators) {
+		this.translators = translators;
+	}
+
+	public ExternalReferenceBuilderSPI<?> getInitialBuilder() {
+		return initialBuilder;
+	}
+
+	public void setInitialBuilder(ExternalReferenceBuilderSPI<?> initialBuilder) {
+		this.initialBuilder = initialBuilder;
+	}
+
+	public ExternalReferenceSPI getSourceReference() {
+		return sourceReference;
+	}
+
+	public void setSourceReference(ExternalReferenceSPI sourceReference) {
+		this.sourceReference = sourceReference;
+	}
+
+	public List<ExternalReferenceBuilderSPI<?>> getBuilders() {
+		return builders;
+	}
+
+	public void setBuilders(List<ExternalReferenceBuilderSPI<?>> builders) {
+		this.builders = builders;
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/UUIDT2ReferenceGenerator.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/UUIDT2ReferenceGenerator.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/UUIDT2ReferenceGenerator.java
new file mode 100644
index 0000000..9e6bbef
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/UUIDT2ReferenceGenerator.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import java.util.UUID;
+
+import net.sf.taverna.t2.reference.T2ReferenceGenerator;
+
+/**
+ * A T2ReferenceGenerator based on UUIDs. Not as fast as
+ * {@link SimpleT2ReferenceGenerator}, but IDs will be globally unique.
+ * 
+ * @author Stian Soiland-Reyes
+ */
+public class UUIDT2ReferenceGenerator extends AbstractT2ReferenceGenerator
+		implements T2ReferenceGenerator {
+	private String namespace = "uuid";
+
+	/**
+	 * Set the namespace for identifiers generated by this class as a string
+	 * 
+	 * @param newNamespace
+	 *            the namespace to use
+	 */
+	public void setNamespace(String newNamespace) {
+		this.namespace = newNamespace;
+	}
+	
+	@Override
+	public String getNamespace() {
+		return namespace;
+	}
+
+	@Override
+	protected String getNextLocalPart() {
+		return UUID.randomUUID().toString();
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/WriteQueueAspect.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/WriteQueueAspect.java b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/WriteQueueAspect.java
new file mode 100644
index 0000000..be1b68b
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/WriteQueueAspect.java
@@ -0,0 +1,142 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.reference.impl;
+
+import static java.util.concurrent.TimeUnit.SECONDS;
+
+import java.lang.ref.SoftReference;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.Executors;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+
+import net.sf.taverna.t2.reference.DaoException;
+import net.sf.taverna.t2.reference.Identified;
+import net.sf.taverna.t2.reference.T2Reference;
+
+import org.aspectj.lang.ProceedingJoinPoint;
+
+/**
+ * An aspect used to intercept calls to the various data access objects and
+ * execute data writes on a thread limited executer with an unbounded blocking
+ * queue.
+ * 
+ * @author David Withers
+ */
+public class WriteQueueAspect {
+	private Map<T2Reference, Identified> store = new ConcurrentHashMap<>();
+	private Map<T2Reference, SoftReference<Identified>> cache = new ConcurrentHashMap<>();
+	private ThreadPoolExecutor executer;
+
+	public WriteQueueAspect() {
+		this(5);
+	}
+
+	public WriteQueueAspect(int threads) {
+		executer = new ThreadPoolExecutor(threads, threads, 60, SECONDS,
+				new LinkedBlockingQueue<Runnable>(),
+				Executors.defaultThreadFactory(),
+				new ThreadPoolExecutor.CallerRunsPolicy());
+	}
+
+	/**
+	 * Handle a 'get by T2Reference' operation on a Dao
+	 * 
+	 * @param pjp
+	 *            the join point representing the ongoing method call to the dao
+	 * @return the entity identified by the T2Reference supplied to the method
+	 *         to which this advice applies
+	 * @throws DaoException
+	 *             if anything goes wrong
+	 */
+	public final Identified getObject(final ProceedingJoinPoint pjp)
+			throws DaoException {
+		Identified result = null;
+
+		// Get the T2Reference from the argument to the get method
+		T2Reference id = (T2Reference) pjp.getArgs()[0];
+		if (id != null) {
+			// try the cache
+			SoftReference<Identified> ref = cache.get(id);
+			if (ref != null)
+				result = ref.get();
+			if (result == null)
+				// not in the cache, check if it's still in the write queue
+				result = store.get(id);
+		}
+		// If we miss the cache then call the method as usual
+		if (result == null)
+			try {
+				result = (Identified) pjp.proceed();
+				if (result != null)
+					cache.put(id, new SoftReference<>(result));
+			} catch (DaoException e) {
+				throw e;
+			} catch (Throwable e) {
+				throw new DaoException(
+						"Unexpected exception type during aspect "
+								+ "based invocation", e);
+			}
+
+		return result;
+	}
+
+	/**
+	 * Called around a write or update operation on the backing store, writes
+	 * through to the cache after modifying the state of the backing store and
+	 * before returning from the dao method
+	 * 
+	 * @param pjp
+	 *            join point representing the ongoing method invocation to cache
+	 * @throws DaoException
+	 *             if anything goes wrong
+	 */
+	public void putObject(final ProceedingJoinPoint pjp) throws DaoException {
+		// Get the Identified being stored by the method we're advising
+		final Identified storedObject = (Identified) pjp.getArgs()[0];
+
+		Runnable task = new Runnable() {
+			@Override
+			public void run() {
+				try {
+					// Run the store or update method
+					pjp.proceed();
+					store.remove(storedObject.getId());
+				} catch (DaoException e) {
+					throw e;
+				} catch (Throwable e) {
+					throw new DaoException(
+							"Unexpected exception type during aspect "
+									+ "based invocation", e);
+				}
+			}
+		};
+
+		cache.put(storedObject.getId(), new SoftReference<>(storedObject));
+		store.put(storedObject.getId(), storedObject);
+		executer.execute(task);
+	}
+
+	public int cacheSize() {
+		return executer.getActiveCount() + executer.getQueue().size();
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/package.html
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/package.html b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/package.html
new file mode 100644
index 0000000..79e0107
--- /dev/null
+++ b/taverna-reference-impl/src/main/java/net/sf/taverna/t2/reference/impl/package.html
@@ -0,0 +1,5 @@
+<body>
+Implementation of the reference manager APIs backed by Hibernate. These
+classes are intended to be used with Spring, so have their dependencies
+injected through set methods rather than constructor arguments.
+</body>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.h3.HibernateComponentClass
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.h3.HibernateComponentClass b/taverna-reference-impl/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.h3.HibernateComponentClass
new file mode 100644
index 0000000..b7b5d58
--- /dev/null
+++ b/taverna-reference-impl/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.h3.HibernateComponentClass
@@ -0,0 +1,2 @@
+net.sf.taverna.t2.reference.impl.T2ReferenceImpl
+net.sf.taverna.t2.reference.impl.StackTraceElementBeanImpl
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.h3.HibernateMappedEntity
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.h3.HibernateMappedEntity b/taverna-reference-impl/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.h3.HibernateMappedEntity
new file mode 100644
index 0000000..ddf2cc5
--- /dev/null
+++ b/taverna-reference-impl/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.h3.HibernateMappedEntity
@@ -0,0 +1,3 @@
+net.sf.taverna.t2.reference.impl.ReferenceSetImpl
+net.sf.taverna.t2.reference.impl.T2ReferenceListImpl
+net.sf.taverna.t2.reference.impl.ErrorDocumentImpl
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/resources/META-INF/spring.handlers
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/resources/META-INF/spring.handlers b/taverna-reference-impl/src/main/resources/META-INF/spring.handlers
new file mode 100644
index 0000000..462f844
--- /dev/null
+++ b/taverna-reference-impl/src/main/resources/META-INF/spring.handlers
@@ -0,0 +1 @@
+http\://taverna.sf.net/schema/artifact-support=net.sf.taverna.platform.spring.ArtifactSupportNamespaceHandler
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/resources/META-INF/spring.schemas
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/resources/META-INF/spring.schemas b/taverna-reference-impl/src/main/resources/META-INF/spring.schemas
new file mode 100644
index 0000000..a4a0513
--- /dev/null
+++ b/taverna-reference-impl/src/main/resources/META-INF/spring.schemas
@@ -0,0 +1 @@
+http\://taverna.sf.net/schema/artifact-support/artifact-support.xsd=artifact-support.xsd
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/resources/META-INF/spring/hibernate-reference-impl-context.xml
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/resources/META-INF/spring/hibernate-reference-impl-context.xml b/taverna-reference-impl/src/main/resources/META-INF/spring/hibernate-reference-impl-context.xml
new file mode 100644
index 0000000..4fb8ba4
--- /dev/null
+++ b/taverna-reference-impl/src/main/resources/META-INF/spring/hibernate-reference-impl-context.xml
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+	<bean id="hibernateReferenceService" class="net.sf.taverna.t2.reference.impl.ReferenceServiceImpl">
+		<property name="converters" ref="converters" />
+		<property name="valueBuilders" ref="valueBuilders" />
+		<property name="referenceSetService">
+			<ref local="referenceSetService" />
+		</property>
+		<property name="listService">
+			<ref local="listService" />
+		</property>
+		<property name="errorDocumentService">
+			<ref local="errorDocumentService" />
+		</property>
+	</bean>
+
+	<bean id="referenceSetService" class="net.sf.taverna.t2.reference.impl.ReferenceSetServiceImpl">
+		<property name="referenceSetDao">
+			<ref local="referenceSetDao" />
+		</property>
+		<property name="t2ReferenceGenerator" ref="t2ReferenceGenerator" />
+		<property name="referenceSetAugmentor" ref="referenceSetAugmentor" />
+	</bean>
+
+	<bean id="listService" class="net.sf.taverna.t2.reference.impl.ListServiceImpl">
+		<property name="listDao">
+			<ref local="listDao" />
+		</property>
+		<property name="t2ReferenceGenerator" ref="t2ReferenceGenerator" />
+	</bean>
+
+	<bean id="errorDocumentService" class="net.sf.taverna.t2.reference.impl.ErrorDocumentServiceImpl">
+		<property name="errorDao">
+			<ref local="errorDocumentDao" />
+		</property>
+		<property name="t2ReferenceGenerator" ref="t2ReferenceGenerator" />
+	</bean>
+
+	<bean id="dataSource" class="javax.sql.DataSource"
+		factory-bean="databaseManager"
+		factory-method="getDataSource" />
+
+	<!-- Configure hibernate to use dynamic schema update -->
+	<bean id="hibernateProperties"
+		class="org.springframework.beans.factory.config.PropertiesFactoryBean">
+		<property name="properties">
+			<props>
+				<prop key="hibernate.hbm2ddl.auto">create</prop>
+				<prop key="hibernate.dialect">
+					org.hibernate.dialect.DerbyDialect
+				</prop>
+				<prop key="hibernate.query.substitutions">
+					true 'T', false 'F'
+				</prop>
+				<prop key="hibernate.show_sql">false</prop>
+				<prop key="hibernate.c3p0.minPoolSize">5</prop>
+				<prop key="hibernate.c3p0.maxPoolSize">20</prop>
+				<prop key="hibernate.c3p0.timeout">600</prop>
+				<prop key="hibernate.c3p0.max_statement">50</prop>
+				<prop key="hibernate.c3p0.testConnectionOnCheckout">
+					false
+				</prop>
+				<prop key="show_sql">true</prop>
+				<prop key="format_sql">true</prop>
+			</props>
+		</property>
+	</bean>
+
+	<!-- A regular hibernate session factory -->
+	<bean id="sessionFactoryBean"
+		class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
+		<property name="dataSource">
+			<ref local="dataSource" />
+		</property>
+		<property name="hibernateProperties">
+			<ref bean="hibernateProperties" />
+		</property>
+		<property name="mappingResources">
+			<list>
+				<value>
+					net/sf/taverna/t2/reference/AbstractExternalReference.hbm.xml
+				</value>
+				<value>
+					net/sf/taverna/t2/reference/impl/ReferenceSetImpl.hbm.xml
+				</value>
+				<value>
+					net/sf/taverna/t2/reference/impl/T2ReferenceListImpl.hbm.xml
+				</value>
+				<value>
+					net/sf/taverna/t2/reference/impl/ErrorDocumentImpl.hbm.xml
+				</value>
+			</list>
+		</property>
+	</bean>
+
+	<bean id="referenceSetDao" class="net.sf.taverna.t2.reference.impl.HibernateReferenceSetDao" >
+		<property name="sessionFactory">
+			<ref local="sessionFactoryBean" />
+		</property>
+	</bean>
+
+	<bean id="listDao" class="net.sf.taverna.t2.reference.impl.HibernateListDao" >
+		<property name="sessionFactory">
+			<ref local="sessionFactoryBean" />
+		</property>
+	</bean>
+
+	<bean id="errorDocumentDao" class="net.sf.taverna.t2.reference.impl.HibernateErrorDocumentDao" >
+		<property name="sessionFactory">
+			<ref local="sessionFactoryBean" />
+		</property>
+	</bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/resources/META-INF/spring/in-memory-reference-impl-context.xml
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/resources/META-INF/spring/in-memory-reference-impl-context.xml b/taverna-reference-impl/src/main/resources/META-INF/spring/in-memory-reference-impl-context.xml
new file mode 100644
index 0000000..3508214
--- /dev/null
+++ b/taverna-reference-impl/src/main/resources/META-INF/spring/in-memory-reference-impl-context.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans 
+        http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+	<bean id="inMemoryReferenceService" class="net.sf.taverna.t2.reference.impl.ReferenceServiceImpl">
+		<property name="converters" ref="converters" />
+		<property name="valueBuilders" ref="valueBuilders" />
+		<property name="referenceSetService">
+			<ref local="referenceSetService" />
+		</property>
+		<property name="listService">
+			<ref local="listService" />
+		</property>
+		<property name="errorDocumentService">
+			<ref local="errorDocumentService" />
+		</property>
+	</bean>
+
+	<bean id="referenceSetService" class="net.sf.taverna.t2.reference.impl.ReferenceSetServiceImpl">
+		<property name="referenceSetDao">
+			<ref local="referenceSetDao" />
+		</property>
+		<property name="t2ReferenceGenerator" ref="t2ReferenceGenerator" />
+		<property name="referenceSetAugmentor" ref="referenceSetAugmentor" />
+	</bean>
+
+	<bean id="listService" class="net.sf.taverna.t2.reference.impl.ListServiceImpl">
+		<property name="listDao">
+			<ref local="listDao" />
+		</property>
+		<property name="t2ReferenceGenerator" ref="t2ReferenceGenerator" />
+	</bean>
+
+	<bean id="errorDocumentService" class="net.sf.taverna.t2.reference.impl.ErrorDocumentServiceImpl">
+		<property name="errorDao">
+			<ref local="errorDocumentDao" />
+		</property>
+		<property name="t2ReferenceGenerator" ref="t2ReferenceGenerator" />
+	</bean>
+	
+	<bean id="referenceSetDao" class="net.sf.taverna.t2.reference.impl.InMemoryReferenceSetDao" />
+	<bean id="listDao" class="net.sf.taverna.t2.reference.impl.InMemoryListDao" />
+	<bean id="errorDocumentDao" class="net.sf.taverna.t2.reference.impl.InMemoryErrorDocumentDao" />
+
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/resources/META-INF/spring/reference-impl-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/resources/META-INF/spring/reference-impl-context-osgi.xml b/taverna-reference-impl/src/main/resources/META-INF/spring/reference-impl-context-osgi.xml
new file mode 100644
index 0000000..27430cd
--- /dev/null
+++ b/taverna-reference-impl/src/main/resources/META-INF/spring/reference-impl-context-osgi.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans:beans xmlns="http://www.springframework.org/schema/osgi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:beans="http://www.springframework.org/schema/beans" xmlns:osgix="http://www.springframework.org/schema/osgi-compendium"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/osgi
+        http://www.springframework.org/schema/osgi/spring-osgi.xsd
+        http://www.springframework.org/schema/osgi-compendium
+       	http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd">
+
+	<list id="converters" interface="net.sf.taverna.t2.reference.ValueToReferenceConverterSPI" cardinality="0..N" />
+	<list id="valueBuilders" interface="net.sf.taverna.t2.reference.StreamToValueConverterSPI" cardinality="0..N" />
+	<list id="builders" interface="net.sf.taverna.t2.reference.ExternalReferenceBuilderSPI" cardinality="0..N">
+		<listener ref="referenceSetAugmentor" bind-method="buildersUpdated" unbind-method="buildersUpdated" />
+	</list>
+	<list id="translators" interface="net.sf.taverna.t2.reference.ExternalReferenceTranslatorSPI" cardinality="0..N">
+		<listener ref="referenceSetAugmentor" bind-method="translatorsUpdated" unbind-method="translatorsUpdated" />
+	</list>
+
+    <reference id="databaseManager" interface="uk.org.taverna.configuration.database.DatabaseManager"/>
+
+	<service ref="inMemoryReferenceService" interface="net.sf.taverna.t2.reference.ReferenceService" />
+	<service ref="hibernateReferenceService" interface="net.sf.taverna.t2.reference.ReferenceService" />
+
+</beans:beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/resources/META-INF/spring/reference-impl-context.xml
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/resources/META-INF/spring/reference-impl-context.xml b/taverna-reference-impl/src/main/resources/META-INF/spring/reference-impl-context.xml
new file mode 100644
index 0000000..f87847b
--- /dev/null
+++ b/taverna-reference-impl/src/main/resources/META-INF/spring/reference-impl-context.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans 
+        http://www.springframework.org/schema/beans/spring-beans.xsd">
+	
+	<bean id="referenceSetAugmentor" class="net.sf.taverna.t2.reference.impl.ReferenceSetAugmentorImpl">
+		<property name="builders" ref="builders" />
+		<property name="translators" ref="translators" />
+	</bean>
+
+	<bean id="t2ReferenceGenerator" class="net.sf.taverna.t2.reference.impl.UUIDT2ReferenceGenerator">
+		<property name="namespace" value="taverna" />
+	</bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/resources/artifact-support.xsd
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/resources/artifact-support.xsd b/taverna-reference-impl/src/main/resources/artifact-support.xsd
new file mode 100644
index 0000000..9fd6891
--- /dev/null
+++ b/taverna-reference-impl/src/main/resources/artifact-support.xsd
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<xsd:schema xmlns="http://taverna.sf.net/schema/artifact-support"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	xmlns:beans="http://www.springframework.org/schema/beans"
+	targetNamespace="http://taverna.sf.net/schema/artifact-support"
+	elementFormDefault="qualified">
+
+	<xsd:import namespace="http://www.springframework.org/schema/beans" />
+
+	<xsd:attribute name="artifact" type="xsd:string" />
+	<xsd:attribute name="repository" type="xsd:string" />
+
+	<xsd:element name="repository">
+		<xsd:complexType>
+			<xsd:complexContent>
+				<xsd:extension base="beans:identifiedType">
+					<xsd:all>
+						<xsd:element ref="system" />
+						<xsd:element ref="repositories" />
+					</xsd:all>
+					<xsd:attribute name="base" type="xsd:string"
+						use="required" />
+				</xsd:extension>
+			</xsd:complexContent>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="system">
+		<xsd:complexType>
+			<xsd:sequence maxOccurs="unbounded" minOccurs="0">
+				<xsd:element ref="sys" />
+			</xsd:sequence>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="sys">
+		<xsd:complexType>
+			<xsd:attribute name="artifact" type="xsd:string" use="required"/>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="repositories">
+		<xsd:complexType>
+			<xsd:sequence maxOccurs="unbounded" minOccurs="0">
+				<xsd:element ref="rep" />
+			</xsd:sequence>
+		</xsd:complexType>
+	</xsd:element>
+
+	<xsd:element name="rep">
+		<xsd:complexType>
+			<xsd:attribute name="url" type="xsd:anyURI" use="required" />
+		</xsd:complexType>
+	</xsd:element>
+
+
+</xsd:schema>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/resources/net/sf/taverna/t2/reference/impl/ErrorDocumentImpl.hbm.xml
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/resources/net/sf/taverna/t2/reference/impl/ErrorDocumentImpl.hbm.xml b/taverna-reference-impl/src/main/resources/net/sf/taverna/t2/reference/impl/ErrorDocumentImpl.hbm.xml
new file mode 100644
index 0000000..0bf7bba
--- /dev/null
+++ b/taverna-reference-impl/src/main/resources/net/sf/taverna/t2/reference/impl/ErrorDocumentImpl.hbm.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+                "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+                "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<!-- Hibernate mapping for ErrorDocumentImpl -->
+<hibernate-mapping>
+	<class name="net.sf.taverna.t2.reference.impl.ErrorDocumentImpl"
+		abstract="false">
+		<id name="internalId" column="id" type="string"/>
+		<!--  Composite key constructed from the namespace and local -->
+		<!--  parts of the T2Reference implementation type           -->
+		<component name="typedId"
+			class="net.sf.taverna.t2.reference.impl.T2ReferenceImpl">
+			<property name="namespacePart" />
+			<property name="localPart" />
+			<property name="containsErrors"/>
+			<property name="depth"/>
+			<property name="referenceType"/>
+		</component>
+		<property name="message" length="10000"/>
+		<property name="exceptionMessage" length="10000"/>
+		<list name="stackTraceList" cascade="all" lazy="false">
+			<key column="id" not-null="true"/>
+			<list-index column="i" base="0" />
+			<composite-element
+				class="net.sf.taverna.t2.reference.impl.StackTraceElementBeanImpl">
+				<property name="fileName" />
+				<property name="className" />
+				<property name="methodName" />
+				<property name="lineNumber" />
+			</composite-element>
+		</list>
+		<set name="errorReferenceSet" cascade="all" lazy="false">
+			<key column="id" not-null="true"/>
+			<composite-element
+				class="net.sf.taverna.t2.reference.impl.T2ReferenceImpl">
+				<property name="namespacePart" />
+				<property name="localPart" />
+				<property name="containsErrors"/>
+				<property name="depth"/>
+				<property name="referenceType"/>
+			</composite-element>
+		</set>
+	</class>
+</hibernate-mapping>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/resources/net/sf/taverna/t2/reference/impl/ReferenceSetImpl.hbm.xml
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/resources/net/sf/taverna/t2/reference/impl/ReferenceSetImpl.hbm.xml b/taverna-reference-impl/src/main/resources/net/sf/taverna/t2/reference/impl/ReferenceSetImpl.hbm.xml
new file mode 100644
index 0000000..04c316d
--- /dev/null
+++ b/taverna-reference-impl/src/main/resources/net/sf/taverna/t2/reference/impl/ReferenceSetImpl.hbm.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+                "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+                "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<!-- Hibernate mapping for ReferenceSetImpl -->
+<hibernate-mapping>
+	<class name="net.sf.taverna.t2.reference.impl.ReferenceSetImpl"
+		abstract="false" lazy="false">
+		<id name="internalId" column="id" type="string"
+			unsaved-value="null" />
+			
+		<!--  Composite key constructed from the namespace and local -->
+		<!--  parts of the T2Reference implementation type, used as  -->
+		<!--  the foreign key in the one to many relationship with   -->
+		<!--  extensions of AbstractExternalReference                -->
+		
+		<component name="typedId"
+			class="net.sf.taverna.t2.reference.impl.T2ReferenceImpl">
+			<property name="namespacePart" />
+			<property name="localPart" />
+			<property name="containsErrors" />
+			<property name="depth" />
+			<property name="referenceType" />
+		</component>
+		<set name="externalReferences" cascade="all" lazy="false">
+			<key column="id" />
+			<one-to-many
+				class="net.sf.taverna.t2.reference.AbstractExternalReference" />
+		</set>
+		<property name="approximateSizeInBytes" />
+	</class>
+</hibernate-mapping>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/main/resources/net/sf/taverna/t2/reference/impl/T2ReferenceListImpl.hbm.xml
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/main/resources/net/sf/taverna/t2/reference/impl/T2ReferenceListImpl.hbm.xml b/taverna-reference-impl/src/main/resources/net/sf/taverna/t2/reference/impl/T2ReferenceListImpl.hbm.xml
new file mode 100644
index 0000000..b24c333
--- /dev/null
+++ b/taverna-reference-impl/src/main/resources/net/sf/taverna/t2/reference/impl/T2ReferenceListImpl.hbm.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+                "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+                "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<!-- Hibernate mapping for T2ReferenceListImpl, used by HibernateListDao -->
+<hibernate-mapping>
+	<class name="net.sf.taverna.t2.reference.impl.T2ReferenceListImpl"
+		abstract="false">
+		<id name="internalId" column="id" type="string"/>
+		<!--  Composite key constructed from the namespace and local -->
+		<!--  parts of the T2Reference implementation type, used as  -->
+		<!--  the foreign key in the one to many relationship with   -->
+		<!--  extensions of AbstractExternalReference                -->
+		<component name="typedId"
+			class="net.sf.taverna.t2.reference.impl.T2ReferenceImpl">
+			<property name="namespacePart" />
+			<property name="localPart" />
+			<property name="containsErrors" />
+			<property name="depth" />
+			<property name="referenceType" />
+		</component>
+		<list name="listContents" cascade="all" lazy="false">
+			<key column="id"/>
+			<list-index column="i" base="0" />
+			<composite-element
+				class="net.sf.taverna.t2.reference.impl.T2ReferenceImpl">
+				<!-- Explicit column mapping otherwise we collide with the implicit -->
+				<!-- mapping used in the key columns. Oh the joys of composites.. -->
+				<property name="namespacePart" column="c_namespace" />
+				<property name="localPart" column="c_local" />
+				<property name="containsErrors" column="c_errors" />
+				<property name="depth" column="c_depth" />
+				<property name="referenceType" column="c_type" />
+			</composite-element>
+		</list>
+	</class>
+</hibernate-mapping>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-reference-impl/src/test/java/net/sf/taverna/platform/spring/jdbc/TemporaryJDBCTest.java
----------------------------------------------------------------------
diff --git a/taverna-reference-impl/src/test/java/net/sf/taverna/platform/spring/jdbc/TemporaryJDBCTest.java b/taverna-reference-impl/src/test/java/net/sf/taverna/platform/spring/jdbc/TemporaryJDBCTest.java
new file mode 100644
index 0000000..449f2b6
--- /dev/null
+++ b/taverna-reference-impl/src/test/java/net/sf/taverna/platform/spring/jdbc/TemporaryJDBCTest.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.platform.spring.jdbc;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+
+import org.junit.Test;
+
+/**
+ * Test {@link TemporaryJDBC}
+ * 
+ * @author Stian Soiland-Reyes
+ *
+ */
+public class TemporaryJDBCTest {
+
+	private static final String DB = ".db";
+	private static final String T2PLATFORM = "t2platform-";
+	private static final String CREATE_TRUE = ";create=true";
+	private static final String JDBC_DERBY = "jdbc:derby:";
+
+	@Test
+	public void getDerby() throws Exception {
+		TemporaryJDBC temporaryJDBC = new TemporaryJDBC();
+		String jdbcURL = temporaryJDBC.getTemporaryDerbyJDBC();
+		assertTrue("Not a Derby URL", jdbcURL.startsWith(JDBC_DERBY));
+		String url = jdbcURL.split(JDBC_DERBY)[1];
+		assertTrue("Did not end with " + CREATE_TRUE, url.endsWith(CREATE_TRUE));
+		String location = url.split(CREATE_TRUE)[0];
+		assertFalse("Location was an empty string", location.equals(""));
+		File locationFile = new File(location);
+		assertFalse("File already exists: " + locationFile, locationFile.exists());
+		File parentFile = locationFile.getParentFile();
+		assertTrue("Parent directory did not exist", parentFile.isDirectory());
+		assertTrue("Did not end with " + T2PLATFORM, parentFile.getName().startsWith(T2PLATFORM));
+		assertTrue("Did not start with " + DB , parentFile.getName().endsWith(DB));
+	}
+	
+}


[32/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/t2flow/FetchTodaysXkcdComic.t2flow
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/t2flow/FetchTodaysXkcdComic.t2flow b/taverna-platform-integration-tests/src/test/resources/t2flow/FetchTodaysXkcdComic.t2flow
new file mode 100644
index 0000000..4aeef6f
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/t2flow/FetchTodaysXkcdComic.t2flow
@@ -0,0 +1,343 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3.0"><dataflow id="24e3ca77-bca1-47a6-8f5e-0549801eb27e" role="top"><name>Fetch_today_s_xkcd_comic</name><inputPorts /><outputPorts><port><name>todaysXkcd</name><annotations /></port></outputPorts><processors><processor><name>getPage</name><inputPorts><port><name>url</name><depth>0</depth></port></inputPorts><outputPorts><port><name>contents</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivity</class><inputMap><map from="url" to="url" /></inputMap><outputMap><map from="contents" to="contents" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>url</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/x-taverna-web-url'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>base</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/x-taverna-web-url'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>contents</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain,text/html'</string>
+      </mimeTypes>
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>URL inputURL = null;
+if (base != void) {
+  inputURL = new URL(new URL(base), url);
+}
+else {
+  inputURL = new URL(url);
+}
+URLConnection con = inputURL.openConnection();
+InputStream in = con.getInputStream();
+
+InputStreamReader isr = new InputStreamReader(in);
+Reader inReader = new BufferedReader(isr);
+
+StringBuffer buf = new StringBuffer();
+int ch;
+while ((ch = inReader.read()) &gt; -1) {
+  buf.append((char)ch);
+}
+inReader.close();
+contents = buf.toString();
+
+
+//String NEWLINE = System.getProperty("line.separator");
+//
+//URL inputURL = null;
+//if (base != void) {
+//	inputURL = new URL(new URL(base), url);
+//} else {
+//	inputURL = new URL(url);
+//}
+//StringBuffer result = new StringBuffer();
+//BufferedReader reader = new BufferedReader(new InputStreamReader(inputURL.openStream()));
+//String line = null;
+//while ((line = reader.readLine()) != null) {
+//	result.append(line);
+//	result.append(NEWLINE);
+//}
+//
+//contents = result.toString();
+</script>
+  <dependencies />
+  <localworkerName>org.embl.ebi.escience.scuflworkers.java.WebPageFetcher</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="url" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>xkcdURL</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" to="value" />
 </outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>http://xkcd.com/</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>getImageLinks</name><inputPorts><port><name>document</name><depth>0</depth></port></inputPorts><outputPorts><port><name>imagelinks</name><depth>1</depth><granularDepth>1</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivity</class><inputMap><map from="document" to="document"
  /></inputMap><outputMap><map from="imagelinks" to="imagelinks" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>document</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/html'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>imagelinks</name>
+      <depth>1</depth>
+      <mimeTypes>
+        <string>l('text/x-taverna-web-url')</string>
+      </mimeTypes>
+      <granularDepth>1</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>String lowerCaseContent = document.toLowerCase();
+int index = 0;
+List imagelinks = new ArrayList();
+while ((index = lowerCaseContent.indexOf("&lt;img", index)) != -1) {
+	if ((index = lowerCaseContent.indexOf("src", index)) == -1)
+		break;
+	if ((index = lowerCaseContent.indexOf("=", index)) == -1)
+		break;
+	index++;
+	String remaining = document.substring(index);
+	StringTokenizer st = new StringTokenizer(remaining, "\t\n\r\"&gt;#");
+	String strLink = st.nextToken();
+	imagelinks.add(strLink);
+}
+
+</script>
+  <dependencies />
+  <localworkerName>org.embl.ebi.escience.scuflworkers.java.ExtractImageLinks</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="document" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>findComicURL</name><inputPorts><port><name>regex</name><depth>0</depth></port><port><name>stringlist</name><depth>1</depth></port></inputPorts><outputPorts><port><name>filteredlist</name><depth>1</depth><granularDepth>1</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.
 sf.taverna.t2.activities.localworker.LocalworkerActivity</class><inputMap><map from="regex" to="regex" /><map from="stringlist" to="stringlist" /></inputMap><outputMap><map from="filteredlist" to="filteredlist" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>stringlist</name>
+      <depth>1</depth>
+      <mimeTypes>
+        <string>l('text/plain')</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>regex</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>filteredlist</name>
+      <depth>1</depth>
+      <mimeTypes>
+        <string>l('text/plain')</string>
+      </mimeTypes>
+      <granularDepth>1</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>filteredlist = new ArrayList();
+for (Iterator i = stringlist.iterator(); i.hasNext();) {
+	String item = (String) i.next();
+	if (item.matches(regex)) {
+		filteredlist.add(item);
+	}
+}
+</script>
+  <dependencies />
+  <localworkerName>org.embl.ebi.escience.scuflworkers.java.FilterStringList</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="regex" depth="0" /><port name="stringlist" depth="1" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>comicURLRegex</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap 
 /><outputMap><map from="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>.*/comics/.*</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>getComicStrip</name><inputPorts><port><name>base</name><depth>0</depth></port><port><name>url</name><depth>0</depth></port></inputPorts><outputPorts><port><name>image</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivity</class><inputMa
 p><map from="base" to="base" /><map from="url" to="url" /></inputMap><outputMap><map from="image" to="image" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>url</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/x-taverna-web-url'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>base</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/x-taverna-web-url'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>image</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'image/*'</string>
+      </mimeTypes>
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>URL inputURL = null;
+if (base != void) {
+	inputURL = new URL(new URL(base), url);
+} else {
+	inputURL = new URL(url);
+}
+
+byte[] contents;
+if (inputURL.openConnection().getContentLength() == -1) {
+	// Content size unknown, must read first...
+	byte[] buffer = new byte[1024];
+	int bytesRead = 0;
+	int totalBytesRead = 0;
+	InputStream is = inputURL.openStream();
+	while (bytesRead != -1) {
+		totalBytesRead += bytesRead;
+		bytesRead = is.read(buffer, 0, 1024);
+	}
+	contents = new byte[totalBytesRead];
+} else {
+	contents = new byte[inputURL.openConnection().getContentLength()];
+}
+int bytesRead = 0;
+int totalBytesRead = 0;
+InputStream is = inputURL.openStream();
+while (bytesRead != -1) {
+	bytesRead = is.read(contents, totalBytesRead, contents.length - totalBytesRead);
+	totalBytesRead += bytesRead;
+	if (contents.length==totalBytesRead) break;
+}
+
+image = contents;
+</script>
+  <dependencies />
+  <localworkerName>org.embl.ebi.escience.scuflworkers.java.WebImageFetcher</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="base" depth="0" /><port name="url" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>getPage</processor><port>url</port></sink><source type="processor"><processor>xkcdURL</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>getImageLinks</processor><port>document</port></sink><source type="processor"><processor>getPage</processor><port>contents</port></source></datalink><datali
 nk><sink type="processor"><processor>findComicURL</processor><port>regex</port></sink><source type="processor"><processor>comicURLRegex</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>findComicURL</processor><port>stringlist</port></sink><source type="processor"><processor>getImageLinks</processor><port>imagelinks</port></source></datalink><datalink><sink type="processor"><processor>getComicStrip</processor><port>base</port></sink><source type="processor"><processor>xkcdURL</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>getComicStrip</processor><port>url</port></sink><source type="processor"><processor>findComicURL</processor><port>filteredlist</port></source></datalink><datalink><sink type="dataflow"><port>todaysXkcd</port></sink><source type="processor"><processor>getComicStrip</processor><port>image</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream">
 <net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>24e3ca77-bca1-47a6-8f5e-0549801eb27e</identification>
+      </annotationBean>
+      <date>2011-07-12 14:11:15.348 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.DescriptiveTitle">
+        <text>Fetch today's xkcd comic</text>
+      </annotationBean>
+      <date>2009-12-15 20:39:06.623 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>8b032490-948e-4983-b632-d16653755fcd</identification>
+      </annotationBean>
+      <date>2010-07-04 18:16:02.491 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.FreeTextDescription">
+        <text>Use the local services and some filtering operations to fetch the comic strip image from http://xkcd.com/
+
+Based on the FetchDailyDilbert workflow.</text>
+      </annotationBean>
+      <date>2011-07-12 14:11:12.608 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.Author">
+        <text>Tom Oinn, Stian Soiland-Reyes</text>
+      </annotationBean>
+      <date>2009-12-15 20:38:58.43 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/t2flow/GBSeqTest.t2flow
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/t2flow/GBSeqTest.t2flow b/taverna-platform-integration-tests/src/test/resources/t2flow/GBSeqTest.t2flow
new file mode 100644
index 0000000..196a4bc
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/t2flow/GBSeqTest.t2flow
@@ -0,0 +1,518 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3.0"><dataflow id="c00b121a-0114-471a-bd29-03597414879c" role="top"><name>GBSeq_test</name><inputPorts /><outputPorts><port><name>nuc_fasta</name><annotations /></port><port><name>nuc_xml</name><annotations /></port><port><name>nuc_insd</name><annotations /></port><port><name>nuc_tiny</name><annotations /></port><port><name>prot_fasta</name><annotations /></port><port><name>protein_xml</name><annotations /></port><port><name>prot_insd</name><annotations /></port><port><name>prot_tiny</name><annotations /></port></outputPorts><processors><processor><name>nuc_id</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.stringconstant.St
 ringConstantActivity</class><inputMap /><outputMap><map from="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>NM_000059</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>protein_id</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf
 .taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>NP_000050</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>Get_Nucleotide_INSDSeq_XML</name><inputPorts><port><name>id</name><depth>0</depth></port></inputPorts><outputPorts><port><name>outputText</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivity</class><inputMap><map from="id" to="id" /></
 inputMap><outputMap><map from="outputText" to="outputText" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>id</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>outputText</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>if ((id == void) || (id == null) || id.equals("")) {
+	throw new RunTimeException("port id must have a non-empty value");
+}
+
+URL url = new URL ("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?rettype=gbc&amp;db=nucleotide&amp;retmode=xml&amp;id=" + id);
+
+BufferedReader reader = new BufferedReader (new InputStreamReader(url.openStream()));
+StringWriter writer = new StringWriter();
+
+char[] buffer = new char[1024];
+    while (true) {
+        int r = reader.read(buffer);
+        if (r &lt;= 0) {
+            break;
+        }
+        writer.write(buffer, 0, r);
+    }
+outputText = writer.toString();
+</script>
+  <dependencies />
+  <localworkerName>net.sourceforge.taverna.scuflworkers.ncbi.NucleotideINSDSeqXMLWorker</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="id" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>Get_Nucleotide_FASTA</name><inputPorts><port><name>id</name><depth>0</depth></port></inputPorts><outputPorts><port><name>outputText</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivit
 y</class><inputMap><map from="id" to="id" /></inputMap><outputMap><map from="outputText" to="outputText" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>id</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>outputText</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>if ((id == void) || (id == null) || id.equals("")) {
+	throw new RunTimeException("port id must have a non-empty value");
+}
+
+URL url = new URL ("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?rettype=fasta&amp;db=nucleotide&amp;retmode=text&amp;id=" + id);
+
+BufferedReader reader = new BufferedReader (new InputStreamReader(url.openStream()));
+StringWriter writer = new StringWriter();
+
+char[] buffer = new char[1024];
+    while (true) {
+        int r = reader.read(buffer);
+        if (r &lt;= 0) {
+            break;
+        }
+        writer.write(buffer, 0, r);
+    }
+outputText = writer.toString();
+</script>
+  <dependencies />
+  <localworkerName>net.sourceforge.taverna.scuflworkers.ncbi.NucleotideFastaWorker</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="id" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>Get_Nucleotide_GBSeq_XML</name><inputPorts><port><name>id</name><depth>0</depth></port></inputPorts><outputPorts><port><name>outputText</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerAct
 ivity</class><inputMap><map from="id" to="id" /></inputMap><outputMap><map from="outputText" to="outputText" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>id</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>outputText</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>if ((id == void) || (id == null) || id.equals("")) {
+	throw new RunTimeException("port id must have a non-empty value");
+}
+
+URL url = new URL ("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?rettype=gb&amp;db=nucleotide&amp;retmode=xml&amp;id=" + id);
+
+BufferedReader reader = new BufferedReader (new InputStreamReader(url.openStream()));
+StringWriter writer = new StringWriter();
+
+char[] buffer = new char[1024];
+    while (true) {
+        int r = reader.read(buffer);
+        if (r &lt;= 0) {
+            break;
+        }
+        writer.write(buffer, 0, r);
+    }
+outputText = writer.toString();
+</script>
+  <dependencies />
+  <localworkerName>net.sourceforge.taverna.scuflworkers.ncbi.NucleotideGBSeqWorker</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="id" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>Get_Nucleotide_TinySeq_XML</name><inputPorts><port><name>id</name><depth>0</depth></port></inputPorts><outputPorts><port><name>outputText</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerA
 ctivity</class><inputMap><map from="id" to="id" /></inputMap><outputMap><map from="outputText" to="outputText" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>id</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>outputText</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>if ((id == void) || (id == null) || id.equals("")) {
+	throw new RunTimeException("port id must have a non-empty value");
+}
+
+URL url = new URL ("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?rettype=fasta&amp;db=nucleotide&amp;retmode=xml&amp;id=" + id);
+
+BufferedReader reader = new BufferedReader (new InputStreamReader(url.openStream()));
+StringWriter writer = new StringWriter();
+
+char[] buffer = new char[1024];
+    while (true) {
+        int r = reader.read(buffer);
+        if (r &lt;= 0) {
+            break;
+        }
+        writer.write(buffer, 0, r);
+    }
+outputText = writer.toString();
+</script>
+  <dependencies />
+  <localworkerName>net.sourceforge.taverna.scuflworkers.ncbi.NucleotideTinySeqXMLWorker</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="id" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>Get_Protein_FASTA</name><inputPorts><port><name>id</name><depth>0</depth></port></inputPorts><outputPorts><port><name>outputText</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivity</
 class><inputMap><map from="id" to="id" /></inputMap><outputMap><map from="outputText" to="outputText" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>id</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>outputText</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>if ((id == void) || (id == null) || id.equals("")) {
+	throw new RunTimeException("port id must have a non-empty value");
+}
+
+URL url = new URL ("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?rettype=fasta&amp;db=protein&amp;retmode=text&amp;id=" + id);
+
+BufferedReader reader = new BufferedReader (new InputStreamReader(url.openStream()));
+StringWriter writer = new StringWriter();
+
+char[] buffer = new char[1024];
+    while (true) {
+        int r = reader.read(buffer);
+        if (r &lt;= 0) {
+            break;
+        }
+        writer.write(buffer, 0, r);
+    }
+outputText = writer.toString();
+</script>
+  <dependencies />
+  <localworkerName>net.sourceforge.taverna.scuflworkers.ncbi.ProteinFastaWorker</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="id" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>Get_Protein_INSDSeq_XML</name><inputPorts><port><name>id</name><depth>0</depth></port></inputPorts><outputPorts><port><name>outputText</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActi
 vity</class><inputMap><map from="id" to="id" /></inputMap><outputMap><map from="outputText" to="outputText" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>id</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>outputText</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>if ((id == void) || (id == null) || id.equals("")) {
+	throw new RunTimeException("port id must have a non-empty value");
+}
+
+URL url = new URL ("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?rettype=gbc&amp;db=protein&amp;retmode=xml&amp;id=" + id);
+
+BufferedReader reader = new BufferedReader (new InputStreamReader(url.openStream()));
+StringWriter writer = new StringWriter();
+
+char[] buffer = new char[1024];
+    while (true) {
+        int r = reader.read(buffer);
+        if (r &lt;= 0) {
+            break;
+        }
+        writer.write(buffer, 0, r);
+    }
+outputText = writer.toString();
+</script>
+  <dependencies />
+  <localworkerName>net.sourceforge.taverna.scuflworkers.ncbi.ProteinINSDSeqXMLWorker</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="id" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>Get_Protein_TinySeq_XML</name><inputPorts><port><name>id</name><depth>0</depth></port></inputPorts><outputPorts><port><name>outputText</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActi
 vity</class><inputMap><map from="id" to="id" /></inputMap><outputMap><map from="outputText" to="outputText" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>id</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>outputText</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>if ((id == void) || (id == null) || id.equals("")) {
+	throw new RunTimeException("port id must have a non-empty value");
+}
+
+URL url = new URL ("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?rettype=fasta&amp;db=protein&amp;retmode=xml&amp;id=" + id);
+
+BufferedReader reader = new BufferedReader (new InputStreamReader(url.openStream()));
+StringWriter writer = new StringWriter();
+
+char[] buffer = new char[1024];
+    while (true) {
+        int r = reader.read(buffer);
+        if (r &lt;= 0) {
+            break;
+        }
+        writer.write(buffer, 0, r);
+    }
+outputText = writer.toString();
+</script>
+  <dependencies />
+  <localworkerName>net.sourceforge.taverna.scuflworkers.ncbi.ProteinTinySeqXMLWorker</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="id" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>Get_Protein_GBSeq_XML</name><inputPorts><port><name>id</name><depth>0</depth></port></inputPorts><outputPorts><port><name>outputText</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivi
 ty</class><inputMap><map from="id" to="id" /></inputMap><outputMap><map from="outputText" to="outputText" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>id</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>outputText</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>if ((id == void) || (id == null) || id.equals("")) {
+	throw new RunTimeException("port id must have a non-empty value");
+}
+
+URL url = new URL ("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?rettype=gb&amp;db=protein&amp;retmode=xml&amp;id=" + id);
+
+BufferedReader reader = new BufferedReader (new InputStreamReader(url.openStream()));
+StringWriter writer = new StringWriter();
+
+char[] buffer = new char[1024];
+    while (true) {
+        int r = reader.read(buffer);
+        if (r &lt;= 0) {
+            break;
+        }
+        writer.write(buffer, 0, r);
+    }
+outputText = writer.toString();
+</script>
+  <dependencies />
+  <localworkerName>net.sourceforge.taverna.scuflworkers.ncbi.ProteinGBSeqWorker</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="id" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>Get_Nucleotide_INSDSeq_XML</processor><port>id</port></sink><source type="processor"><processor>nuc_id</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>Get_Nucleotide_FASTA</processor><port>id</port></sink><source type="processor"><processor>nuc_id</processor><port>value</port></source></datalink><datalink><sink type="pr
 ocessor"><processor>Get_Nucleotide_GBSeq_XML</processor><port>id</port></sink><source type="processor"><processor>nuc_id</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>Get_Nucleotide_TinySeq_XML</processor><port>id</port></sink><source type="processor"><processor>nuc_id</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>Get_Protein_FASTA</processor><port>id</port></sink><source type="processor"><processor>protein_id</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>Get_Protein_INSDSeq_XML</processor><port>id</port></sink><source type="processor"><processor>protein_id</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>Get_Protein_TinySeq_XML</processor><port>id</port></sink><source type="processor"><processor>protein_id</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>Ge
 t_Protein_GBSeq_XML</processor><port>id</port></sink><source type="processor"><processor>protein_id</processor><port>value</port></source></datalink><datalink><sink type="dataflow"><port>nuc_fasta</port></sink><source type="processor"><processor>Get_Nucleotide_FASTA</processor><port>outputText</port></source></datalink><datalink><sink type="dataflow"><port>nuc_xml</port></sink><source type="processor"><processor>Get_Nucleotide_GBSeq_XML</processor><port>outputText</port></source></datalink><datalink><sink type="dataflow"><port>nuc_insd</port></sink><source type="processor"><processor>Get_Nucleotide_INSDSeq_XML</processor><port>outputText</port></source></datalink><datalink><sink type="dataflow"><port>nuc_tiny</port></sink><source type="processor"><processor>Get_Nucleotide_TinySeq_XML</processor><port>outputText</port></source></datalink><datalink><sink type="dataflow"><port>prot_fasta</port></sink><source type="processor"><processor>Get_Protein_FASTA</processor><port>outputText</por
 t></source></datalink><datalink><sink type="dataflow"><port>protein_xml</port></sink><source type="processor"><processor>Get_Protein_GBSeq_XML</processor><port>outputText</port></source></datalink><datalink><sink type="dataflow"><port>prot_insd</port></sink><source type="processor"><processor>Get_Protein_INSDSeq_XML</processor><port>outputText</port></source></datalink><datalink><sink type="dataflow"><port>prot_tiny</port></sink><source type="processor"><processor>Get_Protein_TinySeq_XML</processor><port>outputText</port></source></datalink></datalinks><annotations><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.DescriptiveTitle">
+        <text>GBSeq test</text>
+      </annotationBean>
+      <date>2009-12-15 20:30:12.959 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.FreeTextDescription">
+        <text>This workflow retrieves nucleotide and protein sequences with the literature and references associated
+to them given a protein and a nucleotide id.</text>
+      </annotationBean>
+      <date>2009-12-15 20:30:23.505 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>f0fac9a7-7943-4191-a0d3-7e8e09044e43</identification>
+      </annotationBean>
+      <date>2010-07-04 18:16:42.290 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>c00b121a-0114-471a-bd29-03597414879c</identification>
+      </annotationBean>
+      <date>2011-07-12 14:07:08.97 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>af08cba7-dd16-404c-b20b-fd3cb7ccf7aa</identification>
+      </annotationBean>
+      <date>2011-07-12 14:06:02.422 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.Author">
+        <text>Franck Tanoh</text>
+      </annotationBean>
+      <date>2011-07-12 14:07:04.790 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain></annotations></dataflow></workflow>
\ No newline at end of file


[20/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/scufl2.rdf
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/scufl2.rdf b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/scufl2.rdf
new file mode 100644
index 0000000..15d64c9
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/scufl2.rdf
@@ -0,0 +1,1567 @@
+<?xml version="1.0"?>
+
+
+<!DOCTYPE rdf:RDF [
+    <!ENTITY dcterms "http://purl.org/dc/terms/" >
+    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
+    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
+    <!ENTITY xml "http://www.w3.org/XML/1998/namespace" >
+    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
+    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
+]>
+
+
+<rdf:RDF xmlns="http://ns.taverna.org.uk/2010/scufl2#"
+     xml:base="http://ns.taverna.org.uk/2010/scufl2"
+     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+     xmlns:owl="http://www.w3.org/2002/07/owl#"
+     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
+     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+     xmlns:xml="http://www.w3.org/XML/1998/namespace"
+     xmlns:dcterms="http://purl.org/dc/terms/">
+    <owl:Ontology rdf:about="http://ns.taverna.org.uk/2010/scufl2">
+        <rdfs:label xml:lang="en">SCUFL2 Core ontology</rdfs:label>
+        <rdfs:comment xml:lang="en">The ontology defining SCUFL2 - a model for describing Taverna workflows.</rdfs:comment>
+        <owl:imports rdf:resource="http://purl.org/dc/terms/"/>
+        <rdfs:seeAlso rdf:resource="http://www.mygrid.org.uk/dev/wiki/display/developer/Scufl2+Ontology"/>
+        <rdfs:seeAlso rdf:resource="http://www.taverna.org.uk/"/>
+    </owl:Ontology>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Annotation properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Datatypes
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Object Properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#activateConfiguration -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#activateConfiguration">
+        <rdfs:label xml:lang="en">activate configuration</rdfs:label>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Configuration"/>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Profile"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#workflowRelation"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#activityPort -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#activityPort">
+        <rdfs:label xml:lang="en">Activity port</rdfs:label>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Activity"/>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#ActivityPort"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#port"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#bind -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#bind">
+        <rdf:type rdf:resource="&owl;AsymmetricProperty"/>
+        <rdf:type rdf:resource="&owl;IrreflexiveProperty"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#workflowRelation"/>
+        <rdfs:domain>
+            <owl:Class>
+                <owl:unionOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#PortBinding"/>
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#ProcessorBinding"/>
+                </owl:unionOf>
+            </owl:Class>
+        </rdfs:domain>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#bindActivity -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#bindActivity">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:label xml:lang="en">bind activity</rdfs:label>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Activity"/>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#ProcessorBinding"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#bind"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#bindInputActivityPort -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#bindInputActivityPort">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:label xml:lang="en">bind input activity port</rdfs:label>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#InputActivityPort"/>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#InputPortBinding"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#bindPort"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#bindInputProcessorPort -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#bindInputProcessorPort">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:label xml:lang="en">bind input processor port</rdfs:label>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#InputPortBinding"/>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#InputProcessorPort"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#bindPort"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#bindOutputActivityPort -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#bindOutputActivityPort">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:label xml:lang="en">bind output activity port</rdfs:label>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#OutputActivityPort"/>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#OutputPortBinding"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#bindPort"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#bindOutputProcessorPort -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#bindOutputProcessorPort">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:label xml:lang="en">bind output processor port</rdfs:label>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#OutputPortBinding"/>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#OutputProcessorPort"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#bindPort"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#bindPort -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#bindPort">
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#PortBinding"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#bind"/>
+        <rdfs:range>
+            <owl:Class>
+                <owl:unionOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#ActivityPort"/>
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#ProcessorPort"/>
+                </owl:unionOf>
+            </owl:Class>
+        </rdfs:range>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#bindProcessor -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#bindProcessor">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:label xml:lang="en">bind processor</rdfs:label>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Processor"/>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#ProcessorBinding"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#bind"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#block -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#block">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Blocking"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#controlledProcessor"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#child -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#child">
+        <rdf:type rdf:resource="&owl;AsymmetricProperty"/>
+        <rdf:type rdf:resource="&owl;InverseFunctionalProperty"/>
+        <rdf:type rdf:resource="&owl;IrreflexiveProperty"/>
+        <rdfs:label xml:lang="en">child</rdfs:label>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Child"/>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Parent"/>
+        <owl:inverseOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#parent"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#workflowRelation"/>
+        <rdfs:subPropertyOf rdf:resource="&dcterms;hasPart"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#configure -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#configure">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:label xml:lang="en">configure</rdfs:label>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Configurable"/>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Configuration"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#workflowRelation"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#control -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#control">
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Control"/>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Workflow"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#child"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#controlledProcessor -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#controlledProcessor">
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Control"/>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Processor"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#workflowRelation"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#controllingProcessor -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#controllingProcessor">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:label xml:lang="en">controlling processor</rdfs:label>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Control"/>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Processor"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#workflowRelation"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#datalink -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#datalink">
+        <rdfs:label xml:lang="en">datalink</rdfs:label>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#DataLink"/>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Workflow"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#child"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#dispatchStack -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#dispatchStack">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:label xml:lang="en">dispatch stack</rdfs:label>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#DispatchStack"/>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Processor"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#child"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#globalBaseURI -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#globalBaseURI">
+        <rdf:type rdf:resource="&owl;SymmetricProperty"/>
+        <rdf:type rdf:resource="&owl;TransitiveProperty"/>
+        <rdfs:comment>The resources are the same (like in owl:sameAs), and
+      so are the sub-resources having the same base URI as a parent.  For instance if 
+        &lt;file:///tmp/example/&gt; scufl2:globalBaseURI 
+            &lt;http://ns.taverna.org.uk/2010/workflowBundle/28f7c554-4f35-401f-b34b-516e9a0ef731/&gt; .
+      then also 
+        &lt;file:///tmp/example/workflow/HelloWorld/&gt; scufl2:globalBaseURI 
+            &lt;http://ns.taverna.org.uk/2010/workflowBundle/28f7c554-4f35-401f-b34b-516e9a0ef731/workflow/HelloWorld/&gt; 
+
+      Note that for URIs under
+      &lt;http://ns.taverna.org.uk/2010/workflowBundle/&gt; special URI template rules
+      link the URI with the scufl2:parent, rdf:type, scufl2:name of the
+      resource. 
+      
+      For instance given 
+        &lt;http://ns.taverna.org.uk/2010/workflowBundle/28f7c554-4f35-401f-b34b-516e9a0ef731/workflow/HelloWorld/processor/Hello/out/greeting&gt; 
+      it must be so that:
+
+        &lt;http://ns.taverna.org.uk/2010/workflowBundle/28f7c554-4f35-401f-b34b-516e9a0ef731/workflow/HelloWorld/processor/Hello/out/greeting&gt;
+            a scufl2:OutputProcessorPort;
+            scufl2:name &quot;greeting&quot;;
+            scufl2:parent &lt;http://ns.taverna.org.uk/2010/workflowBundle/28f7c554-4f35-401f-b34b-516e9a0ef731/workflow/HelloWorld/processor/Hello&gt;.
+
+        &lt;http://ns.taverna.org.uk/2010/workflowBundle/28f7c554-4f35-401f-b34b-516e9a0ef731/workflow/HelloWorld/processor/Hello&gt;
+            a scufl2:Processor;
+            scufl2:name &quot;Hello&quot;;
+            scufl2:parent &lt;http://ns.taverna.org.uk/2010/workflowBundle/28f7c554-4f35-401f-b34b-516e9a0ef731/workflow/HelloWorld/&gt;;
+            scufl2:outputProcessorPort &lt;http://ns.taverna.org.uk/2010/workflowBundle/28f7c554-4f35-401f-b34b-516e9a0ef731/workflow/HelloWorld/processor/Hello/out/greeting&gt;.
+        
+        &lt;http://ns.taverna.org.uk/2010/workflowBundle/28f7c554-4f35-401f-b34b-516e9a0ef731/workflow/HelloWorld/&gt;    
+            a scufl2:Workflow;
+            scufl2:name &quot;HelloWorld&quot;;
+            scufl2:parent &lt;http://ns.taverna.org.uk/2010/workflowBundle/28f7c554-4f35-401f-b34b-516e9a0ef731/&gt;;
+            sculf2:processor &lt;http://ns.taverna.org.uk/2010/workflowBundle/28f7c554-4f35-401f-b34b-516e9a0ef731/workflow/HelloWorld/processor/Hello&gt;.
+        
+        &lt;http://ns.taverna.org.uk/2010/workflowBundle/28f7c554-4f35-401f-b34b-516e9a0ef731/&gt;    
+            a scufl2:WorkflowBundle;
+            scufl2:workflow &lt;http://ns.taverna.org.uk/2010/workflowBundle/28f7c554-4f35-401f-b34b-516e9a0ef731/workflow/HelloWorld/&gt;;
+            scufl2:workflowBundleId &quot;28f7c554-4f35-401f-b34b-516e9a0ef731&quot;;
+
+        Where 28f7c554-4f35-401f-b34b-516e9a0ef731 must be a randomly
+        generated UUID.    
+    </rdfs:comment>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#workflowRelation"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#inputActivityPort -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#inputActivityPort">
+        <rdfs:label xml:lang="en">input acticity port</rdfs:label>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Activity"/>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#InputActivityPort"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#activityPort"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#inputPortBinding -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#inputPortBinding">
+        <rdfs:label xml:lang="en">input port binding</rdfs:label>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#InputPortBinding"/>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#ProcessorBinding"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#child"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#inputProcessorPort -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#inputProcessorPort">
+        <rdfs:label xml:lang="en">input processor port</rdfs:label>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#InputProcessorPort"/>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Processor"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#processorPort"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#inputWorkflowPort -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#inputWorkflowPort">
+        <rdfs:label xml:lang="en">input workflow port</rdfs:label>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#InputWorkflowPort"/>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Workflow"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#workflowPort"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#iterateOverInputPort -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#iterateOverInputPort">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#InputProcessorPort"/>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#PortNode"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#workflowRelation"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#iterationStrategyStack -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#iterationStrategyStack">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:label xml:lang="en">iteration strategy stack</rdfs:label>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#IterationStrategyStack"/>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Processor"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#child"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#mainProfile -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#mainProfile">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:label xml:lang="en">main profile</rdfs:label>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Profile"/>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#WorkflowBundle"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#profile"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#mainWorkflow -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#mainWorkflow">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:label xml:lang="en">main workflow</rdfs:label>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Workflow"/>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#WorkflowBundle"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#workflow"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#outputActivityPort -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#outputActivityPort">
+        <rdfs:label xml:lang="en">output activity port</rdfs:label>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Activity"/>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#OutputActivityPort"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#activityPort"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#outputPortBinding -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#outputPortBinding">
+        <rdfs:label xml:lang="en">output port binding</rdfs:label>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#OutputPortBinding"/>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#ProcessorBinding"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#child"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#outputProcessorPort -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#outputProcessorPort">
+        <rdfs:label xml:lang="en">output processor port</rdfs:label>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#OutputProcessorPort"/>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Processor"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#processorPort"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#outputWorkflowPort -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#outputWorkflowPort">
+        <rdfs:label xml:lang="en">output workflow port</rdfs:label>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#OutputWorkflowPort"/>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Workflow"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#workflowPort"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#parent -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#parent">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:label xml:lang="en">parent</rdfs:label>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Child"/>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Parent"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#workflowRelation"/>
+        <rdfs:subPropertyOf rdf:resource="&dcterms;isPartOf"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#port -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#port">
+        <rdfs:label xml:lang="en">port</rdfs:label>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Parent"/>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Port"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#child"/>
+        <rdfs:domain>
+            <owl:Class>
+                <owl:unionOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#Activity"/>
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#Processor"/>
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#Workflow"/>
+                </owl:unionOf>
+            </owl:Class>
+        </rdfs:domain>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#processor -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#processor">
+        <rdfs:label xml:lang="en">processor</rdfs:label>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Processor"/>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Workflow"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#child"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#processorBinding -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#processorBinding">
+        <rdfs:label xml:lang="en">processor binding</rdfs:label>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#ProcessorBinding"/>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Profile"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#child"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#processorPort -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#processorPort">
+        <rdfs:label xml:lang="en">processor port</rdfs:label>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Processor"/>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#ProcessorPort"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#port"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#productOf -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#productOf">
+        <rdfs:label xml:lang="en">product of</rdfs:label>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#child"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#profile -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#profile">
+        <rdfs:label xml:lang="en">profile</rdfs:label>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Profile"/>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#WorkflowBundle"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#child"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#receiveFrom -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#receiveFrom">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:label xml:lang="en">receive from</rdfs:label>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#DataLink"/>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#SenderPort"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#workflowRelation"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#sendTo -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#sendTo">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:label xml:lang="en">send to</rdfs:label>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#DataLink"/>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#ReceiverPort"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#workflowRelation"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#untilFinished -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#untilFinished">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:label xml:lang="en">until finished</rdfs:label>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Blocking"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#controllingProcessor"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#workflow -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#workflow">
+        <rdfs:label xml:lang="en">workflow</rdfs:label>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Workflow"/>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#WorkflowBundle"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#child"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#workflowIdentifier -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#workflowIdentifier">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:label xml:lang="en">workflow identifier</rdfs:label>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Workflow"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#workflowRelation"/>
+        <rdfs:subPropertyOf rdf:resource="&dcterms;isVersionOf"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#workflowPort -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#workflowPort">
+        <rdfs:label xml:lang="en">workflow port</rdfs:label>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Workflow"/>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#WorkflowPort"/>
+        <rdfs:subPropertyOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#port"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#workflowRelation -->
+
+    <owl:ObjectProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#workflowRelation">
+        <rdfs:label xml:lang="en">workflow relation</rdfs:label>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#WorkflowElement"/>
+        <rdfs:range rdf:resource="http://ns.taverna.org.uk/2010/scufl2#WorkflowElement"/>
+        <rdfs:subPropertyOf rdf:resource="&dcterms;relation"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://purl.org/dc/terms/hasPart -->
+
+    <owl:ObjectProperty rdf:about="&dcterms;hasPart"/>
+    
+
+
+    <!-- http://purl.org/dc/terms/isPartOf -->
+
+    <owl:ObjectProperty rdf:about="&dcterms;isPartOf"/>
+    
+
+
+    <!-- http://purl.org/dc/terms/isVersionOf -->
+
+    <owl:ObjectProperty rdf:about="&dcterms;isVersionOf"/>
+    
+
+
+    <!-- http://purl.org/dc/terms/relation -->
+
+    <owl:ObjectProperty rdf:about="&dcterms;relation"/>
+    
+
+
+    <!-- http://www.w3.org/1999/02/22-rdf-syntax-ns#first -->
+
+    <owl:ObjectProperty rdf:about="&rdf;first"/>
+    
+
+
+    <!-- http://www.w3.org/1999/02/22-rdf-syntax-ns#rest -->
+
+    <owl:ObjectProperty rdf:about="&rdf;rest"/>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Data properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#activityPosition -->
+
+    <owl:DatatypeProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#activityPosition">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:label xml:lang="en">activity position</rdfs:label>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#ProcessorBinding"/>
+        <rdfs:range rdf:resource="&xsd;nonNegativeInteger"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#desiredDepth -->
+
+    <owl:DatatypeProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#desiredDepth">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:label xml:lang="en">desired depth</rdfs:label>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#PortNode"/>
+        <rdfs:range rdf:resource="&xsd;nonNegativeInteger"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#granularPortDepth -->
+
+    <owl:DatatypeProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#granularPortDepth">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:label xml:lang="en">granular port depth</rdfs:label>
+        <rdfs:range rdf:resource="&xsd;nonNegativeInteger"/>
+        <rdfs:domain>
+            <owl:Class>
+                <owl:unionOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#InputActivityPort"/>
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#InputProcessorPort"/>
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#OutputActivityPort"/>
+                </owl:unionOf>
+            </owl:Class>
+        </rdfs:domain>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#mergePosition -->
+
+    <owl:DatatypeProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#mergePosition">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:label xml:lang="en">merge position</rdfs:label>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#DataLink"/>
+        <rdfs:range rdf:resource="&xsd;integer"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#name -->
+
+    <owl:DatatypeProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#name">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:label xml:lang="en">name</rdfs:label>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Named"/>
+        <rdfs:subPropertyOf rdf:resource="&dcterms;identifier"/>
+        <rdfs:range rdf:resource="&xsd;string"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#portDepth -->
+
+    <owl:DatatypeProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#portDepth">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:label xml:lang="en">port depth</rdfs:label>
+        <rdfs:range rdf:resource="&xsd;nonNegativeInteger"/>
+        <rdfs:domain>
+            <owl:Class>
+                <owl:unionOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#InputActivityPort"/>
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#InputProcessorPort"/>
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#InputWorkflowPort"/>
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#OutputActivityPort"/>
+                </owl:unionOf>
+            </owl:Class>
+        </rdfs:domain>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#profilePosition -->
+
+    <owl:DatatypeProperty rdf:about="http://ns.taverna.org.uk/2010/scufl2#profilePosition">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:label xml:lang="en">profile position</rdfs:label>
+        <rdfs:domain rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Profile"/>
+        <rdfs:range rdf:resource="&xsd;nonNegativeInteger"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Classes
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#Activity -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#Activity">
+        <rdfs:label xml:lang="en">Activity</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Configurable"/>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Named"/>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#ActivityPort -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#ActivityPort">
+        <rdfs:label xml:lang="en">Activity Port</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Child"/>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Port"/>
+        <rdfs:subClassOf>
+            <owl:Class>
+                <owl:unionOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#InputActivityPort"/>
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#OutputActivityPort"/>
+                </owl:unionOf>
+            </owl:Class>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#parent"/>
+                <owl:someValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Activity"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#Blocking -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#Blocking">
+        <rdfs:label xml:lang="en">Blocking</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Control"/>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#untilFinished"/>
+                <owl:someValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Processor"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#block"/>
+                <owl:someValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Processor"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#Child -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#Child">
+        <rdfs:label xml:lang="en">Child</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#WorkflowElement"/>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#parent"/>
+                <owl:someValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Parent"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:comment xml:lang="en">A WorkflowElement which can be considered a child, for instance a Processor is a child of a Workflow, an InputActivityPort is a child of an Activity.
+
+The Child-relationship also gives a strong hint that the entity should be serialised as part of its parent&apos;s serialisation.</rdfs:comment>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#Configurable -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#Configurable">
+        <rdfs:label xml:lang="en">Configurable</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#WorkflowElement"/>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#Configuration -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#Configuration">
+        <rdfs:label xml:lang="en">Configuration</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Named"/>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#configure"/>
+                <owl:someValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Configurable"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#Control -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#Control">
+        <rdfs:label xml:lang="en">Control</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#WorkflowElement"/>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#controllingProcessor"/>
+                <owl:someValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Processor"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#controlledProcessor"/>
+                <owl:someValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Processor"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#CrossProduct -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#CrossProduct">
+        <rdfs:label xml:lang="en">Cross Product</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Product"/>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#DataLink -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#DataLink">
+        <rdfs:label xml:lang="en">Data Link</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#WorkflowElement"/>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#receiveFrom"/>
+                <owl:someValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Processor"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#sendTo"/>
+                <owl:someValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Processor"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#DispatchStack -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#DispatchStack">
+        <rdfs:label xml:lang="en">Dispatch Stack</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#WorkflowElement"/>
+        <rdfs:subClassOf rdf:resource="&rdf;List"/>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="&rdf;first"/>
+                <owl:allValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#DispatchStackLayer"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf>
+            <owl:Class>
+                <owl:unionOf rdf:parseType="Collection">
+                    <owl:Restriction>
+                        <owl:onProperty rdf:resource="&rdf;rest"/>
+                        <owl:allValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#DispatchStack"/>
+                    </owl:Restriction>
+                    <owl:Restriction>
+                        <owl:onProperty rdf:resource="&rdf;rest"/>
+                        <owl:hasValue rdf:resource="&rdf;nil"/>
+                    </owl:Restriction>
+                </owl:unionOf>
+            </owl:Class>
+        </rdfs:subClassOf>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#DispatchStackLayer -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#DispatchStackLayer">
+        <rdfs:label xml:lang="en">Dispatch Stack Layer</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Configurable"/>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#DotProduct -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#DotProduct">
+        <rdfs:label xml:lang="en">Dot Product</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Product"/>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#InputActivityPort -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#InputActivityPort">
+        <rdfs:label xml:lang="en">Input Activity Port</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#ActivityPort"/>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#portDepth"/>
+                <owl:someValuesFrom rdf:resource="&xsd;nonNegativeInteger"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <owl:disjointWith rdf:resource="http://ns.taverna.org.uk/2010/scufl2#OutputActivityPort"/>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#InputPortBinding -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#InputPortBinding">
+        <rdfs:label xml:lang="en">Input Port Binding</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#PortBinding"/>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#bindInputActivityPort"/>
+                <owl:someValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#InputActivityPort"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#bindInputProcessorPort"/>
+                <owl:someValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#InputProcessorPort"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <owl:disjointWith rdf:resource="http://ns.taverna.org.uk/2010/scufl2#OutputPortBinding"/>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#InputProcessorPort -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#InputProcessorPort">
+        <rdfs:label xml:lang="en">Input Processor Port</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#ProcessorPort"/>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#ReceiverPort"/>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#portDepth"/>
+                <owl:someValuesFrom rdf:resource="&xsd;nonNegativeInteger"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#InputWorkflowPort -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#InputWorkflowPort">
+        <rdfs:label xml:lang="en">Input Workflow Port</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#SenderPort"/>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#WorkflowPort"/>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#portDepth"/>
+                <owl:someValuesFrom rdf:resource="&xsd;nonNegativeInteger"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:comment xml:lang="en">An input to the workflow, representing a parameter required to run the workflow. 
+
+This is considered a SenderPort within the workflow, so that it can be connected to InputProcessorPort of processors contained by the same workflow.</rdfs:comment>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#IterationStrategyChildren -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#IterationStrategyChildren">
+        <rdfs:label xml:lang="en">Iteration Strategy Children</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#WorkflowElement"/>
+        <rdfs:subClassOf rdf:resource="&rdf;List"/>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="&rdf;first"/>
+                <owl:allValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#IterationStrategyNode"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf>
+            <owl:Class>
+                <owl:unionOf rdf:parseType="Collection">
+                    <owl:Restriction>
+                        <owl:onProperty rdf:resource="&rdf;rest"/>
+                        <owl:allValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#IterationStrategyChildren"/>
+                    </owl:Restriction>
+                    <owl:Restriction>
+                        <owl:onProperty rdf:resource="&rdf;rest"/>
+                        <owl:hasValue rdf:resource="&rdf;nil"/>
+                    </owl:Restriction>
+                </owl:unionOf>
+            </owl:Class>
+        </rdfs:subClassOf>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#IterationStrategyNode -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#IterationStrategyNode">
+        <rdfs:label xml:lang="en">Iteration Strategy Node</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#WorkflowElement"/>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#IterationStrategyStack -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#IterationStrategyStack">
+        <rdfs:label xml:lang="en">Iteration Strategy Stack</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#WorkflowElement"/>
+        <rdfs:subClassOf rdf:resource="&rdf;List"/>
+        <rdfs:subClassOf>
+            <owl:Class>
+                <owl:unionOf rdf:parseType="Collection">
+                    <owl:Restriction>
+                        <owl:onProperty rdf:resource="&rdf;rest"/>
+                        <owl:allValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#IterationStrategyStack"/>
+                    </owl:Restriction>
+                    <owl:Restriction>
+                        <owl:onProperty rdf:resource="&rdf;rest"/>
+                        <owl:hasValue rdf:resource="&rdf;nil"/>
+                    </owl:Restriction>
+                </owl:unionOf>
+            </owl:Class>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="&rdf;first"/>
+                <owl:allValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Product"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#Named -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#Named">
+        <rdfs:label xml:lang="en">Named</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#WorkflowElement"/>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#name"/>
+                <owl:minQualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">0</owl:minQualifiedCardinality>
+                <owl:onDataRange rdf:resource="&xsd;string"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:comment xml:lang="en">Anything identified with a scufl2:name</rdfs:comment>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#NamedChild -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#NamedChild">
+        <rdfs:label xml:lang="en">Named Child</rdfs:label>
+        <owl:equivalentClass>
+            <owl:Class>
+                <owl:intersectionOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#Child"/>
+                    <owl:Restriction>
+                        <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#name"/>
+                        <owl:someValuesFrom rdf:resource="&xsd;string"/>
+                    </owl:Restriction>
+                </owl:intersectionOf>
+            </owl:Class>
+        </owl:equivalentClass>
+        <rdfs:comment xml:lang="en">Any Named Child is uniquely identified by its scufl2:name and scufl2:parent</rdfs:comment>
+        <owl:hasKey rdf:parseType="Collection">
+            <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#name"/>
+        </owl:hasKey>
+        <owl:hasKey rdf:parseType="Collection">
+            <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#parent"/>
+        </owl:hasKey>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#OutputActivityPort -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#OutputActivityPort">
+        <rdfs:label xml:lang="en">Output Activity Port</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#ActivityPort"/>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#granularPortDepth"/>
+                <owl:someValuesFrom rdf:resource="&xsd;nonNegativeInteger"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#portDepth"/>
+                <owl:someValuesFrom rdf:resource="&xsd;nonNegativeInteger"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#OutputPortBinding -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#OutputPortBinding">
+        <rdfs:label xml:lang="en">Output Port binding</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#PortBinding"/>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#bindOutputProcessorPort"/>
+                <owl:someValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#OutputProcessorPort"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#bindOutputActivityPort"/>
+                <owl:someValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#OutputActivityPort"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#OutputProcessorPort -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#OutputProcessorPort">
+        <rdfs:label xml:lang="en">Output Processor Port</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#ProcessorPort"/>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#SenderPort"/>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#portDepth"/>
+                <owl:someValuesFrom rdf:resource="&xsd;nonNegativeInteger"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#granularPortDepth"/>
+                <owl:someValuesFrom rdf:resource="&xsd;nonNegativeInteger"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#OutputWorkflowPort -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#OutputWorkflowPort">
+        <rdfs:label xml:lang="en">Output Workflow Port</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#ReceiverPort"/>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#WorkflowPort"/>
+        <rdfs:comment xml:lang="en">An output from the workflow, representing the defined results of the workflow.
+
+This is considered a ReceiverPort within the workflow, so that it can be connected from OutputProcessorPort of processors contained by the same workflow.</rdfs:comment>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#Parent -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#Parent">
+        <rdfs:label xml:lang="en">Parent</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#WorkflowElement"/>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#Port -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#Port">
+        <rdfs:label xml:lang="en">Port</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Named"/>
+        <rdfs:subClassOf>
+            <owl:Class>
+                <owl:unionOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#ActivityPort"/>
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#ProcessorPort"/>
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#WorkflowPort"/>
+                </owl:unionOf>
+            </owl:Class>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#name"/>
+                <owl:someValuesFrom rdf:resource="&xsd;string"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:comment xml:lang="en">A port is an input or output to a Processor, Workflow or Activity. </rdfs:comment>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#PortBinding -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#PortBinding">
+        <rdfs:label xml:lang="en">Port Binding</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Child"/>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#parent"/>
+                <owl:someValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#ProcessorBinding"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf>
+            <owl:Class>
+                <owl:unionOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#InputPortBinding"/>
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#OutputPortBinding"/>
+                </owl:unionOf>
+            </owl:Class>
+        </rdfs:subClassOf>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#PortNode -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#PortNode">
+        <rdfs:label xml:lang="en">Port Node</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#IterationStrategyNode"/>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#desiredDepth"/>
+                <owl:someValuesFrom rdf:resource="&xsd;nonNegativeInteger"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#iterateOverInputPort"/>
+                <owl:someValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#InputProcessorPort"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#Processor -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#Processor">
+        <rdfs:label xml:lang="en">Processor</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Child"/>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Named"/>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#name"/>
+                <owl:someValuesFrom rdf:resource="&xsd;string"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:comment xml:lang="en">A processor is a unit of a Workflow which performs some work. It typically have some InputProcessorPorts and OutputProcessorPorts which are connected to other Ports within the workflow. A processor will start executing as soon as there is a value for each InputProcessorPort and there are no Blocking processors. 
+
+A processor is bound to an Activity which specifies how to execute the task. This ProcessorBinding also specifies PortBindings to map ActivityPorts with ProcessorPorts.</rdfs:comment>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#ProcessorBinding -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#ProcessorBinding">
+        <rdfs:label xml:lang="en">Processor Binding</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Named"/>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#bindProcessor"/>
+                <owl:someValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Processor"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#bindActivity"/>
+                <owl:someValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Processor"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#ProcessorPort -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#ProcessorPort">
+        <rdfs:label xml:lang="en">Processor Port</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Child"/>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Port"/>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#parent"/>
+                <owl:someValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Processor"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf>
+            <owl:Class>
+                <owl:unionOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#InputProcessorPort"/>
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#OutputProcessorPort"/>
+                </owl:unionOf>
+            </owl:Class>
+        </rdfs:subClassOf>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#Product -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#Product">
+        <rdfs:label xml:lang="en">Product</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#IterationStrategyNode"/>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#productOf"/>
+                <owl:someValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#IterationStrategyChildren"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf>
+            <owl:Class>
+                <owl:unionOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#CrossProduct"/>
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#DotProduct"/>
+                </owl:unionOf>
+            </owl:Class>
+        </rdfs:subClassOf>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#Profile -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#Profile">
+        <rdfs:label xml:lang="en">Profile</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Child"/>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Named"/>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#WorkflowElement"/>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#ReceiverPort -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#ReceiverPort">
+        <rdfs:label xml:lang="en">Receiver Port</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Port"/>
+        <rdfs:subClassOf>
+            <owl:Class>
+                <owl:unionOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#InputProcessorPort"/>
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#OutputWorkflowPort"/>
+                </owl:unionOf>
+            </owl:Class>
+        </rdfs:subClassOf>
+        <owl:disjointWith rdf:resource="http://ns.taverna.org.uk/2010/scufl2#SenderPort"/>
+        <rdfs:comment xml:lang="en">A Port which can receive data from a DataLink</rdfs:comment>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#SenderPort -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#SenderPort">
+        <rdfs:label xml:lang="en">Sender Port</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Port"/>
+        <rdfs:subClassOf>
+            <owl:Class>
+                <owl:unionOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#InputWorkflowPort"/>
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#OutputProcessorPort"/>
+                </owl:unionOf>
+            </owl:Class>
+        </rdfs:subClassOf>
+        <rdfs:comment xml:lang="en">A Port which can send data to a DataLink</rdfs:comment>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#Workflow -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#Workflow">
+        <rdfs:label xml:lang="en">Workflow</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Named"/>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#workflowIdentifier"/>
+                <owl:someValuesFrom rdf:resource="&owl;Thing"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#name"/>
+                <owl:someValuesFrom rdf:resource="&xsd;string"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <owl:hasKey rdf:parseType="Collection">
+            <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#workflowIdentifier"/>
+        </owl:hasKey>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#WorkflowBundle -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#WorkflowBundle">
+        <rdfs:label xml:lang="en">Workflow Bundle</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Named"/>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#globalBaseURI"/>
+                <owl:onClass rdf:resource="http://ns.taverna.org.uk/2010/scufl2#WorkflowBundle"/>
+                <owl:minQualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">0</owl:minQualifiedCardinality>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <owl:hasKey rdf:parseType="Collection">
+            <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#globalBaseURI"/>
+        </owl:hasKey>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#WorkflowElement -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#WorkflowElement">
+        <rdfs:label xml:lang="en">Workflow Element</rdfs:label>
+        <rdfs:comment xml:lang="en">Any element that defines a workflow, such as a processor, port, datalink, activity, port binding, profile.
+
+Super-class for any Scufl2 class. </rdfs:comment>
+    </owl:Class>
+    
+
+
+    <!-- http://ns.taverna.org.uk/2010/scufl2#WorkflowPort -->
+
+    <owl:Class rdf:about="http://ns.taverna.org.uk/2010/scufl2#WorkflowPort">
+        <rdfs:label xml:lang="en">Workflow Port</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Port"/>
+        <rdfs:subClassOf>
+            <owl:Class>
+                <owl:unionOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#InputWorkflowPort"/>
+                    <rdf:Description rdf:about="http://ns.taverna.org.uk/2010/scufl2#OutputWorkflowPort"/>
+                </owl:unionOf>
+            </owl:Class>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="http://ns.taverna.org.uk/2010/scufl2#parent"/>
+                <owl:someValuesFrom rdf:resource="http://ns.taverna.org.uk/2010/scufl2#Workflow"/>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:comment xml:lang="en">Ports of a Workflow. </rdfs:comment>
+    </owl:Class>
+    
+
+
+    <!-- http://www.w3.org/1999/02/22-rdf-syntax-ns#List -->
+
+    <owl:Class rdf:about="&rdf;List"/>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Individuals
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://www.w3.org/1999/02/22-rdf-syntax-ns#nil -->
+
+    <owl:NamedIndividual rdf:about="&rdf;nil"/>
+</rdf:RDF>
+
+
+
+<!-- Generated by the OWL API (version 3.2.5.1928) http://owlapi.sourceforge.net -->
+


[27/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/t2flow/wsdl-secure.t2flow
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/t2flow/wsdl-secure.t2flow b/taverna-platform-integration-tests/src/test/resources/t2flow/wsdl-secure.t2flow
new file mode 100644
index 0000000..4db4ad5
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/t2flow/wsdl-secure.t2flow
@@ -0,0 +1,131 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3.0"><dataflow id="b23a2149-976e-4e98-b120-e5b8580839ef" role="top"><name>Workflow13</name><inputPorts /><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>hello_plaintext_password</name><inputPorts><port><name>in0</name><depth>0</depth></port></inputPorts><outputPorts><port><name>helloReturn</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.wsdl.WSDLActivity</class><inputMap><map from="in0" to="in0" /></inputMap><outputMap><map from="helloReturn" to="helloReturn" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean xmlns="">
+  <wsdl>http://heater.cs.man.ac.uk:7070/axis/services/HelloService-PlaintextPassword?wsdl</wsdl>
+  <operation>hello</operation>
+  <securityProfile>WSSecurityUsernameTokenPlainTextPassword</securityProfile>
+</net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in0" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>in0_value</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" to="value" 
 /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>Alan</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>hello_plaintext_password</processor><port>in0</port></sink><source type="processor"><processor>in0_value</processor><port>value</port></source></datalink><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>hello_plaintext_password</processor><port>helloReturn</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotati
 on.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>ca8fb5c5-0e8c-4e68-84f0-bdc85a77e2b3</identification>
+      </annotationBean>
+      <date>2010-11-22 13:29:26.400 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>7153a2dd-18bd-4f25-80ab-1efa8afc567d</identification>
+      </annotationBean>
+      <date>2011-01-21 16:02:39.43 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>394aced4-ee5d-4355-8ebe-9fc8bcfe5303</identification>
+      </annotationBean>
+      <date>2011-06-21 12:07:46.327 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>c71621ca-196c-46cd-9073-48af82b4bd4f</identification>
+      </annotationBean>
+      <date>2011-06-21 12:11:30.87 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>8175c97b-6385-460a-98ab-5cf974010d51</identification>
+      </annotationBean>
+      <date>2010-11-22 12:11:59.610 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>56cadac0-c944-4b9e-83c3-078f57738405</identification>
+      </annotationBean>
+      <date>2011-01-21 16:02:09.633 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>a388d568-ca08-43b4-abaf-3744a6801d45</identification>
+      </annotationBean>
+      <date>2010-11-22 13:30:28.898 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>b23a2149-976e-4e98-b120-e5b8580839ef</identification>
+      </annotationBean>
+      <date>2011-08-23 13:40:15.238 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>3d76be4c-83c4-413b-91f2-b0ce69dcbd97</identification>
+      </annotationBean>
+      <date>2010-11-22 13:29:43.282 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>e61023d9-d603-4df6-87e5-175603f106a5</identification>
+      </annotationBean>
+      <date>2010-11-22 13:28:31.68 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/t2flow/wsdl.t2flow
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/t2flow/wsdl.t2flow b/taverna-platform-integration-tests/src/test/resources/t2flow/wsdl.t2flow
new file mode 100644
index 0000000..4dea6bb
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/t2flow/wsdl.t2flow
@@ -0,0 +1,22 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.2.0"><dataflow id="eed49d32-8563-45ff-8716-347b20800129" role="top"><name>Workflow5</name><inputPorts /><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>getVersion</name><inputPorts /><outputPorts><port><name>getVersionReturn</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.wsdl.WSDLActivity</class><inputMap /><outputMap><map from="getVersionReturn" to="getVersionReturn" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean xmlns="">
+  <wsdl>http://www.mygrid.org.uk/axis/services/Version?wsdl</wsdl>
+  <operation>getVersion</operation>
+</net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>getVersion</processor><port>getVersionReturn</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>eed49d32-8563-45ff-8716-347b20800129</identification>
+      </annotationBean>
+      <date>2011-01-25 16:37:45.583 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/t2flow/xmlSplitter.t2flow
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/t2flow/xmlSplitter.t2flow b/taverna-platform-integration-tests/src/test/resources/t2flow/xmlSplitter.t2flow
new file mode 100644
index 0000000..bd0875d
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/t2flow/xmlSplitter.t2flow
@@ -0,0 +1,339 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.2.0"><dataflow id="52ddd8d4-d1fc-4b62-932a-288df52b77cf" role="top"><name>Workflow1</name><inputPorts><port><name>lastName</name><depth>0</depth><granularDepth>0</granularDepth><annotations><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.ExampleValue">
+        <text>Smith</text>
+      </annotationBean>
+      <date>2011-02-17 10:48:23.657 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain></annotations></port><port><name>firstName</name><depth>0</depth><granularDepth>0</granularDepth><annotations><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.ExampleValue">
+        <text>John</text>
+      </annotationBean>
+      <date>2011-02-17 10:48:16.703 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain></annotations></port><port><name>age</name><depth>0</depth><granularDepth>0</granularDepth><annotations><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.ExampleValue">
+        <text>John</text>
+      </annotationBean>
+      <date>2011-02-17 10:47:56.513 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.ExampleValue">
+        <text>21</text>
+      </annotationBean>
+      <date>2011-02-17 10:48:30.905 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain></annotations></port></inputPorts><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>personToString</name><inputPorts><port><name>parameters</name><depth>0</depth></port></inputPorts><outputPorts><port><name>parameters</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.wsdl.WSDLActivity</class><inputMap><map from="parameters" to="parameters" /></inputMap><outputMap><map from="parameters" to="parameters" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean xmlns="">
+  <wsdl>http://www.mygrid.org.uk/menagerie/xfire/Complex-dlw?wsdl</wsdl>
+  <operation>personToString</operation>
+</net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="parameters" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>personToString_output</name><inputPorts><port><name>input</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLOutputSplitt
 erActivity</class><inputMap><map from="input" to="input" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLSplitterConfigurationBean xmlns="">
+  <wrappedTypeXML>&lt;s:extensions xmlns:s="http://org.embl.ebi.escience/xscufl/0.1alpha"&gt;&lt;s:complextype optional="false" unbounded="false" typename="personToStringResponse" name="parameters" qname="{http://xfire.codehaus.org/BookService}personToStringResponse"&gt;&lt;s:elements&gt;&lt;s:basetype optional="false" unbounded="false" typename="string" name="out" qname="{http://xfire.codehaus.org/BookService}&amp;gt;personToStringResponse&amp;gt;out" /&gt;&lt;/s:elements&gt;&lt;/s:complextype&gt;&lt;/s:extensions&gt;</wrappedTypeXML>
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>false</allowsLiteralValues>
+      <name>input</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/xml'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>0</granularDepth>
+      <name>out</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/plain'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLSplitterConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="input" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>personToString_input</name><inputPorts><port><name>person</name><depth>0</depth></port></inputPorts><outputPorts><port><name>output</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLInputSplitterA
 ctivity</class><inputMap><map from="person" to="person" /></inputMap><outputMap><map from="output" to="output" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLSplitterConfigurationBean xmlns="">
+  <wrappedTypeXML>&lt;s:extensions xmlns:s="http://org.embl.ebi.escience/xscufl/0.1alpha"&gt;&lt;s:complextype optional="false" unbounded="false" typename="personToString" name="parameters" qname="{http://xfire.codehaus.org/BookService}personToString"&gt;&lt;s:elements&gt;&lt;s:complextype optional="false" unbounded="false" typename="Person" name="person" qname="{http://xfire.codehaus.org/BookService}&amp;gt;personToString&amp;gt;person"&gt;&lt;s:elements&gt;&lt;s:complextype optional="true" unbounded="false" typename="Address" name="address" qname="{http://complex.pojo.axis2.menagerie.googlecode}Person&amp;gt;address"&gt;&lt;s:elements&gt;&lt;s:basetype optional="true" unbounded="false" typename="string" name="city" qname="{http://complex.pojo.axis2.menagerie.googlecode}Address&amp;gt;city" /&gt;&lt;s:basetype optional="true" unbounded="false" typename="string" name="road" qname="{http://complex.pojo.axis2.menagerie.googlecode}Address&amp;gt;road" /&gt;&lt;s:basetype optional="true
 " unbounded="false" typename="int" name="roadNumber" qname="{http://complex.pojo.axis2.menagerie.googlecode}Address&amp;gt;roadNumber" /&gt;&lt;/s:elements&gt;&lt;/s:complextype&gt;&lt;s:basetype optional="true" unbounded="false" typename="int" name="age" qname="{http://complex.pojo.axis2.menagerie.googlecode}Person&amp;gt;age" /&gt;&lt;s:basetype optional="true" unbounded="false" typename="string" name="firstName" qname="{http://complex.pojo.axis2.menagerie.googlecode}Person&amp;gt;firstName" /&gt;&lt;s:basetype optional="true" unbounded="false" typename="string" name="lastName" qname="{http://complex.pojo.axis2.menagerie.googlecode}Person&amp;gt;lastName" /&gt;&lt;/s:elements&gt;&lt;/s:complextype&gt;&lt;/s:elements&gt;&lt;/s:complextype&gt;&lt;/s:extensions&gt;</wrappedTypeXML>
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <allowsLiteralValues>false</allowsLiteralValues>
+      <name>person</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/xml'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>0</granularDepth>
+      <name>output</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/xml'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLSplitterConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="person" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>personToString_person</name><inputPorts><port><name>lastName</name><depth>0</depth></port><port><name>firstName</name><depth>0</depth></port><port><name>age</name><depth>0</depth></port><port><name>address</name><depth>0</depth></port></inputPorts><outputPorts><port><name>output</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.act
 ivities</group><artifact>wsdl-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLInputSplitterActivity</class><inputMap><map from="lastName" to="lastName" /><map from="address" to="address" /><map from="age" to="age" /><map from="firstName" to="firstName" /></inputMap><outputMap><map from="output" to="output" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLSplitterConfigurationBean xmlns="">
+  <wrappedTypeXML>&lt;s:extensions xmlns:s="http://org.embl.ebi.escience/xscufl/0.1alpha"&gt;&lt;s:complextype optional="false" unbounded="false" typename="Person" name="person" qname="{http://xfire.codehaus.org/BookService}&amp;gt;personToString&amp;gt;person"&gt;&lt;s:elements&gt;&lt;s:complextype optional="true" unbounded="false" typename="Address" name="address" qname="{http://complex.pojo.axis2.menagerie.googlecode}Person&amp;gt;address"&gt;&lt;s:elements&gt;&lt;s:basetype optional="true" unbounded="false" typename="string" name="city" qname="{http://complex.pojo.axis2.menagerie.googlecode}Address&amp;gt;city" /&gt;&lt;s:basetype optional="true" unbounded="false" typename="string" name="road" qname="{http://complex.pojo.axis2.menagerie.googlecode}Address&amp;gt;road" /&gt;&lt;s:basetype optional="true" unbounded="false" typename="int" name="roadNumber" qname="{http://complex.pojo.axis2.menagerie.googlecode}Address&amp;gt;roadNumber" /&gt;&lt;/s:elements&gt;&lt;/s:complextype&gt
 ;&lt;s:basetype optional="true" unbounded="false" typename="int" name="age" qname="{http://complex.pojo.axis2.menagerie.googlecode}Person&amp;gt;age" /&gt;&lt;s:basetype optional="true" unbounded="false" typename="string" name="firstName" qname="{http://complex.pojo.axis2.menagerie.googlecode}Person&amp;gt;firstName" /&gt;&lt;s:basetype optional="true" unbounded="false" typename="string" name="lastName" qname="{http://complex.pojo.axis2.menagerie.googlecode}Person&amp;gt;lastName" /&gt;&lt;/s:elements&gt;&lt;/s:complextype&gt;&lt;/s:extensions&gt;</wrappedTypeXML>
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <allowsLiteralValues>false</allowsLiteralValues>
+      <name>address</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/xml'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <allowsLiteralValues>false</allowsLiteralValues>
+      <name>age</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/plain'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <allowsLiteralValues>false</allowsLiteralValues>
+      <name>firstName</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/plain'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <allowsLiteralValues>false</allowsLiteralValues>
+      <name>lastName</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/plain'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>0</granularDepth>
+      <name>output</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/xml'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLSplitterConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="lastName" depth="0" /><port name="firstName" depth="0" /><port name="age" depth="0" /><port name="address" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>person_address</name><inputPorts><port><name>city</name><depth>0</depth></port><port><name>road</name><depth>0</depth></port><port><name>roadNumber</name><depth>0</depth></port></inputPorts><outputPorts><port><name>output</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><act
 ivity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLInputSplitterActivity</class><inputMap><map from="road" to="road" /><map from="roadNumber" to="roadNumber" /><map from="city" to="city" /></inputMap><outputMap><map from="output" to="output" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLSplitterConfigurationBean xmlns="">
+  <wrappedTypeXML>&lt;s:extensions xmlns:s="http://org.embl.ebi.escience/xscufl/0.1alpha"&gt;&lt;s:complextype optional="true" unbounded="false" typename="Address" name="address" qname="{http://complex.pojo.axis2.menagerie.googlecode}Person&amp;gt;address"&gt;&lt;s:elements&gt;&lt;s:basetype optional="true" unbounded="false" typename="string" name="city" qname="{http://complex.pojo.axis2.menagerie.googlecode}Address&amp;gt;city" /&gt;&lt;s:basetype optional="true" unbounded="false" typename="string" name="road" qname="{http://complex.pojo.axis2.menagerie.googlecode}Address&amp;gt;road" /&gt;&lt;s:basetype optional="true" unbounded="false" typename="int" name="roadNumber" qname="{http://complex.pojo.axis2.menagerie.googlecode}Address&amp;gt;roadNumber" /&gt;&lt;/s:elements&gt;&lt;/s:complextype&gt;&lt;/s:extensions&gt;</wrappedTypeXML>
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <allowsLiteralValues>false</allowsLiteralValues>
+      <name>city</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/plain'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <allowsLiteralValues>false</allowsLiteralValues>
+      <name>road</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/plain'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <allowsLiteralValues>false</allowsLiteralValues>
+      <name>roadNumber</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/plain'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>0</granularDepth>
+      <name>output</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/xml'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLSplitterConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="city" depth="0" /><port name="road" depth="0" /><port name="roadNumber" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>city_value</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstant
 Activity</class><inputMap /><outputMap><map from="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>Manchester</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>road_value</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf
 .taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>Oxford Road</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>roadNumber_value</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" to="value" /></outputMap><configBean encoding="xstream"><
 net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>40</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>personToString</processor><port>parameters</port></sink><source type="processor"><processor>personToString_input</processor><port>output</port></source></datalink><datalink><sink type="processor"><processor>personToString_output</processor><port>input</port></sink><source type="processor"><processor>personToString</processor><port>parameters</port></source></datalink><datalink><sink type="processor"><processor>pers
 onToString_input</processor><port>person</port></sink><source type="processor"><processor>personToString_person</processor><port>output</port></source></datalink><datalink><sink type="processor"><processor>personToString_person</processor><port>lastName</port></sink><source type="dataflow"><port>lastName</port></source></datalink><datalink><sink type="processor"><processor>personToString_person</processor><port>firstName</port></sink><source type="dataflow"><port>firstName</port></source></datalink><datalink><sink type="processor"><processor>personToString_person</processor><port>age</port></sink><source type="dataflow"><port>age</port></source></datalink><datalink><sink type="processor"><processor>personToString_person</processor><port>address</port></sink><source type="processor"><processor>person_address</processor><port>output</port></source></datalink><datalink><sink type="processor"><processor>person_address</processor><port>city</port></sink><source type="processor"><processo
 r>city_value</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>person_address</processor><port>road</port></sink><source type="processor"><processor>road_value</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>person_address</processor><port>roadNumber</port></sink><source type="processor"><processor>roadNumber_value</processor><port>value</port></source></datalink><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>personToString_output</processor><port>out</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>d79eeb60-919e-4076-af14-70ac4d605bec</identification>
+      </annotationBean>
+      <date>2011-02-17 10:49:46.785 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>52ddd8d4-d1fc-4b62-932a-288df52b77cf</identification>
+      </annotationBean>
+      <date>2011-02-17 10:53:16.981 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>8815f1ea-2659-4b7e-a90e-787c6a3c4ad6</identification>
+      </annotationBean>
+      <date>2011-02-17 10:29:40.492 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>eee0128a-4afe-4566-851a-fe50dcb36340</identification>
+      </annotationBean>
+      <date>2011-02-17 10:48:35.150 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>e64ae430-dd6e-468d-b3dd-de1fea9c717b</identification>
+      </annotationBean>
+      <date>2011-02-17 10:20:55.279 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>2aa76794-f001-42f9-b945-797badfeebb1</identification>
+      </annotationBean>
+      <date>2011-02-17 10:17:24.893 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>2ece2565-7498-4154-9d61-996d8a1db5f3</identification>
+      </annotationBean>
+      <date>2011-02-17 10:24:47.509 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>97fbd479-a423-4e8c-9033-bfc28f1a7885</identification>
+      </annotationBean>
+      <date>2011-02-17 10:42:59.63 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>24e8b191-9f48-4864-82be-d9578f1b8450</identification>
+      </annotationBean>
+      <date>2011-02-17 10:25:38.788 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-platform-integration-tests/src/test/resources/t2flow/xpath.t2flow
----------------------------------------------------------------------
diff --git a/taverna-platform-integration-tests/src/test/resources/t2flow/xpath.t2flow b/taverna-platform-integration-tests/src/test/resources/t2flow/xpath.t2flow
new file mode 100644
index 0000000..0691ccc
--- /dev/null
+++ b/taverna-platform-integration-tests/src/test/resources/t2flow/xpath.t2flow
@@ -0,0 +1,127 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3.0"><dataflow id="9fb6e3ea-f314-4f9f-8eb3-ba3dbf2b494f" role="top"><name>Workflow1</name><inputPorts /><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>XPath_Service</name><inputPorts><port><name>xml_text</name><depth>0</depth></port></inputPorts><outputPorts><port><name>nodelistAsXML</name><depth>1</depth><granularDepth>1</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>xpath-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.xpath.XPathActivity</class><inputMap><map from="xml_text" to="xml_text" /></inputMap><outputMap><map from="nodelistAsXML" to="nodelistAsXML" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.xpath.XPathActivityConfigurationBean xmlns="">
+  <xmlDocument>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;test name="test-name"&gt;
+&lt;test-element&gt;test&lt;/test-element&gt;
+&lt;/test&gt;</xmlDocument>
+  <xpathExpression>/test/test-element</xpathExpression>
+  <xpathNamespaceMap />
+</net.sf.taverna.t2.activities.xpath.XPathActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="xml_text" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>xml_text_value</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" t
 o="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;test name="test-name"&gt; &lt;test-element&gt;test&lt;/test-element&gt; &lt;/test&gt;</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>Merge_String_List_to_a_String</name><inputPorts><port><name>stringlist</name><depth>1</depth></port></inputPorts><outputPorts><port><name>concatenated</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivity</class><inputMap><map from="str
 inglist" to="stringlist" /></inputMap><outputMap><map from="concatenated" to="concatenated" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>stringlist</name>
+      <depth>1</depth>
+      <mimeTypes>
+        <string>l('text/plain')</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>seperator</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>concatenated</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>String seperatorString = "\n";
+if (seperator != void) {
+	seperatorString = seperator;
+}
+StringBuffer sb = new StringBuffer();
+for (Iterator i = stringlist.iterator(); i.hasNext();) {
+	String item = (String) i.next();
+	sb.append(item);
+	if (i.hasNext()) {
+		sb.append(seperatorString);
+	}
+}
+concatenated = sb.toString();
+</script>
+  <dependencies />
+  <localworkerName>org.embl.ebi.escience.scuflworkers.java.StringListMerge</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="stringlist" depth="1" /></cross></strategy></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>XPath_Service</processor><port>xml_text</port></sink><source type="processor"><processor>xml_text_value</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>Merge_String_List_to_a_String</processor><port>stringlist</port></sink><source type="processor"><processor>XPath_Service</processor><port>nodelistAsXML</port></s
 ource></datalink><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>Merge_String_List_to_a_String</processor><port>concatenated</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>9fb6e3ea-f314-4f9f-8eb3-ba3dbf2b494f</identification>
+      </annotationBean>
+      <date>2011-11-03 14:17:32.152 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>bed5342f-45e0-4fc9-a85d-bcd1ea01e33d</identification>
+      </annotationBean>
+      <date>2011-11-03 12:55:28.941 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>9f0cedc9-4a53-4564-aeb5-d0b7f7b2b4e1</identification>
+      </annotationBean>
+      <date>2011-11-03 12:56:36.620 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>94104add-ec12-4c5a-a4f6-b5c1b6d0a700</identification>
+      </annotationBean>
+      <date>2011-11-03 12:56:00.6 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/.gitignore
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/.gitignore b/taverna-prov-owl-bindings/.gitignore
new file mode 100644
index 0000000..1ed65a3
--- /dev/null
+++ b/taverna-prov-owl-bindings/.gitignore
@@ -0,0 +1,5 @@
+target
+.classpath
+.project
+.settings
+.Settings

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/pom.xml b/taverna-prov-owl-bindings/pom.xml
new file mode 100644
index 0000000..276386b
--- /dev/null
+++ b/taverna-prov-owl-bindings/pom.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.taverna.engine</groupId>
+		<artifactId>taverna-engine</artifactId>
+		<version>3.1.0-incubating-SNAPSHOT</version>
+	</parent>
+	<artifactId>taverna-prov-owl-bindings</artifactId>
+	<name>Apache Taverna PROV OWL bindings</name>
+	<build>
+	</build>
+	<dependencies>
+		<dependency>
+			<groupId>commons-beanutils</groupId>
+			<artifactId>commons-beanutils</artifactId>
+			<version>1.8.3</version>
+		</dependency>
+<!--
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-log4j12</artifactId>
+			<version>1.4.3</version>
+		</dependency>
+ -->
+
+	    <dependency>
+	        <groupId>org.apache.jena</groupId>
+	        <artifactId>jena-arq</artifactId>
+	        <version>${jena.version}</version>
+	    </dependency>
+	</dependencies>
+
+	<description>OWL bindings using Jena</description>
+</project>


[42/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionMonitor.java
----------------------------------------------------------------------
diff --git a/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionMonitor.java b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionMonitor.java
new file mode 100755
index 0000000..bf6aaa6
--- /dev/null
+++ b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionMonitor.java
@@ -0,0 +1,548 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.impl.local;
+
+import static java.util.logging.Level.SEVERE;
+import static java.util.logging.Level.WARNING;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.UUID;
+import java.util.logging.Logger;
+
+import net.sf.taverna.t2.facade.ResultListener;
+import net.sf.taverna.t2.invocation.InvocationContext;
+import net.sf.taverna.t2.invocation.WorkflowDataToken;
+import net.sf.taverna.t2.lang.observer.Observable;
+import net.sf.taverna.t2.lang.observer.Observer;
+import net.sf.taverna.t2.monitor.MonitorManager.AddPropertiesMessage;
+import net.sf.taverna.t2.monitor.MonitorManager.DeregisterNodeMessage;
+import net.sf.taverna.t2.monitor.MonitorManager.MonitorMessage;
+import net.sf.taverna.t2.monitor.MonitorManager.RegisterNodeMessage;
+import net.sf.taverna.t2.monitor.MonitorableProperty;
+import net.sf.taverna.t2.reference.ErrorDocument;
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.IdentifiedList;
+import net.sf.taverna.t2.reference.ReferenceService;
+import net.sf.taverna.t2.reference.ReferenceServiceException;
+import net.sf.taverna.t2.reference.ReferenceSet;
+import net.sf.taverna.t2.reference.StackTraceElementBean;
+import net.sf.taverna.t2.reference.T2Reference;
+import net.sf.taverna.t2.reference.T2ReferenceType;
+import net.sf.taverna.t2.reference.impl.external.file.FileReference;
+import net.sf.taverna.t2.reference.impl.external.http.HttpReference;
+import net.sf.taverna.t2.workflowmodel.Dataflow;
+import net.sf.taverna.t2.workflowmodel.DataflowOutputPort;
+import net.sf.taverna.t2.workflowmodel.Processor;
+import net.sf.taverna.t2.workflowmodel.processor.activity.Activity;
+import net.sf.taverna.t2.workflowmodel.processor.dispatch.events.DispatchJobEvent;
+import net.sf.taverna.t2.workflowmodel.processor.dispatch.events.DispatchResultEvent;
+
+import org.purl.wf4ever.robundle.Bundle;
+
+import uk.org.taverna.databundle.DataBundles;
+import uk.org.taverna.platform.execution.api.InvalidWorkflowException;
+import uk.org.taverna.platform.report.ActivityReport;
+import uk.org.taverna.platform.report.Invocation;
+import uk.org.taverna.platform.report.ProcessorReport;
+import uk.org.taverna.platform.report.StatusReport;
+import uk.org.taverna.platform.report.WorkflowReport;
+
+/**
+ * A workflow monitor for local executions.
+ * 
+ * @author David Withers
+ */
+public class LocalExecutionMonitor implements Observer<MonitorMessage> {
+	private static final Logger logger = Logger
+			.getLogger(LocalExecutionMonitor.class.getName());
+	private static final String ID_SEPARATOR = "/";
+
+	private Map<String, StatusReport<?, ?>> reports;
+	private Map<String, Invocation> invocations;
+	private Map<String, String> invocationToActivity;
+	private Map<T2Reference, Path> referenceToPath;
+	private final String facadeId;
+	private final Bundle dataBundle;
+
+	public LocalExecutionMonitor(WorkflowReport workflowReport,
+			Bundle dataBundle, WorkflowToDataflowMapper mapping, String facadeId)
+			throws InvalidWorkflowException {
+		this.dataBundle = dataBundle;
+		this.facadeId = facadeId;
+		reports = new HashMap<>();
+		invocations = new HashMap<>();
+		invocationToActivity = new HashMap<>();
+		referenceToPath = new HashMap<>();
+		mapReports("", workflowReport, mapping);
+	}
+
+	private void mapReports(String id, WorkflowReport workflowReport,
+			WorkflowToDataflowMapper mapping) throws InvalidWorkflowException {
+		Dataflow dataflow = mapping.getDataflow(workflowReport.getSubject());
+		String dataflowId = null;
+		if (id.isEmpty()) {
+			dataflowId = dataflow.getLocalName();
+		} else {
+			dataflowId = id + ID_SEPARATOR + dataflow.getLocalName();
+		}
+		reports.put(dataflowId, workflowReport);
+		for (ProcessorReport processorReport : workflowReport
+				.getProcessorReports()) {
+			Processor processor = mapping.getDataflowProcessor(processorReport
+					.getSubject());
+			String processorId = dataflowId + ID_SEPARATOR
+					+ processor.getLocalName();
+			reports.put(processorId, (LocalProcessorReport) processorReport);
+			for (ActivityReport activityReport : processorReport
+					.getActivityReports()) {
+				Activity<?> activity = mapping
+						.getDataflowActivity(activityReport.getSubject());
+				String activityId = processorId + ID_SEPARATOR
+						+ activity.hashCode();
+				reports.put(activityId, activityReport);
+				WorkflowReport nestedWorkflowReport = activityReport
+						.getNestedWorkflowReport();
+				if (nestedWorkflowReport != null)
+					mapReports(activityId, nestedWorkflowReport, mapping);
+			}
+		}
+	}
+
+	@Override
+	public void notify(Observable<MonitorMessage> sender, MonitorMessage message)
+			throws Exception {
+		String[] owningProcess = message.getOwningProcess();
+		if (owningProcess.length > 0 && owningProcess[0].equals(facadeId)) {
+			if (message instanceof RegisterNodeMessage) {
+				RegisterNodeMessage regMessage = (RegisterNodeMessage) message;
+				registerNode(regMessage.getWorkflowObject(), owningProcess,
+						regMessage.getProperties());
+			} else if (message instanceof DeregisterNodeMessage) {
+				deregisterNode(owningProcess);
+			} else if (message instanceof AddPropertiesMessage) {
+				AddPropertiesMessage addMessage = (AddPropertiesMessage) message;
+				addPropertiesToNode(owningProcess,
+						addMessage.getNewProperties());
+			} else {
+				logger.warning("Unknown message " + message + " from " + sender);
+			}
+		}
+	}
+
+	public void registerNode(Object dataflowObject, String[] owningProcess,
+			Set<MonitorableProperty<?>> properties) {
+		if (dataflowObject instanceof Dataflow) {
+			Dataflow dataflow = (Dataflow) dataflowObject;
+			Invocation parentInvocation = invocations
+					.get(getParentInvocationId(owningProcess));
+			WorkflowReport report = (WorkflowReport) reports
+					.get(getReportId(owningProcess));
+			report.setStartedDate(new Date());
+			Invocation invocation = new Invocation(
+					getInvocationName(owningProcess), parentInvocation, report);
+			if (parentInvocation == null) {
+				if (DataBundles.hasInputs(dataBundle)) {
+					try {
+						invocation.setInputs(DataBundles.getPorts(DataBundles
+								.getInputs(dataBundle)));
+					} catch (IOException e) {
+						logger.log(WARNING, "Error setting input ports", e);
+					}
+				}
+				try {
+					Path outputs = DataBundles.getOutputs(dataBundle);
+					DataflowResultListener dataflowResultListener = new DataflowResultListener(
+							outputs);
+					for (DataflowOutputPort dataflowOutputPort : dataflow
+							.getOutputPorts()) {
+						String portName = dataflowOutputPort.getName();
+						Path portPath = DataBundles.getPort(outputs, portName);
+						invocation.setOutput(portName, portPath);
+						dataflowOutputPort
+								.addResultListener(dataflowResultListener);
+					}
+				} catch (IOException e) {
+					logger.log(WARNING, "Error setting output ports", e);
+				}
+				invocations.put(getInvocationId(owningProcess), invocation);
+			} else {
+				invocation.setInputs(parentInvocation.getInputs());
+				NestedDataflowResultListener resultListener = new NestedDataflowResultListener(
+						invocation);
+				for (DataflowOutputPort dataflowOutputPort : dataflow
+						.getOutputPorts()) {
+					dataflowOutputPort.addResultListener(resultListener);
+				}
+				invocations.put(getInvocationId(owningProcess), invocation);
+			}
+		} else if (dataflowObject instanceof Processor) {
+			StatusReport<?, ?> report = reports.get(getReportId(owningProcess));
+			report.setStartedDate(new Date());
+			if (report instanceof LocalProcessorReport)
+				((LocalProcessorReport) report).addProperties(properties);
+		} else if (dataflowObject instanceof Activity) {
+			Activity<?> activity = (Activity<?>) dataflowObject;
+			invocationToActivity.put(owningProcess[owningProcess.length - 1],
+					String.valueOf(activity.hashCode()));
+		} else if (dataflowObject instanceof DispatchJobEvent) {
+			DispatchJobEvent jobEvent = (DispatchJobEvent) dataflowObject;
+			StatusReport<?, ?> report = reports.get(getReportId(owningProcess));
+			// create a new invocation
+			Invocation parentInvocation;
+			Invocation invocation;
+
+			if (report instanceof ActivityReport) {
+				parentInvocation = invocations
+						.get(getParentInvocationId(owningProcess)
+								+ indexToString(jobEvent.getIndex()));
+				invocation = new Invocation(getInvocationName(owningProcess),
+						jobEvent.getIndex(), parentInvocation, report);
+				invocations.put(getInvocationId(owningProcess), invocation);
+			} else {
+				parentInvocation = invocations
+						.get(getParentInvocationId(owningProcess));
+				invocation = new Invocation(getInvocationName(owningProcess)
+						+ indexToString(jobEvent.getIndex()),
+						jobEvent.getIndex(), parentInvocation, report);
+				invocations.put(getInvocationId(owningProcess)
+						+ indexToString(jobEvent.getIndex()), invocation);
+			}
+			// set the invocation inputs
+			try {
+				for (Entry<String, T2Reference> inputInfo : jobEvent.getData()
+						.entrySet()) {
+					invocation.setInput(
+							inputInfo.getKey(),
+							getIntermediate(inputInfo.getValue(),
+									jobEvent.getContext()));
+				}
+			} catch (IOException | URISyntaxException e) {
+				logger.log(WARNING, "Error saving intermediate inputs for "
+						+ jobEvent.getOwningProcess(), e);
+			}
+
+		} else if (dataflowObject instanceof DispatchResultEvent) {
+			DispatchResultEvent resultEvent = (DispatchResultEvent) dataflowObject;
+			StatusReport<?, ?> report = reports.get(getReportId(owningProcess));
+			// find the invocation
+			Invocation invocation;
+			if (report instanceof ActivityReport)
+				invocation = invocations.remove(getInvocationId(owningProcess));
+			else
+				invocation = invocations.remove(getInvocationId(owningProcess)
+						+ indexToString(resultEvent.getIndex()));
+
+			if (invocation == null) {
+				logger.log(SEVERE, "Can't find invocation for owning process "
+						+ owningProcess);
+				return;
+			}
+
+			// set the invocation outputs
+			try {
+				for (Entry<String, T2Reference> outputInfo : resultEvent.getData()
+						.entrySet()) {
+					invocation.setOutput(
+							outputInfo.getKey(),
+							getIntermediate(outputInfo.getValue(),
+									resultEvent.getContext()));
+				}
+			} catch (IOException | URISyntaxException e) {
+				logger.log(WARNING, "Error saving intermediate outputs for "
+						+ resultEvent.getOwningProcess(), e);
+			}
+			invocation.setCompletedDate(new Date());
+		}
+	}
+
+	public void deregisterNode(String[] owningProcess) {
+		StatusReport<?, ?> report = reports.get(getReportId(owningProcess));
+		if (report == null) {
+			return;
+		} else if (report instanceof WorkflowReport) {
+			Invocation invocation = invocations
+					.remove(getInvocationId(owningProcess));
+			invocation.setCompletedDate(new Date());
+			report.setCompletedDate(new Date());
+		} else if (report instanceof LocalProcessorReport) {
+			((LocalProcessorReport) report).saveProperties();
+			report.setCompletedDate(new Date());
+		} else if (report instanceof ActivityReport) {
+			// Invocation may still exist if the activity failed
+			Invocation invocation = invocations
+					.remove(getInvocationId(owningProcess));
+			if (invocation != null) {
+				invocation.setCompletedDate(new Date());
+				report.setFailedDate(new Date());
+			} else
+				report.setCompletedDate(new Date());
+			invocationToActivity
+					.remove(owningProcess[owningProcess.length - 1]);
+		}
+	}
+
+	public void addPropertiesToNode(String[] owningProcess,
+			Set<MonitorableProperty<?>> newProperties) {
+		StatusReport<?, ?> report = reports.get(getReportId(owningProcess));
+		if (report instanceof LocalProcessorReport) {
+			LocalProcessorReport processorReport = (LocalProcessorReport) report;
+			processorReport.addProperties(newProperties);
+		}
+	}
+
+	private String getParentInvocationId(String[] owningProcess) {
+		List<String> id = new ArrayList<>();
+		for (int i = 1; i < owningProcess.length - 1; i++)
+			if (i % 4 != 0)
+				id.add(owningProcess[i]);
+		return toPath(id);
+	}
+
+	private String getInvocationId(String[] owningProcess) {
+		List<String> id = new ArrayList<>();
+		for (int i = 1; i < owningProcess.length; i++)
+			if (i % 4 != 0)
+				id.add(owningProcess[i]);
+		return toPath(id);
+	}
+
+	private String getInvocationName(String[] owningProcess) {
+		return owningProcess[owningProcess.length - 1];
+	}
+
+	private String toPath(List<String> id) {
+		StringBuilder sb = new StringBuilder();
+		String sep = "";
+		for (String string : id) {
+			sb.append(sep).append(string);
+			sep = ID_SEPARATOR;
+		}
+		return sb.toString();
+	}
+
+	private String getReportId(String[] owningProcess) {
+		List<String> id = new ArrayList<>();
+		for (int i = 1, position = 0; i < owningProcess.length; i++) {
+			if (i % 4 == 0)
+				continue;
+			if (position == 2) {
+				id.add(invocationToActivity.get(owningProcess[i]));
+				position = 0;
+			} else {
+				id.add(owningProcess[i]);
+				position++;
+			}
+		}
+		return toPath(id);
+	}
+
+	public String getProcessorId(String[] owningProcess) {
+		StringBuffer sb = new StringBuffer();
+		for (int i = 1, skip = 0; i < owningProcess.length; i++, skip--)
+			if (i <= 2 || skip < 0) {
+				sb.append(owningProcess[i]);
+				skip = 3;
+			}
+		return sb.toString();
+	}
+
+	private String indexToString(int[] index) {
+		StringBuilder indexString = new StringBuilder();
+		for (int i = 0; i < index.length; i++) {
+			if (i != 0)
+				indexString.append(":");
+			indexString.append(index[i] + 1);
+		}
+		return indexString.toString();
+	}
+
+	private Path getIntermediate(T2Reference t2Reference,
+			InvocationContext context) throws IOException, URISyntaxException {
+		if (referenceToPath.containsKey(t2Reference))
+			return referenceToPath.get(t2Reference);
+
+		Path path = referencePath(t2Reference);
+		convertReferenceToPath(path, t2Reference, context);
+		referenceToPath.put(t2Reference, path);
+		return path;
+	}
+
+	private Path referencePath(T2Reference t2Reference) throws IOException {
+		String local = t2Reference.getLocalPart();
+		try {
+			return DataBundles.getIntermediate(dataBundle,
+					UUID.fromString(local));
+		} catch (IllegalArgumentException ex) {
+			return DataBundles.getIntermediates(dataBundle)
+					.resolve(t2Reference.getNamespacePart())
+					.resolve(t2Reference.getLocalPart());
+		}
+	}
+
+	public static String getStackTraceElementString(
+			StackTraceElementBean stackTraceElement) {
+		StringBuilder sb = new StringBuilder();
+		sb.append(stackTraceElement.getClassName()).append('.')
+				.append(stackTraceElement.getMethodName());
+		if (stackTraceElement.getFileName() == null) {
+			sb.append("(unknown file)");
+		} else {
+			sb.append('(').append(stackTraceElement.getFileName()).append(':')
+					.append(stackTraceElement.getLineNumber()).append(')');
+		}
+		return sb.toString();
+	}
+
+	public void convertReferenceToPath(Path path, T2Reference reference,
+			InvocationContext context) throws IOException, URISyntaxException {
+		ReferenceService referenceService = context.getReferenceService();
+		if (reference.getReferenceType() == T2ReferenceType.ReferenceSet) {
+			if (DataBundles.isMissing(path)) {
+				ReferenceSet rs = referenceService.getReferenceSetService()
+						.getReferenceSet(reference);
+				if (rs == null)
+					throw new ReferenceServiceException(
+							"Could not find ReferenceSet " + reference);
+				// Check that there are references in the set
+				if (rs.getExternalReferences().isEmpty())
+					throw new ReferenceServiceException("ReferenceSet "
+							+ reference + " is empty");
+
+				for (ExternalReferenceSPI ers : rs.getExternalReferences()) {
+					if (ers instanceof FileReference) {
+						URI uri = ((FileReference) ers).getFile().toURI();
+						DataBundles.setReference(path, uri);
+					} else if (ers instanceof HttpReference) {
+						URI uri = ((HttpReference) ers).getHttpUrl().toURI();
+						DataBundles.setReference(path, uri);
+					} else {
+						try (InputStream in = ers.openStream(context)) {
+							Files.copy(in, path);
+						}
+					}
+				}
+			}
+		} else if (reference.getReferenceType() == T2ReferenceType.ErrorDocument) {
+			if (DataBundles.isMissing(path)) {
+				ErrorDocument errorDocument = referenceService
+						.getErrorDocumentService().getError(reference);
+				String message = errorDocument.getMessage();
+				StringBuilder trace = new StringBuilder();
+				if (errorDocument.getExceptionMessage() != null
+						&& !errorDocument.getExceptionMessage().isEmpty()) {
+					trace.append(errorDocument.getExceptionMessage());
+					trace.append("\n");
+				}
+				List<StackTraceElementBean> stackTraceStrings = errorDocument
+						.getStackTraceStrings();
+				for (StackTraceElementBean stackTraceElement : stackTraceStrings) {
+					trace.append(getStackTraceElementString(stackTraceElement));
+					trace.append("\n");
+				}
+				List<Path> causes = new ArrayList<>();
+				for (T2Reference errorReference : errorDocument
+						.getErrorReferences())
+					causes.add(getIntermediate(errorReference, context));
+				DataBundles.setError(path, message, trace.toString(),
+						causes.toArray(new Path[causes.size()]));
+			}
+		} else { // it is an IdentifiedList<T2Reference>
+			IdentifiedList<T2Reference> identifiedList = referenceService
+					.getListService().getList(reference);
+			if (!DataBundles.isList(path))
+				DataBundles.createList(path);
+			for (T2Reference ref : identifiedList)
+				convertReferenceToPath(DataBundles.newListItem(path), ref,
+						context);
+		}
+	}
+
+	private class NestedDataflowResultListener implements ResultListener {
+		private final Invocation invocation;
+
+		public NestedDataflowResultListener(Invocation invocation) {
+			this.invocation = invocation;
+		}
+
+		@Override
+		public void resultTokenProduced(WorkflowDataToken token, String portName) {
+			try {
+				if (token.isFinal())
+					invocation
+							.setOutput(
+									portName,
+									getIntermediate(token.getData(),
+											token.getContext()));
+			} catch (IOException | URISyntaxException e) {
+				logger.log(SEVERE, "Unable to convert T2Reference", e);
+			}
+		}
+
+	}
+
+	private class DataflowResultListener implements ResultListener {
+		private Path outputs;
+		private Map<String, Integer> depthSeen = new HashMap<>();
+
+		public DataflowResultListener(Path outputs) {
+			this.outputs = outputs;
+		}
+
+		@Override
+		public void resultTokenProduced(WorkflowDataToken token, String portName) {
+			Integer depth = depthSeen.get(portName);
+			if (depth == null || depth.equals(token.getIndex().length)) {
+				if (depth == null)
+					depthSeen.put(portName, token.getIndex().length);
+				try {
+					Path port = DataBundles.getPort(outputs, portName);
+					Path path = getPath(port, 0, token.getIndex());
+					convertReferenceToPath(path, token.getData(),
+							token.getContext());
+				} catch (IOException | URISyntaxException e) {
+					logger.log(SEVERE, "Unable to convert T2Reference", e);
+				}
+			}
+		}
+
+		private Path getPath(Path path, int depth, int[] index)
+				throws IOException {
+			if (depth == index.length)
+				return path;
+			if (!DataBundles.isList(path))
+				DataBundles.createList(path);
+			return getPath(DataBundles.getListItem(path, index[depth]),
+					depth + 1, index);
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionService.java
----------------------------------------------------------------------
diff --git a/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionService.java b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionService.java
new file mode 100644
index 0000000..9038e0f
--- /dev/null
+++ b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionService.java
@@ -0,0 +1,149 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.impl.local;
+
+import java.net.URI;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.WeakHashMap;
+
+import net.sf.taverna.t2.reference.ReferenceService;
+import net.sf.taverna.t2.workflowmodel.Dataflow;
+import net.sf.taverna.t2.workflowmodel.Edits;
+
+import org.purl.wf4ever.robundle.Bundle;
+
+import uk.org.taverna.platform.capability.api.ActivityService;
+import uk.org.taverna.platform.capability.api.DispatchLayerService;
+import uk.org.taverna.platform.execution.api.AbstractExecutionService;
+import uk.org.taverna.platform.execution.api.Execution;
+import uk.org.taverna.platform.execution.api.ExecutionEnvironment;
+import uk.org.taverna.platform.execution.api.InvalidWorkflowException;
+import uk.org.taverna.platform.execution.api.WorkflowCompiler;
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+import uk.org.taverna.scufl2.api.core.Workflow;
+import uk.org.taverna.scufl2.api.profiles.Profile;
+
+/**
+ * Service for executing Taverna workflows on a local Taverna Dataflow Engine.
+ *
+ * @author David Withers
+ */
+public class LocalExecutionService extends AbstractExecutionService implements
+		WorkflowCompiler {
+	private Edits edits;
+	private ActivityService activityService;
+	private DispatchLayerService dispatchLayerService;
+	private ReferenceService referenceService;
+
+	/**
+	 * Constructs an execution service that executes workflows using the T2
+	 * dataflow engine.
+	 */
+	public LocalExecutionService() {
+		super(
+				LocalExecutionService.class.getName(),
+				"Taverna Local Execution Service",
+				"Execution Service for executing Taverna workflows using a local Taverna Dataflow Engine");
+	}
+
+	@Override
+	public Set<ExecutionEnvironment> getExecutionEnvironments() {
+		Set<ExecutionEnvironment> executionEnvironments = new HashSet<>();
+		executionEnvironments.add(new LocalExecutionEnvironment(this,
+				activityService, dispatchLayerService));
+		return executionEnvironments;
+	}
+
+	@Override
+	protected Execution createExecutionImpl(WorkflowBundle workflowBundle,
+			Workflow workflow, Profile profile, Bundle dataBundle)
+			throws InvalidWorkflowException {
+		return new LocalExecution(workflowBundle, workflow, profile,
+				dataBundle, referenceService, edits, activityService,
+				dispatchLayerService);
+	}
+
+	/**
+	 * Sets the Edits Service for creating Taverna Dataflows.
+	 *
+	 * @param edits
+	 *            the Edits Service for creating Taverna Dataflows
+	 */
+	public void setEdits(Edits edits) {
+		this.edits = edits;
+	}
+
+	/**
+	 * Sets the service for creating activities.
+	 *
+	 * @param activityService
+	 *            the service for creating activities
+	 */
+	public void setActivityService(ActivityService activityService) {
+		this.activityService = activityService;
+	}
+
+	/**
+	 * Sets the service for creating dispatch layers.
+	 *
+	 * @param dispatchLayerService
+	 *            the service for creating dispatch layers
+	 */
+	public void setDispatchLayerService(DispatchLayerService dispatchLayerService) {
+		this.dispatchLayerService = dispatchLayerService;
+	}
+
+	/**
+	 * Sets the reference service.
+	 *
+	 * @param referenceService
+	 *            the reference service
+	 */
+	public void setReferenceService(ReferenceService referenceService) {
+		this.referenceService = referenceService;
+	}
+
+	private WeakHashMap<URI, WorkflowToDataflowMapper> cache = new WeakHashMap<>();
+
+	private synchronized WorkflowToDataflowMapper getMapper(
+			WorkflowBundle bundle) {
+		WorkflowToDataflowMapper m = cache.get(bundle.getIdentifier());
+		if (m == null) {
+			m = new WorkflowToDataflowMapper(bundle, bundle.getMainProfile(),
+					edits, activityService, dispatchLayerService);
+			cache.put(bundle.getIdentifier(), m);
+		}
+		return m;
+	}
+
+	@Override
+	public Dataflow getDataflow(Workflow workflow)
+			throws InvalidWorkflowException {
+		return getMapper(workflow.getParent()).getDataflow(workflow);
+	}
+
+	@Override
+	public synchronized Dataflow getDataflow(WorkflowBundle bundle)
+			throws InvalidWorkflowException {
+		return getMapper(bundle).getDataflow(bundle.getMainWorkflow());
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalProcessorReport.java
----------------------------------------------------------------------
diff --git a/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalProcessorReport.java b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalProcessorReport.java
new file mode 100644
index 0000000..0677eaf
--- /dev/null
+++ b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/LocalProcessorReport.java
@@ -0,0 +1,141 @@
+package uk.org.taverna.platform.execution.impl.local;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import net.sf.taverna.t2.monitor.MonitorableProperty;
+import net.sf.taverna.t2.monitor.NoSuchPropertyException;
+import net.sf.taverna.t2.monitor.SteerableProperty;
+import uk.org.taverna.platform.report.ProcessorReport;
+import uk.org.taverna.scufl2.api.core.Processor;
+
+/**
+ * ProcessorReport implementation based on MonitorableProperty objects.
+ * 
+ * @author David Withers
+ */
+public class LocalProcessorReport extends ProcessorReport {
+	private static final String DISPATCH_ERRORBOUNCE_TOTAL_TRANSLATED = "dispatch:errorbounce:totalTranslated";
+	private static final String DISPATCH_PARALLELIZE_COMPLETEDJOBS = "dispatch:parallelize:completedjobs";
+	private static final String DISPATCH_PARALLELIZE_SENTJOBS = "dispatch:parallelize:sentjobs";
+	private static final String DISPATCH_PARALLELIZE_QUEUESIZE = "dispatch:parallelize:queuesize";
+
+	private Map<String, MonitorableProperty<?>> propertyMap;
+
+	public LocalProcessorReport(Processor processor) {
+		super(processor);
+		propertyMap = new HashMap<String, MonitorableProperty<?>>();
+	}
+
+	public void addProperties(Set<MonitorableProperty<?>> properties) {
+		for (MonitorableProperty<?> property : properties) {
+			propertyMap.put(getPropertyName(property), property);
+		}
+	}
+
+	public void saveProperties() {
+		for (Entry<String, MonitorableProperty<?>> entry : propertyMap
+				.entrySet())
+			entry.setValue(new StaticProperty(entry.getValue()));
+	}
+
+	@Override
+	public int getJobsQueued() {
+		int result = -1;
+		MonitorableProperty<?> property = propertyMap
+				.get(DISPATCH_PARALLELIZE_QUEUESIZE);
+		try {
+			if (property != null)
+				result = (Integer) property.getValue();
+		} catch (NoSuchPropertyException e) {
+		}
+		return result;
+	}
+
+	@Override
+	public int getJobsStarted() {
+		int result = -1;
+		MonitorableProperty<?> property = propertyMap
+				.get(DISPATCH_PARALLELIZE_SENTJOBS);
+		if (property != null) {
+			try {
+				result = (Integer) property.getValue();
+			} catch (NoSuchPropertyException e) {
+			}
+		}
+		return result;
+	}
+
+	@Override
+	public int getJobsCompleted() {
+		int result = -1;
+		MonitorableProperty<?> property = propertyMap
+				.get(DISPATCH_PARALLELIZE_COMPLETEDJOBS);
+		try {
+			if (property != null)
+				result = (Integer) property.getValue();
+		} catch (NoSuchPropertyException e) {
+		}
+		return result;
+	}
+
+	@Override
+	public int getJobsCompletedWithErrors() {
+		int result = -1;
+		MonitorableProperty<?> property = propertyMap
+				.get(DISPATCH_ERRORBOUNCE_TOTAL_TRANSLATED);
+		try {
+			if (property != null)
+				result = (Integer) property.getValue();
+		} catch (NoSuchPropertyException e) {
+		}
+		return result;
+	}
+
+	@Override
+	public Set<String> getPropertyKeys() {
+		if (!propertyMap.isEmpty())
+			return new HashSet<>(propertyMap.keySet());
+		return super.getPropertyKeys();
+	}
+
+	@Override
+	public Object getProperty(String key) {
+		Object result = null;
+		MonitorableProperty<?> property = propertyMap.get(key);
+		try {
+			if (property != null)
+				result = property.getValue();
+		} catch (NoSuchPropertyException e) {
+		}
+		return result;
+	}
+
+	@Override
+	public void setProperty(String key, Object value) {
+		MonitorableProperty<?> monitorableProperty = propertyMap.get(key);
+		if (monitorableProperty instanceof SteerableProperty<?>) {
+			@SuppressWarnings("unchecked")
+			SteerableProperty<Object> steerableProperty = (SteerableProperty<Object>) monitorableProperty;
+			try {
+				steerableProperty.setProperty(value);
+			} catch (NoSuchPropertyException e) {
+			}
+		}
+	}
+
+	private String getPropertyName(MonitorableProperty<?> property) {
+		StringBuilder sb = new StringBuilder();
+		String[] name = property.getName();
+		for (int i = 0; i < name.length; i++) {
+			if (i > 0)
+				sb.append(':');
+			sb.append(name[i]);
+		}
+		return sb.toString();
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/StaticProperty.java
----------------------------------------------------------------------
diff --git a/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/StaticProperty.java b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/StaticProperty.java
new file mode 100755
index 0000000..e8c2c07
--- /dev/null
+++ b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/StaticProperty.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.impl.local;
+
+import java.util.Date;
+
+import net.sf.taverna.t2.monitor.MonitorableProperty;
+import net.sf.taverna.t2.monitor.NoSuchPropertyException;
+
+/**
+ * A MonitorableProperty with fixed values.
+ * 
+ * @author David Withers
+ */
+public class StaticProperty implements MonitorableProperty<Object> {
+	private Object value;
+	private String[] name;
+	private Date lastModified;
+	
+	/**
+	 * Records the state of the MonitorableProperty.
+	 * 
+	 * @param property
+	 */
+	public StaticProperty(MonitorableProperty<?> property) {
+		try {
+			value = property.getValue();
+		} catch (NoSuchPropertyException e) {
+		}
+		name = property.getName();
+		lastModified = property.getLastModified();
+	}
+	
+	@Override
+	public Object getValue() throws NoSuchPropertyException {
+		return value;
+	}
+
+	@Override
+	public String[] getName() {
+		return name;
+	}
+
+	@Override
+	public Date getLastModified() {
+		return lastModified;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/T2ReferenceConverter.java
----------------------------------------------------------------------
diff --git a/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/T2ReferenceConverter.java b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/T2ReferenceConverter.java
new file mode 100644
index 0000000..879074a
--- /dev/null
+++ b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/T2ReferenceConverter.java
@@ -0,0 +1,41 @@
+/**
+ *
+ */
+package uk.org.taverna.platform.execution.impl.local;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.List;
+
+import uk.org.taverna.databundle.DataBundles;
+
+/**
+ * @author David Withers
+ */
+public class T2ReferenceConverter {
+	public static Object convertPathToObject(Path path) throws IOException {
+		Object object = null;
+		if (DataBundles.isValue(path)) {
+			object = DataBundles.getStringValue(path);
+		} else if (DataBundles.isReference(path)) {
+			URI reference = DataBundles.getReference(path);
+			String scheme = reference.getScheme();
+			if ("file".equals(scheme)) {
+				object = new File(reference);
+			} else {
+				object = reference.toURL();
+			}
+		} else if (DataBundles.isList(path)) {
+			List<Path> list = DataBundles.getList(path);
+			List<Object> objectList = new ArrayList<Object>(list.size());
+			for (Path pathElement : list) {
+				objectList.add(convertPathToObject(pathElement));
+			}
+			object = objectList;
+		}
+		return object;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/WorkflowToDataflowMapper.java
----------------------------------------------------------------------
diff --git a/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/WorkflowToDataflowMapper.java b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/WorkflowToDataflowMapper.java
new file mode 100644
index 0000000..986705a
--- /dev/null
+++ b/taverna-execution-local/src/main/java/uk/org/taverna/platform/execution/impl/local/WorkflowToDataflowMapper.java
@@ -0,0 +1,527 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.impl.local;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.IdentityHashMap;
+import java.util.List;
+import java.util.Map;
+
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.workflowmodel.Dataflow;
+import net.sf.taverna.t2.workflowmodel.DataflowInputPort;
+import net.sf.taverna.t2.workflowmodel.DataflowOutputPort;
+import net.sf.taverna.t2.workflowmodel.Datalink;
+import net.sf.taverna.t2.workflowmodel.EditException;
+import net.sf.taverna.t2.workflowmodel.Edits;
+import net.sf.taverna.t2.workflowmodel.EventForwardingOutputPort;
+import net.sf.taverna.t2.workflowmodel.EventHandlingInputPort;
+import net.sf.taverna.t2.workflowmodel.Merge;
+import net.sf.taverna.t2.workflowmodel.MergeInputPort;
+import net.sf.taverna.t2.workflowmodel.ProcessorInputPort;
+import net.sf.taverna.t2.workflowmodel.ProcessorOutputPort;
+import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityInputPort;
+import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityOutputPort;
+import net.sf.taverna.t2.workflowmodel.processor.activity.NestedDataflow;
+import net.sf.taverna.t2.workflowmodel.processor.dispatch.DispatchLayer;
+import net.sf.taverna.t2.workflowmodel.processor.dispatch.DispatchStack;
+import net.sf.taverna.t2.workflowmodel.processor.iteration.IterationStrategy;
+import net.sf.taverna.t2.workflowmodel.processor.iteration.NamedInputPortNode;
+import uk.org.taverna.platform.capability.api.ActivityConfigurationException;
+import uk.org.taverna.platform.capability.api.ActivityNotFoundException;
+import uk.org.taverna.platform.capability.api.ActivityService;
+import uk.org.taverna.platform.capability.api.DispatchLayerConfigurationException;
+import uk.org.taverna.platform.capability.api.DispatchLayerNotFoundException;
+import uk.org.taverna.platform.capability.api.DispatchLayerService;
+import uk.org.taverna.platform.execution.api.InvalidWorkflowException;
+import uk.org.taverna.scufl2.api.activity.Activity;
+import uk.org.taverna.scufl2.api.common.Scufl2Tools;
+import uk.org.taverna.scufl2.api.configurations.Configuration;
+import uk.org.taverna.scufl2.api.container.WorkflowBundle;
+import uk.org.taverna.scufl2.api.core.BlockingControlLink;
+import uk.org.taverna.scufl2.api.core.ControlLink;
+import uk.org.taverna.scufl2.api.core.DataLink;
+import uk.org.taverna.scufl2.api.core.Processor;
+import uk.org.taverna.scufl2.api.core.Workflow;
+import uk.org.taverna.scufl2.api.iterationstrategy.CrossProduct;
+import uk.org.taverna.scufl2.api.iterationstrategy.DotProduct;
+import uk.org.taverna.scufl2.api.iterationstrategy.IterationStrategyNode;
+import uk.org.taverna.scufl2.api.iterationstrategy.IterationStrategyStack;
+import uk.org.taverna.scufl2.api.iterationstrategy.IterationStrategyTopNode;
+import uk.org.taverna.scufl2.api.iterationstrategy.PortNode;
+import uk.org.taverna.scufl2.api.port.InputActivityPort;
+import uk.org.taverna.scufl2.api.port.InputProcessorPort;
+import uk.org.taverna.scufl2.api.port.InputWorkflowPort;
+import uk.org.taverna.scufl2.api.port.OutputActivityPort;
+import uk.org.taverna.scufl2.api.port.OutputProcessorPort;
+import uk.org.taverna.scufl2.api.port.OutputWorkflowPort;
+import uk.org.taverna.scufl2.api.port.Port;
+import uk.org.taverna.scufl2.api.port.ReceiverPort;
+import uk.org.taverna.scufl2.api.port.SenderPort;
+import uk.org.taverna.scufl2.api.profiles.ProcessorBinding;
+import uk.org.taverna.scufl2.api.profiles.ProcessorInputPortBinding;
+import uk.org.taverna.scufl2.api.profiles.ProcessorOutputPortBinding;
+import uk.org.taverna.scufl2.api.profiles.Profile;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+/**
+ * Translates a scufl2 {@link Workflow} into a {@link Dataflow}.
+ * 
+ * @author David Withers
+ */
+public class WorkflowToDataflowMapper {
+	private static final URI NESTED_WORKFLOW_URI = URI
+			.create("http://ns.taverna.org.uk/2010/activity/nested-workflow");
+
+	private Edits edits;
+	private final Scufl2Tools scufl2Tools = new Scufl2Tools();
+	private final Map<Port, EventHandlingInputPort> inputPorts;
+	private final Map<Port, EventForwardingOutputPort> outputPorts;
+	private final Map<Port, Merge> merges;
+	private final Map<Workflow, Dataflow> workflowToDataflow;
+	private final Map<Dataflow, Workflow> dataflowToWorkflow;
+	private final Map<Processor, net.sf.taverna.t2.workflowmodel.Processor> workflowToDataflowProcessors;
+	private final Map<net.sf.taverna.t2.workflowmodel.Processor, Processor> dataflowToWorkflowProcessors;
+	private final Map<Activity, net.sf.taverna.t2.workflowmodel.processor.activity.Activity<?>> workflowToDataflowActivities;
+	private final Map<net.sf.taverna.t2.workflowmodel.processor.activity.Activity<?>, Activity> dataflowToWorkflowActivities;
+	@SuppressWarnings("unused")
+	private final WorkflowBundle workflowBundle;
+	private final Profile profile;
+	private final ActivityService activityService;
+	private final DispatchLayerService dispatchLayerService;
+
+	public WorkflowToDataflowMapper(WorkflowBundle workflowBundle,
+			Profile profile, Edits edits, ActivityService activityService,
+			DispatchLayerService dispatchLayerService) {
+		this.workflowBundle = workflowBundle;
+		this.profile = profile;
+		this.edits = edits;
+		this.activityService = activityService;
+		this.dispatchLayerService = dispatchLayerService;
+		inputPorts = new IdentityHashMap<>();
+		outputPorts = new IdentityHashMap<>();
+		merges = new IdentityHashMap<>();
+		workflowToDataflow = new IdentityHashMap<>();
+		dataflowToWorkflow = new HashMap<>();
+		workflowToDataflowProcessors = new IdentityHashMap<>();
+		dataflowToWorkflowProcessors = new HashMap<>();
+		workflowToDataflowActivities = new IdentityHashMap<>();
+		dataflowToWorkflowActivities = new HashMap<>();
+	}
+
+	public Workflow getWorkflow(Dataflow dataflow) {
+		return dataflowToWorkflow.get(dataflow);
+	}
+
+	public Dataflow getDataflow(Workflow workflow)
+			throws InvalidWorkflowException {
+		if (!workflowToDataflow.containsKey(workflow)) {
+			try {
+				Dataflow dataflow = createDataflow(workflow);
+				workflowToDataflow.put(workflow, dataflow);
+				dataflowToWorkflow.put(dataflow, workflow);
+			} catch (EditException | ActivityConfigurationException
+					| DispatchLayerConfigurationException
+					| ActivityNotFoundException
+					| DispatchLayerNotFoundException e) {
+				throw new InvalidWorkflowException(e);
+			}
+		}
+		return workflowToDataflow.get(workflow);
+	}
+
+	public Processor getWorkflowProcessor(
+			net.sf.taverna.t2.workflowmodel.Processor dataflowProcessor) {
+		return dataflowToWorkflowProcessors.get(dataflowProcessor);
+	}
+
+	public net.sf.taverna.t2.workflowmodel.Processor getDataflowProcessor(
+			Processor workflowProcessor) {
+		return workflowToDataflowProcessors.get(workflowProcessor);
+	}
+
+	public Activity getWorkflowActivity(
+			net.sf.taverna.t2.workflowmodel.processor.activity.Activity<?> dataflowActiviy) {
+		return dataflowToWorkflowActivities.get(dataflowActiviy);
+	}
+
+	public net.sf.taverna.t2.workflowmodel.processor.activity.Activity<?> getDataflowActivity(
+			Activity workflowActivity) {
+		return workflowToDataflowActivities.get(workflowActivity);
+	}
+
+	protected Dataflow createDataflow(Workflow workflow) throws EditException,
+			ActivityNotFoundException, ActivityConfigurationException,
+			InvalidWorkflowException, DispatchLayerNotFoundException,
+			DispatchLayerConfigurationException {
+		// create the dataflow
+		Dataflow dataflow = edits.createDataflow();
+		// set the dataflow name
+		edits.getUpdateDataflowNameEdit(dataflow, workflow.getName()).doEdit();
+
+		addInputPorts(workflow, dataflow);
+		addOutputPorts(workflow, dataflow);
+		addProcessors(workflow, dataflow);
+		addDataLinks(workflow, dataflow);
+		addControlLinks(workflow);
+
+		return dataflow;
+	}
+
+	private void addProcessors(Workflow workflow, Dataflow dataflow)
+			throws EditException, ActivityNotFoundException,
+			ActivityConfigurationException, InvalidWorkflowException,
+			DispatchLayerNotFoundException, DispatchLayerConfigurationException {
+		for (Processor processor : workflow.getProcessors()) {
+			net.sf.taverna.t2.workflowmodel.Processor dataflowProcessor = edits
+					.createProcessor(processor.getName());
+			edits.getAddProcessorEdit(dataflow, dataflowProcessor).doEdit();
+			// map the processor
+			workflowToDataflowProcessors.put(processor, dataflowProcessor);
+			dataflowToWorkflowProcessors.put(dataflowProcessor, processor);
+			// add input ports
+			for (InputProcessorPort inputProcessorPort : processor
+					.getInputPorts()) {
+				if (inputProcessorPort.getDatalinksTo().isEmpty())
+					continue;
+				ProcessorInputPort processorInputPort = edits
+						.createProcessorInputPort(dataflowProcessor,
+								inputProcessorPort.getName(),
+								inputProcessorPort.getDepth());
+				edits.getAddProcessorInputPortEdit(dataflowProcessor,
+						processorInputPort).doEdit();
+				inputPorts.put(inputProcessorPort, processorInputPort);
+			}
+			// add output ports
+			for (OutputProcessorPort outputProcessorPort : processor
+					.getOutputPorts()) {
+				ProcessorOutputPort processorOutputPort = edits
+						.createProcessorOutputPort(dataflowProcessor,
+								outputProcessorPort.getName(),
+								outputProcessorPort.getDepth(),
+								outputProcessorPort.getGranularDepth());
+				edits.getAddProcessorOutputPortEdit(dataflowProcessor,
+						processorOutputPort).doEdit();
+				outputPorts.put(outputProcessorPort, processorOutputPort);
+			}
+
+			// add dispatch stack
+			addDispatchStack(processor, dataflowProcessor);
+
+			addIterationStrategy(processor, dataflowProcessor);
+
+			// add bound activities
+			for (ProcessorBinding processorBinding : scufl2Tools
+					.processorBindingsForProcessor(processor, profile))
+				addActivity(processorBinding);
+		}
+	}
+
+	private void addDispatchStack(Processor processor,
+			net.sf.taverna.t2.workflowmodel.Processor dataflowProcessor)
+			throws DispatchLayerNotFoundException,
+			DispatchLayerConfigurationException, EditException {
+		DispatchStack dispatchStack = dataflowProcessor.getDispatchStack();
+
+		JsonNode json = null;
+		try {
+			json = processor.getConfiguration(profile).getJson();
+		} catch (IndexOutOfBoundsException e) {
+			// no configuration for processor
+		}
+
+		int layer = 0;
+		addDispatchLayer(
+				dispatchStack,
+				URI.create("http://ns.taverna.org.uk/2010/scufl2/taverna/dispatchlayer/Parallelize"),
+				layer++, json == null ? null : json.get("parallelize"));
+		addDispatchLayer(
+				dispatchStack,
+				URI.create("http://ns.taverna.org.uk/2010/scufl2/taverna/dispatchlayer/ErrorBounce"),
+				layer++, null);
+		addDispatchLayer(
+				dispatchStack,
+				URI.create("http://ns.taverna.org.uk/2010/scufl2/taverna/dispatchlayer/Failover"),
+				layer++, null);
+		addDispatchLayer(
+				dispatchStack,
+				URI.create("http://ns.taverna.org.uk/2010/scufl2/taverna/dispatchlayer/Retry"),
+				layer++, json == null ? null : json.get("retry"));
+		addDispatchLayer(
+				dispatchStack,
+				URI.create("http://ns.taverna.org.uk/2010/scufl2/taverna/dispatchlayer/Stop"),
+				layer++, null);
+		addDispatchLayer(
+				dispatchStack,
+				URI.create("http://ns.taverna.org.uk/2010/scufl2/taverna/dispatchlayer/Invoke"),
+				layer++, null);
+
+	}
+
+	private void addDispatchLayer(DispatchStack dispatchStack,
+			URI dispatchLayerType, int layer, JsonNode json)
+			throws DispatchLayerConfigurationException,
+			DispatchLayerNotFoundException, EditException {
+		// create the dispatch layer
+		DispatchLayer<?> dispatchLayer = dispatchLayerService
+				.createDispatchLayer(dispatchLayerType, json);
+		// add the dispatch layer to the dispatch layer stack
+		edits.getAddDispatchLayerEdit(dispatchStack, dispatchLayer, layer)
+				.doEdit();
+	}
+
+	private void addIterationStrategy(Processor processor,
+			net.sf.taverna.t2.workflowmodel.Processor dataflowProcessor)
+			throws EditException, InvalidWorkflowException {
+		// get the iteration strategy from the processor
+		net.sf.taverna.t2.workflowmodel.processor.iteration.IterationStrategyStack dataflowIterationStrategyStack = dataflowProcessor
+				.getIterationStrategy();
+		// clear the iteration strategy
+		edits.getClearIterationStrategyStackEdit(dataflowIterationStrategyStack)
+				.doEdit();
+		IterationStrategyStack iterationStrategyStack = processor
+				.getIterationStrategyStack();
+		for (IterationStrategyTopNode iterationStrategyTopNode : iterationStrategyStack) {
+			// create iteration strategy
+			IterationStrategy dataflowIterationStrategy = edits
+					.createIterationStrategy();
+			// add iteration strategy to the stack
+			edits.getAddIterationStrategyEdit(dataflowIterationStrategyStack,
+					dataflowIterationStrategy).doEdit();
+			// add the node to the iteration strategy
+			addIterationStrategyNode(dataflowIterationStrategy,
+					dataflowIterationStrategy.getTerminalNode(),
+					iterationStrategyTopNode);
+		}
+	}
+
+	private void addIterationStrategyNode(
+			IterationStrategy dataflowIterationStrategy,
+			net.sf.taverna.t2.workflowmodel.processor.iteration.IterationStrategyNode dataflowIterationStrategyNode,
+			IterationStrategyNode iterationStrategyNode) throws EditException,
+			InvalidWorkflowException {
+		net.sf.taverna.t2.workflowmodel.processor.iteration.IterationStrategyNode childDataflowIterationStrategyNode = null;
+		if (iterationStrategyNode instanceof CrossProduct) {
+			CrossProduct crossProduct = (CrossProduct) iterationStrategyNode;
+			childDataflowIterationStrategyNode = new net.sf.taverna.t2.workflowmodel.processor.iteration.CrossProduct();
+			for (IterationStrategyNode iterationStrategyNode2 : crossProduct)
+				addIterationStrategyNode(dataflowIterationStrategy,
+						childDataflowIterationStrategyNode,
+						iterationStrategyNode2);
+		} else if (iterationStrategyNode instanceof DotProduct) {
+			DotProduct dotProduct = (DotProduct) iterationStrategyNode;
+			childDataflowIterationStrategyNode = new net.sf.taverna.t2.workflowmodel.processor.iteration.DotProduct();
+			for (IterationStrategyNode iterationStrategyNode2 : dotProduct)
+				addIterationStrategyNode(dataflowIterationStrategy,
+						childDataflowIterationStrategyNode,
+						iterationStrategyNode2);
+		} else if (iterationStrategyNode instanceof PortNode) {
+			PortNode portNode = (PortNode) iterationStrategyNode;
+			Integer desiredDepth = portNode.getDesiredDepth();
+			if (desiredDepth == null)
+				desiredDepth = portNode.getInputProcessorPort().getDepth();
+			NamedInputPortNode namedInputPortNode = new NamedInputPortNode(
+					portNode.getInputProcessorPort().getName(), desiredDepth);
+			edits.getAddIterationStrategyInputNodeEdit(
+					dataflowIterationStrategy, namedInputPortNode).doEdit();
+			childDataflowIterationStrategyNode = namedInputPortNode;
+		} else {
+			throw new InvalidWorkflowException(
+					"Unknown IterationStrategyNode type : "
+							+ iterationStrategyNode.getClass().getName());
+		}
+		childDataflowIterationStrategyNode
+				.setParent(dataflowIterationStrategyNode);
+	}
+
+	private void addActivity(ProcessorBinding processorBinding)
+			throws EditException, ActivityNotFoundException,
+			ActivityConfigurationException, InvalidWorkflowException {
+		net.sf.taverna.t2.workflowmodel.Processor processor = workflowToDataflowProcessors
+				.get(processorBinding.getBoundProcessor());
+		Activity scufl2Activity = processorBinding.getBoundActivity();
+		URI activityType = scufl2Activity.getType();
+		if (!activityService.activityExists(activityType))
+			throw new ActivityNotFoundException("No activity exists for "
+					+ activityType);
+		Configuration configuration = scufl2Activity.getConfiguration();
+
+		// create the activity
+		net.sf.taverna.t2.workflowmodel.processor.activity.Activity<?> activity = activityService
+				.createActivity(activityType, configuration.getJson());
+		// check if we have a nested workflow
+		if (activityType.equals(NESTED_WORKFLOW_URI)) {
+			if (activity instanceof NestedDataflow) {
+				Workflow nestedWorkflow = scufl2Tools
+						.nestedWorkflowForProcessor(
+								processorBinding.getBoundProcessor(), profile);
+				((NestedDataflow) activity)
+						.setNestedDataflow(getDataflow(nestedWorkflow));
+			} else
+				throw new ActivityConfigurationException(
+						"Activity is not an instance of NestedDataflow");
+		}
+
+		// add the activity to the processor
+		edits.getAddActivityEdit(processor, activity).doEdit();
+
+		// add input ports
+		for (InputActivityPort inputActivityPort : scufl2Activity
+				.getInputPorts()) {
+			ActivityInputPort activityInputPort = edits
+					.createActivityInputPort(
+							inputActivityPort.getName(),
+							inputActivityPort.getDepth(),
+							false,
+							new ArrayList<Class<? extends ExternalReferenceSPI>>(),
+							String.class);
+			edits.getAddActivityInputPortEdit(activity, activityInputPort)
+					.doEdit();
+		}
+		// add output ports
+		for (OutputActivityPort outputActivityPort : scufl2Activity
+				.getOutputPorts()) {
+			ActivityOutputPort activitytOutputPort = edits
+					.createActivityOutputPort(outputActivityPort.getName(),
+							outputActivityPort.getDepth(),
+							outputActivityPort.getGranularDepth());
+			edits.getAddActivityOutputPortEdit(activity, activitytOutputPort)
+					.doEdit();
+		}
+		// map input ports
+		for (ProcessorInputPortBinding portBinding : processorBinding
+				.getInputPortBindings()) {
+			InputProcessorPort processorPort = portBinding
+					.getBoundProcessorPort();
+			InputActivityPort activityPort = portBinding.getBoundActivityPort();
+			edits.getAddActivityInputPortMappingEdit(activity,
+					processorPort.getName(), activityPort.getName()).doEdit();
+		}
+		// map output ports
+		for (ProcessorOutputPortBinding portBinding : processorBinding
+				.getOutputPortBindings()) {
+			OutputProcessorPort processorPort = portBinding
+					.getBoundProcessorPort();
+			OutputActivityPort activityPort = portBinding
+					.getBoundActivityPort();
+			edits.getAddActivityOutputPortMappingEdit(activity,
+					processorPort.getName(), activityPort.getName()).doEdit();
+		}
+		workflowToDataflowActivities.put(scufl2Activity, activity);
+		dataflowToWorkflowActivities.put(activity, scufl2Activity);
+	}
+
+	private void addDataLinks(Workflow workflow, Dataflow dataflow)
+			throws EditException {
+		for (DataLink dataLink : workflow.getDataLinks()) {
+			ReceiverPort receiverPort = dataLink.getSendsTo();
+			SenderPort senderPort = dataLink.getReceivesFrom();
+			EventForwardingOutputPort source = outputPorts.get(senderPort);
+			EventHandlingInputPort sink = inputPorts.get(receiverPort);
+			Integer mergePosition = dataLink.getMergePosition();
+			if (mergePosition != null) {
+				if (!merges.containsKey(receiverPort)) {
+					Merge merge = edits.createMerge(dataflow);
+					edits.getAddMergeEdit(dataflow, merge).doEdit();
+					merges.put(receiverPort, merge);
+				}
+				Merge merge = merges.get(receiverPort);
+				// create merge input port
+				MergeInputPort mergeInputPort = edits.createMergeInputPort(
+						merge, "input" + mergePosition, sink.getDepth());
+				// add it to the correct position in the merge
+				@SuppressWarnings("unchecked")
+				List<MergeInputPort> mergeInputPorts = (List<MergeInputPort>) merge
+						.getInputPorts();
+				if (mergePosition > mergeInputPorts.size())
+					mergeInputPorts.add(mergeInputPort);
+				else
+					mergeInputPorts.add(mergePosition, mergeInputPort);
+				// connect a datalink into the merge
+				Datalink datalinkIn = edits.createDatalink(source,
+						mergeInputPort);
+				edits.getConnectDatalinkEdit(datalinkIn).doEdit();
+				// check if the merge output has been connected
+				EventForwardingOutputPort mergeOutputPort = merge
+						.getOutputPort();
+				if (mergeOutputPort.getOutgoingLinks().isEmpty()) {
+					Datalink datalinkOut = edits.createDatalink(
+							merge.getOutputPort(), sink);
+					edits.getConnectDatalinkEdit(datalinkOut).doEdit();
+				} else if (mergeOutputPort.getOutgoingLinks().size() == 1) {
+					if (mergeOutputPort.getOutgoingLinks().iterator().next()
+							.getSink() != sink)
+						throw new EditException(
+								"Cannot add a different sinkPort to a Merge that already has one defined");
+				} else
+					throw new EditException(
+							"The merge instance cannot have more that 1 outgoing Datalink");
+			} else {
+				Datalink datalink = edits.createDatalink(source, sink);
+				edits.getConnectDatalinkEdit(datalink).doEdit();
+			}
+		}
+	}
+
+	private void addControlLinks(Workflow workflow) throws EditException {
+		for (ControlLink controlLink : workflow.getControlLinks()) {
+			if (controlLink instanceof BlockingControlLink) {
+				BlockingControlLink blockingControlLink = (BlockingControlLink) controlLink;
+				Processor untilFinished = blockingControlLink
+						.getUntilFinished();
+				Processor block = blockingControlLink.getBlock();
+				edits.getCreateConditionEdit(
+						workflowToDataflowProcessors.get(untilFinished),
+						workflowToDataflowProcessors.get(block)).doEdit();
+			}
+		}
+	}
+
+	private void addOutputPorts(Workflow workflow, Dataflow dataflow)
+			throws EditException {
+		for (OutputWorkflowPort outputWorkflowPort : workflow.getOutputPorts()) {
+			DataflowOutputPort dataflowOutputPort = edits
+					.createDataflowOutputPort(outputWorkflowPort.getName(),
+							dataflow);
+			edits.getAddDataflowOutputPortEdit(dataflow, dataflowOutputPort)
+					.doEdit();
+			inputPorts.put(outputWorkflowPort,
+					dataflowOutputPort.getInternalInputPort());
+		}
+	}
+
+	private void addInputPorts(Workflow workflow, Dataflow dataflow)
+			throws EditException {
+		for (InputWorkflowPort inputWorkflowPort : workflow.getInputPorts()) {
+			DataflowInputPort dataflowInputPort = edits
+					.createDataflowInputPort(inputWorkflowPort.getName(),
+							inputWorkflowPort.getDepth(),
+							inputWorkflowPort.getDepth(), dataflow);
+			edits.getAddDataflowInputPortEdit(dataflow, dataflowInputPort)
+					.doEdit();
+			outputPorts.put(inputWorkflowPort,
+					dataflowInputPort.getInternalOutputPort());
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-local/src/main/resources/META-INF/spring/execution-local-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-execution-local/src/main/resources/META-INF/spring/execution-local-context-osgi.xml b/taverna-execution-local/src/main/resources/META-INF/spring/execution-local-context-osgi.xml
new file mode 100644
index 0000000..21a07c4
--- /dev/null
+++ b/taverna-execution-local/src/main/resources/META-INF/spring/execution-local-context-osgi.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans:beans xmlns="http://www.springframework.org/schema/osgi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:beans="http://www.springframework.org/schema/beans"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+                                 http://www.springframework.org/schema/beans/spring-beans.xsd
+                                 http://www.springframework.org/schema/osgi
+                                 http://www.springframework.org/schema/osgi/spring-osgi.xsd">
+
+	<service ref="localExecution">
+		<interfaces>
+			<beans:value>uk.org.taverna.platform.execution.api.ExecutionService</beans:value>
+			<beans:value>uk.org.taverna.platform.execution.api.WorkflowCompiler</beans:value>
+		</interfaces>
+		<service-properties>
+			<beans:entry key="executor" value="TavernaEngine" />
+		</service-properties>
+	</service>
+
+	<reference id="workflowModelEdits" interface="net.sf.taverna.t2.workflowmodel.Edits" />
+	<reference id="activityService" interface="uk.org.taverna.platform.capability.api.ActivityService" />
+	<reference id="dispatchLayerService" interface="uk.org.taverna.platform.capability.api.DispatchLayerService" />
+	<reference id="referenceService" interface="net.sf.taverna.t2.reference.ReferenceService" />
+</beans:beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-local/src/main/resources/META-INF/spring/execution-local-context.xml
----------------------------------------------------------------------
diff --git a/taverna-execution-local/src/main/resources/META-INF/spring/execution-local-context.xml b/taverna-execution-local/src/main/resources/META-INF/spring/execution-local-context.xml
new file mode 100644
index 0000000..bf9a146
--- /dev/null
+++ b/taverna-execution-local/src/main/resources/META-INF/spring/execution-local-context.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+                           http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+	<bean id="localExecution" class="uk.org.taverna.platform.execution.impl.local.LocalExecutionService">
+		<property name="edits" ref="workflowModelEdits" />
+		<property name="activityService" ref="activityService" />
+		<property name="dispatchLayerService" ref="dispatchLayerService" />
+		<property name="referenceService" ref="referenceService" />
+	</bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-local/src/test/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionTest.java
----------------------------------------------------------------------
diff --git a/taverna-execution-local/src/test/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionTest.java b/taverna-execution-local/src/test/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionTest.java
new file mode 100644
index 0000000..58a667e
--- /dev/null
+++ b/taverna-execution-local/src/test/java/uk/org/taverna/platform/execution/impl/local/LocalExecutionTest.java
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * Copyright (C) 2010 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package uk.org.taverna.platform.execution.impl.local;
+
+import java.util.Map;
+
+import org.junit.Ignore;
+import org.junit.Test;
+
+import uk.org.taverna.platform.report.WorkflowReport;
+
+/**
+ * 
+ * @author David Withers
+ */
+public class LocalExecutionTest {
+	
+	/**
+	 * Test method for {@link uk.org.taverna.platform.execution.impl.local.LocalExecution#start()}.
+	 */
+	@Test
+	@Ignore
+	public void testStart() {
+		// fail("Not yet implemented");
+	}
+
+	/**
+	 * Test method for {@link uk.org.taverna.platform.execution.impl.local.LocalExecution#pause()}.
+	 */
+	@Test
+	@Ignore
+	public void testPause() {
+		// fail("Not yet implemented");
+	}
+
+	/**
+	 * Test method for {@link uk.org.taverna.platform.execution.impl.local.LocalExecution#resume()}.
+	 */
+	@Test
+	@Ignore
+	public void testResume() {
+		// fail("Not yet implemented");
+	}
+
+	/**
+	 * Test method for {@link uk.org.taverna.platform.execution.impl.local.LocalExecution#cancel()}.
+	 */
+	@Test
+	@Ignore
+	public void testCancel() {
+		// fail("Not yet implemented");
+	}
+
+	/**
+	 * Test method for
+	 * {@link uk.org.taverna.platform.execution.impl.local.LocalExecution#DataflowExecution(uk.org.taverna.scufl2.api.core.Workflow, java.util.Map, net.sf.taverna.t2.reference.ReferenceService)}
+	 * .
+	 * 
+	 * @throws Exception
+	 */
+	@Test
+	@Ignore
+	public void testDataflowExecution() throws Exception {
+		// URL wfResource = getClass().getResource("/t2flow/in-out.t2flow");
+		// assertNotNull(wfResource);
+		// TavernaResearchObject researchObject = new
+		// T2FlowParser().parseT2Flow(wfResource.openStream());
+		// Workflow workflow = researchObject.getMainWorkflow();
+		// Profile profile = researchObject.getProfiles().iterator().next();
+		//
+		// T2Reference reference = context.getReferenceService().register("test-input", 0, true,
+		// context);
+		// Map<String, T2Reference> inputs = new HashMap<String, T2Reference>();
+		// inputs.put("in", reference);
+		//
+		// DataflowExecution execution = new DataflowExecution(workflow, profile, inputs,
+		// context.getReferenceService());
+		// WorkflowReport report = execution.getWorkflowReport();
+		// assertEquals(State.CREATED, report.getState());
+		// execution.start();
+		//
+		// Map<String, Object> results = execution.getResults();
+		// waitForResult(results, "out", report);
+		//
+		// String result = (String) context.getReferenceService().renderIdentifier((T2Reference)
+		// results.get("out"), String.class, context);
+		// assertEquals("test-input", result);
+		// assertEquals(State.COMPLETED, report.getState());
+		// System.out.println(report);
+	}
+
+	// @Test
+	// // @Ignore
+	// public void testDataflowExecution2() throws Exception {
+	// URL wfResource = getClass().getResource("/t2flow/beanshell.t2flow");
+	// assertNotNull(wfResource);
+	// T2FlowParser t2FlowParser = new T2FlowParser();
+	// t2FlowParser.setStrict(true);
+	// WorkflowBundle researchObject = t2FlowParser.parseT2Flow(wfResource.openStream());
+	// Workflow workflow = researchObject.getMainWorkflow();
+	// Profile profile = researchObject.getProfiles().iterator().next();
+	//
+	// InvocationContext context = null;
+	// T2Reference reference = context.getReferenceService().register("test-input", 0, true,
+	// context);
+	// Map<String, T2Reference> inputs = new HashMap<String, T2Reference>();
+	// inputs.put("in", reference);
+	//
+	// LocalExecution execution = new LocalExecution(workflow, profile, inputs,
+	// context.getReferenceService(), new EditsImpl());
+	// WorkflowReport report = execution.getWorkflowReport();
+	// System.out.println(report);
+	// assertEquals(State.CREATED, report.getState());
+	// execution.start();
+	// System.out.println(report);
+	//
+	// Map<String, Object> results = execution.getResults();
+	// waitForResult(results, "out", report);
+	//
+	// List<String> result = (List<String>) context.getReferenceService().renderIdentifier(
+	// (T2Reference) results.get("out"), String.class, context);
+	// assertEquals(1000, result.size());
+	// assertEquals("test-input:0", result.get(0));
+	// assertEquals(State.COMPLETED, report.getState());
+	// System.out.println(report);
+	// }
+
+	@SuppressWarnings("unused")
+	private void waitForResult(Map<String, Object> results, String port, WorkflowReport report)
+			throws InterruptedException {
+		int wait = 0;
+		while (!results.containsKey(port) && wait++ < 10) {
+			System.out.println(report);
+			Thread.sleep(500);
+		}
+	}
+
+	/**
+	 * Test method for
+	 * {@link uk.org.taverna.platform.execution.impl.local.LocalExecution#resultTokenProduced(net.sf.taverna.t2.invocation.WorkflowDataToken, java.lang.String)}
+	 * .
+	 */
+	@Test
+	public void testResultTokenProduced() {
+		// fail("Not yet implemented");
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-local/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/taverna-execution-local/src/test/resources/log4j.properties b/taverna-execution-local/src/test/resources/log4j.properties
new file mode 100644
index 0000000..54f0936
--- /dev/null
+++ b/taverna-execution-local/src/test/resources/log4j.properties
@@ -0,0 +1 @@
+log4j.logger.net.sf.taverna=INFO

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-local/src/test/resources/t2flow/beanshell.t2flow
----------------------------------------------------------------------
diff --git a/taverna-execution-local/src/test/resources/t2flow/beanshell.t2flow b/taverna-execution-local/src/test/resources/t2flow/beanshell.t2flow
new file mode 100644
index 0000000..59fa307
--- /dev/null
+++ b/taverna-execution-local/src/test/resources/t2flow/beanshell.t2flow
@@ -0,0 +1,137 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.2.0"><dataflow id="78cb1427-d57f-42c2-a385-1d20c1580f3b" role="top"><name>Workflow13</name><inputPorts><port><name>in</name><depth>0</depth><granularDepth>0</granularDepth><annotations /></port></inputPorts><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>Echo</name><inputPorts><port><name>in</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>beanshell-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.beanshell.BeanshellActivity</class><inputMap><map from="in" to="in" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfi
 gurationBean xmlns="">
+  <script>out=in;</script>
+  <dependencies />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>0</granularDepth>
+      <name>out</name>
+      <depth>0</depth>
+      <mimeTypes />
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>ListGenerator</name><inputPorts><port><name>in</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>1</depth><granularDepth>1</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>beanshell-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.beanshell.BeanshellActivity</class><inputMap><
 map from="in" to="in" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean xmlns="">
+  <script>out = new ArrayList();
+
+for (int i = 0; i &lt; 1000; i++) {
+  out.add(in + ":" + i);
+}</script>
+  <dependencies />
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+      <name>in</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>text/plain</string>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>1</granularDepth>
+      <name>out</name>
+      <depth>1</depth>
+      <mimeTypes />
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>Echo</processor><port>in</port></sink><source type="processor"><processor>ListGenerator</processor><port>out</port></source></datalink><datalink><sink type="processor"><processor>ListGenerator</processor><port>in</port></sink><source type="dataflow"><port>in</port></source></datalink><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><
 processor>Echo</processor><port>out</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.impl.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.impl.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.impl.annotationbeans.IdentificationAssertion">
+        <identification>13c70169-dfaa-4ea6-b6ab-3551dae7fa84</identification>
+      </annotationBean>
+      <date>2010-08-19 12:28:57.881 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.impl.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.impl.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.impl.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.impl.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.impl.annotationbeans.IdentificationAssertion">
+        <identification>7ef10e93-7376-41a9-9255-552149094142</identification>
+      </annotationBean>
+      <date>2010-08-31 13:06:57.536 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.impl.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.impl.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.impl.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.impl.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.impl.annotationbeans.IdentificationAssertion">
+        <identification>3b7c0b9c-572d-466b-af6d-0fb40699e8a5</identification>
+      </annotationBean>
+      <date>2010-08-31 12:50:40.306 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.impl.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.impl.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.impl.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.impl.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.impl.annotationbeans.IdentificationAssertion">
+        <identification>eb6a550d-f34e-4de9-b0fc-1b3df8ab36c4</identification>
+      </annotationBean>
+      <date>2010-08-31 14:32:44.634 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.impl.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.impl.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.impl.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.impl.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.impl.annotationbeans.IdentificationAssertion">
+        <identification>78cb1427-d57f-42c2-a385-1d20c1580f3b</identification>
+      </annotationBean>
+      <date>2010-08-31 14:36:00.297 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.impl.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.impl.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.impl.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.impl.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.impl.annotationbeans.IdentificationAssertion">
+        <identification>ad638364-a6e0-4852-abca-9f609c9553d2</identification>
+      </annotationBean>
+      <date>2010-08-19 13:43:43.797 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.impl.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.impl.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-local/src/test/resources/t2flow/in-out.t2flow
----------------------------------------------------------------------
diff --git a/taverna-execution-local/src/test/resources/t2flow/in-out.t2flow b/taverna-execution-local/src/test/resources/t2flow/in-out.t2flow
new file mode 100644
index 0000000..8901a8d
--- /dev/null
+++ b/taverna-execution-local/src/test/resources/t2flow/in-out.t2flow
@@ -0,0 +1,23 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3-SNAPSHOT-20100817"><dataflow id="ad638364-a6e0-4852-abca-9f609c9553d2" role="top"><name>Workflow13</name><inputPorts><port><name>in</name><depth>0</depth><granularDepth>0</granularDepth><annotations /></port></inputPorts><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors /><conditions /><datalinks><datalink><sink type="dataflow"><port>out</port></sink><source type="dataflow"><port>in</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.impl.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.impl.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.impl.annotationbeans.IdentificationAssertion">
+        <identification>13c70169-dfaa-4ea6-b6ab-3551dae7fa84</identification>
+      </annotationBean>
+      <date>2010-08-19 12:28:57.881 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.impl.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.impl.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.impl.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.impl.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.impl.annotationbeans.IdentificationAssertion">
+        <identification>ad638364-a6e0-4852-abca-9f609c9553d2</identification>
+      </annotationBean>
+      <date>2010-08-19 13:43:43.797 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.impl.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.impl.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-execution-remote/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-execution-remote/pom.xml b/taverna-execution-remote/pom.xml
new file mode 100644
index 0000000..81e039e
--- /dev/null
+++ b/taverna-execution-remote/pom.xml
@@ -0,0 +1,48 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.taverna.engine</groupId>
+		<artifactId>taverna-engine</artifactId>
+		<version>3.1.0-incubating-SNAPSHOT</version>
+	</parent>
+	<artifactId>taverna-execution-remote</artifactId>
+	<packaging>bundle</packaging>
+	<name>Apache Taverna Platform Remote Execution Service</name>
+	<description>An Execution Service for executing Taverna workflows on a Taverna Server
+	</description>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-bundle-plugin</artifactId>
+				<configuration>
+					<instructions>
+						<Import-Package>uk.org.taverna.platform.execution.api;provide:=true,*</Import-Package>
+					</instructions>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+	<dependencies>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-execution-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>taverna-report-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.language</groupId>
+			<artifactId>taverna-scufl2-api</artifactId>
+			<version>${taverna.language.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.taverna.language</groupId>
+			<artifactId>taverna-databundle</artifactId>
+			<version>${taverna.language.version}</version>
+		</dependency>
+	</dependencies>
+</project>


[26/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/java/org/purl/wf4ever/provtaverna/owl/ProvModel.java
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/java/org/purl/wf4ever/provtaverna/owl/ProvModel.java b/taverna-prov-owl-bindings/src/main/java/org/purl/wf4ever/provtaverna/owl/ProvModel.java
new file mode 100644
index 0000000..e1bfab7
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/java/org/purl/wf4ever/provtaverna/owl/ProvModel.java
@@ -0,0 +1,402 @@
+package org.purl.wf4ever.provtaverna.owl;
+
+import java.io.InputStream;
+import java.net.URI;
+import java.util.Calendar;
+
+import org.apache.jena.riot.IO_Jena;
+import org.apache.jena.riot.system.IO_JenaWriters;
+import org.apache.log4j.Logger;
+
+import com.hp.hpl.jena.ontology.DatatypeProperty;
+import com.hp.hpl.jena.ontology.Individual;
+import com.hp.hpl.jena.ontology.ObjectProperty;
+import com.hp.hpl.jena.ontology.OntClass;
+import com.hp.hpl.jena.ontology.OntDocumentManager;
+import com.hp.hpl.jena.ontology.OntModel;
+import com.hp.hpl.jena.ontology.OntModelSpec;
+import com.hp.hpl.jena.rdf.model.Literal;
+import com.hp.hpl.jena.rdf.model.Model;
+import com.hp.hpl.jena.rdf.model.ModelFactory;
+import com.hp.hpl.jena.util.FileManager;
+import com.hp.hpl.jena.util.LocationMapper;
+
+public class ProvModel {
+    
+    private static Logger logger = Logger.getLogger(ProvModel.class);
+
+    private static final String EMPTY_PREFIX = "";
+
+    protected static final OntModelSpec DEFAULT_ONT_MODEL_SPEC = OntModelSpec.OWL_MEM_RDFS_INF;
+
+    protected static final String FOAF_0_1 = "http://xmlns.com/foaf/0.1/";
+
+    protected static final String FOAF_RDF = "foaf.rdf";
+    protected static final String ORE = "http://www.openarchives.org/ore/terms/";
+    protected static final String PAV = "http://purl.org/pav/";
+    protected static final String PAV_RDF = "pav.rdf";
+
+    protected static final String PROV = "http://www.w3.org/ns/prov#";
+    protected static final String PROV_AQ_RDF = "prov-aq.rdf";
+    protected static final String PROV_DICTIONARY = "http://www.w3.org/ns/prov-dictionary#";
+    protected static final String PROV_DICTIONARY_TTL = "prov-dictionary.ttl";
+    protected static final String PROV_O = "http://www.w3.org/ns/prov-o#";
+    protected static final String PROV_O_RDF = "prov-o.rdf";
+
+    protected static final String RO = "http://purl.org/wf4ever/ro#";
+
+    public OntClass Activity;
+    public OntClass Association;
+    public OntClass Bundle;
+    public OntClass Collection;
+    public OntClass Communication;
+    public OntClass Dictionary;
+    public OntClass EmptyCollection;
+    public OntClass EmptyDictionary;
+    public OntClass End;
+    public OntClass Entity;
+    public OntClass Generation;
+    public OntClass KeyEntityPair;
+    public OntClass Plan;
+    public OntClass Role;
+    public OntClass Start;
+    public OntClass Usage;
+
+    public ObjectProperty activity;
+    public ObjectProperty agent;
+    public ObjectProperty entity;
+    public ObjectProperty hadDictionaryMember;
+    public ObjectProperty hadMember;
+    public ObjectProperty hadPlan;
+    public ObjectProperty hadRole;
+    public ObjectProperty pairEntity;
+    public ObjectProperty qualifiedAssociation;
+    public ObjectProperty qualifiedCommunication;
+    public ObjectProperty qualifiedEnd;
+    public ObjectProperty qualifiedGeneration;
+    public ObjectProperty qualifiedStart;
+    public ObjectProperty qualifiedUsage;
+    public ObjectProperty used;
+    public ObjectProperty wasAssociatedWith;
+    public ObjectProperty wasDerivedFrom;
+    public ObjectProperty wasGeneratedBy;
+    public ObjectProperty wasInformedBy;
+
+    public DatatypeProperty atTime;
+    public DatatypeProperty endedAtTime;
+    public DatatypeProperty pairKey;
+    public DatatypeProperty startedAtTime;
+
+    public OntModel model;
+    
+    private static boolean jenaFileManagerInitialized = false;
+    
+    protected OntModel prov;
+    protected OntModel provDict;
+    
+    public ProvModel() {
+        this(ModelFactory.createOntologyModel(DEFAULT_ONT_MODEL_SPEC));
+    }
+
+    public ProvModel(Model model) {
+        String defaultPrefix = model.getNsPrefixURI(EMPTY_PREFIX);
+        OntModel ontModel;
+        if (model instanceof OntModel) {
+            ontModel = (OntModel) model;
+        } else {
+            OntModelSpec spec = DEFAULT_ONT_MODEL_SPEC;
+            ontModel = ModelFactory.createOntologyModel(spec, model);
+        }
+        setModel(ontModel);
+        resetJena();
+        initializeJenaFileManager();
+        loadOntologies();
+        
+        if (defaultPrefix != null) {
+            // Restore the defaultPrefix (:)
+            model.setNsPrefix(EMPTY_PREFIX, defaultPrefix);
+        } else {
+            model.removeNsPrefix(EMPTY_PREFIX);
+        }
+    }
+
+    private void initializeJenaFileManager() {
+        if (! jenaFileManagerInitialized) {
+            // Only initialize once to avoid adding the same locators
+            // (but no need to synchronize, the occassional extra should be ok)
+            jenaFileManagerInitialized = true;
+            // So that it can find our location-mapping.n3
+            // and the OWLs in classpath /org/purl/wf4ever/provtaverna/owl/
+            FileManager.get().addLocatorClassLoader(getClass().getClassLoader());
+            
+            Model mapping = ModelFactory.createDefaultModel();
+            InputStream mappingStream = getClass().getResourceAsStream("/location-mapping.n3");
+            mapping.read(mappingStream, "", "N3");
+            
+			FileManager.get().setLocationMapper(new LocationMapper(mapping));	
+			
+			OntDocumentManager.getInstance().setFileManager(FileManager.get());
+        }
+    }
+
+    public void resetJena() {
+		IO_Jena.resetJena();
+    }
+
+    public void addKeyPair(Individual dictionary, long position,
+            Individual listItem) {
+        dictionary.addProperty(hadMember, listItem);
+        Individual keyPair = model.createIndividual(KeyEntityPair);
+        keyPair.addProperty(pairEntity, listItem);
+        keyPair.addLiteral(pairKey, position);
+        dictionary.addProperty(hadDictionaryMember, keyPair);
+
+    }
+
+    protected void checkNotNull(OntModel model, Object... possiblyNulls) {
+        int i = 0;
+        for (Object check : possiblyNulls) {
+            if (check == null) {
+                throw new IllegalStateException("Could not load term #" + i
+                        + " from ontology");
+            }
+            i++;
+        }
+
+    }
+
+    public Individual createActivity(URI uri) {
+        return model.createIndividual(uri.toASCIIString(), Activity);
+    }
+
+    public Individual createBundle(URI uri) {
+        return model.createIndividual(uri.toASCIIString(), Bundle);
+    }
+
+    public Individual createDictionary(URI uri) {
+        Individual artifact = createEntity(uri);
+        artifact.addRDFType(Collection);
+        artifact.addRDFType(Dictionary);
+        return artifact;
+    }
+
+    public Individual createEntity(URI uri) {
+        return model.createIndividual(uri.toASCIIString(), Entity);
+    }
+
+    public Individual createPlan(URI planUri) {
+        return model.createIndividual(planUri.toString(), Plan);
+    }
+
+    public Individual createRole(URI uri) {
+        return model.createIndividual(uri.toASCIIString(), Role);
+    }
+
+    public OntModel getModel() {
+        return model;
+    }
+
+    public void loadOntologies() {
+        loadPROVO();
+        loadProvDictionary();
+        model.setNsPrefixes(prov);
+    }
+
+    protected OntModel loadOntologyFromClasspath(String classPathUri, String uri) {
+        
+        OntModel ontModel = ModelFactory.createOntologyModel();
+
+        // Load from classpath
+        InputStream inStream = getClass().getResourceAsStream(classPathUri);
+        if (inStream == null) {
+            throw new IllegalArgumentException("Can't load " + classPathUri);
+        }
+        // Ontology ontology = ontModel.createOntology(uri);
+        if (classPathUri.endsWith(".ttl")) {
+            ontModel.read(inStream, uri, "TURTLE");
+        } else {
+            ontModel.read(inStream, uri);
+        }
+        return ontModel;
+    }
+
+    protected synchronized void loadProvDictionary() {
+        if (provDict != null) {
+            return;
+        }
+        OntModel ontModel = loadOntologyFromClasspath(PROV_DICTIONARY_TTL,
+                PROV_DICTIONARY);
+
+        hadDictionaryMember = ontModel.getObjectProperty(PROV
+                + "hadDictionaryMember");
+        pairEntity = ontModel.getObjectProperty(PROV + "pairEntity");
+        pairKey = ontModel.getDatatypeProperty(PROV + "pairKey");
+
+        Dictionary = ontModel.getOntClass(PROV + "Dictionary");
+        EmptyDictionary = ontModel.getOntClass(PROV + "EmptyDictionary");
+        KeyEntityPair = ontModel.getOntClass(PROV + "KeyEntityPair");
+
+        checkNotNull(ontModel, hadDictionaryMember, pairEntity, pairKey,
+                Dictionary, EmptyDictionary, KeyEntityPair);
+
+        provDict = ontModel;
+    }
+
+    protected synchronized void loadPROVO() {
+        if (prov != null) {
+            return;
+        }
+        OntModel ontModel = loadOntologyFromClasspath(PROV_O_RDF, PROV_O);
+        ontModel.setNsPrefix("prov", PROV_O);
+        wasDerivedFrom = ontModel.getObjectProperty(PROV + "wasDerivedFrom");
+        wasAssociatedWith = ontModel.getObjectProperty(PROV
+                + "wasAssociatedWith");
+        qualifiedAssociation = ontModel.getObjectProperty(PROV
+                + "qualifiedAssociation");
+        wasGeneratedBy = ontModel.getObjectProperty(PROV + "wasGeneratedBy");
+        qualifiedGeneration = ontModel.getObjectProperty(PROV
+                + "qualifiedGeneration");
+        used = ontModel.getObjectProperty(PROV + "used");
+        qualifiedUsage = ontModel.getObjectProperty(PROV + "qualifiedUsage");
+        wasInformedBy = ontModel.getObjectProperty(PROV + "wasInformedBy");
+        qualifiedCommunication = ontModel.getObjectProperty(PROV
+                + "qualifiedCommunication");
+        qualifiedStart = ontModel.getObjectProperty(PROV + "qualifiedStart");
+        qualifiedEnd = ontModel.getObjectProperty(PROV + "qualifiedEnd");
+        hadMember = ontModel.getObjectProperty(PROV + "hadMember");
+
+        agent = ontModel.getObjectProperty(PROV + "agent");
+        entity = ontModel.getObjectProperty(PROV + "entity");
+        activity = ontModel.getObjectProperty(PROV + "activity");
+        hadPlan = ontModel.getObjectProperty(PROV + "hadPlan");
+        hadRole = ontModel.getObjectProperty(PROV + "hadRole");
+
+        startedAtTime = ontModel.getDatatypeProperty(PROV + "startedAtTime");
+        endedAtTime = ontModel.getDatatypeProperty(PROV + "endedAtTime");
+        atTime = ontModel.getDatatypeProperty(PROV + "atTime");
+
+        Bundle = ontModel.getOntClass(PROV + "Bundle");
+        Entity = ontModel.getOntClass(PROV + "Entity");
+        Activity = ontModel.getOntClass(PROV + "Activity");
+        Start = ontModel.getOntClass(PROV + "Start");
+        End = ontModel.getOntClass(PROV + "End");
+
+        Association = ontModel.getOntClass(PROV + "Association");
+        Plan = ontModel.getOntClass(PROV + "Plan");
+        Role = ontModel.getOntClass(PROV + "Role");
+
+        Generation = ontModel.getOntClass(PROV + "Generation");
+        Usage = ontModel.getOntClass(PROV + "Usage");
+        Communication = ontModel.getOntClass(PROV + "Communication");
+        Collection = ontModel.getOntClass(PROV + "Collection");
+        EmptyCollection = ontModel.getOntClass(PROV + "EmptyCollection");
+
+        checkNotNull(ontModel, wasDerivedFrom, wasAssociatedWith,
+                qualifiedAssociation, wasGeneratedBy, qualifiedGeneration,
+                used, qualifiedUsage, wasInformedBy, qualifiedCommunication,
+                agent, entity, activity, hadPlan, hadMember, hadRole,
+                startedAtTime, endedAtTime, atTime, qualifiedStart,
+                qualifiedEnd,
+
+                Bundle, Entity, Activity, Association, Plan, Role, Generation,
+                Usage, Communication, Start, End, Collection, EmptyCollection);
+        prov = ontModel;
+    }
+
+    public void setEmptyDictionary(Individual dictionary) {
+        dictionary.addRDFType(EmptyCollection);
+        dictionary.addRDFType(EmptyDictionary);
+    }
+
+    public Individual setEndedAtTime(Individual endedActivity, Calendar time) {
+        if (time == null) {
+            logger.warn("Unknown end time");
+            return null;
+        }
+        return setEndedAtTime(endedActivity, model.createTypedLiteral(time));
+    }
+
+    public Individual setEndedAtTime(Individual endedActivity, Literal time) {
+        if (time == null) {
+            logger.warn("Unknown end time");
+            return null;
+        }
+        endedActivity.addLiteral(endedAtTime, time);
+        Individual end = model.createIndividual(End);
+        endedActivity.setPropertyValue(qualifiedEnd, end);
+        end.addLiteral(atTime, time);
+        return end;
+    }
+
+    public void setModel(OntModel model) {
+        this.model = model;
+    }
+
+    public void setRole(Individual involvement, Individual role) {
+        involvement.addProperty(hadRole, role);
+
+    }
+
+    public Individual setStartedAtTime(Individual startedActivity, Calendar time) {
+        if (time == null) {
+            logger.warn("Unknown start time");
+            return null;
+        }
+        return setStartedAtTime(startedActivity, model.createTypedLiteral(time));
+    }
+
+    public Individual setStartedAtTime(Individual startedActivity, Literal time) {
+        if (time == null) {
+            logger.warn("Unknown start time");
+            return null;
+        }
+        startedActivity.addLiteral(startedAtTime, time);
+        Individual start = model.createIndividual(Start);
+        startedActivity.setPropertyValue(qualifiedStart, start);
+        start.addLiteral(atTime, time);
+        return start;
+    }
+
+    public Individual setUsed(Individual activity, Individual usedEntity) {
+        activity.addProperty(used, usedEntity);
+        Individual usage = model.createIndividual(Usage);
+        activity.addProperty(qualifiedUsage, usage);
+        usage.addProperty(entity, usedEntity);
+        return usage;
+    }
+
+    public Individual setWasAssociatedWith(Individual activity,
+            Individual associatedAgent, Individual plan) {
+        activity.setPropertyValue(wasAssociatedWith, associatedAgent);
+        Individual association = model.createIndividual(Association);
+        activity.setPropertyValue(qualifiedAssociation, association);
+        association.setPropertyValue(agent, associatedAgent);
+        if (plan != null) {
+            association.setPropertyValue(hadPlan, plan);
+        }
+        return association;
+    }
+
+    public void setWasDerivedFrom(Individual derived, Individual original) {
+        derived.addProperty(wasDerivedFrom, original);
+    }
+
+    public Individual setWasGeneratedBy(Individual generated,
+            Individual generatingActivity) {
+        generated.setPropertyValue(wasGeneratedBy, generatingActivity);
+        Individual generation = model.createIndividual(Generation);
+        generated.setPropertyValue(qualifiedGeneration, generation);
+        generation.setPropertyValue(activity, generatingActivity);
+        return generation;
+
+    }
+
+    public Individual setWasInformedBy(Individual informed, Individual informer) {
+        informed.setPropertyValue(wasInformedBy, informer);
+        Individual communication = model.createIndividual(Communication);
+        informed.setPropertyValue(qualifiedCommunication, communication);
+        communication.setPropertyValue(activity, informer);
+        return communication;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/java/org/purl/wf4ever/provtaverna/owl/TavernaProvModel.java
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/java/org/purl/wf4ever/provtaverna/owl/TavernaProvModel.java b/taverna-prov-owl-bindings/src/main/java/org/purl/wf4ever/provtaverna/owl/TavernaProvModel.java
new file mode 100644
index 0000000..b0f0766
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/java/org/purl/wf4ever/provtaverna/owl/TavernaProvModel.java
@@ -0,0 +1,112 @@
+package org.purl.wf4ever.provtaverna.owl;
+
+import java.net.URI;
+
+import com.hp.hpl.jena.ontology.DatatypeProperty;
+import com.hp.hpl.jena.ontology.Individual;
+import com.hp.hpl.jena.ontology.ObjectProperty;
+import com.hp.hpl.jena.ontology.OntClass;
+import com.hp.hpl.jena.ontology.OntModel;
+
+public class TavernaProvModel extends WfprovModel {
+    protected static final String CNT = "http://www.w3.org/2011/content#";
+
+    protected static final String TAVERNAPROV = "http://ns.taverna.org.uk/2012/tavernaprov/";
+
+    protected static final String TAVERNAPROV_TTL = "taverna-prov.ttl";
+
+    public ObjectProperty content;
+
+    public OntClass Content;
+    public OntClass ContentAsBase64;
+    public OntClass ContentAsText;
+    public OntClass Error;
+    public OntClass TavernaEngine;
+    
+    public OntModel cnt;
+    public OntModel tavernaProv;
+    
+    public DatatypeProperty byteCount;
+    public DatatypeProperty bytes;
+    public DatatypeProperty characterEncoding;
+    public DatatypeProperty chars;
+    public DatatypeProperty errorMessage;
+    public DatatypeProperty sha1;
+    public DatatypeProperty sha512;
+    public DatatypeProperty stackTrace;
+    
+    public Individual createTavernaEngine(URI uri) {
+        Individual engine = model.createIndividual(uri.toASCIIString(), TavernaEngine);
+        return engine;
+    }
+    
+    private void loadCnt() {
+        if (cnt != null) {
+            return;
+        }
+        OntModel ontModel = loadOntologyFromClasspath("content.owl", CNT);    
+        
+        bytes = ontModel.getDatatypeProperty(CNT + "bytes");
+        chars = ontModel.getDatatypeProperty(CNT + "chars");
+        characterEncoding = ontModel.getDatatypeProperty(CNT + "characterEncoding");
+        
+        ContentAsText = ontModel.getOntClass(CNT + "ContentAsText");
+        ContentAsBase64 = ontModel.getOntClass(CNT + "ContentAsBase64");
+        checkNotNull(ontModel, bytes, chars, characterEncoding, ContentAsText, ContentAsBase64);
+        cnt = ontModel;
+        
+    }
+
+    @Override
+    public void loadOntologies() {
+        super.loadOntologies();
+        loadCnt();
+        loadTavernaProv();
+        model.setNsPrefixes(tavernaProv);
+       
+    }
+
+    protected synchronized void loadTavernaProv() {
+        if (tavernaProv != null) {
+            return;
+        }
+        OntModel ontModel = loadOntologyFromClasspath(TAVERNAPROV_TTL, TAVERNAPROV);    
+        
+        content = ontModel.getObjectProperty(TAVERNAPROV + "content");        
+        
+        byteCount = ontModel.getDatatypeProperty(TAVERNAPROV + "byteCount");
+        sha1 = ontModel.getDatatypeProperty(TAVERNAPROV + "sha1");
+        sha512 = ontModel.getDatatypeProperty(TAVERNAPROV + "sha512");
+        stackTrace = ontModel.getDatatypeProperty(TAVERNAPROV + "stackTrace");
+        errorMessage = ontModel.getDatatypeProperty(TAVERNAPROV + "errorMessage");
+        
+        Content = ontModel.getOntClass(TAVERNAPROV + "Content");
+        Error = ontModel.getOntClass(TAVERNAPROV + "Error");
+        TavernaEngine = ontModel.getOntClass(TAVERNAPROV + "TavernaEngine");
+        
+        checkNotNull(ontModel, content, Content, byteCount,sha1, sha512, stackTrace, errorMessage, Content, Error, TavernaEngine);
+        tavernaProv = ontModel;            
+    }
+
+
+    public Individual setContent(Individual entity, URI uri) {
+        Individual cont = model.createIndividual(uri.toASCIIString(), Content);
+        entity.setPropertyValue(content, cont);
+        return cont;
+    }
+
+
+    public Individual createError(URI errorURI) {
+        return model.createIndividual(errorURI.toASCIIString(), Error);
+    }
+
+
+
+
+
+
+
+
+
+ 
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/java/org/purl/wf4ever/provtaverna/owl/WfprovModel.java
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/java/org/purl/wf4ever/provtaverna/owl/WfprovModel.java b/taverna-prov-owl-bindings/src/main/java/org/purl/wf4ever/provtaverna/owl/WfprovModel.java
new file mode 100644
index 0000000..f20542b
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/java/org/purl/wf4ever/provtaverna/owl/WfprovModel.java
@@ -0,0 +1,202 @@
+package org.purl.wf4ever.provtaverna.owl;
+
+import java.net.URI;
+
+import com.hp.hpl.jena.ontology.Individual;
+import com.hp.hpl.jena.ontology.ObjectProperty;
+import com.hp.hpl.jena.ontology.OntClass;
+import com.hp.hpl.jena.ontology.OntModel;
+import com.hp.hpl.jena.rdf.model.ModelFactory;
+
+public class WfprovModel extends ProvModel {
+
+    private static final String DCTERMS = "http://purl.org/dc/terms/";
+    private static final String WFPROV_OWL = "wfprov.owl";
+    private static final String WFPROV = "http://purl.org/wf4ever/wfprov#";
+
+    private static final String WFDESC_OWL = "wfdesc.owl";
+    private static final String WFDESC = "http://purl.org/wf4ever/wfdesc#";
+    
+    protected OntModel wfdesc;
+    protected OntModel wfprov;
+    
+    protected OntClass Process;
+    protected OntClass Workflow;
+    protected OntClass WorkflowRun;
+
+    protected ObjectProperty wasEnactedBy;
+    protected ObjectProperty describedByProcess;
+    protected ObjectProperty describedByWorkflow;
+    protected OntClass ProcessRun;
+    protected ObjectProperty wasPartOfWorkflowRun;
+    protected ObjectProperty hasPart;
+    protected OntModel dcterms;
+    protected ObjectProperty hasSubProcess;
+    protected OntClass Artifact;
+    protected ObjectProperty wasOutputFrom;
+    protected ObjectProperty usedInput;
+    protected OntClass Output;
+    protected OntClass Input;
+    protected ObjectProperty describedByParameter;
+
+    
+    @Override
+    public void loadOntologies() {
+        super.loadOntologies();
+        loadDcTerms();
+        loadWfDesc();
+        loadWfprov();
+        model.setNsPrefixes(wfprov);
+    }
+
+    protected synchronized void loadDcTerms() {
+        if (dcterms != null) {
+            return;
+        }
+        // As http://purl.org/dc/terms/ pulls in various rubbish we cheat
+        OntModel ontModel = ModelFactory.createOntologyModel(); 
+        hasPart = ontModel.createObjectProperty(DCTERMS + "hasPart");
+        checkNotNull(ontModel, hasPart);
+        dcterms = ontModel;
+    }
+
+    
+    protected synchronized void loadWfDesc() {
+        if (wfdesc != null) {
+            return;
+        }
+        OntModel ontModel = loadOntologyFromClasspath(WFDESC_OWL, WFDESC);  
+        
+        hasSubProcess = ontModel.getObjectProperty(WFDESC + "hasSubProcess");
+        Input = ontModel.getOntClass(WFDESC + "Input");
+//      Input.addSuperClass(Role);
+        Output = ontModel.getOntClass(WFDESC + "Output");
+//    Output.addSuperClass(Role);
+
+        Process = ontModel.getOntClass(WFDESC + "Process");
+        Workflow = ontModel.getOntClass(WFDESC + "Workflow");
+        checkNotNull(ontModel, hasSubProcess, Process, Workflow, Input, Output);
+
+        wfdesc = ontModel;
+    }
+    
+    protected synchronized void loadWfprov() {
+        if (wfprov != null) {
+            return;
+        }
+        OntModel ontModel = loadOntologyFromClasspath(WFPROV_OWL, WFPROV);    
+        
+        wasEnactedBy = ontModel.getObjectProperty(WFPROV + "wasEnactedBy");
+//        wasEnactedBy.addSuperProperty(wasAssociatedWith);
+        describedByWorkflow = ontModel.getObjectProperty(WFPROV + "describedByWorkflow");
+        describedByProcess = ontModel.getObjectProperty(WFPROV + "describedByProcess");
+        describedByParameter = ontModel.getObjectProperty(WFPROV + "describedByParameter");
+        usedInput = ontModel.getObjectProperty(WFPROV + "usedInput");
+        wasOutputFrom = ontModel.getObjectProperty(WFPROV + "wasOutputFrom");
+
+        wasPartOfWorkflowRun = ontModel.getObjectProperty(WFPROV + "wasPartOfWorkflowRun");
+//        wasPartOfWorkflowRun.addSuperProperty(hasPart);
+
+        Artifact = ontModel.getOntClass(WFPROV + "Artifact");
+//        Artifact.addSuperClass(Entity);
+        ProcessRun = ontModel.getOntClass(WFPROV + "ProcessRun");
+//        ProcessRun.addSuperClass(Activity);
+        WorkflowRun = ontModel.getOntClass(WFPROV + "WorkflowRun");
+        
+        checkNotNull(ontModel, wasEnactedBy, describedByWorkflow, describedByProcess,
+                describedByParameter, 
+                wasPartOfWorkflowRun, usedInput, wasOutputFrom, 
+                 Artifact, ProcessRun, WorkflowRun);
+        wfprov = ontModel;
+    }
+    
+    public Individual createWorkflowRun(URI runURI) {
+        Individual a = createActivity(runURI);
+        a.setRDFType(WorkflowRun);
+        return a;
+    }
+    
+    public Individual createProcessRun(URI processURI) {
+        Individual a = createActivity(processURI);
+        a.setRDFType(ProcessRun);
+        return a;
+    }
+
+    public void setWasPartOfWorkflowRun(Individual process,
+            Individual parentProcess) {
+        process.addProperty(wasPartOfWorkflowRun, parentProcess);
+        parentProcess.addProperty(hasPart, process);
+    }
+    
+    public Individual setWasEnactedBy(Individual workflowRun, Individual workflowEngine, Individual wfplan) {
+        Individual association = setWasAssociatedWith(workflowRun, workflowEngine, wfplan);
+        workflowRun.addProperty(wasEnactedBy, workflowEngine);
+        return association;
+    }
+
+    public void setDescribedByWorkflow(Individual workflowRun, Individual wfplan) {
+        workflowRun.addProperty(describedByWorkflow, wfplan);
+    }
+    
+    public void addSubProcess(Individual wf, Individual proc) {
+//      parentWf.getWfdescHasSubProcesses().add(procPlan);
+//      objCon.addDesignation(parentWf, Resource.class).getDctermsHasPart().add(procPlan);
+      wf.addProperty(hasSubProcess, proc);
+      wf.addProperty(hasPart, proc);
+  }
+
+
+    public void setDescribedByProcess(Individual processRun, Individual processPlan) {
+        processRun.addProperty(describedByProcess, processPlan);
+    }
+
+    
+    public Individual createWorkflow(URI wfUri) {
+        Individual wfplan = createPlan(wfUri);
+        wfplan.addRDFType(Workflow);
+        return wfplan;
+    }
+    public Individual createProcess(URI processUri) {
+        Individual wfplan = createPlan(processUri);
+        wfplan.addRDFType(Process);
+        return wfplan;
+    }
+
+    public Individual createArtifact(URI dataURI) {
+       Individual entity = createEntity(dataURI);
+       entity.addRDFType(Artifact);
+       return entity;
+    }
+    
+
+    public Individual setUsedInput(Individual activity, Individual entity) {
+        Individual usage = setUsed(activity, entity);
+        activity.addProperty(usedInput, entity);
+        return usage;
+    }
+
+    public Individual setWasOutputFrom(Individual entity, Individual activity) {
+        Individual usage = setWasGeneratedBy(entity, activity);
+        entity.addProperty(wasOutputFrom, activity);
+        return usage;
+    }
+    
+    public Individual createInputParameter(URI portURI) {
+        Individual parameter = createRole(portURI);
+        parameter.addRDFType(Input);
+        return parameter;
+    }
+
+    
+    public Individual createOutputParameter(URI portURI) {
+        Individual parameter = createRole(portURI);
+        parameter.addRDFType(Output);
+        return parameter;
+    }
+
+    public void setDescribedByParameter(Individual entity, Individual portRole, Individual involvement) {
+        setRole(involvement, portRole);        
+        entity.addProperty(describedByParameter, portRole);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/resources/location-mapping.n3
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/resources/location-mapping.n3 b/taverna-prov-owl-bindings/src/main/resources/location-mapping.n3
new file mode 100644
index 0000000..69f4d08
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/resources/location-mapping.n3
@@ -0,0 +1,36 @@
+@prefix lm: <http://jena.hpl.hp.com/2004/08/location-mapping#> .
+
+[] lm:mapping
+   [ lm:name "http://purl.org/ao/" ; lm:altName "org/purl/wf4ever/provtaverna/owl/annotation-core.owl" ] ,
+   [ lm:name "http://purl.org/ao/core/" ; lm:altName "org/purl/wf4ever/provtaverna/owl/annotation-core.owl" ] ,
+   [ lm:name "http://www.w3.org/2011/content" ; lm:altName "org/purl/wf4ever/provtaverna/owl/content.owl" ] ,
+   [ lm:name "http://purl.org/NET/dc_owl2dl/dcam" ; lm:altName "org/purl/wf4ever/provtaverna/owl/dcam.owl" ],  
+   [ lm:name "http://purl.org/wf4ever/dcam" ; lm:altName "org/purl/wf4ever/provtaverna/owl/dcam.owl" ] , 
+   [ lm:name "http://purl.org/dc/terms/" ; lm:altName "org/purl/wf4ever/provtaverna/owl/dcterms_od.owl" ], 
+   [ lm:name "http://purl.org/NET/dc_owl2dl/terms_od" ; lm:altName "org/purl/wf4ever/provtaverna/owl/dcterms_od.owl" ] ,
+   [ lm:name "http://xmlns.com/foaf/0.1/" ; lm:altName "org/purl/wf4ever/provtaverna/owl/foaf.rdf" ] ,
+   [ lm:name "http://purl.org/wf4ever/ore-owl" ; lm:altName "org/purl/wf4ever/provtaverna/owl/ore-owl.owl" ] ,
+   [ lm:name "http://purl.org/pav/" ; lm:altName "org/purl/wf4ever/provtaverna/owl/pav.owl" ] ,
+   [ lm:name "http://purl.org/pav/2.0/" ; lm:altName "org/purl/wf4ever/provtaverna/owl/pav.owl" ] ,
+   [ lm:name "http://purl.org/pav/2.1" ; lm:altName "org/purl/wf4ever/provtaverna/owl/pav.owl" ] ,
+   [ lm:name "http://www.w3.org/ns/prov#" ; lm:altName "org/purl/wf4ever/provtaverna/owl/prov-o.rdf" ] ,
+   [ lm:name "http://www.w3.org/ns/prov-o#" ; lm:altName "org/purl/wf4ever/provtaverna/owl/prov-o.rdf" ] ,
+   [ lm:name "http://www.w3.org/ns/prov-aq#" ; lm:altName "org/purl/wf4ever/provtaverna/owl/prov-aq.rdf" ] ,
+   [ lm:name "http://www.w3.org/ns/prov-dictionary#" ; lm:altName "org/purl/wf4ever/provtaverna/owl/prov-dictionary.rdf" ] ,
+   [ lm:name "http://purl.org/wf4ever/ro" ; lm:altName "org/purl/wf4ever/provtaverna/owl/ro.owl" ] ,
+   [ lm:name "http://purl.org/wf4ever/ro#" ; lm:altName "org/purl/wf4ever/provtaverna/owl/ro.owl" ] ,
+   [ lm:name "http://purl.org/wf4ever/roevo" ; lm:altName "org/purl/wf4ever/provtaverna/owl/roevo.owl" ] ,
+   [ lm:name "http://purl.org/wf4ever/roevo#" ; lm:altName "org/purl/wf4ever/provtaverna/owl/roevo.owl" ] ,
+   [ lm:name "http://ns.taverna.org.uk/2010/scufl2" ; lm:altName "org/purl/wf4ever/provtaverna/owl/scufl2.rdf" ] ,
+   [ lm:name "http://ns.taverna.org.uk/2010/scufl2#" ; lm:altName "org/purl/wf4ever/provtaverna/owl/scufl2.owl" ] ,
+   [ lm:name "http://www.w3.org/2004/02/skos/core" ; lm:altName "org/purl/wf4ever/provtaverna/owl/skos-owl1-dl.rdf" ] ,
+   [ lm:name "http://www.w3.org/TR/skos-reference/skos-owl1-dl.rdf" ; lm:altName "org/purl/wf4ever/provtaverna/owl/skos-owl1-dl.rdf" ] ,
+   [ lm:name "http://ns.taverna.org.uk/2012/tavernaprov/" ; lm:altName "org/purl/wf4ever/provtaverna/owl/taverna-prov.owl" ] ,
+   [ lm:name "http://www.openarchives.org/ore/terms/" ; lm:altName "org/purl/wf4ever/provtaverna/owl/terms.rdf" ] ,
+   [ lm:name "http://purl.org/wf4ever/wf4ever" ; lm:altName "org/purl/wf4ever/provtaverna/owl/wf4ever.owl" ] ,
+   [ lm:name "http://purl.org/wf4ever/wf4ever#" ; lm:altName "org/purl/wf4ever/provtaverna/owl/wf4ever.owl" ] ,
+   [ lm:name "http://purl.org/wf4ever/wfdesc" ; lm:altName "org/purl/wf4ever/provtaverna/owl/wfdesc.owl" ] ,
+   [ lm:name "http://purl.org/wf4ever/wfdesc#" ; lm:altName "org/purl/wf4ever/provtaverna/owl/wfdesc.owl" ] ,
+   [ lm:name "http://purl.org/wf4ever/wfprov" ; lm:altName "org/purl/wf4ever/provtaverna/owl/wfprov.owl" ] ,
+   [ lm:name "http://purl.org/wf4ever/wfprov#" ; lm:altName "org/purl/wf4ever/provtaverna/owl/wfprov.owl" ]
+   .

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/.gitignore
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/.gitignore b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/.gitignore
new file mode 100644
index 0000000..fe73470
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/.gitignore
@@ -0,0 +1 @@
+/catalog-v001.xml

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/annotation-core.owl
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/annotation-core.owl b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/annotation-core.owl
new file mode 100644
index 0000000..e5521be
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/annotation-core.owl
@@ -0,0 +1,399 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- Created by Paolo Ciccarese http://www.paolociccarese.info on April 12th, 2010 -->
+
+<!DOCTYPE rdf:RDF [
+    <!-- Other namespaces -->
+    <!ENTITY xsd  "http://www.w3.org/2001/XMLSchema#" >
+    <!ENTITY rdf  "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
+    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
+    <!ENTITY owl  "http://www.w3.org/2002/07/owl#" >
+    <!ENTITY dct  "http://dublincore.org/documents/dcmi-terms/" >
+    <!ENTITY foaf "http://xmlns.com/foaf/0.1/">
+    <!ENTITY pav  "http://purl.org/pav/">
+    
+    <!-- Ontology -->
+    <!ENTITY ontology "http://purl.org/ao/core/" >
+    
+    <!-- Main namespace -->
+    <!ENTITY annotation-core "http://purl.org/ao/" >
+]>
+
+<rdf:RDF
+    xml:base="&annotation-core;"
+    xmlns="&annotation-core;"
+    xmlns:pav="&pav;"
+    xmlns:rdfs="&rdfs;"
+    xmlns:owl="&owl;"
+    xmlns:rdf="&rdf;"
+    xmlns:xsd="&xsd;"
+    xmlns:dct="&dct;"
+    xmlns:foaf="&foaf;">
+   
+    <owl:Ontology rdf:about="&ontology;">
+        <rdf:type rdf:resource="&owl;Ontology"/>
+        <rdfs:label rdf:datatype="&xsd;string">Annotation Ontology Core v. 1.0</rdfs:label>
+
+		<owl:imports rdf:resource="http://purl.org/pav/2.0/"/>
+
+    	<dct:language>en</dct:language>
+    	<dct:title xml:lang="en">Annotation Ontology Core</dct:title>
+    	<dct:creator rdf:resource="http://www.hcklab.org/foaf.rdf#me"/>
+    	<dct:publisher rdf:resource="http://www.mindinformatics.org"/>
+    	<dct:contributor rdf:datatype="&xsd;string">Paolo Ciccarese</dct:contributor>
+    	<dct:contributor rdf:datatype="&xsd;string">Marco Ocana</dct:contributor>
+        <dct:created rdf:datatype="&xsd;string">April 12, 2010</dct:created>
+        <dct:date rdf:datatype="&xsd;string">May 9, 2010</dct:date>
+        <dct:format rdf:datatype="&xsd;string">rdf/xml</dct:format>    
+    </owl:Ontology> 
+  
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Annotation Properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+     
+    <rdf:Description rdf:about="&dct;title">
+        <rdf:type rdf:resource="&owl;AnnotationProperty"/>
+    </rdf:Description>
+    <rdf:Description rdf:about="&dct;created">
+        <rdf:type rdf:resource="&owl;AnnotationProperty"/>
+    </rdf:Description>
+    <rdf:Description rdf:about="&dct;date">
+        <rdf:type rdf:resource="&owl;AnnotationProperty"/>
+    </rdf:Description>
+    <rdf:Description rdf:about="&dct;creator">
+        <rdf:type rdf:resource="&owl;AnnotationProperty"/>
+    </rdf:Description>
+    <rdf:Description rdf:about="&dct;format">
+        <rdf:type rdf:resource="&owl;AnnotationProperty"/>
+    </rdf:Description>
+    <rdf:Description rdf:about="&dct;language">
+        <rdf:type rdf:resource="&owl;AnnotationProperty"/>
+    </rdf:Description>
+    <rdf:Description rdf:about="&dct;publisher">
+        <rdf:type rdf:resource="&owl;AnnotationProperty"/>
+    </rdf:Description>
+    <rdf:Description rdf:about="&dct;contributor">
+        <rdf:type rdf:resource="&owl;AnnotationProperty"/>
+    </rdf:Description>      
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Annotation Ontology Classes
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+  	
+    <owl:Class rdf:about="Annotation" rdfs:label="(ao) Annotation">
+    	<rdfs:subClassOf rdf:resource="&owl;Thing"/>
+        <owl:disjointWith rdf:resource="AnnotationCuration"/>
+        <owl:disjointWith rdf:resource="Selector"/>
+        <owl:disjointWith rdf:resource="AnnotationSet"/>
+        <owl:disjointWith rdf:resource="DocumentAnnotation"/>
+    	
+        <rdfs:comment rdf:datatype="&xsd;string">
+            Generic annotation class.
+        </rdfs:comment>
+        
+        <!-- created by -->
+        <rdfs:subClassOf>
+            <owl:Restriction>
                <owl:onProperty rdf:resource="&pav;createdBy"/>
                <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
            </owl:Restriction>
+        </rdfs:subClassOf>	
+		
+        <!-- created on -->
+        <rdfs:subClassOf>
+            <owl:Restriction>
                <owl:onProperty rdf:resource="&pav;createdOn"/>
                <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
            </owl:Restriction>
+        </rdfs:subClassOf>	
+        
+        <!-- annotates -->
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="annotatesResource"/>
+                <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
+            </owl:Restriction>
+        </rdfs:subClassOf>	
+        
+        <!-- selector -->
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="context"/>
+                <owl:someValuesFrom>
+                    <owl:Class rdf:about="Selector"/>
+                </owl:someValuesFrom>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="context"/>
+                <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">0</owl:minCardinality>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        
+        <!-- has topic -->
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="hasTopic"/>
+                <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">0</owl:minCardinality>
+            </owl:Restriction>
+        </rdfs:subClassOf>	
+        
+        <!-- body -->
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="body"/>
+                <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">0</owl:minCardinality>
+            </owl:Restriction>
+        </rdfs:subClassOf>	
+    </owl:Class>
+    
+    <owl:Class rdf:about="Selector" rdfs:label="(ao) Selector">
+        <rdfs:subClassOf rdf:resource="&owl;Thing"/>
+        <owl:disjointWith rdf:resource="Annotation"/>
+        <owl:disjointWith rdf:resource="AnnotationCuration"/>
+        <owl:disjointWith rdf:resource="AnnotationSet"/>
+        <owl:disjointWith rdf:resource="DocumentAnnotation"/>
+    	
+        <rdfs:comment rdf:datatype="&xsd;string">
+            Selectors identify document fragments.
+        </rdfs:comment>
+    </owl:Class>
+      	
+    <owl:Class rdf:about="AnnotationCuration" rdfs:label="(ao) Annotation Curation">
+    	<rdfs:subClassOf rdf:resource="&pav;Curation"/>
+        <owl:disjointWith rdf:resource="Annotation"/>
+        <owl:disjointWith rdf:resource="Selector"/> 
+        <owl:disjointWith rdf:resource="AnnotationSet"/> 
+        <owl:disjointWith rdf:resource="DocumentAnnotation"/> 
+    
+        <rdfs:comment rdf:datatype="&xsd;string">
+        </rdfs:comment>
+  		
+        <!-- created by -->
+        <rdfs:subClassOf>
+            <owl:Restriction>
                <owl:onProperty rdf:resource="&pav;createdBy"/>
                <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
            </owl:Restriction>
+        </rdfs:subClassOf>	
+		
+        <!-- created on -->
+        <rdfs:subClassOf>
+            <owl:Restriction>
                <owl:onProperty rdf:resource="&pav;createdOn"/>
                <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
            </owl:Restriction>
+        </rdfs:subClassOf>
+        
+        <!-- curates (exactly one annotation) -->
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="&pav;curates"/>
+                <owl:allValuesFrom>
+                    <owl:Class rdf:about="Annotation"/>
+                </owl:allValuesFrom>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="&pav;curates"/>
+                <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="&pav;curates"/>
+                <owl:maxCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:maxCardinality>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="&pav;curatedBy"/>
+                <owl:maxCardinality rdf:datatype="&xsd;nonNegativeInteger">0</owl:maxCardinality>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        
+        <!-- status -->
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="status"/>
+                <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
+            </owl:Restriction>
+        </rdfs:subClassOf>	
+    </owl:Class>
+    
+    <owl:Class rdf:about="AnnotationSet" rdfs:label="(ao) Annotation Set">
+        <rdfs:subClassOf rdf:resource="&owl;Thing"/>
+        <owl:disjointWith rdf:resource="Annotation"/>
+        <owl:disjointWith rdf:resource="Selector"/>   
+        <owl:disjointWith rdf:resource="AnnotationCuration"/>
+        <owl:disjointWith rdf:resource="DocumentAnnotation"/>
+    
+        <rdfs:comment rdf:datatype="&xsd;string">
+        </rdfs:comment>
+  		
+        <!-- created by -->
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="&pav;createdBy"/>
+                <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
+            </owl:Restriction>
+        </rdfs:subClassOf>	
+		
+        <!-- created on -->
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="&pav;createdOn"/>
+                <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+
+        <!-- has topic -->
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="hasTopic"/>
+                <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">0</owl:minCardinality>
+            </owl:Restriction>
+        </rdfs:subClassOf>	
+        
+        <!-- items -->
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="item"/>
+                <owl:allValuesFrom>
+                    <owl:Class rdf:about="Annotation"/>
+                </owl:allValuesFrom>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="item"/>
+                <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
+            </owl:Restriction>
+        </rdfs:subClassOf>	
+        
+        <!-- source document -->
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="onResource"/>
+                <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
+            </owl:Restriction>
+        </rdfs:subClassOf>	
+    </owl:Class>
+    
+    <owl:Class rdf:about="DocumentAnnotation" rdfs:label="(ao) Document Annotation">
+        <rdfs:subClassOf rdf:resource="&owl;Thing"/>
+        <owl:disjointWith rdf:resource="Annotation"/>
+        <owl:disjointWith rdf:resource="AnnotationCuration"/>
+        <owl:disjointWith rdf:resource="Selector"/>    
+        <owl:disjointWith rdf:resource="AnnotationSet"/>
+    
+        <rdfs:comment rdf:datatype="&xsd;string">
+        </rdfs:comment>
+  		
+        <!-- created by -->
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="&pav;createdBy"/>
+                <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
+            </owl:Restriction>
+        </rdfs:subClassOf>	
+		
+        <!-- created on -->
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="&pav;createdOn"/>
+                <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+
+        <!-- has topic -->
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="hasTopic"/>
+                <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">0</owl:minCardinality>
+            </owl:Restriction>
+        </rdfs:subClassOf>	
+        
+        <!-- items -->
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="item"/>
+                <owl:allValuesFrom>
+                    <owl:Class rdf:about="AnnotationSet"/>
+                </owl:allValuesFrom>
+            </owl:Restriction>
+        </rdfs:subClassOf>
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="item"/>
+                <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
+            </owl:Restriction>
+        </rdfs:subClassOf>	
+        
+        <!-- source document -->
+        <rdfs:subClassOf>
+            <owl:Restriction>
+                <owl:onProperty rdf:resource="onResource"/>
+                <owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
+            </owl:Restriction>
+        </rdfs:subClassOf>	
+    </owl:Class>
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Annotation Ontology Properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+    <owl:ObjectProperty rdf:about="onResource">
+    </owl:ObjectProperty> 
+    
+    <owl:ObjectProperty rdf:about="annotatesResource">
+    </owl:ObjectProperty> 
+    
+    <owl:ObjectProperty rdf:about="onSourceDocument">
+    	<rdfs:range rdf:resource="&pav;SourceDocument" />
+    </owl:ObjectProperty>
+    
+    <owl:ObjectProperty rdf:about="hasTopic">
+    </owl:ObjectProperty>
+    
+    <owl:ObjectProperty rdf:about="body">
+    </owl:ObjectProperty>
+    
+    <owl:ObjectProperty rdf:about="item">
+    </owl:ObjectProperty>
+    
+    <owl:ObjectProperty rdf:about="&pav;curates">
+        <owl:inverseOf rdf:resource="&pav;curatedBy" />
+    </owl:ObjectProperty>
+    
+    <owl:DatatypeProperty rdf:about="status">
+    </owl:DatatypeProperty>
+    
+    <owl:ObjectProperty rdf:about="context">
+    	<rdfs:domain rdf:resource="Annotation" />
+    	<rdfs:range rdf:resource="Selector" />
+    </owl:ObjectProperty>
+    
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Integration
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+    <rdf:Description rdf:about="&pav;Curation" rdfs:label="(pav) Curation">
+    	<rdfs:subClassOf rdf:resource="&owl;Thing"/>
+    </rdf:Description> 
+    
+    <rdf:Description rdf:about="&pav;SourceDocument" rdfs:label="(pav) Source Document">
+    	<rdfs:subClassOf rdf:resource="&owl;Thing"/>
+    	
+    	<owl:disjointWith rdf:resource="Annotation"/>
+        <owl:disjointWith rdf:resource="AnnotationCuration"/>
+        <owl:disjointWith rdf:resource="Selector"/>    
+        <owl:disjointWith rdf:resource="AnnotationSet"/>
+    </rdf:Description> 
+
+</rdf:RDF>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/annotation.owl
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/annotation.owl b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/annotation.owl
new file mode 100644
index 0000000..6cdadf8
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/annotation.owl
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- Created by Paolo Ciccarese http://www.paolociccarese.info on April 12th, 2010 -->
+
+<!DOCTYPE rdf:RDF [
+    <!-- Other namespaces -->
+    <!ENTITY xsd  "http://www.w3.org/2001/XMLSchema#" >
+    <!ENTITY rdf  "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
+    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
+    <!ENTITY owl  "http://www.w3.org/2002/07/owl#" >
+    <!ENTITY dct  "http://dublincore.org/documents/dcmi-terms/" >
+    <!ENTITY ans  "http://www.w3.org/2000/10/annotation-ns#" >
+    <!ENTITY bkm  "http://www.w3.org/2002/01/bookmark#" >
+    <!ENTITY foaf "http://xmlns.com/foaf/0.1/">
+    <!ENTITY pav  "http://purl.org/pav/">
+    
+    <!-- Main namespace -->
+    <!ENTITY annotation "http://purl.org/ao/" >
+]>
+
+<rdf:RDF
+    xml:base="&annotation;"
+    xmlns="&annotation;"
+    xmlns:pav="&pav;"
+    xmlns:rdfs="&rdfs;"
+    xmlns:owl="&owl;"
+    xmlns:rdf="&rdf;"
+    xmlns:xsd="&xsd;"
+    xmlns:dct="&dct;"
+    xmlns:foaf="&foaf;"
+    xmlns:ans="&ans;"
+    xmlns:bkm="&bkm;">
+    
+    <owl:Ontology rdf:about="&annotation;">
+        <rdf:type rdf:resource="&owl;Ontology"/>
+        <rdfs:label rdf:datatype="&xsd;string">Annotation Ontology v. 1.0</rdfs:label>
+        
+        <owl:imports rdf:resource="http://purl.org/ao/core/"/>
+        <owl:imports rdf:resource="http://purl.org/ao/annotea/"/>
+        <owl:imports rdf:resource="http://purl.org/ao/selectors/"/>
+        <owl:imports rdf:resource="http://purl.org/ao/types/"/>
+        <owl:imports rdf:resource="http://purl.org/ao/foaf/"/>
+        
+        <owl:imports rdf:resource="http://purl.org/pav/2.0/"/>
+
+    	<dct:language>en</dct:language>
+    	<dct:title xml:lang="en">Annotation Ontology</dct:title>
+    	<dct:creator rdf:resource="http://www.hcklab.org/foaf.rdf#me"/>
+    	<dct:publisher rdf:resource="http://www.mindinformatics.org"/>
+    	<dct:contributor rdf:datatype="&xsd;string">Paolo Ciccarese</dct:contributor>
+        <dct:created rdf:datatype="&xsd;string">April 12, 2010</dct:created>
+        <dct:date rdf:datatype="&xsd;string">May 26, 2010</dct:date>
+        <dct:format rdf:datatype="&xsd;string">rdf/xml</dct:format>    
+    </owl:Ontology> 
+  
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Annotation Properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+     
+    <rdf:Description rdf:about="&dct;title">
+        <rdf:type rdf:resource="&owl;AnnotationProperty"/>
+    </rdf:Description>
+    <rdf:Description rdf:about="&dct;created">
+        <rdf:type rdf:resource="&owl;AnnotationProperty"/>
+    </rdf:Description>
+    <rdf:Description rdf:about="&dct;date">
+        <rdf:type rdf:resource="&owl;AnnotationProperty"/>
+    </rdf:Description>
+    <rdf:Description rdf:about="&dct;creator">
+        <rdf:type rdf:resource="&owl;AnnotationProperty"/>
+    </rdf:Description>
+    <rdf:Description rdf:about="&dct;format">
+        <rdf:type rdf:resource="&owl;AnnotationProperty"/>
+    </rdf:Description>
+    <rdf:Description rdf:about="&dct;language">
+        <rdf:type rdf:resource="&owl;AnnotationProperty"/>
+    </rdf:Description>
+    <rdf:Description rdf:about="&dct;publisher">
+        <rdf:type rdf:resource="&owl;AnnotationProperty"/>
+    </rdf:Description>
+    <rdf:Description rdf:about="&dct;contributor">
+        <rdf:type rdf:resource="&owl;AnnotationProperty"/>
+    </rdf:Description>          
+
+</rdf:RDF>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/content.owl
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/content.owl b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/content.owl
new file mode 100644
index 0000000..79553e6
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/content.owl
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="utf-8"?>
+<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+	xmlns:owl="http://www.w3.org/2002/07/owl#" 
+	xmlns:dct="http://purl.org/dc/terms/"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema#" 
+	xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+	xmlns:cnt="http://www.w3.org/2011/content#" 
+	xmlns="http://www.w3.org/2011/content#"
+	xml:base="http://www.w3.org/2011/content"
+>
+
+	<owl:Ontology rdf:about="">
+		<rdfs:label xml:lang="en">Representing Content in RDF</rdfs:label>
+		<rdfs:comment xml:lang="en">Representing Content in RDF as defined by http://www.w3.org/TR/Content-in-RDF/</rdfs:comment>
+		<owl:versionInfo xml:lang="en">Working Draft 29 April 2011</owl:versionInfo>
+		<rdfs:isDefinedBy rdf:resource="http://www.w3.org/TR/Content-in-RDF/" />
+		<rdfs:seeAlso rdf:resource="http://www.w3.org/WAI/intro/earl" />
+        <!--<owl:imports rdf:resource="http://purl.org/dc/terms/" />-->
+	</owl:Ontology>
+
+	<!-- Classes -->
+
+	<rdfs:Class rdf:about="#Content">
+		<rdfs:label xml:lang="en">Content</rdfs:label>
+		<rdfs:comment xml:lang="en">The content.</rdfs:comment>
+		<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class" />
+	</rdfs:Class>
+
+	<rdfs:Class rdf:ID="ContentAsBase64">
+		<rdfs:label xml:lang="en">Base64 content</rdfs:label>
+		<rdfs:comment xml:lang="en">The base64 encoded content (can be used for binary content).</rdfs:comment>
+		<rdfs:subClassOf rdf:resource="#Content" />
+		<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class" />
+	</rdfs:Class>
+
+	<rdfs:Class rdf:ID="ContentAsText">
+		<rdfs:label xml:lang="en">Text content</rdfs:label>
+		<rdfs:comment xml:lang="en">The text content (can be used for text content).</rdfs:comment>
+		<rdfs:subClassOf rdf:resource="#Content" />
+		<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class" />
+	</rdfs:Class>
+
+	<rdfs:Class rdf:ID="ContentAsXML">
+		<rdfs:label xml:lang="en">XML content</rdfs:label>
+		<rdfs:comment xml:lang="en">The XML content (can only be used for XML-wellformed content).</rdfs:comment>
+		<rdfs:subClassOf rdf:resource="#Content" />
+		<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class" />
+	</rdfs:Class>
+
+	<rdfs:Class rdf:ID="DoctypeDecl">
+		<rdfs:label xml:lang="en">Document type declaration</rdfs:label>
+		<rdfs:comment xml:lang="en">The document type declaration.</rdfs:comment>
+		<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class" />
+	</rdfs:Class>
+
+	<!-- Properties -->
+
+	<rdf:Property rdf:ID="bytes">
+		<rdfs:label xml:lang="en">Base64 encoded byte sequence</rdfs:label>
+		<rdfs:comment xml:lang="en">The Base64 encoded byte sequence of the content.</rdfs:comment>
+		<rdfs:domain rdf:resource="#ContentAsBase64" />
+    	<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#base64Binary" />
+		<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty" />
+	</rdf:Property>
+
+	<rdf:Property rdf:ID="characterEncoding">
+		<rdfs:domain rdf:resource="#Content" />
+		<rdfs:label xml:lang="en">Character encoding</rdfs:label>
+		<rdfs:comment xml:lang="en">The character encoding used to create a character sequence from a byte sequence or vice versa.</rdfs:comment>
+		<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal" />
+		<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty" />
+	</rdf:Property>
+
+	<rdf:Property rdf:ID="chars">
+		<rdfs:domain rdf:resource="#ContentAsText" />
+		<rdfs:label xml:lang="en">Character sequence</rdfs:label>
+		<rdfs:comment xml:lang="en">The character sequence of the text content.</rdfs:comment>
+		<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal" />
+		<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty" />
+	</rdf:Property>
+
+	<rdf:Property rdf:ID="declaredEncoding">
+		<rdfs:label xml:lang="en">XML character encoding</rdfs:label>
+		<rdfs:comment xml:lang="en">The character encoding declared in the XML declaration.</rdfs:comment>
+		<rdfs:domain rdf:resource="#ContentAsXML" />
+		<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal" />
+		<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty" />
+	</rdf:Property>
+
+	<rdf:Property rdf:ID="doctypeName">
+		<rdfs:label xml:lang="en">Document type name</rdfs:label>
+		<rdfs:comment xml:lang="en">The document type name.</rdfs:comment>
+		<rdfs:domain rdf:resource="#DoctypeDecl" />
+		<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal" />
+		<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty" />
+	</rdf:Property>
+
+	<rdf:Property rdf:ID="dtDecl">
+		<rdfs:label xml:lang="en">Document type declaration</rdfs:label>
+		<rdfs:comment xml:lang="en">The document type declaration.</rdfs:comment>
+		<rdfs:domain rdf:resource="#ContentAsXML" />
+		<rdfs:range rdf:resource="#DoctypeDecl" />
+		<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty" />
+	</rdf:Property>
+
+	<rdf:Property rdf:ID="internalSubset">
+		<rdfs:label xml:lang="en">Internal DTD subset</rdfs:label>
+		<rdfs:comment xml:lang="en">The internal document type definition subset within the document type declarations.</rdfs:comment>
+		<rdfs:domain rdf:resource="#DoctypeDecl" />
+		<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal" />
+		<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty" />
+	</rdf:Property>
+
+	<rdf:Property rdf:ID="leadingMisc">
+		<rdfs:label xml:lang="en">XML leading misc</rdfs:label>
+		<rdfs:comment xml:lang="en">The XML content preceding the document type declaration.</rdfs:comment>
+		<rdfs:domain rdf:resource="#ContentAsXML" />
+		<rdfs:range rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral" />
+		<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty" />
+	</rdf:Property>
+
+	<rdf:Property rdf:ID="publicId">
+		<rdfs:label xml:lang="en">Public ID</rdfs:label>
+		<rdfs:comment xml:lang="en">The document type declarations's public identifier.</rdfs:comment>
+		<rdfs:domain rdf:resource="#DoctypeDecl" />
+		<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal" />
+		<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty" />
+	</rdf:Property>
+
+	<rdf:Property rdf:ID="rest">
+		<rdfs:label xml:lang="en">XML rest</rdfs:label>
+		<rdfs:comment xml:lang="en">The XML content following the document type declaration.</rdfs:comment>
+		<rdfs:domain rdf:resource="#ContentAsXML" />
+		<rdfs:range rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral" />
+		<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty" />
+	</rdf:Property>
+
+	<rdf:Property rdf:ID="standalone">
+		<rdfs:label xml:lang="en">XML standalone document declaration</rdfs:label>
+		<rdfs:comment xml:lang="en">The standalone declaration in the XML declaration.</rdfs:comment>
+		<rdfs:domain rdf:resource="#ContentAsXML" />
+		<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal" />
+		<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty" />
+	</rdf:Property>
+
+	<rdf:Property rdf:ID="systemId">
+		<rdfs:label xml:lang="en">System ID</rdfs:label>
+		<rdfs:comment xml:lang="en">The document type declarations's system identifier (typed: xsd:anyURI)</rdfs:comment>
+		<rdfs:domain rdf:resource="#DoctypeDecl" />
+		<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#anyURI" />
+		<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty" />
+	</rdf:Property>
+
+	<rdf:Property rdf:ID="version">
+		<rdfs:label xml:lang="en">XML version</rdfs:label>
+		<rdfs:comment xml:lang="en">The XML version declared in the XML declaration.</rdfs:comment>
+		<rdfs:domain rdf:resource="#ContentAsXML" />
+		<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal" />
+		<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty" />
+	</rdf:Property>
+</rdf:RDF>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/dcam.owl
----------------------------------------------------------------------
diff --git a/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/dcam.owl b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/dcam.owl
new file mode 100644
index 0000000..a96ea8d
--- /dev/null
+++ b/taverna-prov-owl-bindings/src/main/resources/org/purl/wf4ever/provtaverna/owl/dcam.owl
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcam="http://purl.org/dc/dcam/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xml:base="http://triplr.org/rdf/bloody-byte.net/rdf/dc_owl2dl/dcam.ttl">
+    <!--
+  <owl:Ontology rdf:about="http://purl.org/NET/dc_owl2dl/dcam">
+  -->
+  <owl:Ontology rdf:about="http://purl.org/wf4ever/dcam">
+    <owl:imports rdf:resource="http://www.w3.org/TR/skos-reference/skos-owl1-dl.rdf"/>
+    <rdfs:label xml:lang="en">DCMI Abstract Model</rdfs:label>
+    <rdfs:comment xml:lang="en">OWL 2 DL ontology for a few terms of the DCMI abstract model from the http://purl.org/dc/dcam/ namespace</rdfs:comment>
+  </owl:Ontology>
+  <owl:ObjectProperty rdf:about="http://purl.org/dc/dcam/memberOf">
+    <skos:definition xml:lang="en-US">A relationship between a resource and a vocabulary encoding scheme which indicates that the resource is a member of a set.</skos:definition>
+    <rdfs:label xml:lang="en-US">Member Of</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://dublincore.org/documents/2007/06/04/abstract-model/"/>
+    <rdfs:range rdf:resource="http://purl.org/dc/dcam/VocabularyEncodingScheme"/>
+  </owl:ObjectProperty>
+  <owl:Class rdf:about="http://purl.org/dc/dcam/VocabularyEncodingScheme">
+    <skos:definition xml:lang="en-US">An enumerated set of resources.</skos:definition>
+    <rdfs:label xml:lang="en-US">Vocabulary Encoding Scheme</rdfs:label>
+    <rdfs:isDefinedBy rdf:resource="http://dublincore.org/documents/2007/06/04/abstract-model/"/>
+  </owl:Class>
+</rdf:RDF>
+<!--
+Made by Triplr http://triplr.org by Dave Beckett, http://purl.org/net/dajobe/
+from http://bloody-byte.net/rdf/dc_owl2dl/dcam.ttl in format turtle to rdfxml-abbrev
+using Redland 1.0.7 and Raptor 1.4.18 from http://librdf.org/
+This document is http://triplr.org/rdf/bloody-byte.net/rdf/dc_owl2dl/dcam.ttl
+-->


[35/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/resources/t2flow/wsdl-secure.t2flow
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/resources/t2flow/wsdl-secure.t2flow b/taverna-integration-tests/src/test/resources/t2flow/wsdl-secure.t2flow
new file mode 100644
index 0000000..4db4ad5
--- /dev/null
+++ b/taverna-integration-tests/src/test/resources/t2flow/wsdl-secure.t2flow
@@ -0,0 +1,131 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3.0"><dataflow id="b23a2149-976e-4e98-b120-e5b8580839ef" role="top"><name>Workflow13</name><inputPorts /><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>hello_plaintext_password</name><inputPorts><port><name>in0</name><depth>0</depth></port></inputPorts><outputPorts><port><name>helloReturn</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.wsdl.WSDLActivity</class><inputMap><map from="in0" to="in0" /></inputMap><outputMap><map from="helloReturn" to="helloReturn" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean xmlns="">
+  <wsdl>http://heater.cs.man.ac.uk:7070/axis/services/HelloService-PlaintextPassword?wsdl</wsdl>
+  <operation>hello</operation>
+  <securityProfile>WSSecurityUsernameTokenPlainTextPassword</securityProfile>
+</net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="in0" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>in0_value</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" to="value" 
 /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>Alan</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>hello_plaintext_password</processor><port>in0</port></sink><source type="processor"><processor>in0_value</processor><port>value</port></source></datalink><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>hello_plaintext_password</processor><port>helloReturn</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotati
 on.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>ca8fb5c5-0e8c-4e68-84f0-bdc85a77e2b3</identification>
+      </annotationBean>
+      <date>2010-11-22 13:29:26.400 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>7153a2dd-18bd-4f25-80ab-1efa8afc567d</identification>
+      </annotationBean>
+      <date>2011-01-21 16:02:39.43 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>394aced4-ee5d-4355-8ebe-9fc8bcfe5303</identification>
+      </annotationBean>
+      <date>2011-06-21 12:07:46.327 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>c71621ca-196c-46cd-9073-48af82b4bd4f</identification>
+      </annotationBean>
+      <date>2011-06-21 12:11:30.87 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>8175c97b-6385-460a-98ab-5cf974010d51</identification>
+      </annotationBean>
+      <date>2010-11-22 12:11:59.610 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>56cadac0-c944-4b9e-83c3-078f57738405</identification>
+      </annotationBean>
+      <date>2011-01-21 16:02:09.633 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>a388d568-ca08-43b4-abaf-3744a6801d45</identification>
+      </annotationBean>
+      <date>2010-11-22 13:30:28.898 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>b23a2149-976e-4e98-b120-e5b8580839ef</identification>
+      </annotationBean>
+      <date>2011-08-23 13:40:15.238 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>3d76be4c-83c4-413b-91f2-b0ce69dcbd97</identification>
+      </annotationBean>
+      <date>2010-11-22 13:29:43.282 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>e61023d9-d603-4df6-87e5-175603f106a5</identification>
+      </annotationBean>
+      <date>2010-11-22 13:28:31.68 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/resources/t2flow/wsdl.t2flow
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/resources/t2flow/wsdl.t2flow b/taverna-integration-tests/src/test/resources/t2flow/wsdl.t2flow
new file mode 100644
index 0000000..4dea6bb
--- /dev/null
+++ b/taverna-integration-tests/src/test/resources/t2flow/wsdl.t2flow
@@ -0,0 +1,22 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.2.0"><dataflow id="eed49d32-8563-45ff-8716-347b20800129" role="top"><name>Workflow5</name><inputPorts /><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>getVersion</name><inputPorts /><outputPorts><port><name>getVersionReturn</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.wsdl.WSDLActivity</class><inputMap /><outputMap><map from="getVersionReturn" to="getVersionReturn" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean xmlns="">
+  <wsdl>http://www.mygrid.org.uk/axis/services/Version?wsdl</wsdl>
+  <operation>getVersion</operation>
+</net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>getVersion</processor><port>getVersionReturn</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>eed49d32-8563-45ff-8716-347b20800129</identification>
+      </annotationBean>
+      <date>2011-01-25 16:37:45.583 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/resources/t2flow/xmlSplitter.t2flow
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/resources/t2flow/xmlSplitter.t2flow b/taverna-integration-tests/src/test/resources/t2flow/xmlSplitter.t2flow
new file mode 100644
index 0000000..bd0875d
--- /dev/null
+++ b/taverna-integration-tests/src/test/resources/t2flow/xmlSplitter.t2flow
@@ -0,0 +1,339 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.2.0"><dataflow id="52ddd8d4-d1fc-4b62-932a-288df52b77cf" role="top"><name>Workflow1</name><inputPorts><port><name>lastName</name><depth>0</depth><granularDepth>0</granularDepth><annotations><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.ExampleValue">
+        <text>Smith</text>
+      </annotationBean>
+      <date>2011-02-17 10:48:23.657 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain></annotations></port><port><name>firstName</name><depth>0</depth><granularDepth>0</granularDepth><annotations><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.ExampleValue">
+        <text>John</text>
+      </annotationBean>
+      <date>2011-02-17 10:48:16.703 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain></annotations></port><port><name>age</name><depth>0</depth><granularDepth>0</granularDepth><annotations><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.ExampleValue">
+        <text>John</text>
+      </annotationBean>
+      <date>2011-02-17 10:47:56.513 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.ExampleValue">
+        <text>21</text>
+      </annotationBean>
+      <date>2011-02-17 10:48:30.905 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain></annotations></port></inputPorts><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>personToString</name><inputPorts><port><name>parameters</name><depth>0</depth></port></inputPorts><outputPorts><port><name>parameters</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.wsdl.WSDLActivity</class><inputMap><map from="parameters" to="parameters" /></inputMap><outputMap><map from="parameters" to="parameters" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean xmlns="">
+  <wsdl>http://www.mygrid.org.uk/menagerie/xfire/Complex-dlw?wsdl</wsdl>
+  <operation>personToString</operation>
+</net.sf.taverna.t2.activities.wsdl.WSDLActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="parameters" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>personToString_output</name><inputPorts><port><name>input</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLOutputSplitt
 erActivity</class><inputMap><map from="input" to="input" /></inputMap><outputMap><map from="out" to="out" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLSplitterConfigurationBean xmlns="">
+  <wrappedTypeXML>&lt;s:extensions xmlns:s="http://org.embl.ebi.escience/xscufl/0.1alpha"&gt;&lt;s:complextype optional="false" unbounded="false" typename="personToStringResponse" name="parameters" qname="{http://xfire.codehaus.org/BookService}personToStringResponse"&gt;&lt;s:elements&gt;&lt;s:basetype optional="false" unbounded="false" typename="string" name="out" qname="{http://xfire.codehaus.org/BookService}&amp;gt;personToStringResponse&amp;gt;out" /&gt;&lt;/s:elements&gt;&lt;/s:complextype&gt;&lt;/s:extensions&gt;</wrappedTypeXML>
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>false</allowsLiteralValues>
+      <name>input</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/xml'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>0</granularDepth>
+      <name>out</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/plain'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLSplitterConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="input" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>personToString_input</name><inputPorts><port><name>person</name><depth>0</depth></port></inputPorts><outputPorts><port><name>output</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLInputSplitterA
 ctivity</class><inputMap><map from="person" to="person" /></inputMap><outputMap><map from="output" to="output" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLSplitterConfigurationBean xmlns="">
+  <wrappedTypeXML>&lt;s:extensions xmlns:s="http://org.embl.ebi.escience/xscufl/0.1alpha"&gt;&lt;s:complextype optional="false" unbounded="false" typename="personToString" name="parameters" qname="{http://xfire.codehaus.org/BookService}personToString"&gt;&lt;s:elements&gt;&lt;s:complextype optional="false" unbounded="false" typename="Person" name="person" qname="{http://xfire.codehaus.org/BookService}&amp;gt;personToString&amp;gt;person"&gt;&lt;s:elements&gt;&lt;s:complextype optional="true" unbounded="false" typename="Address" name="address" qname="{http://complex.pojo.axis2.menagerie.googlecode}Person&amp;gt;address"&gt;&lt;s:elements&gt;&lt;s:basetype optional="true" unbounded="false" typename="string" name="city" qname="{http://complex.pojo.axis2.menagerie.googlecode}Address&amp;gt;city" /&gt;&lt;s:basetype optional="true" unbounded="false" typename="string" name="road" qname="{http://complex.pojo.axis2.menagerie.googlecode}Address&amp;gt;road" /&gt;&lt;s:basetype optional="true
 " unbounded="false" typename="int" name="roadNumber" qname="{http://complex.pojo.axis2.menagerie.googlecode}Address&amp;gt;roadNumber" /&gt;&lt;/s:elements&gt;&lt;/s:complextype&gt;&lt;s:basetype optional="true" unbounded="false" typename="int" name="age" qname="{http://complex.pojo.axis2.menagerie.googlecode}Person&amp;gt;age" /&gt;&lt;s:basetype optional="true" unbounded="false" typename="string" name="firstName" qname="{http://complex.pojo.axis2.menagerie.googlecode}Person&amp;gt;firstName" /&gt;&lt;s:basetype optional="true" unbounded="false" typename="string" name="lastName" qname="{http://complex.pojo.axis2.menagerie.googlecode}Person&amp;gt;lastName" /&gt;&lt;/s:elements&gt;&lt;/s:complextype&gt;&lt;/s:elements&gt;&lt;/s:complextype&gt;&lt;/s:extensions&gt;</wrappedTypeXML>
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <allowsLiteralValues>false</allowsLiteralValues>
+      <name>person</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/xml'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>0</granularDepth>
+      <name>output</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/xml'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLSplitterConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="person" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>personToString_person</name><inputPorts><port><name>lastName</name><depth>0</depth></port><port><name>firstName</name><depth>0</depth></port><port><name>age</name><depth>0</depth></port><port><name>address</name><depth>0</depth></port></inputPorts><outputPorts><port><name>output</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.act
 ivities</group><artifact>wsdl-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLInputSplitterActivity</class><inputMap><map from="lastName" to="lastName" /><map from="address" to="address" /><map from="age" to="age" /><map from="firstName" to="firstName" /></inputMap><outputMap><map from="output" to="output" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLSplitterConfigurationBean xmlns="">
+  <wrappedTypeXML>&lt;s:extensions xmlns:s="http://org.embl.ebi.escience/xscufl/0.1alpha"&gt;&lt;s:complextype optional="false" unbounded="false" typename="Person" name="person" qname="{http://xfire.codehaus.org/BookService}&amp;gt;personToString&amp;gt;person"&gt;&lt;s:elements&gt;&lt;s:complextype optional="true" unbounded="false" typename="Address" name="address" qname="{http://complex.pojo.axis2.menagerie.googlecode}Person&amp;gt;address"&gt;&lt;s:elements&gt;&lt;s:basetype optional="true" unbounded="false" typename="string" name="city" qname="{http://complex.pojo.axis2.menagerie.googlecode}Address&amp;gt;city" /&gt;&lt;s:basetype optional="true" unbounded="false" typename="string" name="road" qname="{http://complex.pojo.axis2.menagerie.googlecode}Address&amp;gt;road" /&gt;&lt;s:basetype optional="true" unbounded="false" typename="int" name="roadNumber" qname="{http://complex.pojo.axis2.menagerie.googlecode}Address&amp;gt;roadNumber" /&gt;&lt;/s:elements&gt;&lt;/s:complextype&gt
 ;&lt;s:basetype optional="true" unbounded="false" typename="int" name="age" qname="{http://complex.pojo.axis2.menagerie.googlecode}Person&amp;gt;age" /&gt;&lt;s:basetype optional="true" unbounded="false" typename="string" name="firstName" qname="{http://complex.pojo.axis2.menagerie.googlecode}Person&amp;gt;firstName" /&gt;&lt;s:basetype optional="true" unbounded="false" typename="string" name="lastName" qname="{http://complex.pojo.axis2.menagerie.googlecode}Person&amp;gt;lastName" /&gt;&lt;/s:elements&gt;&lt;/s:complextype&gt;&lt;/s:extensions&gt;</wrappedTypeXML>
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <allowsLiteralValues>false</allowsLiteralValues>
+      <name>address</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/xml'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <allowsLiteralValues>false</allowsLiteralValues>
+      <name>age</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/plain'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <allowsLiteralValues>false</allowsLiteralValues>
+      <name>firstName</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/plain'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <allowsLiteralValues>false</allowsLiteralValues>
+      <name>lastName</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/plain'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>0</granularDepth>
+      <name>output</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/xml'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLSplitterConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="lastName" depth="0" /><port name="firstName" depth="0" /><port name="age" depth="0" /><port name="address" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>person_address</name><inputPorts><port><name>city</name><depth>0</depth></port><port><name>road</name><depth>0</depth></port><port><name>roadNumber</name><depth>0</depth></port></inputPorts><outputPorts><port><name>output</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><act
 ivity><raven><group>net.sf.taverna.t2.activities</group><artifact>wsdl-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLInputSplitterActivity</class><inputMap><map from="road" to="road" /><map from="roadNumber" to="roadNumber" /><map from="city" to="city" /></inputMap><outputMap><map from="output" to="output" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLSplitterConfigurationBean xmlns="">
+  <wrappedTypeXML>&lt;s:extensions xmlns:s="http://org.embl.ebi.escience/xscufl/0.1alpha"&gt;&lt;s:complextype optional="true" unbounded="false" typename="Address" name="address" qname="{http://complex.pojo.axis2.menagerie.googlecode}Person&amp;gt;address"&gt;&lt;s:elements&gt;&lt;s:basetype optional="true" unbounded="false" typename="string" name="city" qname="{http://complex.pojo.axis2.menagerie.googlecode}Address&amp;gt;city" /&gt;&lt;s:basetype optional="true" unbounded="false" typename="string" name="road" qname="{http://complex.pojo.axis2.menagerie.googlecode}Address&amp;gt;road" /&gt;&lt;s:basetype optional="true" unbounded="false" typename="int" name="roadNumber" qname="{http://complex.pojo.axis2.menagerie.googlecode}Address&amp;gt;roadNumber" /&gt;&lt;/s:elements&gt;&lt;/s:complextype&gt;&lt;/s:extensions&gt;</wrappedTypeXML>
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <allowsLiteralValues>false</allowsLiteralValues>
+      <name>city</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/plain'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <allowsLiteralValues>false</allowsLiteralValues>
+      <name>road</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/plain'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <allowsLiteralValues>false</allowsLiteralValues>
+      <name>roadNumber</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/plain'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <granularDepth>0</granularDepth>
+      <name>output</name>
+      <depth>0</depth>
+      <mimeTypes class="java.util.Collections$SingletonList">
+        <element class="string">'text/xml'</element>
+      </mimeTypes>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+</net.sf.taverna.t2.activities.wsdl.xmlsplitter.XMLSplitterConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="city" depth="0" /><port name="road" depth="0" /><port name="roadNumber" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>city_value</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstant
 Activity</class><inputMap /><outputMap><map from="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>Manchester</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>road_value</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf
 .taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>Oxford Road</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>roadNumber_value</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" to="value" /></outputMap><configBean encoding="xstream"><
 net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>40</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.2</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>personToString</processor><port>parameters</port></sink><source type="processor"><processor>personToString_input</processor><port>output</port></source></datalink><datalink><sink type="processor"><processor>personToString_output</processor><port>input</port></sink><source type="processor"><processor>personToString</processor><port>parameters</port></source></datalink><datalink><sink type="processor"><processor>pers
 onToString_input</processor><port>person</port></sink><source type="processor"><processor>personToString_person</processor><port>output</port></source></datalink><datalink><sink type="processor"><processor>personToString_person</processor><port>lastName</port></sink><source type="dataflow"><port>lastName</port></source></datalink><datalink><sink type="processor"><processor>personToString_person</processor><port>firstName</port></sink><source type="dataflow"><port>firstName</port></source></datalink><datalink><sink type="processor"><processor>personToString_person</processor><port>age</port></sink><source type="dataflow"><port>age</port></source></datalink><datalink><sink type="processor"><processor>personToString_person</processor><port>address</port></sink><source type="processor"><processor>person_address</processor><port>output</port></source></datalink><datalink><sink type="processor"><processor>person_address</processor><port>city</port></sink><source type="processor"><processo
 r>city_value</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>person_address</processor><port>road</port></sink><source type="processor"><processor>road_value</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>person_address</processor><port>roadNumber</port></sink><source type="processor"><processor>roadNumber_value</processor><port>value</port></source></datalink><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>personToString_output</processor><port>out</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>d79eeb60-919e-4076-af14-70ac4d605bec</identification>
+      </annotationBean>
+      <date>2011-02-17 10:49:46.785 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>52ddd8d4-d1fc-4b62-932a-288df52b77cf</identification>
+      </annotationBean>
+      <date>2011-02-17 10:53:16.981 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>8815f1ea-2659-4b7e-a90e-787c6a3c4ad6</identification>
+      </annotationBean>
+      <date>2011-02-17 10:29:40.492 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>eee0128a-4afe-4566-851a-fe50dcb36340</identification>
+      </annotationBean>
+      <date>2011-02-17 10:48:35.150 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>e64ae430-dd6e-468d-b3dd-de1fea9c717b</identification>
+      </annotationBean>
+      <date>2011-02-17 10:20:55.279 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>2aa76794-f001-42f9-b945-797badfeebb1</identification>
+      </annotationBean>
+      <date>2011-02-17 10:17:24.893 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>2ece2565-7498-4154-9d61-996d8a1db5f3</identification>
+      </annotationBean>
+      <date>2011-02-17 10:24:47.509 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>97fbd479-a423-4e8c-9033-bfc28f1a7885</identification>
+      </annotationBean>
+      <date>2011-02-17 10:42:59.63 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>24e8b191-9f48-4864-82be-d9578f1b8450</identification>
+      </annotationBean>
+      <date>2011-02-17 10:25:38.788 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/resources/t2flow/xpath.t2flow
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/resources/t2flow/xpath.t2flow b/taverna-integration-tests/src/test/resources/t2flow/xpath.t2flow
new file mode 100644
index 0000000..0691ccc
--- /dev/null
+++ b/taverna-integration-tests/src/test/resources/t2flow/xpath.t2flow
@@ -0,0 +1,127 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3.0"><dataflow id="9fb6e3ea-f314-4f9f-8eb3-ba3dbf2b494f" role="top"><name>Workflow1</name><inputPorts /><outputPorts><port><name>out</name><annotations /></port></outputPorts><processors><processor><name>XPath_Service</name><inputPorts><port><name>xml_text</name><depth>0</depth></port></inputPorts><outputPorts><port><name>nodelistAsXML</name><depth>1</depth><granularDepth>1</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>xpath-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.xpath.XPathActivity</class><inputMap><map from="xml_text" to="xml_text" /></inputMap><outputMap><map from="nodelistAsXML" to="nodelistAsXML" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.xpath.XPathActivityConfigurationBean xmlns="">
+  <xmlDocument>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+&lt;test name="test-name"&gt;
+&lt;test-element&gt;test&lt;/test-element&gt;
+&lt;/test&gt;</xmlDocument>
+  <xpathExpression>/test/test-element</xpathExpression>
+  <xpathNamespaceMap />
+</net.sf.taverna.t2.activities.xpath.XPathActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="xml_text" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>xml_text_value</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" t
 o="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;test name="test-name"&gt; &lt;test-element&gt;test&lt;/test-element&gt; &lt;/test&gt;</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>Merge_String_List_to_a_String</name><inputPorts><port><name>stringlist</name><depth>1</depth></port></inputPorts><outputPorts><port><name>concatenated</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivity</class><inputMap><map from="str
 inglist" to="stringlist" /></inputMap><outputMap><map from="concatenated" to="concatenated" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>stringlist</name>
+      <depth>1</depth>
+      <mimeTypes>
+        <string>l('text/plain')</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>seperator</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>concatenated</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>String seperatorString = "\n";
+if (seperator != void) {
+	seperatorString = seperator;
+}
+StringBuffer sb = new StringBuffer();
+for (Iterator i = stringlist.iterator(); i.hasNext();) {
+	String item = (String) i.next();
+	sb.append(item);
+	if (i.hasNext()) {
+		sb.append(seperatorString);
+	}
+}
+concatenated = sb.toString();
+</script>
+  <dependencies />
+  <localworkerName>org.embl.ebi.escience.scuflworkers.java.StringListMerge</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="stringlist" depth="1" /></cross></strategy></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>XPath_Service</processor><port>xml_text</port></sink><source type="processor"><processor>xml_text_value</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>Merge_String_List_to_a_String</processor><port>stringlist</port></sink><source type="processor"><processor>XPath_Service</processor><port>nodelistAsXML</port></s
 ource></datalink><datalink><sink type="dataflow"><port>out</port></sink><source type="processor"><processor>Merge_String_List_to_a_String</processor><port>concatenated</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>9fb6e3ea-f314-4f9f-8eb3-ba3dbf2b494f</identification>
+      </annotationBean>
+      <date>2011-11-03 14:17:32.152 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>bed5342f-45e0-4fc9-a85d-bcd1ea01e33d</identification>
+      </annotationBean>
+      <date>2011-11-03 12:55:28.941 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>9f0cedc9-4a53-4564-aeb5-d0b7f7b2b4e1</identification>
+      </annotationBean>
+      <date>2011-11-03 12:56:36.620 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>94104add-ec12-4c5a-a4f6-b5c1b6d0a700</identification>
+      </annotationBean>
+      <date>2011-11-03 12:56:00.6 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-observer/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-observer/pom.xml b/taverna-observer/pom.xml
new file mode 100644
index 0000000..1ec7d62
--- /dev/null
+++ b/taverna-observer/pom.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+    <groupId>org.apache.taverna.engine</groupId>
+    <artifactId>taverna-engine</artifactId>
+    <version>3.1.0-incubating-SNAPSHOT</version>
+	</parent>
+	<artifactId>taverna-observer</artifactId>
+  <packaging>bundle</packaging>
+	<name>Apache Taverna Observer pattern</name>
+	<description>Implementation of the Observer pattern</description>
+	<dependencies>
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+			<version>${log4j.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/MultiCaster.java
----------------------------------------------------------------------
diff --git a/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/MultiCaster.java b/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/MultiCaster.java
new file mode 100644
index 0000000..d563e39
--- /dev/null
+++ b/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/MultiCaster.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.lang.observer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Send notifications to registered observers about changes to models
+ * 
+ * @author Ian Dunlop
+ * @author Stian Soiland
+ * 
+ * @param <Message>
+ */
+public class MultiCaster<Message> implements Observable<Message> {
+
+	private static Logger logger = Logger.getLogger(MultiCaster.class);
+
+	private Observable<Message> observable;
+
+	protected List<Observer<Message>> observers = new ArrayList<Observer<Message>>();
+
+	/**
+	 * Set the {@link #observable} ie. the class that changes are happening to
+	 * and it's Message for this {@link MultiCaster}
+	 * 
+	 * @param observable
+	 */
+	public MultiCaster(Observable<Message> observable) {
+		this.observable = observable;
+	}
+
+	/**
+	 * Tell all the registered observers about the change to the model
+	 * 
+	 * @param message
+	 */
+	@SuppressWarnings("unchecked")
+	public void notify(Message message) {
+		// Use a copy that can be iterated even if register/remove is called
+		for (Observer<Message> observer : getObservers()) {
+			try {
+				observer.notify(observable, message);
+			} catch (Exception ex) {
+				logger.warn("Could not notify " + observer, ex);
+			}
+		}
+	}
+
+	/**
+	 * Register an observer ie. someone who wants informed about changes
+	 */
+	public synchronized void addObserver(Observer<Message> observer) {
+		observers.add(observer);
+	}
+
+	/**
+	 * Remove the observer and no longer send out any notifications about it
+	 */
+	public synchronized void removeObserver(Observer<Message> observer) {
+		observers.remove(observer);
+	}
+
+	/**
+	 * A list of all the classes currently registered with this
+	 * {@link MultiCaster}
+	 */
+	public synchronized List<Observer<Message>> getObservers() {
+		return new ArrayList<Observer<Message>>(observers);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/Observable.java
----------------------------------------------------------------------
diff --git a/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/Observable.java b/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/Observable.java
new file mode 100644
index 0000000..1fa7425
--- /dev/null
+++ b/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/Observable.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.lang.observer;
+
+import java.util.List;
+
+/**
+ * Implements this if you want to notify other classes about changes
+ * 
+ * @author Ian Dunlop
+ * @author Stian Soiland
+ * 
+ * @param <Message>
+ */
+public interface Observable<Message> {
+	/**
+	 * Register an {@link Observer}
+	 * 
+	 * @param observer
+	 *            the class who wants notified of changes
+	 */
+	public void addObserver(Observer<Message> observer);
+
+	/**
+	 * Remove a class who is currently observing
+	 * 
+	 * @param observer
+	 *            the class who no longer wants notified
+	 */
+	public void removeObserver(Observer<Message> observer);
+
+	/**
+	 * A list of all the currently registered {@link Observer}s
+	 * 
+	 * @return
+	 */
+	public List<Observer<Message>> getObservers();
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/Observer.java
----------------------------------------------------------------------
diff --git a/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/Observer.java b/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/Observer.java
new file mode 100644
index 0000000..81b7c85
--- /dev/null
+++ b/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/Observer.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.lang.observer;
+
+/**
+ * Implement if you want to register with an {@link Observable}
+ * 
+ * @author Ian Dunlop
+ * @author Stian Soiland
+ * 
+ * @param <Message>
+ */
+public interface Observer<Message> {
+	/**
+	 * Called by the {@link Observable} to notify the implementing class of
+	 * changes
+	 * 
+	 * @param sender
+	 *            the class where the changes have happened
+	 * @param message
+	 *            what has changed
+	 * @throws Exception
+	 */
+	public void notify(Observable<Message> sender, Message message)
+			throws Exception;
+}


[11/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/Port.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/Port.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/Port.java
new file mode 100644
index 0000000..4c2af25
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/Port.java
@@ -0,0 +1,198 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.provenance.lineageservice.utils;
+
+/**
+ * a Port that has no pName is either a WF input or output, depending on isInput
+ * 
+ * @author Paolo Missier
+ */
+public class Port {
+
+	@Override
+	public String toString() {
+		return "Port [identifier=" + identifier + ", isInputPort="
+				+ isInputPort + ", portName=" + portName + ", processorName="
+				+ processorName + ", workflowId=" + workflowId + "]";
+	}
+
+	@Override
+	public int hashCode() {
+		return 31 + ((identifier == null) ? 0 : identifier.hashCode());
+	}
+
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		Port other = (Port) obj;
+		if (identifier == null) {
+			if (other.identifier != null)
+				return false;
+		} else if (!identifier.equals(other.identifier))
+			return false;
+		return true;
+	}
+
+	private String identifier;
+	private String portName;
+	private String processorName;
+	private boolean isInputPort;
+	private String workflowId;
+	private int depth = 0;
+	private Integer resolvedDepth = null;
+	private int iterationStrategyOrder = 0;
+	private String processorId;
+
+	/**
+	 * @return the workflowId
+	 */
+	public String getWorkflowId() {
+		return workflowId;
+	}
+
+	/**
+	 * @param workflowId
+	 *            the workflowId to set
+	 */
+	public void setWorkflowId(String workflowId) {
+		this.workflowId = workflowId;
+	}
+
+	/**
+	 * @return the vName
+	 */
+	public String getPortName() {
+		return portName;
+	}
+
+	/**
+	 * @param name
+	 *            the portName to set
+	 */
+	public void setPortName(String portName) {
+		this.portName = portName;
+	}
+
+	/**
+	 * @return the processorName
+	 */
+	public String getProcessorName() {
+		return processorName;
+	}
+
+	/**
+	 * @param name
+	 *            the processorName to set
+	 */
+	public void setProcessorName(String processorName) {
+		this.processorName = processorName;
+	}
+
+	/**
+	 * @return <code>true</code> if the port is an input port,
+	 *         <code>false</code> if it is an output port
+	 */
+	public boolean isInputPort() {
+		return isInputPort;
+	}
+
+	/**
+	 * @param isInputPort
+	 *            <code>true</code> if the port is an input port,
+	 *            <code>false</code> if it is an output port
+	 */
+	public void setInputPort(boolean isInputPort) {
+		this.isInputPort = isInputPort;
+	}
+
+	/**
+	 * @return the depth
+	 */
+	public int getDepth() {
+		return depth;
+	}
+
+	/**
+	 * @param depth
+	 *            the depth to set
+	 */
+	public void setDepth(int depth) {
+		this.depth = depth;
+	}
+
+	/**
+	 * @return the resolvedDepth
+	 */
+	public Integer getResolvedDepth() {
+		return resolvedDepth;
+	}
+
+	/**
+	 * @param resolvedDepth
+	 *            the resolvedDepth to set
+	 */
+	public void setResolvedDepth(Integer resolvedDepth) {
+		this.resolvedDepth = resolvedDepth;
+	}
+
+	/**
+	 * @return <code>true</code> if the {@link #resolvedDepth} has been set
+	 */
+	public boolean isResolvedDepthSet() {
+		return resolvedDepth != null;
+	}
+
+	public void setIdentifier(String identifier) {
+		this.identifier = identifier;
+	}
+
+	public String getIdentifier() {
+		return identifier;
+	}
+
+	/**
+	 * @return the iterationStrategyOrder
+	 */
+	public int getIterationStrategyOrder() {
+		return iterationStrategyOrder;
+	}
+
+	/**
+	 * @param iterationStrategyOrder
+	 *            the iterationStrategyOrder to set
+	 */
+	public void setIterationStrategyOrder(int iterationStrategyOrder) {
+		this.iterationStrategyOrder = iterationStrategyOrder;
+	}
+
+	public String getProcessorId() {
+		return processorId;
+	}
+
+	public void setProcessorId(String processorId) {
+		this.processorId = processorId;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/PortBinding.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/PortBinding.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/PortBinding.java
new file mode 100644
index 0000000..c6b0b86
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/PortBinding.java
@@ -0,0 +1,258 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.provenance.lineageservice.utils;
+
+/**
+ * @author Paolo Missier
+ * 
+ */
+public class PortBinding {
+	private String workflowId;
+	private String portName;
+	private String workflowRunId;
+	private String value;
+	private String collIDRef;
+	private int positionInColl;
+	private String processorName;
+	private String valueType;
+	private String reference;
+	private String iteration;
+	private String resolvedValue;
+	private String portId;
+	private Boolean isInputPort;
+
+	public PortBinding() {
+	}
+
+	public PortBinding(PortBinding vb) {
+		workflowId = vb.workflowId;
+		portName = vb.portName;
+		workflowRunId = vb.workflowRunId;
+		value = vb.value;
+		collIDRef = vb.collIDRef;
+		positionInColl = vb.positionInColl;
+		processorName = vb.processorName;
+		valueType = vb.valueType;
+		reference = vb.reference;
+		iteration = vb.iteration;
+		resolvedValue = vb.resolvedValue;
+		portId = vb.portId;
+		isInputPort = vb.isInputPort;
+	}
+
+	public String getPortId() {
+		return portId;
+	}
+
+	@Override
+	public String toString() {
+		return "PortBinding [workflowId=" + workflowId + ", portName="
+				+ portName + ", workflowRunId=" + workflowRunId + ", value="
+				+ value + ", collIDRef=" + collIDRef + ", positionInColl="
+				+ positionInColl + ", processorName=" + processorName
+				+ ", valueType=" + valueType + ", reference=" + reference
+				+ ", iteration=" + iteration + ", resolvedValue="
+				+ resolvedValue + ", portId=" + portId + ", isInputPort="
+				+ isInputPort + "]";
+	}
+
+	/**
+	 * @return the positionInColl
+	 */
+	public int getPositionInColl() {
+		return positionInColl;
+	}
+
+	/**
+	 * @param positionInColl
+	 *            the positionInColl to set
+	 */
+	public void setPositionInColl(int positionInColl) {
+		this.positionInColl = positionInColl;
+	}
+
+	/**
+	 * @return the valueType
+	 */
+	public String getValueType() {
+		return valueType;
+	}
+
+	/**
+	 * @param valueType
+	 *            the valueType to set
+	 */
+	public void setValueType(String valueType) {
+		this.valueType = valueType;
+	}
+
+	/**
+	 * @return the portName
+	 */
+	public String getPortName() {
+		return portName;
+	}
+
+	/**
+	 * @param portName
+	 *            the portName to set
+	 */
+	public void setPortName(String portName) {
+		this.portName = portName;
+	}
+
+	/**
+	 * @return the workflowRunId
+	 */
+	public String getWorkflowRunId() {
+		return workflowRunId;
+	}
+
+	/**
+	 * @param workflowRunId
+	 *            the workflowRunId to set
+	 */
+	public void setWorkflowRunId(String workflowRunId) {
+		this.workflowRunId = workflowRunId;
+	}
+
+	/**
+	 * @return the processorName
+	 */
+	public String getProcessorName() {
+		return processorName;
+	}
+
+	/**
+	 * @param processorName
+	 *            the processorName to set
+	 */
+	public void setProcessorName(String processorName) {
+		this.processorName = processorName;
+	}
+
+	/**
+	 * @return the collIDRef
+	 */
+	public String getCollIDRef() {
+		return collIDRef;
+	}
+
+	/**
+	 * @param collIDRef
+	 *            the collIDRef to set
+	 */
+	public void setCollIDRef(String collIDRef) {
+		this.collIDRef = collIDRef;
+	}
+
+	/**
+	 * @return the iteration
+	 */
+	public String getIteration() {
+		return iteration;
+	}
+
+	/**
+	 * @param iterationVector
+	 *            the iteration to set
+	 */
+	public void setIteration(String iterationVector) {
+		this.iteration = iterationVector;
+	}
+
+	/**
+	 * @return the value
+	 */
+	public String getValue() {
+		return value;
+	}
+
+	/**
+	 * @param value
+	 *            the value to set
+	 */
+	public void setValue(String value) {
+		this.value = value;
+	}
+
+	/**
+	 * @return the ref
+	 */
+	public String getReference() {
+		return reference;
+	}
+
+	/**
+	 * @param ref
+	 *            the ref to set
+	 */
+	public void setReference(String ref) {
+		this.reference = ref;
+	}
+
+	/**
+	 * @return the resolvedValue
+	 */
+	public String getResolvedValue() {
+		return resolvedValue;
+	}
+
+	/**
+	 * @param resolvedValue
+	 *            the resolvedValue to set
+	 */
+	public void setResolvedValue(String resolvedValue) {
+		this.resolvedValue = resolvedValue;
+	}
+
+	/**
+	 * @return the workflowId
+	 */
+	public String getWorkflowId() {
+		return workflowId;
+	}
+
+	/**
+	 * @param workflowId
+	 *            the workflowId to set
+	 */
+	public void setWorkflowId(String workflowId) {
+		this.workflowId = workflowId;
+	}
+
+	public void setPortId(String portId) {
+		this.portId = portId;
+
+	}
+
+	public void setIsInputPort(boolean isInputPort) {
+		this.setInputPort(isInputPort);
+	}
+
+	public void setInputPort(boolean isInputPort) {
+		this.isInputPort = isInputPort;
+	}
+
+	public Boolean isInputPort() {
+		return isInputPort;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/ProcessorBinding.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/ProcessorBinding.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/ProcessorBinding.java
new file mode 100644
index 0000000..46a8565
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/ProcessorBinding.java
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.provenance.lineageservice.utils;
+
+/**
+ * @author Paolo Missier
+ * 
+ */
+public class ProcessorBinding {
+	private String identifier;
+
+	private String processorName;
+	private String workflowRunId;
+	private String workflowId;
+	private String firstActivityClassName;
+	private String iterationVector;
+
+	@Override
+	public String toString() {
+		return "ProcessorBinding [firstActivityClassName="
+				+ firstActivityClassName + ", identifier=" + identifier
+				+ ", iterationVector=" + iterationVector + ", processorName="
+				+ processorName + ", workflowId=" + workflowId
+				+ ", workflowRunId=" + workflowRunId + "]";
+	}
+
+	/**
+	 * @return the processorNameRef
+	 */
+	public String getProcessorName() {
+		return processorName;
+	}
+
+	/**
+	 * @param nameRef
+	 *            the processorNameRef to set
+	 */
+	public void setProcessorName(String processorNameRef) {
+		this.processorName = processorNameRef;
+	}
+
+	/**
+	 * @return the execIDRef
+	 */
+	public String getWorkflowRunId() {
+		return workflowRunId;
+	}
+
+	/**
+	 * @param workflowRunId
+	 *            the workflowRunId to set
+	 */
+	public void setWorkflowRunId(String workflowRunId) {
+		this.workflowRunId = workflowRunId;
+	}
+
+	/**
+	 * @return the actName
+	 */
+	public String getFirstActivityClassName() {
+		return firstActivityClassName;
+	}
+
+	/**
+	 * @param actName
+	 *            the actName to set
+	 */
+	public void setFirstActivityClassName(String actName) {
+		this.firstActivityClassName = actName;
+	}
+
+	/**
+	 * @return the iteration
+	 */
+	public String getIterationVector() {
+		return iterationVector;
+	}
+
+	/**
+	 * @param iterationVector
+	 *            the iteration to set
+	 */
+	public void setIterationVector(String iterationVector) {
+		this.iterationVector = iterationVector;
+	}
+
+	public void setIdentifier(String identifier) {
+		this.identifier = identifier;
+	}
+
+	public String getIdentifier() {
+		return identifier;
+	}
+
+	/**
+	 * @return the workflowId
+	 */
+	public String getWorkflowId() {
+		return workflowId;
+	}
+
+	/**
+	 * @param workflowId
+	 *            the workflowId to set
+	 */
+	public void setWorkflowId(String workflowId) {
+		this.workflowId = workflowId;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/ProcessorEnactment.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/ProcessorEnactment.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/ProcessorEnactment.java
new file mode 100644
index 0000000..fd59fdf
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/ProcessorEnactment.java
@@ -0,0 +1,151 @@
+package net.sf.taverna.t2.provenance.lineageservice.utils;
+
+import java.sql.Timestamp;
+
+public class ProcessorEnactment {
+	private Timestamp enactmentEnded;
+	private Timestamp enactmentStarted;
+	private String finalOutputsDataBindingId;
+	private String initialInputsDataBindingId;
+	private String iteration;
+	private String parentProcessorEnactmentId;
+	private String processEnactmentId;
+	private String processIdentifier;
+	private String processorId;
+	private String workflowRunId;
+
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		ProcessorEnactment other = (ProcessorEnactment) obj;
+		if (processEnactmentId == null) {
+			if (other.processEnactmentId != null)
+				return false;
+		} else if (!processEnactmentId.equals(other.processEnactmentId))
+			return false;
+		return true;
+	}
+
+	public Timestamp getEnactmentEnded() {
+		return enactmentEnded;
+	}
+
+	public Timestamp getEnactmentStarted() {
+		return enactmentStarted;
+	}
+
+	public String getFinalOutputsDataBindingId() {
+		return finalOutputsDataBindingId;
+	}
+
+	public String getInitialInputsDataBindingId() {
+		return initialInputsDataBindingId;
+	}
+
+	public String getIteration() {
+		return iteration;
+	}
+
+	public String getParentProcessorEnactmentId() {
+		return parentProcessorEnactmentId;
+	}
+
+	public String getProcessEnactmentId() {
+		return processEnactmentId;
+	}
+
+	public String getProcessIdentifier() {
+		return processIdentifier;
+	}
+
+	public String getProcessorId() {
+		return processorId;
+	}
+
+	public String getWorkflowRunId() {
+		return workflowRunId;
+	}
+
+	@Override
+	public int hashCode() {
+		final int prime = 31;
+		int result = 1;
+		result = prime
+				* result
+				+ ((processEnactmentId == null) ? 0 : processEnactmentId
+						.hashCode());
+		return result;
+	}
+
+	public void setEnactmentEnded(Timestamp enactmentEnded) {
+		this.enactmentEnded = enactmentEnded;
+	}
+
+	public void setEnactmentStarted(Timestamp enactmentStarted) {
+		this.enactmentStarted = enactmentStarted;
+	}
+
+	public void setFinalOutputsDataBindingId(String finalOutputsDataBindingId) {
+		this.finalOutputsDataBindingId = finalOutputsDataBindingId;
+	}
+
+	public void setInitialInputsDataBindingId(String initialInputsDataBindingId) {
+		this.initialInputsDataBindingId = initialInputsDataBindingId;
+	}
+
+	public void setIteration(String iteration) {
+		this.iteration = iteration;
+	}
+
+	public void setParentProcessorEnactmentId(String parentProcessorEnactmentId) {
+		this.parentProcessorEnactmentId = parentProcessorEnactmentId;
+	}
+
+	public void setProcessEnactmentId(String processEnactmentId) {
+		this.processEnactmentId = processEnactmentId;
+	}
+
+	public void setProcessIdentifier(String processIdentifier) {
+		this.processIdentifier = processIdentifier;
+	}
+
+	public void setProcessorId(String processorId) {
+		this.processorId = processorId;
+	}
+
+	public void setWorkflowRunId(String workflowRunId) {
+		this.workflowRunId = workflowRunId;
+	}
+
+	@Override
+	public String toString() {
+		StringBuilder builder = new StringBuilder();
+		builder.append("ProcessorEnactment [enactmentEnded=");
+		builder.append(enactmentEnded);
+		builder.append(", enactmentStarted=");
+		builder.append(enactmentStarted);
+		builder.append(", finalOutputs=");
+		builder.append(finalOutputsDataBindingId);
+		builder.append(", initialInputs=");
+		builder.append(initialInputsDataBindingId);
+		builder.append(", iteration=");
+		builder.append(iteration);
+		builder.append(", parentProcessEnactmentId=");
+		builder.append(parentProcessorEnactmentId);
+		builder.append(", processEnactmentId=");
+		builder.append(processEnactmentId);
+		builder.append(", processIdentifier=");
+		builder.append(processIdentifier);
+		builder.append(", processorId=");
+		builder.append(processorId);
+		builder.append(", workflowRunId=");
+		builder.append(workflowRunId);
+		builder.append("]");
+		return builder.toString();
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/ProvenanceProcessor.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/ProvenanceProcessor.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/ProvenanceProcessor.java
new file mode 100644
index 0000000..fb1a8fb
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/ProvenanceProcessor.java
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (C) 2007 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.provenance.lineageservice.utils;
+
+/**
+ * a Port that has no pName is either a WF input or output, depending on isInput
+ * 
+ * @author Paolo Missier
+ */
+public class ProvenanceProcessor {
+
+	public static final String DATAFLOW_ACTIVITY = "net.sf.taverna.t2.activities.dataflow.DataflowActivity";
+
+	private String identifier;
+	private String processorName;
+	private String workflowId;
+	private String firstActivityClassName;
+	private boolean isTopLevelProcessor;
+
+	public ProvenanceProcessor() {
+	}
+
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder();
+		sb.append("PROCESSOR: ****").append("\nworkflow: " + getWorkflowId())
+				.append("\nprocessor name: " + getProcessorName())
+				.append("\ntype: " + getFirstActivityClassName());
+
+		return sb.toString();
+	}
+
+	/**
+	 * @return the workflowId
+	 */
+	public String getWorkflowId() {
+		return workflowId;
+	}
+
+	/**
+	 * @param workflowId
+	 *            the workflowId to set
+	 */
+	public void setWorkflowId(String workflowId) {
+		this.workflowId = workflowId;
+	}
+
+	/**
+	 * @return The fully qualified classname for the first activity in this
+	 *         processor, or {@link #DATAFLOW_ACTIVITY} if this is a virtual
+	 *         processor representing the workflow itself.
+	 */
+	public String getFirstActivityClassName() {
+		return firstActivityClassName;
+	}
+
+	/**
+	 * @param firstActivityClassName
+	 *            The fully qualified classname for the first activity in this
+	 *            processor, or {@link #DATAFLOW_ACTIVITY} if this is a virtual
+	 *            processor representing the workflow itself.
+	 */
+	public void setFirstActivityClassName(String firstActivityClassName) {
+		this.firstActivityClassName = firstActivityClassName;
+	}
+
+	/**
+	 * @return the processorName
+	 */
+	public String getProcessorName() {
+		return processorName;
+	}
+
+	/**
+	 * @param processorName
+	 *            the processorName to set
+	 */
+	public void setProcessorName(String processorName) {
+		this.processorName = processorName;
+	}
+
+	public void setIdentifier(String identifier) {
+		this.identifier = identifier;
+	}
+
+	public String getIdentifier() {
+		return identifier;
+	}
+
+	public void setTopLevelProcessor(boolean isTopLevelProcessor) {
+		this.isTopLevelProcessor = isTopLevelProcessor;
+	}
+
+	public boolean isTopLevelProcessor() {
+		return isTopLevelProcessor;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/ProvenanceUtils.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/ProvenanceUtils.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/ProvenanceUtils.java
new file mode 100644
index 0000000..a36308a
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/ProvenanceUtils.java
@@ -0,0 +1,128 @@
+package net.sf.taverna.t2.provenance.lineageservice.utils;
+
+import static net.sf.taverna.t2.provenance.vocabulary.SharedVocabulary.INPUTDATA_EVENT_TYPE;
+
+import java.util.Set;
+import java.util.regex.Pattern;
+
+import net.sf.taverna.t2.provenance.item.DataProvenanceItem;
+import net.sf.taverna.t2.reference.ErrorDocument;
+import net.sf.taverna.t2.reference.ExternalReferenceSPI;
+import net.sf.taverna.t2.reference.IdentifiedList;
+import net.sf.taverna.t2.reference.ReferenceService;
+import net.sf.taverna.t2.reference.ReferenceSet;
+import net.sf.taverna.t2.reference.T2Reference;
+
+import org.jdom.Element;
+import org.tupeloproject.kernel.NotFoundException;
+
+public class ProvenanceUtils {
+	public static Pattern parentProcessPattern = Pattern.compile("^(.*):?[^:]+:[^:]+$");
+	
+	public static String iterationToString(int[] iteration) {
+		String result = "[";
+		for (int i = 0; i < iteration.length; i++) {
+			result += iteration[i];
+			if (i < (iteration.length - 1))
+				result += ",";
+		}
+		result += "]";
+		return result;
+	}
+	
+	/**
+	 * Returns an Element representing the data item, identfied as either input
+	 * or output. References to data are currently resolved to their actual
+	 * values
+	 */
+	public static Element getDataItemAsXML(DataProvenanceItem provenanceItem) {
+		String name;
+		if (provenanceItem.getEventType().equals(INPUTDATA_EVENT_TYPE)) {
+			name = "inputdata";
+		} else {
+			name = "outputdata";
+		}
+		Element result = new Element(name);
+		result.setAttribute("identifier", provenanceItem.getIdentifier());
+		result.setAttribute("processID", provenanceItem.getProcessId());
+		result.setAttribute("parent", provenanceItem.getParentId());
+		for (String port : provenanceItem.getDataMap().keySet()) {
+			Element portElement = new Element("port");
+			portElement.setAttribute("name", port);
+			portElement.setAttribute(
+					"depth",
+					Integer.toString(provenanceItem.getDataMap().get(port)
+							.getDepth()));
+			result.addContent(portElement);
+			portElement.addContent(resolveToElement(provenanceItem.getDataMap()
+					.get(port), provenanceItem.getReferenceService()));
+			Element element = new Element("some_stuff");
+			portElement.addContent(element);
+		}
+		return result;
+	}
+	
+	/**
+	 * Given a {@link T2Reference} return all the other {@link T2Reference}s
+	 * which it contains as an XML Element.
+	 * 
+	 * @param entityIdentifier
+	 * @return
+	 * @throws NotFoundException
+	 * @throws RetrievalException
+	 */
+	private static org.jdom.Element resolveToElement(T2Reference reference,
+			ReferenceService referenceService) {
+		Element element = new Element("resolvedReference");
+		switch (reference.getReferenceType()) {
+		case ErrorDocument:
+			ErrorDocument error = referenceService.getErrorDocumentService()
+					.getError(reference);
+
+			element.setName("error");
+			element.setAttribute("id", reference.toString());
+			Element messageElement = new Element("message");
+			messageElement.addContent(error.getExceptionMessage());
+			element.addContent(messageElement);
+			break;
+		case ReferenceSet:
+			element.setName("referenceSet");
+			element.setAttribute("id", reference.toString());
+			ReferenceSet referenceSet = referenceService
+					.getReferenceSetService().getReferenceSet(reference);
+			Set<ExternalReferenceSPI> externalReferences = referenceSet
+					.getExternalReferences();
+			for (ExternalReferenceSPI externalReference : externalReferences) {
+				// FIXME does this make sense? No!! Should get the actual value
+				// not what it is (TEXT etc)
+				Element refElement = new Element("reference");
+				refElement.addContent(externalReference.getDataNature()
+						.toString());
+				element.addContent(refElement);
+			}
+			break;
+		case IdentifiedList:
+			IdentifiedList<T2Reference> list = referenceService
+					.getListService().getList(reference);
+
+			element.setName("list");
+			element.setAttribute("id", reference.toString());
+			for (T2Reference ref : list)
+				element.addContent(resolveToElement(ref, referenceService));
+			break;
+		default:
+			// throw something (maybe a tantrum)
+		}
+		return element;
+	}
+
+	public static String parentProcess(String processId, int levels) {
+		if (levels < 1)
+			return processId;
+		int lastColon = processId.lastIndexOf(":");
+		if (lastColon == -1)
+			return null;
+		return parentProcess(processId.substring(0, lastColon), --levels);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/QueryPort.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/QueryPort.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/QueryPort.java
new file mode 100644
index 0000000..34b4f9b
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/QueryPort.java
@@ -0,0 +1,119 @@
+/**
+ * 
+ */
+package net.sf.taverna.t2.provenance.lineageservice.utils;
+
+/**
+ * @author Paolo Missier
+ *         <p/>
+ * 
+ */
+public class QueryPort {
+	private String workflowRunId;
+	private String workflowId;
+	private String processorName;
+	private String portName;
+	private String path;
+	private String value;
+
+	@Override
+	public String toString() {
+		StringBuilder sb = new StringBuilder();
+		sb.append("PORT: ****").append("\nworkflow: " + getWorkflowId())
+				.append("\nprocessor: " + getProcessorName())
+				.append("\nport: " + getPortName())
+				.append("\npath to value: " + getPath());
+
+		return sb.toString();
+	}
+
+	/**
+	 * @return the processorName
+	 */
+	public String getProcessorName() {
+		return processorName;
+	}
+
+	/**
+	 * @param processorName
+	 *            the processorName to set
+	 */
+	public void setProcessorName(String processorName) {
+		this.processorName = processorName;
+	}
+
+	/**
+	 * @return the vname
+	 */
+	public String getPortName() {
+		return portName;
+	}
+
+	/**
+	 * @param vname
+	 *            the vname to set
+	 */
+	public void setPortName(String vname) {
+		this.portName = vname;
+	}
+
+	/**
+	 * @return the path
+	 */
+	public String getPath() {
+		return path;
+	}
+
+	/**
+	 * @param path
+	 *            the path to set
+	 */
+	public void setPath(String path) {
+		this.path = path;
+	}
+
+	/**
+	 * @return the value
+	 */
+	public String getValue() {
+		return value;
+	}
+
+	/**
+	 * @param value
+	 *            the value to set
+	 */
+	public void setValue(String value) {
+		this.value = value;
+	}
+
+	/**
+	 * @return the workflowRunId
+	 */
+	public String getWorkflowRunId() {
+		return workflowRunId;
+	}
+
+	/**
+	 * @param workflowRunId
+	 *            the workflowRunId to set
+	 */
+	public void setWorkflowRunId(String workflowRunId) {
+		this.workflowRunId = workflowRunId;
+	}
+
+	/**
+	 * @return the workflowId
+	 */
+	public String getWorkflowId() {
+		return workflowId;
+	}
+
+	/**
+	 * @param workflowId
+	 *            the workflowId to set
+	 */
+	public void setWorkflowId(String workflowId) {
+		this.workflowId = workflowId;
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/ServiceInvocation.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/ServiceInvocation.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/ServiceInvocation.java
new file mode 100644
index 0000000..83de7ce
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/ServiceInvocation.java
@@ -0,0 +1,161 @@
+package net.sf.taverna.t2.provenance.lineageservice.utils;
+
+import java.sql.Timestamp;
+
+public class ServiceInvocation {
+	private ProcessorEnactment processorEnactment;
+	private String workflowRunId;
+	private long invocationNumber;
+	private Timestamp invocationStarted;
+	private Timestamp invocationEnded;
+	private DataBinding inputs;
+	private DataBinding outputs;
+	private String failureT2Reference;
+	private Activity activity;
+	private String initiatingDispatchLayer;
+	private String finalDispatchLayer;
+
+	public ProcessorEnactment getProcessorEnactment() {
+		return processorEnactment;
+	}
+
+	public void setProcessorEnactment(ProcessorEnactment processorEnactment) {
+		this.processorEnactment = processorEnactment;
+	}
+
+	public String getWorkflowRunId() {
+		return workflowRunId;
+	}
+
+	public void setWorkflowRunId(String workflowRunId) {
+		this.workflowRunId = workflowRunId;
+	}
+
+	public long getInvocationNumber() {
+		return invocationNumber;
+	}
+
+	public void setInvocationNumber(long invocationNumber) {
+		this.invocationNumber = invocationNumber;
+	}
+
+	public Timestamp getInvocationStarted() {
+		return invocationStarted;
+	}
+
+	public void setInvocationStarted(Timestamp invocationStarted) {
+		this.invocationStarted = invocationStarted;
+	}
+
+	public Timestamp getInvocationEnded() {
+		return invocationEnded;
+	}
+
+	public void setInvocationEnded(Timestamp invocationEnded) {
+		this.invocationEnded = invocationEnded;
+	}
+
+	public DataBinding getInputs() {
+		return inputs;
+	}
+
+	public void setInputs(DataBinding inputs) {
+		this.inputs = inputs;
+	}
+
+	public DataBinding getOutputs() {
+		return outputs;
+	}
+
+	public void setOutputs(DataBinding outputs) {
+		this.outputs = outputs;
+	}
+
+	public String getFailureT2Reference() {
+		return failureT2Reference;
+	}
+
+	public void setFailureT2Reference(String failureT2Reference) {
+		this.failureT2Reference = failureT2Reference;
+	}
+
+	public Activity getActivity() {
+		return activity;
+	}
+
+	public void setActivity(Activity activity) {
+		this.activity = activity;
+	}
+
+	public String getInitiatingDispatchLayer() {
+		return initiatingDispatchLayer;
+	}
+
+	public void setInitiatingDispatchLayer(String initiatingDispatchLayer) {
+		this.initiatingDispatchLayer = initiatingDispatchLayer;
+	}
+
+	public String getFinalDispatchLayer() {
+		return finalDispatchLayer;
+	}
+
+	public void setFinalDispatchLayer(String finalDispatchLayer) {
+		this.finalDispatchLayer = finalDispatchLayer;
+	}
+
+	@Override
+	public int hashCode() {
+		return 31
+				* (int) (invocationNumber ^ (invocationNumber >>> 32))
+				+ ((processorEnactment == null) ? 0 : processorEnactment
+						.hashCode());
+	}
+
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		ServiceInvocation other = (ServiceInvocation) obj;
+		if (invocationNumber != other.invocationNumber)
+			return false;
+		if (processorEnactment == null) {
+			if (other.processorEnactment != null)
+				return false;
+		} else if (!processorEnactment.equals(other.processorEnactment))
+			return false;
+		return true;
+	}
+
+	@Override
+	public String toString() {
+		StringBuilder builder = new StringBuilder();
+		builder.append("ServiceInvocation [activity=");
+		builder.append(activity);
+		builder.append(", failureT2Reference=");
+		builder.append(failureT2Reference);
+		builder.append(", finalDispatchLayer=");
+		builder.append(finalDispatchLayer);
+		builder.append(", initiatingDispatchLayer=");
+		builder.append(initiatingDispatchLayer);
+		builder.append(", inputs=");
+		builder.append(inputs);
+		builder.append(", invocationEnded=");
+		builder.append(invocationEnded);
+		builder.append(", invocationNumber=");
+		builder.append(invocationNumber);
+		builder.append(", invocationStarted=");
+		builder.append(invocationStarted);
+		builder.append(", outputs=");
+		builder.append(outputs);
+		builder.append(", processorEnactment=");
+		builder.append(processorEnactment);
+		builder.append(", workflowRunId=");
+		builder.append(workflowRunId);
+		builder.append("]");
+		return builder.toString();
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/Workflow.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/Workflow.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/Workflow.java
new file mode 100644
index 0000000..b1f75ef
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/Workflow.java
@@ -0,0 +1,37 @@
+package net.sf.taverna.t2.provenance.lineageservice.utils;
+
+public class Workflow {
+	private String workflowId;
+	private String parentWorkflowId;
+	private String externalName;
+	
+	public void setWorkflowId(String workflowId) {
+		this.workflowId = workflowId;
+	}
+
+	public String getWorkflowId() {
+		return workflowId;
+	}
+
+	public void setParentWorkflowId(String parentIdentifier) {
+		this.parentWorkflowId = parentIdentifier;
+	}
+
+	public String getParentWorkflowId() {
+		return parentWorkflowId;
+	}
+
+	/**
+	 * @return the externalName
+	 */
+	public String getExternalName() {
+		return externalName;
+	}
+
+	/**
+	 * @param externalName the externalName to set
+	 */
+	public void setExternalName(String externalName) {
+		this.externalName = externalName;
+	}	
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/WorkflowRun.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/WorkflowRun.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/WorkflowRun.java
new file mode 100644
index 0000000..8e5b25a
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/WorkflowRun.java
@@ -0,0 +1,72 @@
+package net.sf.taverna.t2.provenance.lineageservice.utils;
+
+import java.sql.Blob;
+
+public class WorkflowRun {
+	private String workflowRunId;
+	/**
+	 * this is the workflowId for the TOP LEVEL workflow for this run.
+	 * <p>
+	 * CHECK
+	 */
+	private String workflowId;
+	private String timestamp;
+	private String workflowExternalName;
+	private byte[] dataflowBlob;
+
+	public void setWorkflowId(String workflowIdentifier) {
+		this.workflowId = workflowIdentifier;
+	}
+
+	public String getWorkflowId() {
+		return workflowId;
+	}
+
+	public void setTimestamp(String timestamp) {
+		this.timestamp = timestamp;
+	}
+
+	public String getTimestamp() {
+		return timestamp;
+	}
+
+	/**
+	 * @return the workflowRunId
+	 */
+	public String getWorkflowRunId() {
+		return workflowRunId;
+	}
+
+	/**
+	 * @param workflowRunId the workflowRunId to set
+	 */
+	public void setWorkflowRunId(String workflowRunId) {
+		this.workflowRunId = workflowRunId;
+	}
+
+	/**
+	 * @return the workflowExternalName
+	 */
+	public String getWorkflowExternalName() {
+		return workflowExternalName;
+	}
+
+	/**
+	 * @param workflowExternalName the workflowExternalName to set
+	 */
+	public void setWorkflowExternalName(String workflowExternalName) {
+		this.workflowExternalName = workflowExternalName;
+	}
+	
+	/**
+	 * A {@link Blob} object representing the dataflow
+	 * @param bs
+	 */
+	public void setDataflowBlob(byte[] bs) {
+		this.dataflowBlob = bs;
+	}
+
+	public byte[] getDataflowBlob() {
+		return dataflowBlob;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/WorkflowTree.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/WorkflowTree.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/WorkflowTree.java
new file mode 100644
index 0000000..7db0259
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/lineageservice/utils/WorkflowTree.java
@@ -0,0 +1,73 @@
+/**
+ * 
+ */
+package net.sf.taverna.t2.provenance.lineageservice.utils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * a tree structure used to describe the nested static structure of a workflow
+ * as it is found in the provenance DB
+ * 
+ * @author Paolo Missier
+ */
+public class WorkflowTree {
+	private Workflow node;
+	private List<WorkflowTree> children = new ArrayList<>();
+
+	/**
+	 * @return the children
+	 */
+	public List<WorkflowTree> getChildren() {
+		return children;
+	}
+
+	/**
+	 * @param children
+	 *            the children to set
+	 */
+	public void setChildren(List<WorkflowTree> children) {
+		this.children = children;
+	}
+
+	/**
+	 * @return the node
+	 */
+	public Workflow getNode() {
+		return node;
+	}
+
+	/**
+	 * @param node
+	 *            the node to set
+	 */
+	public void setNode(Workflow node) {
+		this.node = node;
+	}
+
+	public void addChild(WorkflowTree childStructure) {
+		children.add(childStructure);
+	}
+
+	@Override
+	public String toString() {
+		return toString(new StringBuilder(), 0);
+	}
+
+	public String toString(int indent) {
+		return toString(new StringBuilder(), indent);
+	}
+
+	protected String toString(StringBuilder sb, int indent) {
+		sb.append(getNode().getExternalName() + "\n");
+		for (WorkflowTree tree : getChildren()) {
+			indent++;
+			for (int i = 1; i < indent; i++)
+				sb.append("-");
+			sb.append(tree.toString(indent));
+			indent--;
+		}
+		return sb.toString();
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/opm/OPMImporter.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/opm/OPMImporter.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/opm/OPMImporter.java
new file mode 100644
index 0000000..f491683
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/opm/OPMImporter.java
@@ -0,0 +1,541 @@
+/**
+ * 
+ */
+package net.sf.taverna.t2.provenance.opm;
+
+import java.io.File;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import net.sf.taverna.t2.provenance.lineageservice.ProvenanceWriter;
+import net.sf.taverna.t2.provenance.lineageservice.utils.Port;
+import net.sf.taverna.t2.provenance.lineageservice.utils.PortBinding;
+import net.sf.taverna.t2.provenance.lineageservice.utils.ProvenanceProcessor;
+
+import org.apache.log4j.Logger;
+import org.openprovenance.model.Account;
+import org.openprovenance.model.AccountRef;
+import org.openprovenance.model.Accounts;
+import org.openprovenance.model.Artifact;
+import org.openprovenance.model.ArtifactRef;
+import org.openprovenance.model.Artifacts;
+import org.openprovenance.model.Dependencies;
+import org.openprovenance.model.OPMDeserialiser;
+import org.openprovenance.model.OPMGraph;
+import org.openprovenance.model.Process;
+import org.openprovenance.model.ProcessRef;
+import org.openprovenance.model.Role;
+import org.openprovenance.model.Used;
+import org.openprovenance.model.WasControlledBy;
+import org.openprovenance.model.WasDerivedFrom;
+import org.openprovenance.model.WasGeneratedBy;
+import org.openprovenance.model.WasTriggeredBy;
+
+/**
+ * imports foreign XML-serialized OPM graphs into the native Taverna provenance
+ * DB, so they can be queried using
+ * {@link net.sf.taverna.t2.provenance.lineageservice.ProvenanceAnalysis}
+ * 
+ * @author paolo
+ */
+public class OPMImporter {
+	private static final String PROC_NAME = "P";
+	private static final String OPM_DEF_ACCOUNT = "OPMDefaultAccount";
+	private static Logger logger = Logger.getLogger(OPMImporter.class);
+
+	private ProvenanceWriter pw;
+	private OPMGraph graph;
+
+	// Maps Account names to Taverna workflows
+	private Map<String, String> accountToWorkflow = new HashMap<>();
+	private Map<String, String> workflowToInstance = new HashMap<>();
+
+	// maps workflowId --> (workflowId --> List(Port))
+	private Map<String, Map<String, List<Port>>> usedVarsByAccount = new HashMap<>();
+	private Map<String, Map<String, List<Port>>> wgbVarsByAccount = new HashMap<>();
+
+	// maps accountname --> (artifact -> List(Process))
+	private Map<String, Map<String, List<String>>> wgbArtifactsByAccount = new HashMap<>();
+
+	// maps accountname --> (artifact -> List(Process))
+	private Map<String, Map<String, List<String>>> usedArtifactsByAccount = new HashMap<>();
+
+	private int procNameCounter;
+
+	public OPMImporter(ProvenanceWriter pw) {
+		this.pw = pw;
+	}	
+
+	/**
+	 * orphan artifacts are those that are in the graph but are never used
+	 * neither generated. this indicates some problem with the graph structure.
+	 * this method is used for diagnostics after import has finished
+	 * 
+	 * @return
+	 */
+	public List<String> getOrphanArtifacts() {
+		List<String> allwgb  = new ArrayList<>();
+		List<String> allUsed = new ArrayList<>();
+		List<String> orphans = new ArrayList<>();
+
+		if (graph == null) {
+			logger.warn("null graph while attempting to count orphan artifacts -- giving up");
+			return orphans;
+		}
+
+		Artifacts allArtifacts = graph.getArtifacts();
+
+		for (Map.Entry<String, Map<String, List<String>>> entry : wgbArtifactsByAccount
+				.entrySet())
+			allwgb.addAll(entry.getValue().keySet());
+		for (Map.Entry<String, Map<String, List<String>>> entry : usedArtifactsByAccount
+				.entrySet())
+			allUsed.addAll(entry.getValue().keySet());
+
+		for (Artifact a : allArtifacts.getArtifact())
+			if (!allwgb.contains(a.getId()) && !allUsed.contains(a.getId()))
+				orphans.add(a.getId());
+		return orphans;
+	}
+
+	public void importGraph(String XMLOPMGraphFilename) throws Exception,
+			SQLException {
+		try {
+			logger.info("Importing OPM XML from file " + XMLOPMGraphFilename);
+
+			// deserialize an XML OPM graph from file
+			OPMDeserialiser deser = new OPMDeserialiser();
+			graph = deser.deserialiseOPMGraph(new File(XMLOPMGraphFilename));
+
+		} catch (Exception e) {
+			logger.fatal("exception while deserializing -- unable to continue");
+			logger.fatal(e.getMessage());
+			return;
+		}
+
+		logger.debug("XML graph deserialized");
+
+		/*
+		 * generates one pair <workflowId, workflowRun> for each account in the
+		 * graph
+		 */
+		try {
+			Accounts accounts = graph.getAccounts();
+
+			// use this global account alongside any other that may be defined in the graph
+			generateWFFromAccount(OPM_DEF_ACCOUNT);
+
+			if (accounts == null) {
+				logger.warn("this graph contains no accounts -- using only the default");
+			} else {
+				for (Account acc:accounts.getAccount())
+					// writes both workflow and instance into the DB, updates accountToWorkflow
+					generateWFFromAccount(acc.getId());
+			}
+		} catch (Exception e) {
+			logger.warn("exception while getting accounts for this graph");
+		}
+
+		// what have we got?
+		// retrieve all OPM relations from the graph		
+		Dependencies dependencies = graph.getDependencies();
+
+		/*
+		 * associates processes and ports to workflows and varbindings to
+		 * corresponding workflowRuns
+		 */
+		List<Object> allDeps = dependencies
+				.getUsedOrWasGeneratedByOrWasTriggeredBy();
+		// make sure these are processed in the right order: used, wgby, THEN wdf because this latter is derived from the first 2!
+		// so collect them into sets and process them separately
+
+		Set<WasGeneratedBy> wgbSet = new HashSet<>();
+		Set<Used> usedSet = new HashSet<>();
+		Set<WasDerivedFrom> wdfSet = new HashSet<>();
+		Set<WasControlledBy> wcbSet = new HashSet<>();
+		Set<WasTriggeredBy> wtbSet = new HashSet<>();
+
+		for (Object dep : allDeps) {
+			logger.info("dependency of type: " + dep.getClass().getName());
+
+			if (dep instanceof org.openprovenance.model.WasGeneratedBy)
+				wgbSet.add((WasGeneratedBy) dep);
+			else if (dep instanceof org.openprovenance.model.Used)
+				usedSet.add((Used) dep);
+			else if (dep instanceof org.openprovenance.model.WasDerivedFrom)
+				wdfSet.add((WasDerivedFrom) dep);
+			else if (dep instanceof org.openprovenance.model.WasControlledBy)
+				wcbSet.add((WasControlledBy) dep);
+			else if (dep instanceof org.openprovenance.model.WasTriggeredBy)
+				wtbSet.add((WasTriggeredBy) dep);
+		}
+
+		// process these in the correct order
+		for (WasGeneratedBy dep: wgbSet)
+			processWGBy(dep);
+
+		for (Used dep : usedSet)
+			processUsed(dep);
+
+		for (WasDerivedFrom dep : wdfSet)
+			processWDF(dep);
+
+		// we actually ignore the others... 
+
+		// *********
+		// complete the induced graph by building datalinks using the Artifact -> [Port] maps
+		// *********
+
+		List<String> accountNames = new ArrayList<>();
+
+		accountNames.add(OPM_DEF_ACCOUNT);
+
+		/* Disabled as allAccounts is never assigned to
+		if (allAccounts != null)  
+			for (Account acc:allAccounts) { accountNames.add(acc.getId()); }
+		*/
+
+		for (String acc : accountNames) {
+			String workflowId = accountToWorkflow.get(acc);
+
+			Map<String, List<Port>> usedVars = usedVarsByAccount
+					.get(workflowId);
+			Map<String, List<Port>> wgbVars = wgbVarsByAccount.get(workflowId);
+
+			if (usedVars == null || wgbVars == null)
+				continue;
+
+			// install an Datalink from each wgb var to each used var when the artifact is the same
+			for (Map.Entry<String, List<Port>> entry : wgbVars.entrySet()) {
+				// all Ports for this artifact get connected to all corresponding Ports in used
+				List<Port> sourceVars = entry.getValue();
+				List<Port> targetVars = usedVars.get(entry.getKey());
+
+				if (sourceVars == null || targetVars == null)
+					continue;
+
+				// create an datalink from each sourceVar to each targetVar
+				// note that we expect a single targetVar, but this is not guaranteed
+				for (Port sourceVar : sourceVars)
+					for (Port targetVar : targetVars)
+						pw.addDataLink(sourceVar, targetVar, workflowId);
+			}
+		}
+	}
+
+	private void generateWFFromAccount(String accName) throws SQLException {
+		String workflowId = accName + "-" + UUID.randomUUID().toString();
+		String workflowRun = accName + "-" + UUID.randomUUID().toString();
+
+		pw.addWFId(workflowId);
+		pw.addWorkflowRun(workflowId, workflowRun);
+		accountToWorkflow.put(accName, workflowId);
+		workflowToInstance.put(workflowId, workflowRun);
+
+		logger.info("generated workflowId " + workflowId + " and instance "
+				+ workflowRun + "  for account " + accName);
+	}
+
+	private Port processProcessArtifactDep(String procName, String value,
+			String portName, String workflowId, String workflowRun,
+			boolean artifactIsInput) {
+		// generate Process
+		ProvenanceProcessor proc = null;
+		try {
+			proc = pw.addProcessor(procName, workflowId, false);
+			logger.debug("added processor " + procName + " to workflow "
+					+ workflowId);
+		} catch (SQLException e) {
+			// no panic -- just catch duplicates
+			logger.warn(e.getMessage());
+			return null;
+		}
+
+		// generate Port
+		Port outputVar = new Port();
+		outputVar.setProcessorId(proc.getIdentifier());
+		outputVar.setProcessorName(procName);
+		outputVar.setWorkflowId(workflowId);
+		outputVar.setPortName(portName);
+		outputVar.setDepth(0);
+		outputVar.setInputPort(artifactIsInput); // wgby is an output var
+
+		List<Port> vars = new ArrayList<>(); // only one Port in the list
+		vars.add(outputVar);
+
+		try {
+			pw.addPorts(vars, workflowId);
+			logger.debug("added var "+portName+" to workflow "+workflowId);
+		} catch (SQLException e) {  // no panic -- just catch duplicates
+			logger.warn(e.getMessage());
+		}
+
+		// generate PortBindings (workflowRun, procName, portName, value)
+		PortBinding vb = new PortBinding();
+
+		vb.setWorkflowRunId(workflowRun);
+		vb.setProcessorName(procName);
+		vb.setPortName(portName);
+		vb.setValue(value);
+		vb.setIteration("[]");
+
+		try {
+			pw.addPortBinding(vb);
+			logger.debug("added var binding with value " + value
+					+ " to workflow instance " + workflowRun);
+		} catch (SQLException e) { // no panic -- just catch duplicates
+			logger.error("Failed to add var binding: " + e.getMessage());
+		}
+
+		return outputVar;
+	}
+
+	/**
+	 * generic processing of a process-artifact dependency
+	 * 
+	 * @param procID
+	 * @param artId
+	 * @param role
+	 * @param workflowId
+	 * @param workflowRun
+	 * @param artifactIsInput
+	 */
+	private Port processProcessArtifactDep(ProcessRef procID,
+			ArtifactRef artId, Role role, String workflowId,
+			String workflowRun, boolean artifactIsInput) {
+		String procName = ((Process) procID.getRef()).getId();
+		String portName = role.getValue();
+		String value = ((Artifact) artId.getRef()).getId();
+
+		portName = removeBlanks(portName);
+
+		return processProcessArtifactDep(procName, value, portName, workflowId,
+				workflowRun, artifactIsInput);
+	}
+
+	private String removeBlanks(String portName) {
+		return portName.replace(" ", "_");
+	}
+
+	/**
+	 * used(A,R,P,acc): generates a process for P, a Port for (P,R) an
+	 * <em>input</em> PortBinding for (P,R,A) <br/>
+	 * this is very similar to {@link #processWGBy(WasGeneratedBy)}
+	 * 
+	 * @param dep
+	 */
+	private void processUsed(Used dep) {
+		// Acc determines the scope -- this dep may belong to > 1 account, deal with all of them
+		List<AccountRef> accountIDs = dep.getAccount();
+		ProcessRef procID = dep.getEffect();
+		ArtifactRef artId = dep.getCause();
+		Role role = dep.getRole();
+
+		List<String> accNames = new ArrayList<String>();
+
+		for (AccountRef accId : accountIDs)
+			accNames.add(((Account) accId.getRef()).getId());
+
+		accNames.add(OPM_DEF_ACCOUNT);
+
+		for (String accName : accNames) {
+			String workflowId = accountToWorkflow.get(accName);
+			String workflowRun = workflowToInstance.get(workflowId);
+
+			Port v = processProcessArtifactDep(procID, artId, role, workflowId,
+					workflowRun, true); // true -> input var
+
+			// save the mapping from artifact to var for this account
+			Map<String, List<Port>> usedVars = usedVarsByAccount
+					.get(workflowId);
+			if (usedVars == null) {
+				usedVars = new HashMap<>();
+				usedVarsByAccount.put(workflowId, usedVars);
+			}
+			List<Port> vars = usedVars.get(((Artifact) artId.getRef()).getId());
+
+			if (vars == null) {
+				vars = new ArrayList<>();
+				usedVars.put(((Artifact) artId.getRef()).getId(), vars);
+			}
+			vars.add(v);
+
+			// record the fact that (procID used artId) within this account
+			Map<String, List<String>> usedArtifacts = usedArtifactsByAccount
+					.get(accName);
+			if (usedArtifacts == null) {
+				usedArtifacts = new HashMap<>();
+				usedArtifactsByAccount.put(accName, usedArtifacts);
+			}
+
+			String artifactName = ((Artifact) artId.getRef()).getId();
+			List<String> processes = usedArtifacts.get(artifactName);
+			if (processes == null) {
+				processes = new ArrayList<>();
+				usedArtifacts.put(artifactName, processes);
+			}
+			processes.add(((org.openprovenance.model.Process) procID.getRef())
+					.getId());
+		}
+	}
+
+	/**
+	 * wgb(A,R,P,Acc): generates a Process for P, a Port for (P,R), an
+	 * <em>output</em> PortBinding for (P,R,A) This is all relative to the
+	 * workflow corresponding to account Acc.
+	 * 
+	 * @param dep
+	 * @throws SQLException
+	 */
+	private void processWGBy(WasGeneratedBy dep)  {
+		// Acc determines the scope -- this dep may belong to > 1 account, deal with all of them
+		List<AccountRef> accountIDs = dep.getAccount();
+		ProcessRef procID = dep.getCause();
+		ArtifactRef artId = dep.getEffect();
+		Role role = dep.getRole();
+
+		List<String> accNames = new ArrayList<String>();
+		for (AccountRef accId : accountIDs)
+			accNames.add(((Account) accId.getRef()).getId());
+		accNames.add(OPM_DEF_ACCOUNT);
+
+		for (String accName : accNames) {
+			String workflowId = accountToWorkflow.get(accName);
+			String workflowRun = workflowToInstance.get(workflowId);
+
+			Port v = processProcessArtifactDep(procID, artId, role, workflowId,
+					workflowRun, false); // false -> output var
+
+			Map<String, List<Port>> wgbVars = wgbVarsByAccount.get(workflowId);
+			if (wgbVars == null) {
+				wgbVars = new HashMap<>();
+				wgbVarsByAccount.put(workflowId, wgbVars);
+			}
+
+			List<Port> vars = wgbVars.get(((Artifact) artId.getRef()).getId());
+			if (vars == null) {
+				vars = new ArrayList<>();
+				wgbVars.put(((Artifact) artId.getRef()).getId(), vars);
+			}
+			vars.add(v);
+
+			// record the fact that (artId wgby procID) within this account
+			Map<String, List<String>> wgbArtifacts = wgbArtifactsByAccount
+					.get(accName);
+			if (wgbArtifacts == null) {
+				wgbArtifacts = new HashMap<>();
+				wgbArtifactsByAccount.put(accName, wgbArtifacts);
+			}
+
+			String artifactName = ((Artifact) artId.getRef()).getId();
+			List<String> processes = wgbArtifacts.get(artifactName);
+			if (processes == null) {
+				processes = new ArrayList<>();
+				wgbArtifacts.put(artifactName, processes);
+			}
+			processes.add(((org.openprovenance.model.Process) procID.getRef())
+					.getId());
+		}
+	}
+
+	/**
+	 * this is a dep between two artifacts A1 and A2. In Taverna we need to
+	 * postulate the existence of a Process to mediate this dependency. <p/>
+	 * However, we only need to account for this dep if it cannot be inferred
+	 * from a combination of used and wgby that involve A1 and A2: if there
+	 * exists P s.t. A1 wgby P and P used A2, then this dep. is redundant in the
+	 * DB and we can safely ignore it. <p/>
+	 * note that this analysis is conducted regardless of the accounts in which
+	 * the wgby and used properties appear, as one account could be used
+	 * deliberately to This will unclutter the DB.
+	 * 
+	 * @param dep
+	 */
+	private void processWDF(WasDerivedFrom dep) {
+		List<AccountRef> accountIDs = dep.getAccount();
+		ArtifactRef fromArtId = dep.getCause();
+		ArtifactRef toArtId = dep.getEffect();
+
+		List<String> accNames = new ArrayList<>();
+		for (AccountRef accId : accountIDs)
+			accNames.add(((Account) accId.getRef()).getId());
+		accNames.add(OPM_DEF_ACCOUNT);
+
+		for (String accName:accNames) {
+			int varCounter = 0;
+
+			String workflowId = accountToWorkflow.get(accName);
+			String workflowRun = workflowToInstance.get(workflowId);
+
+			List<String> generatingProcesses = null, usingProcesses = null;
+
+			// look for any triple fromArtId wasGeneratedBy P within this account
+			Map<String, List<String>> wgbArtifacts = wgbArtifactsByAccount
+					.get(accName);
+
+			if (wgbArtifacts != null) {
+				String toArtifactName = ((Artifact) toArtId.getRef()).getId();
+				generatingProcesses = wgbArtifacts.get(toArtifactName);
+				if (generatingProcesses != null)
+					logger.debug("artifact " + toArtifactName
+							+ " wgby one or more processes...");
+			}
+
+			// look for any triple (P used toArtId) within this account
+
+			// get map for this account
+			Map<String, List<String>> usedArtifacts = usedArtifactsByAccount
+					.get(accName);
+
+			if (usedArtifacts != null) {
+				String fromArtifactName = ((Artifact) fromArtId.getRef())
+						.getId();
+				usingProcesses = usedArtifacts.get(fromArtifactName);
+				if (usingProcesses != null)
+					logger.debug("artifact " + fromArtifactName
+							+ " was used by one or more processes...");
+			}
+
+			if (generatingProcesses != null && usingProcesses != null)
+				for (String gp : generatingProcesses)
+					if (usingProcesses.contains(gp)) {
+						logger.debug("intersection between process sets not empty, this WDF is redundant");
+						return;
+					}
+
+			/* We only postulate a new process if the native one was not found */
+
+			String procName = PROC_NAME+"_"+procNameCounter++;
+
+			try {
+				pw.addProcessor(procName, workflowId, false);
+				logger.info("created non-native added processor " + procName
+						+ " to workflow " + workflowId);
+			} catch (SQLException e) {  // no panic -- just catch duplicates
+				logger.warn(e.getMessage());
+			}
+
+			// create a role for fromArtId from the procName
+			String inputPortName = procName + "_" + varCounter++;
+			String inputValue = ((Artifact) fromArtId.getRef()).getId();
+
+			// add to DB
+			processProcessArtifactDep(procName, inputValue, inputPortName,
+					workflowId, workflowRun, true);
+
+			// create a role for toArtId
+			String outputPortName = procName + "_" + varCounter++;
+			String outputValue = ((Artifact) toArtId.getRef()).getId();
+
+			// add to DB
+			processProcessArtifactDep(procName, outputValue, outputPortName,
+					workflowId, workflowRun, false);
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/opm/OPMManager.java
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/opm/OPMManager.java b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/opm/OPMManager.java
new file mode 100644
index 0000000..a82abdf
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/java/net/sf/taverna/t2/provenance/opm/OPMManager.java
@@ -0,0 +1,414 @@
+/**
+ * 
+ */
+package net.sf.taverna.t2.provenance.opm;
+
+import static org.tupeloproject.rdf.Resource.literal;
+import static org.tupeloproject.rdf.Resource.uriRef;
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.List;
+
+import net.sf.taverna.t2.provenance.lineageservice.URIGenerator;
+import net.sf.taverna.t2.provenance.lineageservice.utils.DataValueExtractor;
+
+import org.apache.log4j.Logger;
+import org.tupeloproject.kernel.Context;
+import org.tupeloproject.kernel.OperatorException;
+import org.tupeloproject.kernel.UnionContext;
+import org.tupeloproject.kernel.impl.MemoryContext;
+import org.tupeloproject.kernel.impl.ResourceContext;
+import org.tupeloproject.provenance.ProvenanceAccount;
+import org.tupeloproject.provenance.ProvenanceArtifact;
+import org.tupeloproject.provenance.ProvenanceException;
+import org.tupeloproject.provenance.ProvenanceGeneratedArc;
+import org.tupeloproject.provenance.ProvenanceProcess;
+import org.tupeloproject.provenance.ProvenanceRole;
+import org.tupeloproject.provenance.ProvenanceUsedArc;
+import org.tupeloproject.provenance.impl.ProvenanceContextFacade;
+import org.tupeloproject.rdf.Literal;
+import org.tupeloproject.rdf.Resource;
+import org.tupeloproject.rdf.xml.RdfXmlWriter;
+
+
+/**
+ * @author paolo
+ * 
+ */
+public class OPMManager {
+	private static Logger logger = Logger.getLogger(OPMManager.class);
+
+	public static final String OPM_TAVERNA_NAMESPACE = "http://ns.taverna.org.uk/2011/provenance/opm/";
+	private static final String VALUE_PROP = "value";
+
+	private ProvenanceContextFacade graph = null;
+	private Context context = null;
+
+	private ProvenanceAccount currentAccount = null;
+	private ProvenanceArtifact currentArtifact = null;
+	private ProvenanceRole currentRole = null;
+	private ProvenanceProcess currentProcess = null;
+
+	private boolean isActive = true;
+
+	public OPMManager() {
+		// init Tupelo RDF provenance graph
+		MemoryContext mc = new MemoryContext();
+		ResourceContext rc = new ResourceContext("http://example.org/data/",
+				"/provenanceExample/");
+		context = new UnionContext();
+		context.addChild(mc);
+		context.addChild(rc);
+
+		graph = new ProvenanceContextFacade(mc);
+	}
+
+	/**
+	 * default implementation of this method returns null -- has no idea how to
+	 * extract simple values from incoming artifact values
+	 * 
+	 * @return
+	 */
+	public List<DataValueExtractor> getDataValueExtractor() {
+		return null;
+	}
+
+	/**
+	 * create new account to hold the causality graph and give it a Resource
+	 * name
+	 * 
+	 * @param accountName
+	 * @throws ProvenanceException
+	 */
+	public void createAccount(String accountName) throws ProvenanceException {
+		currentAccount = graph.newAccount("OPM-" + accountName,
+				uriRef(uriGenerator.makeRunUri(accountName)));
+		graph.assertAccount(currentAccount);
+	}
+
+	/**
+	 * @param aName
+	 * @param aValue
+	 *            actual value can be used optionally as part of a separate
+	 *            triple. Whether this is used or not depends on the settings,
+	 *            see {@link OPMManager.addValueTriple}. This also sets the
+	 *            currentArtifact to the newly created artifact
+	 * @throws ProvenanceException
+	 */
+	public void addArtifact(String aName, Object aValue)
+			throws ProvenanceException {
+		Resource r = addArtifact(aName);
+
+		if (aValue == null) {
+			logger.debug("OPMManager::addArtifact: aValue for [" + aName
+					+ "] is NULL");
+			return;
+		}
+
+		logger.debug("OPMManager::addArtifact: aValue is NOT NULL");
+
+		// if we have a valid DataValueExtractor, use it here
+		List<DataValueExtractor> dveList;
+		String extractedValue = (String) aValue;  // default is same value
+		dveList = getDataValueExtractor();
+		if (dveList != null)
+			// try all available extractors... UGLY but data comes with NO TYPE at all!
+			for (DataValueExtractor dve : dveList)
+				try {
+					logger.debug("OPMManager::addArtifact: trying extractor "
+							+ dve.getClass().getName());
+					extractedValue = dve.extractString(aValue);
+					logger.debug("OPMManager::addArtifact: - extracted value = "
+							+ extractedValue);
+					break; // extractor worked
+				} catch (Exception e) {
+					// no panic, reset value and try another extractor
+					logger.warn("OPMManager::addArtifact: extractor failed");
+					extractedValue = (String) aValue;
+				}
+
+		logger.debug("OPMManager::addArtifact: using value " + extractedValue);
+		try {
+			Literal lValue = literal(extractedValue);
+			context.addTriple(r, uriRef(OPM_TAVERNA_NAMESPACE + VALUE_PROP),
+					lValue);
+		} catch (OperatorException e) {
+			logger.warn("OPM iteration triple creation exception", e);
+		}
+	}
+
+	/**
+	 * no actual value is recorded
+	 * 
+	 * @param aName
+	 * @return
+	 * @throws ProvenanceException
+	 */
+	public Resource addArtifact(String aName) throws ProvenanceException {
+		String artID = null;
+		// make sure artifact name is a good URI
+		try {
+			URI artURI = new URI(aName);
+			if (artURI.getScheme() != null) {
+				if (artURI.getScheme().equals("t2"))
+					artID = uriGenerator.makeT2ReferenceURI(aName);
+				else
+					artID = aName;
+			}
+		} catch (URISyntaxException e1) {
+			// generate later
+		}
+		if (artID == null)
+			artID = OPM_TAVERNA_NAMESPACE + "artifact/"
+					+ uriGenerator.escape(aName);
+
+		Resource r = uriRef(artID);
+		currentArtifact = graph.newArtifact(artID, r);
+		graph.assertArtifact(currentArtifact);
+		return r;
+	}
+
+	public void createRole(String workflowRunId, String workflowId,
+			String processorName, String iteration) {
+		String aRole = uriGenerator.makeIteration(workflowRunId, workflowId,
+				processorName, iteration);
+		Resource r = Resource.uriRef(aRole);
+		currentRole = graph.newRole(aRole, r);
+	}
+
+	private URIGenerator uriGenerator = new URIGenerator();
+
+	public void addProcess(String processorName, String iterationVector,
+			String workflowId, String workflowRunId) throws ProvenanceException {
+		String processID;
+
+		/*
+		 * PM added 5/09 -- a process name may already be a URI -- this happens
+		 * for example when we export back OPM after importing a workflow from
+		 * our own OPM... in this case, do not pre-pend a new URI scheme
+		 */
+		try {
+			URI procURI = new URI(processorName);
+
+			if (procURI.getAuthority() == null) {
+				processID = uriGenerator.makeProcessorURI(processorName, workflowId);
+			} else {
+				processID = processorName;
+			}
+		} catch (URISyntaxException e1) {
+			processID = uriGenerator.makeProcessorURI(processorName, workflowId);
+		}
+		
+		uriGenerator.makeIteration(workflowRunId, workflowId, processorName,
+				iterationVector);
+
+		Resource processResource = uriRef(processID);
+		currentProcess = graph.newProcess(processID, processResource);
+		graph.assertProcess(currentProcess);
+
+		/*
+		 * add a triple to specify the iteration vector for this occurrence of
+		 * Process, if it is available
+		 */
+		try {
+			if (! iterationVector.equals("[]"))
+				// Resource inputProcessSubject = ((RdfProvenanceProcess) process).getSubject();
+				context.addTriple(processResource, uriRef(OPM_TAVERNA_NAMESPACE
+						+ "iteration"), iterationVector);
+		} catch (OperatorException e) {
+			logger.warn("OPM iteration triple creation exception", e);
+		}
+	}
+
+	public void assertGeneratedBy(ProvenanceArtifact artifact,
+			ProvenanceProcess process, ProvenanceRole role,
+			ProvenanceAccount account, boolean noDuplicates)
+			throws ProvenanceException {
+		boolean found = false;
+		if (noDuplicates && artifact != null)
+			for (ProvenanceGeneratedArc datalink : graph
+					.getGeneratedBy(artifact)) {
+				ProvenanceProcess pp = datalink.getProcess();
+				if (pp.getName().equals(process.getName())) {
+					found = true;
+					break;
+				}
+			}
+
+		if (!noDuplicates || (noDuplicates && !found) && artifact != null)
+			graph.assertGeneratedBy(artifact, process, role, account);
+	}
+
+	public void assertUsed(ProvenanceArtifact artifact,
+			ProvenanceProcess process, ProvenanceRole role,
+			ProvenanceAccount account, boolean noDuplicates)
+			throws ProvenanceException {
+		boolean found = false;
+
+		if (noDuplicates)
+			for (ProvenanceUsedArc datalink : graph.getUsed(process)) {
+				ProvenanceArtifact pa = datalink.getArtifact();
+				if (pa.getName().equals(artifact.getName())) {
+					found = true;
+					break;
+				}
+			}
+
+		if (!noDuplicates || (noDuplicates && !found))
+			graph.assertUsed(process, artifact, role, account);
+	}
+
+	public ProvenanceContextFacade getGraph() {
+		return graph;
+	}
+
+	/**
+	 * @return the account
+	 */
+	public ProvenanceAccount getAccount() {
+		return currentAccount;
+	}
+
+	/**
+	 * @param account
+	 *            the account to set
+	 */
+	public void setAccount(ProvenanceAccount account) {
+		this.currentAccount = account;
+	}
+
+	/**
+	 * @return the currentRole
+	 */
+	public ProvenanceRole getCurrentRole() {
+		return currentRole;
+	}
+
+	/**
+	 * @param currentRole
+	 *            the currentRole to set
+	 */
+	public void setCurrentRole(ProvenanceRole currentRole) {
+		this.currentRole = currentRole;
+	}
+
+	/**
+	 * @return the currentArtifact
+	 */
+	public ProvenanceArtifact getCurrentArtifact() {
+		return currentArtifact;
+	}
+
+	/**
+	 * @param currentArtifact
+	 *            the currentArtifact to set
+	 */
+	public void setCurrentArtifact(ProvenanceArtifact currentArtifact) {
+		this.currentArtifact = currentArtifact;
+	}
+
+	/**
+	 * @return the currentAccount
+	 */
+	public ProvenanceAccount getCurrentAccount() {
+		return currentAccount;
+	}
+
+	/**
+	 * @param currentAccount
+	 *            the currentAccount to set
+	 */
+	public void setCurrentAccount(ProvenanceAccount currentAccount) {
+		this.currentAccount = currentAccount;
+	}
+
+	/**
+	 * @return the currentProcess
+	 */
+	public ProvenanceProcess getCurrentProcess() {
+		return currentProcess;
+	}
+
+	/**
+	 * @param currentProcess
+	 *            the currentProcess to set
+	 */
+	public void setCurrentProcess(ProvenanceProcess currentProcess) {
+		this.currentProcess = currentProcess;
+	}
+
+	public String writeGraph() {
+		// print out OPM graph in RDF/XML form
+		try {
+			StringWriter sw = new StringWriter();
+			new RdfXmlWriter().write(context.getTriples(), sw);
+			return sw.toString();
+		} catch (OperatorException | IOException e) {
+			logger.error("Could not write graph", e);
+		}
+		return null;
+	}
+
+	/**
+	 * IN THE RELEASE WE DO NOT SUPPORT XML -- ONE CAN CONVERT THE RDF TO XML OUT-OF-BAND
+	 * simply invokes the org.openprovenance for converting an RDF OPM graph to an XML OPM graph
+	 * @return a hard-coded filename for the converted XML OPM graph
+	 * @throws OperatorException
+	 * @throws IOException
+	 * @throws JAXBException
+	 */
+//	public String Rdf2Xml() throws OperatorException, IOException, JAXBException {
+//
+//		OPMRdf2Xml converter = new OPMRdf2Xml();
+//		converter.convert(OPM_RDF_GRAPH_FILE, OPM_XML_GRAPH_FILE);		
+//		return OPM_XML_GRAPH_FILE;
+//	}
+
+	/**
+	 * creates a dot file from the current OPMGraph. <br/>
+	 * DOT NOT USE NEEDS FIXING
+	 * @return
+	 * @throws IOException 
+	 * @throws OperatorException 
+	 */
+	/*
+	public String Rdf2Dot() throws OperatorException, IOException {
+
+		OPMRdf2Xml converter = new OPMRdf2Xml();
+		OPMGraph graph = converter.convert(OPM_RDF_GRAPH_FILE);
+
+		List<Process> processes = graph.getProcesses().getProcess();		
+		for (Process p:processes) { p.setId("\""+p.getId()+"\""); }
+
+		List<Artifact> artifacts = graph.getArtifacts().getArtifact();		
+		for (Artifact a:artifacts) { a.setId("\""+a.getId()+"\""); }
+
+//		OPMToDot aOPMToDot = new OPMToDot(DOT_CONFIG_FILE);  		
+		OPMToDot aOPMToDot = new OPMToDot();  		
+
+		aOPMToDot.convert(graph, new File(OPM_DOT_FILE));
+		return OPM_DOT_FILE;
+
+	}
+
+    */
+
+	/**
+	 * @param graph
+	 *            the graph to set
+	 */
+	public void setGraph(ProvenanceContextFacade graph) {
+		this.graph = graph;
+	}
+
+	public void setActive(boolean active) {
+		isActive = active;
+	}
+
+	public boolean isActive() {
+		return isActive;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/resources/META-INF/spring/provenance-connector-context.xml
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/resources/META-INF/spring/provenance-connector-context.xml b/taverna-provenanceconnector/src/main/resources/META-INF/spring/provenance-connector-context.xml
new file mode 100644
index 0000000..2a4b3c0
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/resources/META-INF/spring/provenance-connector-context.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:osgi="http://www.springframework.org/schema/osgi"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans.xsd
+                      http://www.springframework.org/schema/osgi
+                      http://www.springframework.org/schema/osgi/spring-osgi.xsd">
+
+	<bean id="ProvenanceAccess" class="net.sf.taverna.t2.provenance.api.ProvenanceAccess">
+		<property name="referenceService" ref="referenceService" />
+		<property name="provenanceConnector" ref="provenanceConnector" />
+	</bean>
+
+	<osgi:service ref="ProvenanceAccess" interface="net.sf.taverna.t2.provenance.Provenance"/>
+
+	<osgi:reference id="referenceService" interface="net.sf.taverna.t2.reference.ReferenceService"/>
+	<osgi:reference id="provenanceConnector" interface="net.sf.taverna.t2.provenance.reporter.ProvenanceReporter"/>
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-provenanceconnector/src/main/resources/janus.owl
----------------------------------------------------------------------
diff --git a/taverna-provenanceconnector/src/main/resources/janus.owl b/taverna-provenanceconnector/src/main/resources/janus.owl
new file mode 100644
index 0000000..1017574
--- /dev/null
+++ b/taverna-provenanceconnector/src/main/resources/janus.owl
@@ -0,0 +1 @@
+/Users/paolo/Dropbox/Janus/janus.owl
\ No newline at end of file


[40/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/resources/t2flow/FetchTodaysXkcdComic.t2flow
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/resources/t2flow/FetchTodaysXkcdComic.t2flow b/taverna-integration-tests/src/test/resources/t2flow/FetchTodaysXkcdComic.t2flow
new file mode 100644
index 0000000..4aeef6f
--- /dev/null
+++ b/taverna-integration-tests/src/test/resources/t2flow/FetchTodaysXkcdComic.t2flow
@@ -0,0 +1,343 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3.0"><dataflow id="24e3ca77-bca1-47a6-8f5e-0549801eb27e" role="top"><name>Fetch_today_s_xkcd_comic</name><inputPorts /><outputPorts><port><name>todaysXkcd</name><annotations /></port></outputPorts><processors><processor><name>getPage</name><inputPorts><port><name>url</name><depth>0</depth></port></inputPorts><outputPorts><port><name>contents</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivity</class><inputMap><map from="url" to="url" /></inputMap><outputMap><map from="contents" to="contents" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>url</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/x-taverna-web-url'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>base</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/x-taverna-web-url'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>contents</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain,text/html'</string>
+      </mimeTypes>
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>URL inputURL = null;
+if (base != void) {
+  inputURL = new URL(new URL(base), url);
+}
+else {
+  inputURL = new URL(url);
+}
+URLConnection con = inputURL.openConnection();
+InputStream in = con.getInputStream();
+
+InputStreamReader isr = new InputStreamReader(in);
+Reader inReader = new BufferedReader(isr);
+
+StringBuffer buf = new StringBuffer();
+int ch;
+while ((ch = inReader.read()) &gt; -1) {
+  buf.append((char)ch);
+}
+inReader.close();
+contents = buf.toString();
+
+
+//String NEWLINE = System.getProperty("line.separator");
+//
+//URL inputURL = null;
+//if (base != void) {
+//	inputURL = new URL(new URL(base), url);
+//} else {
+//	inputURL = new URL(url);
+//}
+//StringBuffer result = new StringBuffer();
+//BufferedReader reader = new BufferedReader(new InputStreamReader(inputURL.openStream()));
+//String line = null;
+//while ((line = reader.readLine()) != null) {
+//	result.append(line);
+//	result.append(NEWLINE);
+//}
+//
+//contents = result.toString();
+</script>
+  <dependencies />
+  <localworkerName>org.embl.ebi.escience.scuflworkers.java.WebPageFetcher</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="url" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>xkcdURL</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" to="value" />
 </outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>http://xkcd.com/</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>getImageLinks</name><inputPorts><port><name>document</name><depth>0</depth></port></inputPorts><outputPorts><port><name>imagelinks</name><depth>1</depth><granularDepth>1</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivity</class><inputMap><map from="document" to="document"
  /></inputMap><outputMap><map from="imagelinks" to="imagelinks" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>document</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/html'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>imagelinks</name>
+      <depth>1</depth>
+      <mimeTypes>
+        <string>l('text/x-taverna-web-url')</string>
+      </mimeTypes>
+      <granularDepth>1</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>String lowerCaseContent = document.toLowerCase();
+int index = 0;
+List imagelinks = new ArrayList();
+while ((index = lowerCaseContent.indexOf("&lt;img", index)) != -1) {
+	if ((index = lowerCaseContent.indexOf("src", index)) == -1)
+		break;
+	if ((index = lowerCaseContent.indexOf("=", index)) == -1)
+		break;
+	index++;
+	String remaining = document.substring(index);
+	StringTokenizer st = new StringTokenizer(remaining, "\t\n\r\"&gt;#");
+	String strLink = st.nextToken();
+	imagelinks.add(strLink);
+}
+
+</script>
+  <dependencies />
+  <localworkerName>org.embl.ebi.escience.scuflworkers.java.ExtractImageLinks</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="document" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>findComicURL</name><inputPorts><port><name>regex</name><depth>0</depth></port><port><name>stringlist</name><depth>1</depth></port></inputPorts><outputPorts><port><name>filteredlist</name><depth>1</depth><granularDepth>1</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.
 sf.taverna.t2.activities.localworker.LocalworkerActivity</class><inputMap><map from="regex" to="regex" /><map from="stringlist" to="stringlist" /></inputMap><outputMap><map from="filteredlist" to="filteredlist" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>stringlist</name>
+      <depth>1</depth>
+      <mimeTypes>
+        <string>l('text/plain')</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>regex</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>filteredlist</name>
+      <depth>1</depth>
+      <mimeTypes>
+        <string>l('text/plain')</string>
+      </mimeTypes>
+      <granularDepth>1</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>filteredlist = new ArrayList();
+for (Iterator i = stringlist.iterator(); i.hasNext();) {
+	String item = (String) i.next();
+	if (item.matches(regex)) {
+		filteredlist.add(item);
+	}
+}
+</script>
+  <dependencies />
+  <localworkerName>org.embl.ebi.escience.scuflworkers.java.FilterStringList</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="regex" depth="0" /><port name="stringlist" depth="1" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>comicURLRegex</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap 
 /><outputMap><map from="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>.*/comics/.*</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>getComicStrip</name><inputPorts><port><name>base</name><depth>0</depth></port><port><name>url</name><depth>0</depth></port></inputPorts><outputPorts><port><name>image</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivity</class><inputMa
 p><map from="base" to="base" /><map from="url" to="url" /></inputMap><outputMap><map from="image" to="image" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>url</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/x-taverna-web-url'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>base</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/x-taverna-web-url'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>image</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'image/*'</string>
+      </mimeTypes>
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>URL inputURL = null;
+if (base != void) {
+	inputURL = new URL(new URL(base), url);
+} else {
+	inputURL = new URL(url);
+}
+
+byte[] contents;
+if (inputURL.openConnection().getContentLength() == -1) {
+	// Content size unknown, must read first...
+	byte[] buffer = new byte[1024];
+	int bytesRead = 0;
+	int totalBytesRead = 0;
+	InputStream is = inputURL.openStream();
+	while (bytesRead != -1) {
+		totalBytesRead += bytesRead;
+		bytesRead = is.read(buffer, 0, 1024);
+	}
+	contents = new byte[totalBytesRead];
+} else {
+	contents = new byte[inputURL.openConnection().getContentLength()];
+}
+int bytesRead = 0;
+int totalBytesRead = 0;
+InputStream is = inputURL.openStream();
+while (bytesRead != -1) {
+	bytesRead = is.read(contents, totalBytesRead, contents.length - totalBytesRead);
+	totalBytesRead += bytesRead;
+	if (contents.length==totalBytesRead) break;
+}
+
+image = contents;
+</script>
+  <dependencies />
+  <localworkerName>org.embl.ebi.escience.scuflworkers.java.WebImageFetcher</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="base" depth="0" /><port name="url" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>getPage</processor><port>url</port></sink><source type="processor"><processor>xkcdURL</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>getImageLinks</processor><port>document</port></sink><source type="processor"><processor>getPage</processor><port>contents</port></source></datalink><datali
 nk><sink type="processor"><processor>findComicURL</processor><port>regex</port></sink><source type="processor"><processor>comicURLRegex</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>findComicURL</processor><port>stringlist</port></sink><source type="processor"><processor>getImageLinks</processor><port>imagelinks</port></source></datalink><datalink><sink type="processor"><processor>getComicStrip</processor><port>base</port></sink><source type="processor"><processor>xkcdURL</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>getComicStrip</processor><port>url</port></sink><source type="processor"><processor>findComicURL</processor><port>filteredlist</port></source></datalink><datalink><sink type="dataflow"><port>todaysXkcd</port></sink><source type="processor"><processor>getComicStrip</processor><port>image</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream">
 <net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>24e3ca77-bca1-47a6-8f5e-0549801eb27e</identification>
+      </annotationBean>
+      <date>2011-07-12 14:11:15.348 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.DescriptiveTitle">
+        <text>Fetch today's xkcd comic</text>
+      </annotationBean>
+      <date>2009-12-15 20:39:06.623 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>8b032490-948e-4983-b632-d16653755fcd</identification>
+      </annotationBean>
+      <date>2010-07-04 18:16:02.491 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.FreeTextDescription">
+        <text>Use the local services and some filtering operations to fetch the comic strip image from http://xkcd.com/
+
+Based on the FetchDailyDilbert workflow.</text>
+      </annotationBean>
+      <date>2011-07-12 14:11:12.608 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.Author">
+        <text>Tom Oinn, Stian Soiland-Reyes</text>
+      </annotationBean>
+      <date>2009-12-15 20:38:58.43 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain></annotations></dataflow></workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-integration-tests/src/test/resources/t2flow/GBSeqTest.t2flow
----------------------------------------------------------------------
diff --git a/taverna-integration-tests/src/test/resources/t2flow/GBSeqTest.t2flow b/taverna-integration-tests/src/test/resources/t2flow/GBSeqTest.t2flow
new file mode 100644
index 0000000..196a4bc
--- /dev/null
+++ b/taverna-integration-tests/src/test/resources/t2flow/GBSeqTest.t2flow
@@ -0,0 +1,518 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3.0"><dataflow id="c00b121a-0114-471a-bd29-03597414879c" role="top"><name>GBSeq_test</name><inputPorts /><outputPorts><port><name>nuc_fasta</name><annotations /></port><port><name>nuc_xml</name><annotations /></port><port><name>nuc_insd</name><annotations /></port><port><name>nuc_tiny</name><annotations /></port><port><name>prot_fasta</name><annotations /></port><port><name>protein_xml</name><annotations /></port><port><name>prot_insd</name><annotations /></port><port><name>prot_tiny</name><annotations /></port></outputPorts><processors><processor><name>nuc_id</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.stringconstant.St
 ringConstantActivity</class><inputMap /><outputMap><map from="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>NM_000059</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>protein_id</name><inputPorts /><outputPorts><port><name>value</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>stringconstant-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.stringconstant.StringConstantActivity</class><inputMap /><outputMap><map from="value" to="value" /></outputMap><configBean encoding="xstream"><net.sf
 .taverna.t2.activities.stringconstant.StringConstantConfigurationBean xmlns="">
+  <value>NP_000050</value>
+</net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy /></iteration></iterationStrategyStack></processor><processor><name>Get_Nucleotide_INSDSeq_XML</name><inputPorts><port><name>id</name><depth>0</depth></port></inputPorts><outputPorts><port><name>outputText</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivity</class><inputMap><map from="id" to="id" /></
 inputMap><outputMap><map from="outputText" to="outputText" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>id</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>outputText</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>if ((id == void) || (id == null) || id.equals("")) {
+	throw new RunTimeException("port id must have a non-empty value");
+}
+
+URL url = new URL ("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?rettype=gbc&amp;db=nucleotide&amp;retmode=xml&amp;id=" + id);
+
+BufferedReader reader = new BufferedReader (new InputStreamReader(url.openStream()));
+StringWriter writer = new StringWriter();
+
+char[] buffer = new char[1024];
+    while (true) {
+        int r = reader.read(buffer);
+        if (r &lt;= 0) {
+            break;
+        }
+        writer.write(buffer, 0, r);
+    }
+outputText = writer.toString();
+</script>
+  <dependencies />
+  <localworkerName>net.sourceforge.taverna.scuflworkers.ncbi.NucleotideINSDSeqXMLWorker</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="id" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>Get_Nucleotide_FASTA</name><inputPorts><port><name>id</name><depth>0</depth></port></inputPorts><outputPorts><port><name>outputText</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivit
 y</class><inputMap><map from="id" to="id" /></inputMap><outputMap><map from="outputText" to="outputText" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>id</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>outputText</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>if ((id == void) || (id == null) || id.equals("")) {
+	throw new RunTimeException("port id must have a non-empty value");
+}
+
+URL url = new URL ("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?rettype=fasta&amp;db=nucleotide&amp;retmode=text&amp;id=" + id);
+
+BufferedReader reader = new BufferedReader (new InputStreamReader(url.openStream()));
+StringWriter writer = new StringWriter();
+
+char[] buffer = new char[1024];
+    while (true) {
+        int r = reader.read(buffer);
+        if (r &lt;= 0) {
+            break;
+        }
+        writer.write(buffer, 0, r);
+    }
+outputText = writer.toString();
+</script>
+  <dependencies />
+  <localworkerName>net.sourceforge.taverna.scuflworkers.ncbi.NucleotideFastaWorker</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="id" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>Get_Nucleotide_GBSeq_XML</name><inputPorts><port><name>id</name><depth>0</depth></port></inputPorts><outputPorts><port><name>outputText</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerAct
 ivity</class><inputMap><map from="id" to="id" /></inputMap><outputMap><map from="outputText" to="outputText" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>id</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>outputText</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>if ((id == void) || (id == null) || id.equals("")) {
+	throw new RunTimeException("port id must have a non-empty value");
+}
+
+URL url = new URL ("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?rettype=gb&amp;db=nucleotide&amp;retmode=xml&amp;id=" + id);
+
+BufferedReader reader = new BufferedReader (new InputStreamReader(url.openStream()));
+StringWriter writer = new StringWriter();
+
+char[] buffer = new char[1024];
+    while (true) {
+        int r = reader.read(buffer);
+        if (r &lt;= 0) {
+            break;
+        }
+        writer.write(buffer, 0, r);
+    }
+outputText = writer.toString();
+</script>
+  <dependencies />
+  <localworkerName>net.sourceforge.taverna.scuflworkers.ncbi.NucleotideGBSeqWorker</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="id" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>Get_Nucleotide_TinySeq_XML</name><inputPorts><port><name>id</name><depth>0</depth></port></inputPorts><outputPorts><port><name>outputText</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerA
 ctivity</class><inputMap><map from="id" to="id" /></inputMap><outputMap><map from="outputText" to="outputText" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>id</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>outputText</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>if ((id == void) || (id == null) || id.equals("")) {
+	throw new RunTimeException("port id must have a non-empty value");
+}
+
+URL url = new URL ("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?rettype=fasta&amp;db=nucleotide&amp;retmode=xml&amp;id=" + id);
+
+BufferedReader reader = new BufferedReader (new InputStreamReader(url.openStream()));
+StringWriter writer = new StringWriter();
+
+char[] buffer = new char[1024];
+    while (true) {
+        int r = reader.read(buffer);
+        if (r &lt;= 0) {
+            break;
+        }
+        writer.write(buffer, 0, r);
+    }
+outputText = writer.toString();
+</script>
+  <dependencies />
+  <localworkerName>net.sourceforge.taverna.scuflworkers.ncbi.NucleotideTinySeqXMLWorker</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="id" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>Get_Protein_FASTA</name><inputPorts><port><name>id</name><depth>0</depth></port></inputPorts><outputPorts><port><name>outputText</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivity</
 class><inputMap><map from="id" to="id" /></inputMap><outputMap><map from="outputText" to="outputText" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>id</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>outputText</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>if ((id == void) || (id == null) || id.equals("")) {
+	throw new RunTimeException("port id must have a non-empty value");
+}
+
+URL url = new URL ("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?rettype=fasta&amp;db=protein&amp;retmode=text&amp;id=" + id);
+
+BufferedReader reader = new BufferedReader (new InputStreamReader(url.openStream()));
+StringWriter writer = new StringWriter();
+
+char[] buffer = new char[1024];
+    while (true) {
+        int r = reader.read(buffer);
+        if (r &lt;= 0) {
+            break;
+        }
+        writer.write(buffer, 0, r);
+    }
+outputText = writer.toString();
+</script>
+  <dependencies />
+  <localworkerName>net.sourceforge.taverna.scuflworkers.ncbi.ProteinFastaWorker</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="id" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>Get_Protein_INSDSeq_XML</name><inputPorts><port><name>id</name><depth>0</depth></port></inputPorts><outputPorts><port><name>outputText</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActi
 vity</class><inputMap><map from="id" to="id" /></inputMap><outputMap><map from="outputText" to="outputText" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>id</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>outputText</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>if ((id == void) || (id == null) || id.equals("")) {
+	throw new RunTimeException("port id must have a non-empty value");
+}
+
+URL url = new URL ("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?rettype=gbc&amp;db=protein&amp;retmode=xml&amp;id=" + id);
+
+BufferedReader reader = new BufferedReader (new InputStreamReader(url.openStream()));
+StringWriter writer = new StringWriter();
+
+char[] buffer = new char[1024];
+    while (true) {
+        int r = reader.read(buffer);
+        if (r &lt;= 0) {
+            break;
+        }
+        writer.write(buffer, 0, r);
+    }
+outputText = writer.toString();
+</script>
+  <dependencies />
+  <localworkerName>net.sourceforge.taverna.scuflworkers.ncbi.ProteinINSDSeqXMLWorker</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="id" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>Get_Protein_TinySeq_XML</name><inputPorts><port><name>id</name><depth>0</depth></port></inputPorts><outputPorts><port><name>outputText</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActi
 vity</class><inputMap><map from="id" to="id" /></inputMap><outputMap><map from="outputText" to="outputText" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>id</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>outputText</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>if ((id == void) || (id == null) || id.equals("")) {
+	throw new RunTimeException("port id must have a non-empty value");
+}
+
+URL url = new URL ("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?rettype=fasta&amp;db=protein&amp;retmode=xml&amp;id=" + id);
+
+BufferedReader reader = new BufferedReader (new InputStreamReader(url.openStream()));
+StringWriter writer = new StringWriter();
+
+char[] buffer = new char[1024];
+    while (true) {
+        int r = reader.read(buffer);
+        if (r &lt;= 0) {
+            break;
+        }
+        writer.write(buffer, 0, r);
+    }
+outputText = writer.toString();
+</script>
+  <dependencies />
+  <localworkerName>net.sourceforge.taverna.scuflworkers.ncbi.ProteinTinySeqXMLWorker</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="id" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>Get_Protein_GBSeq_XML</name><inputPorts><port><name>id</name><depth>0</depth></port></inputPorts><outputPorts><port><name>outputText</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivi
 ty</class><inputMap><map from="id" to="id" /></inputMap><outputMap><map from="outputText" to="outputText" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>id</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>outputText</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>if ((id == void) || (id == null) || id.equals("")) {
+	throw new RunTimeException("port id must have a non-empty value");
+}
+
+URL url = new URL ("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?rettype=gb&amp;db=protein&amp;retmode=xml&amp;id=" + id);
+
+BufferedReader reader = new BufferedReader (new InputStreamReader(url.openStream()));
+StringWriter writer = new StringWriter();
+
+char[] buffer = new char[1024];
+    while (true) {
+        int r = reader.read(buffer);
+        if (r &lt;= 0) {
+            break;
+        }
+        writer.write(buffer, 0, r);
+    }
+outputText = writer.toString();
+</script>
+  <dependencies />
+  <localworkerName>net.sourceforge.taverna.scuflworkers.ncbi.ProteinGBSeqWorker</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="
 ">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="id" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>Get_Nucleotide_INSDSeq_XML</processor><port>id</port></sink><source type="processor"><processor>nuc_id</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>Get_Nucleotide_FASTA</processor><port>id</port></sink><source type="processor"><processor>nuc_id</processor><port>value</port></source></datalink><datalink><sink type="pr
 ocessor"><processor>Get_Nucleotide_GBSeq_XML</processor><port>id</port></sink><source type="processor"><processor>nuc_id</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>Get_Nucleotide_TinySeq_XML</processor><port>id</port></sink><source type="processor"><processor>nuc_id</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>Get_Protein_FASTA</processor><port>id</port></sink><source type="processor"><processor>protein_id</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>Get_Protein_INSDSeq_XML</processor><port>id</port></sink><source type="processor"><processor>protein_id</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>Get_Protein_TinySeq_XML</processor><port>id</port></sink><source type="processor"><processor>protein_id</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>Ge
 t_Protein_GBSeq_XML</processor><port>id</port></sink><source type="processor"><processor>protein_id</processor><port>value</port></source></datalink><datalink><sink type="dataflow"><port>nuc_fasta</port></sink><source type="processor"><processor>Get_Nucleotide_FASTA</processor><port>outputText</port></source></datalink><datalink><sink type="dataflow"><port>nuc_xml</port></sink><source type="processor"><processor>Get_Nucleotide_GBSeq_XML</processor><port>outputText</port></source></datalink><datalink><sink type="dataflow"><port>nuc_insd</port></sink><source type="processor"><processor>Get_Nucleotide_INSDSeq_XML</processor><port>outputText</port></source></datalink><datalink><sink type="dataflow"><port>nuc_tiny</port></sink><source type="processor"><processor>Get_Nucleotide_TinySeq_XML</processor><port>outputText</port></source></datalink><datalink><sink type="dataflow"><port>prot_fasta</port></sink><source type="processor"><processor>Get_Protein_FASTA</processor><port>outputText</por
 t></source></datalink><datalink><sink type="dataflow"><port>protein_xml</port></sink><source type="processor"><processor>Get_Protein_GBSeq_XML</processor><port>outputText</port></source></datalink><datalink><sink type="dataflow"><port>prot_insd</port></sink><source type="processor"><processor>Get_Protein_INSDSeq_XML</processor><port>outputText</port></source></datalink><datalink><sink type="dataflow"><port>prot_tiny</port></sink><source type="processor"><processor>Get_Protein_TinySeq_XML</processor><port>outputText</port></source></datalink></datalinks><annotations><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.DescriptiveTitle">
+        <text>GBSeq test</text>
+      </annotationBean>
+      <date>2009-12-15 20:30:12.959 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.FreeTextDescription">
+        <text>This workflow retrieves nucleotide and protein sequences with the literature and references associated
+to them given a protein and a nucleotide id.</text>
+      </annotationBean>
+      <date>2009-12-15 20:30:23.505 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>f0fac9a7-7943-4191-a0d3-7e8e09044e43</identification>
+      </annotationBean>
+      <date>2010-07-04 18:16:42.290 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>c00b121a-0114-471a-bd29-03597414879c</identification>
+      </annotationBean>
+      <date>2011-07-12 14:07:08.97 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>af08cba7-dd16-404c-b20b-fd3cb7ccf7aa</identification>
+      </annotationBean>
+      <date>2011-07-12 14:06:02.422 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.Author">
+        <text>Franck Tanoh</text>
+      </annotationBean>
+      <date>2011-07-12 14:07:04.790 BST</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain></annotations></dataflow></workflow>
\ No newline at end of file


[47/54] [partial] incubator-taverna-engine git commit: Revert "temporarily empty repository"

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/main/java/net/sf/taverna/t2/security/credentialmanager/impl/DefaultMasterPasswordProvider.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/main/java/net/sf/taverna/t2/security/credentialmanager/impl/DefaultMasterPasswordProvider.java b/taverna-credential-manager-impl/src/main/java/net/sf/taverna/t2/security/credentialmanager/impl/DefaultMasterPasswordProvider.java
new file mode 100644
index 0000000..9b72188
--- /dev/null
+++ b/taverna-credential-manager-impl/src/main/java/net/sf/taverna/t2/security/credentialmanager/impl/DefaultMasterPasswordProvider.java
@@ -0,0 +1,51 @@
+package net.sf.taverna.t2.security.credentialmanager.impl;
+
+import static net.sf.taverna.t2.security.credentialmanager.CredentialManager.USER_SET_MASTER_PASSWORD_INDICATOR_FILE_NAME;
+
+import java.io.File;
+
+import net.sf.taverna.t2.security.credentialmanager.MasterPasswordProvider;
+import uk.org.taverna.configuration.app.ApplicationConfiguration;
+
+//import org.apache.log4j.Logger;
+
+public class DefaultMasterPasswordProvider implements MasterPasswordProvider {
+	/**
+	 * Default master password for Credential Manager - used by default and
+	 * ignored if user sets their own
+	 */
+	private final String DEFAULT_MASTER_PASSWORD = "taverna";
+	private ApplicationConfiguration appConfig;
+
+	@Override
+	public int getProviderPriority() {
+		// Higher priority then the UI provider so this one will be tried first
+		return 101;
+	}
+
+	/**
+	 * Sets the applicationConfiguration.
+	 * 
+	 * @param applicationConfiguration
+	 *            the new value of applicationConfiguration
+	 */
+	public void setApplicationConfiguration(
+			ApplicationConfiguration applicationConfiguration) {
+		appConfig = applicationConfiguration;
+	}
+
+	@Override
+	public String getMasterPassword(boolean firstTime) {
+		File cmDir = DistinguishedNameParserImpl.getTheCredentialManagerDefaultDirectory(appConfig);
+		File flagFile = new File(cmDir,
+				USER_SET_MASTER_PASSWORD_INDICATOR_FILE_NAME);
+		if (flagFile.exists())
+			return null;
+		return DEFAULT_MASTER_PASSWORD;
+	}
+
+	@Override
+	public void setMasterPassword(String password) {
+		// We always ignore this; we're never changing our password
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/main/java/net/sf/taverna/t2/security/credentialmanager/impl/DistinguishedNameParserImpl.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/main/java/net/sf/taverna/t2/security/credentialmanager/impl/DistinguishedNameParserImpl.java b/taverna-credential-manager-impl/src/main/java/net/sf/taverna/t2/security/credentialmanager/impl/DistinguishedNameParserImpl.java
new file mode 100644
index 0000000..5fdd8ca
--- /dev/null
+++ b/taverna-credential-manager-impl/src/main/java/net/sf/taverna/t2/security/credentialmanager/impl/DistinguishedNameParserImpl.java
@@ -0,0 +1,177 @@
+/*******************************************************************************
+ * Copyright (C) 2014 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.security.credentialmanager.impl;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.math.BigInteger;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+
+import net.sf.taverna.t2.security.credentialmanager.CMException;
+import net.sf.taverna.t2.security.credentialmanager.DistinguishedNameParser;
+
+import org.apache.log4j.Logger;
+
+import uk.org.taverna.configuration.app.ApplicationConfiguration;
+
+/**
+ * Utility methods for Credential Manager and security-related stuff.
+ * 
+ * @author Alex Nenadic
+ * @author Stian Soiland-Reyes
+ * @author Christian Brenninkmeijer
+ */
+public class DistinguishedNameParserImpl implements DistinguishedNameParser{
+	private static Logger logger = Logger.getLogger(DistinguishedNameParserImpl.class);
+
+        public DistinguishedNameParserImpl(){
+        }
+        
+	/**
+	 * Get the configuration directory where the security stuff will be/is saved
+	 * to.
+	 */
+	public static File getTheCredentialManagerDefaultDirectory(
+			ApplicationConfiguration applicationConfiguration) {
+		File home = applicationConfiguration.getApplicationHomeDir();
+		File secConfigDirectory = new File(home, "security");
+		if (!secConfigDirectory.exists())
+			secConfigDirectory.mkdir();
+		return secConfigDirectory;
+	}
+
+        @Override
+	public final File getCredentialManagerDefaultDirectory(
+			ApplicationConfiguration applicationConfiguration) {
+		return getTheCredentialManagerDefaultDirectory(applicationConfiguration);
+	}
+
+        static URI resolveUriFragment(URI uri, String realm)
+			throws URISyntaxException {
+		/*
+		 * Little hack to encode the fragment correctly - why does not
+		 * java.net.URI expose this quoting or have setFragment()?
+		 */
+		URI fragment = new URI("http", "localhost", "/", realm);
+		fragment = fragment.resolve(fragment.getPath()).relativize(fragment);
+		return uri.resolve(fragment);
+	}
+
+        @Override
+	public final URI setFragmentForURI(URI uri, String fragment)
+			throws URISyntaxException {
+		return new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(),
+				uri.getPort(), uri.getPath(), uri.getQuery(), fragment);
+	}
+
+        @Override
+	public final URI setUserInfoForURI(URI uri, String userinfo)
+			throws URISyntaxException {
+		return new URI(uri.getScheme(), userinfo, uri.getHost(), uri.getPort(),
+				uri.getPath(), uri.getQuery(), uri.getFragment());
+	}
+
+        @Override
+	public final X509Certificate convertCertificate(Certificate cert)
+			throws CMException {
+		try {
+			// Get the factory for X509 certificates
+			CertificateFactory cf = CertificateFactory.getInstance("X.509");
+			// Get the encoded (binary) form of the certificate.
+			// For an X509 certificate the encoding will be DER.
+			ByteArrayInputStream bais = new ByteArrayInputStream(
+					cert.getEncoded());
+			// Create the X509 certificate object from the stream
+			return (X509Certificate) cf.generateCertificate(bais);
+		} catch (CertificateException ex) {
+			throw new CMException(
+					"Failed to convert the certificate object into X.509 certificate.",
+					ex);
+		}
+	}
+
+	/**
+	 * Get the message digest of the given byte array as a string of hexadecimal
+	 * characters in the form XX:XX:XX... using the given digest algorithm.
+	 */
+	public String getMessageDigestAsFormattedString(byte[] messageBytes,
+			String digestAlgorithm) {
+
+		MessageDigest messageDigest;
+		byte[] digestBytes;
+		try {
+			messageDigest = MessageDigest.getInstance(digestAlgorithm);
+			digestBytes = messageDigest.digest(messageBytes);
+		} catch (NoSuchAlgorithmException ex) {
+			logger.error("Failed to create message digest.", ex);
+			return "";
+		}
+
+		// Create the integer value from the digest bytes
+		BigInteger number = new BigInteger(1, digestBytes);
+		// Convert the integer from decimal to hexadecimal representation
+		String hexValueString = number.toString(16).toUpperCase();
+
+		StringBuffer strBuff = new StringBuffer(hexValueString);
+		// If the hex number contains odd number of characters -
+		// insert a padding "0" at the front of the string
+		if ((strBuff.length() % 2) != 0)
+			strBuff.insert(0, '0');
+
+		// Insert colons after every two hex characters - start form the end of
+		// the hex string
+		if (strBuff.length() > 2)
+			for (int i = 2; i < strBuff.length(); i += 3)
+				strBuff.insert(i, ':');
+
+		return strBuff.toString();
+	}
+
+
+	private String emailAddress; // not from RFC 2253, yet some certificates
+									// contain this field
+
+	private String CN;
+	private String L;
+	private String ST;
+	private String C;
+	private String O;
+	private String OU;
+
+	/**
+	 * Parses a DN string and fills in fields with DN parts. Heavily based on
+	 * uk.ac.omii.security.utils.DNParser class from omii-security-utils
+	 * library.
+	 * 
+	 * http://maven.omii.ac.uk/maven2/repository/omii/omii-security-utils/
+	 */
+	public ParsedDistinguishedNameImpl parseDN(String DNstr) {
+            return new ParsedDistinguishedNameImpl(DNstr);
+        }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/main/java/net/sf/taverna/t2/security/credentialmanager/impl/ParsedDistinguishedNameImpl.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/main/java/net/sf/taverna/t2/security/credentialmanager/impl/ParsedDistinguishedNameImpl.java b/taverna-credential-manager-impl/src/main/java/net/sf/taverna/t2/security/credentialmanager/impl/ParsedDistinguishedNameImpl.java
new file mode 100644
index 0000000..c049d49
--- /dev/null
+++ b/taverna-credential-manager-impl/src/main/java/net/sf/taverna/t2/security/credentialmanager/impl/ParsedDistinguishedNameImpl.java
@@ -0,0 +1,265 @@
+/*******************************************************************************
+ * Copyright (C) 2014 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.security.credentialmanager.impl;
+
+import java.net.URI;
+import java.util.ArrayList;
+import net.sf.taverna.t2.security.credentialmanager.ParsedDistinguishedName;
+import org.apache.log4j.Logger;
+
+/**
+ * Parses a Distinguished Name and stores the parts for retreival.
+ * 
+ * @author Alex Nenadic
+ * @author Stian Soiland-Reyes
+ * @author Christian Brenninkmeijer
+ */
+public class ParsedDistinguishedNameImpl implements ParsedDistinguishedName{
+	private static final Logger logger = Logger.getLogger(ParsedDistinguishedNameImpl.class);
+
+	private String emailAddress; // not from RFC 2253, yet some certificates
+									// contain this field
+	private String CN;
+	private String L;
+	private String ST;
+	private String C;
+	private String O;
+	private String OU;
+
+	// /**
+	// * Gets the intended certificate uses, i.e. Netscape Certificate Type
+	// * extension (2.16.840.1.113730.1.1) as a string.
+	// */
+	// // From openssl's documentation: "The [above] extension is non standard,
+	// Netscape
+	// // specific and largely obsolete. Their use in new applications is
+	// discouraged."
+	// // TODO replace with "basicConstraints, keyUsage and extended key usage
+	// extensions
+	// // which are now used instead."
+	// public static String getIntendedCertificateUses(byte[] value) {
+	//
+	// // Netscape Certificate Types (2.16.840.1.113730.1.1) denoting the
+	// // intended uses of a certificate
+	// int[] INTENDED_USES = new int[] { NetscapeCertType.sslClient,
+	// NetscapeCertType.sslServer, NetscapeCertType.smime,
+	// NetscapeCertType.objectSigning, NetscapeCertType.reserved,
+	// NetscapeCertType.sslCA, NetscapeCertType.smimeCA,
+	// NetscapeCertType.objectSigningCA, };
+	//
+	// // Netscape Certificate Type strings (2.16.840.1.113730.1.1)
+	// HashMap<String, String> INTENDED_USES_STRINGS = new HashMap<String,
+	// String>();
+	// INTENDED_USES_STRINGS.put("128", "SSL Client");
+	// INTENDED_USES_STRINGS.put("64", "SSL Server");
+	// INTENDED_USES_STRINGS.put("32", "S/MIME");
+	// INTENDED_USES_STRINGS.put("16", "Object Signing");
+	// INTENDED_USES_STRINGS.put("8", "Reserved");
+	// INTENDED_USES_STRINGS.put("4", "SSL CA");
+	// INTENDED_USES_STRINGS.put("2", "S/MIME CA");
+	// INTENDED_USES_STRINGS.put("1", "Object Signing CA");
+	//
+	// // Get DER octet string from extension value
+	// ASN1OctetString derOctetString = new DEROctetString(value);
+	// byte[] octets = derOctetString.getOctets();
+	// // Get DER bit string
+	// DERBitString derBitString = new DERBitString(octets);
+	// int val = new NetscapeCertType(derBitString).intValue();
+	// StringBuffer strBuff = new StringBuffer();
+	// for (int i = 0, len = INTENDED_USES.length; i < len; i++) {
+	// int use = INTENDED_USES[i];
+	// if ((val & use) == use) {
+	// strBuff.append(INTENDED_USES_STRINGS.get(String.valueOf(use))
+	// + ", \n");
+	// }
+	// }
+	// // remove the last ", \n" from the end of the buffer
+	// String str = strBuff.toString();
+	// str = str.substring(0, str.length() - 3);
+	// return str;
+	// }
+
+	// FROM RFC 2253:
+	// CN commonName
+	// L localityName
+	// ST stateOrProvinceName
+	// O organizationName
+	// OU organizationalUnitName
+	// C countryName
+	// STREET streetAddress
+	// DC domainComponent
+	// UID userid
+
+        /**
+	 * Parses a DN string and fills in fields with DN parts. Heavily based on
+	 * uk.ac.omii.security.utils.DNParser class from omii-security-utils
+	 * library.
+	 * 
+	 * http://maven.omii.ac.uk/maven2/repository/omii/omii-security-utils/
+	 */
+	public ParsedDistinguishedNameImpl(String DNstr) {
+		// ///////////////////////////////////////////////////////////////////////////////////////////////////
+		// Parse the DN String and put into variables. First, tokenise using a
+		// "," character as a delimiter
+		// UNLESS escaped with a "\" character. Put the tokens into an
+		// ArrayList. These should be name value pairs
+		// separated by "=". Tokenise these using a StringTokenizer class, test
+		// for the name, and if one of the
+		// recognised names, copy into the correct variable. The reason
+		// StringTokenizer is not used for the major
+		// token list is that the StringTokenizer class does not handle escaped
+		// delimiters so an escaped delimiter
+		// in the code would be treated as a valid one.
+
+		int i = 0;
+
+		char majorListDelimiter = ',';
+		char majorListEscapeChar = '\\';
+
+		// String minorListDelimiter = "=";
+
+		String DNchars = DNstr;
+
+		int startIndex = 0;
+		int endIndex = 0;
+		boolean ignoreThisChar = false;
+
+		boolean inQuotes = false;
+
+		ArrayList<String> majorTokenList = new ArrayList<String>();
+
+		for (i = 0; i < DNchars.length(); i++) {
+			if (ignoreThisChar == true) {
+				ignoreThisChar = false;
+			} else if ((inQuotes == false) && (DNchars.charAt(i) == '\"')) {
+				inQuotes = true;
+			} else if ((inQuotes == true) && (DNchars.charAt(i) == '\"')) {
+				inQuotes = false;
+			} else if (inQuotes == true) {
+				continue;
+			} else if (DNchars.charAt(i) == majorListEscapeChar) {
+				ignoreThisChar = true;
+			} else if ((DNchars.charAt(i) == majorListDelimiter)
+					&& (ignoreThisChar == false)) {
+				endIndex = i;
+				majorTokenList.add(DNchars.substring(startIndex, endIndex));
+				startIndex = i + 1;
+			}
+		}
+
+		// Add last token - after the last delimiter
+		endIndex = DNchars.length();
+		majorTokenList.add(DNchars.substring(startIndex, endIndex));
+
+		for (String currentToken : majorTokenList) {
+			currentToken = currentToken.trim();
+
+			// split on first equals only, as value can contain an equals char
+			String[] minorTokenList = currentToken.split("=", 2);
+
+			if (minorTokenList.length == 2) {
+				// there had better be a key and a value only
+				String DNTokenName = minorTokenList[0].toUpperCase();
+				String DNTokenValue = minorTokenList[1];
+
+				if (DNTokenName.equals("CN")
+						|| DNTokenName.equals("COMMONNAME")) {
+					CN = DNTokenValue;
+				} else if (DNTokenName.equals("EMAIL")
+						|| DNTokenName.equals("EMAILADDRESS")) {
+					emailAddress = DNTokenValue;
+				} else if (DNTokenName.equals("OU")
+						|| DNTokenName.equals("ORGANIZATIONALUNITNAME")) {
+					OU = DNTokenValue;
+				} else if (DNTokenName.equals("O")
+						|| DNTokenName.equals("ORGANIZATIONNAME")) {
+					O = DNTokenValue;
+				} else if (DNTokenName.equals("L")
+						|| DNTokenName.equals("LOCALITYNAME")) {
+					L = DNTokenValue;
+				} else if (DNTokenName.equals("ST")
+						|| DNTokenName.equals("STATEORPROVINCENAME")) {
+					ST = DNTokenValue;
+				} else if (DNTokenName.equals("C")
+						|| DNTokenName.equals("COUNTRYNAME")) {
+					C = DNTokenValue;
+				}
+			}
+			// else we have a key with no value, so skip processing the key
+		}
+
+		if (CN == null)
+			CN = "none";
+
+		if (emailAddress == null)
+			emailAddress = "none";
+
+		if (OU == null)
+			OU = "none";
+
+		if (O == null)
+			O = "none";
+
+		if (L == null)
+			L = "none";
+
+		if (ST == null)
+			ST = "none";
+
+		if (C == null)
+			C = "none";
+	}
+
+        @Override
+	public String getCN() {
+		return CN;
+	}
+
+        @Override
+	public String getEmailAddress() {
+		return emailAddress;
+	}
+
+        @Override
+	public String getOU() {
+		return OU;
+	}
+
+        @Override
+	public String getO() {
+		return O;
+	}
+
+        @Override
+	public String getL() {
+		return L;
+	}
+
+        @Override
+	public String getST() {
+		return ST;
+	}
+
+        @Override
+	public String getC() {
+		return C;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/main/resources/META-INF/spring/credential-manager-impl-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/main/resources/META-INF/spring/credential-manager-impl-context-osgi.xml b/taverna-credential-manager-impl/src/main/resources/META-INF/spring/credential-manager-impl-context-osgi.xml
new file mode 100644
index 0000000..3c59bf6
--- /dev/null
+++ b/taverna-credential-manager-impl/src/main/resources/META-INF/spring/credential-manager-impl-context-osgi.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+                                 http://www.springframework.org/schema/beans/spring-beans.xsd
+                                 http://www.springframework.org/schema/osgi
+                                 http://www.springframework.org/schema/osgi/spring-osgi.xsd">
+
+	<service ref="credentialManager"
+		interface="net.sf.taverna.t2.security.credentialmanager.CredentialManager" />
+	<service ref="defaultMasterPassword"
+		interface="net.sf.taverna.t2.security.credentialmanager.MasterPasswordProvider" />
+	<service ref="distinguishedNameParser"
+		interface="net.sf.taverna.t2.security.credentialmanager.DistinguishedNameParser" />
+            
+	<reference id="applicationConfiguration"
+		interface="uk.org.taverna.configuration.app.ApplicationConfiguration" />
+
+	<list id="masterPasswordProviders"
+		interface="net.sf.taverna.t2.security.credentialmanager.MasterPasswordProvider"
+		cardinality="0..N" comparator-ref="MasterPasswordProviderComparator" />
+	<list id="javaTruststorePasswordProviders"
+		interface="net.sf.taverna.t2.security.credentialmanager.JavaTruststorePasswordProvider"
+		cardinality="0..N" />
+	<list id="serviceUsernameAndPasswordProviders"
+		interface="net.sf.taverna.t2.security.credentialmanager.ServiceUsernameAndPasswordProvider"
+		cardinality="0..N" />
+	<list id="trustConfirmationProviders"
+		interface="net.sf.taverna.t2.security.credentialmanager.TrustConfirmationProvider"
+		cardinality="0..N" />
+</beans:beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/main/resources/META-INF/spring/credential-manager-impl-context.xml
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/main/resources/META-INF/spring/credential-manager-impl-context.xml b/taverna-credential-manager-impl/src/main/resources/META-INF/spring/credential-manager-impl-context.xml
new file mode 100644
index 0000000..d1531e1
--- /dev/null
+++ b/taverna-credential-manager-impl/src/main/resources/META-INF/spring/credential-manager-impl-context.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+                           http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+	<bean id="credentialManager" init-method="installAuthenticator"
+		class="net.sf.taverna.t2.security.credentialmanager.impl.CredentialManagerImpl">
+		<property name="masterPasswordProviders" ref="masterPasswordProviders" />
+		<property name="javaTruststorePasswordProviders" ref="javaTruststorePasswordProviders" />
+		<property name="serviceUsernameAndPasswordProviders" ref="serviceUsernameAndPasswordProviders" />
+		<property name="trustConfirmationProviders" ref="trustConfirmationProviders" />
+		<property name="applicationConfiguration" ref="applicationConfiguration" />
+	</bean>
+
+	<bean id="MasterPasswordProviderComparator"
+		class="net.sf.taverna.t2.security.credentialmanager.MasterPasswordProvider$ProviderComparator" />
+
+	<bean id="distinguishedNameParser"
+		class="net.sf.taverna.t2.security.credentialmanager.impl.DistinguishedNameParserImpl" />
+	<bean id="defaultMasterPassword"
+		class="net.sf.taverna.t2.security.credentialmanager.impl.DefaultMasterPasswordProvider">
+		<property name="applicationConfiguration" ref="applicationConfiguration" />
+	</bean>
+</beans>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/main/resources/trusted-certificates/AddTrustExternalCARoot.crt
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/main/resources/trusted-certificates/AddTrustExternalCARoot.crt b/taverna-credential-manager-impl/src/main/resources/trusted-certificates/AddTrustExternalCARoot.crt
new file mode 100644
index 0000000..20585f1
--- /dev/null
+++ b/taverna-credential-manager-impl/src/main/resources/trusted-certificates/AddTrustExternalCARoot.crt
@@ -0,0 +1,25 @@
+-----BEGIN CERTIFICATE-----
+MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
+MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs
+IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290
+MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux
+FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h
+bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v
+dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt
+H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9
+uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX
+mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX
+a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN
+E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0
+WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD
+VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0
+Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU
+cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx
+IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN
+AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH
+YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5
+6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC
+Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX
+c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a
+mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
+-----END CERTIFICATE-----

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/main/resources/trusted-certificates/TERENASSLCA.crt
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/main/resources/trusted-certificates/TERENASSLCA.crt b/taverna-credential-manager-impl/src/main/resources/trusted-certificates/TERENASSLCA.crt
new file mode 100644
index 0000000..1e70af9
--- /dev/null
+++ b/taverna-credential-manager-impl/src/main/resources/trusted-certificates/TERENASSLCA.crt
@@ -0,0 +1,27 @@
+-----BEGIN CERTIFICATE-----
+MIIEmDCCA4CgAwIBAgIQS8gUAy8H+mqk8Nop32F5ujANBgkqhkiG9w0BAQUFADCB
+lzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug
+Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho
+dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3Qt
+SGFyZHdhcmUwHhcNMDkwNTE4MDAwMDAwWhcNMjAwNTMwMTA0ODM4WjA2MQswCQYD
+VQQGEwJOTDEPMA0GA1UEChMGVEVSRU5BMRYwFAYDVQQDEw1URVJFTkEgU1NMIENB
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw+NIxC9cwcupmf0booNd
+ij2tOtDipEMfTQ7+NSUwpWkbxOjlwY9UfuFqoppcXN49/ALOlrhfj4NbzGBAkPjk
+tjolnF8UUeyx56+eUKExVccCvaxSin81joL6hK0V/qJ/gxA6VVOULAEWdJRUYyij
+8lspPZSIgCDiFFkhGbSkmOFg5vLrooCDQ+CtaPN5GYtoQ1E/iptBhQw1jF218bbl
+p8ODtWsjb9Sl61DllPFKX+4nSxQSFSRMDc9ijbcAIa06Mg9YC18em9HfnY6pGTVQ
+L0GprTvG4EWyUzl/Ib8iGodcNK5Sbwd9ogtOnyt5pn0T3fV/g3wvWl13eHiRoBS/
+fQIDAQABo4IBPjCCATowHwYDVR0jBBgwFoAUoXJfJhsomEOVXQc31YWWnUvSw0Uw
+HQYDVR0OBBYEFAy9k2gM896ro0lrKzdXR+qQ47ntMA4GA1UdDwEB/wQEAwIBBjAS
+BgNVHRMBAf8ECDAGAQH/AgEAMBgGA1UdIAQRMA8wDQYLKwYBBAGyMQECAh0wRAYD
+VR0fBD0wOzA5oDegNYYzaHR0cDovL2NybC51c2VydHJ1c3QuY29tL1VUTi1VU0VS
+Rmlyc3QtSGFyZHdhcmUuY3JsMHQGCCsGAQUFBwEBBGgwZjA9BggrBgEFBQcwAoYx
+aHR0cDovL2NydC51c2VydHJ1c3QuY29tL1VUTkFkZFRydXN0U2VydmVyX0NBLmNy
+dDAlBggrBgEFBQcwAYYZaHR0cDovL29jc3AudXNlcnRydXN0LmNvbTANBgkqhkiG
+9w0BAQUFAAOCAQEATiPuSJz2hYtxxApuc5NywDqOgIrZs8qy1AGcKM/yXA4hRJML
+thoh45gBlA5nSYEevj0NTmDa76AxTpXv8916WoIgQ7ahY0OzUGlDYktWYrA0irkT
+Q1mT7BR5iPNIk+idyfqHcgxrVqDDFY1opYcfcS3mWm08aXFABFXcoEOUIEU4eNe9
+itg5xt8Jt1qaqQO4KBB4zb8BG1oRPjj02Bs0ec8z0gH9rJjNbUcRkEy7uVvYcOfV
+r7bMxIbmdcCeKbYrDyqlaQIN4+mitF3A884saoU4dmHGSYKrUbOCprlBmCiY+2v+
+ihb/MX5UR6g83EMmqZsFt57ANEORMNQywxFa4Q==
+-----END CERTIFICATE-----

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/main/resources/trusted-certificates/UTNAddTrustServer_CA.crt
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/main/resources/trusted-certificates/UTNAddTrustServer_CA.crt b/taverna-credential-manager-impl/src/main/resources/trusted-certificates/UTNAddTrustServer_CA.crt
new file mode 100644
index 0000000..3642581
--- /dev/null
+++ b/taverna-credential-manager-impl/src/main/resources/trusted-certificates/UTNAddTrustServer_CA.crt
@@ -0,0 +1,25 @@
+-----BEGIN CERTIFICATE-----
+MIIEPDCCAySgAwIBAgIQSEus8arH1xND0aJ0NUmXJTANBgkqhkiG9w0BAQUFADBv
+MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFk
+ZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBF
+eHRlcm5hbCBDQSBSb290MB4XDTA1MDYwNzA4MDkxMFoXDTIwMDUzMDEwNDgzOFow
+gZcxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJVVDEXMBUGA1UEBxMOU2FsdCBMYWtl
+IENpdHkxHjAcBgNVBAoTFVRoZSBVU0VSVFJVU1QgTmV0d29yazEhMB8GA1UECxMY
+aHR0cDovL3d3dy51c2VydHJ1c3QuY29tMR8wHQYDVQQDExZVVE4tVVNFUkZpcnN0
+LUhhcmR3YXJlMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsffDOD+0
+qH/POYJRZ9Btn9L/WPPnnyvsDYlUmbk4mRb34CF5SMK7YXQSlh08anLVPBBnOjnt
+KxPNZuuVCTOkbJex6MbswXV5nEZejavQav25KlUXEFSzGfCa9vGxXbanbfvgcRdr
+ooj7AN/+GjF3DJoBerEy4ysBBzhuw6VeI7xFm3tQwckwj9vlK3rTW/szQB6g1ZgX
+vIuHw4nTXaCOsqqq9o5piAbF+okh8widaS4JM5spDUYPjMxJNLBpUb35Bs1orWZM
+vD6sYb0KiA7I3z3ufARMnQpea5HW7sftKI2rTYeJc9BupNAeFosU4XZEA39jrOTN
+SZzFkvSrMqFIWwIDAQABo4GqMIGnMB8GA1UdIwQYMBaAFK29mHo0tCb3+sQmVO8D
+veAky1QaMB0GA1UdDgQWBBShcl8mGyiYQ5VdBzfVhZadS9LDRTAOBgNVHQ8BAf8E
+BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBEBgNVHR8EPTA7MDmgN6A1hjNodHRwOi8v
+Y3JsLnVzZXJ0cnVzdC5jb20vQWRkVHJ1c3RFeHRlcm5hbENBUm9vdC5jcmwwDQYJ
+KoZIhvcNAQEFBQADggEBADzse+Cuow6WbTDXhcbSaFtFWoKmNA+wyZIjXhFtCBGy
+dAkjOjUlc1heyrl8KPpH7PmgA1hQtlPvjNs55Gfp2MooRtSn4PU4dfjny1y/HRE8
+akCbLURW0/f/BSgyDBXIZEWT6CEkjy3aeoR7T8/NsiV8dxDTlNEEkaglHAkiD31E
+NREU768A/l7qX46w2ZJZuvwTlqAYAVbO2vYoC7Gv3VxPXLLzj1pxz+0YrWOIHY6V
+9+qV5x+tkLiECEeFfyIvGh1IMNZMCNg3GWcyK+tc0LL8blefBDVekAB+EcfeEyrN
+pG1FJseIVqDwavfY5/wnfmcI0L36tsNhAgFlubgvz1o=
+-----END CERTIFICATE-----

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/main/resources/trusted-certificates/heater.cs.man.ac.uk-not-needed.pem
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/main/resources/trusted-certificates/heater.cs.man.ac.uk-not-needed.pem b/taverna-credential-manager-impl/src/main/resources/trusted-certificates/heater.cs.man.ac.uk-not-needed.pem
new file mode 100644
index 0000000..e7e861f
--- /dev/null
+++ b/taverna-credential-manager-impl/src/main/resources/trusted-certificates/heater.cs.man.ac.uk-not-needed.pem
@@ -0,0 +1,26 @@
+-----BEGIN CERTIFICATE-----
+MIIEczCCA1ugAwIBAgIQPNDfg7NaMsjkGjowei7/JjANBgkqhkiG9w0BAQUFADA2
+MQswCQYDVQQGEwJOTDEPMA0GA1UEChMGVEVSRU5BMRYwFAYDVQQDEw1URVJFTkEg
+U1NMIENBMB4XDTEzMDUyMjAwMDAwMFoXDTE2MDUyMTIzNTk1OVowQTEhMB8GA1UE
+CxMYRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkMRwwGgYDVQQDExNoZWF0ZXIuY3Mu
+bWFuLmFjLnVrMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2egVdh/d
+PbrglnEp/BATt2UWk48tplWdt0aFcpvatItJZ4+CY0Rfd0TCIRKDp+PppbE1/PcE
+pe77Zngiu1YYnOpAIoS3Mfgc/yxssEHJj/tAjY1d4/NFa8jwY/MIoSPZrNGtTEpf
+IMn7OUNsEh1YyWYdDmvNaxQFdLVjO/QhFqtQedUJEg7YaD1/OacmQoWAZvOPkXeQ
+lUHpieiFjGeJYI/RCqWE1tjU6E/4WtczOsXXA50kFJ/XykQVwto3e8ckKju6HI0g
+FL1R/7wrhfSJ5rkiwmlPWZd5Keik/va/8JJKlWG3OzYaLb5qPTqgaKTTKbWvU/nX
+cPeKaIZ0Sa7AYwIDAQABo4IBcDCCAWwwHwYDVR0jBBgwFoAUDL2TaAzz3qujSWsr
+N1dH6pDjue0wHQYDVR0OBBYEFEKp10paTphB4PCL5kK5C/aVod4+MA4GA1UdDwEB
+/wQEAwIFoDAMBgNVHRMBAf8EAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEF
+BQcDAjAiBgNVHSAEGzAZMA0GCysGAQQBsjEBAgIdMAgGBmeBDAECATA6BgNVHR8E
+MzAxMC+gLaArhilodHRwOi8vY3JsLnRjcy50ZXJlbmEub3JnL1RFUkVOQVNTTENB
+LmNybDBtBggrBgEFBQcBAQRhMF8wNQYIKwYBBQUHMAKGKWh0dHA6Ly9jcnQudGNz
+LnRlcmVuYS5vcmcvVEVSRU5BU1NMQ0EuY3J0MCYGCCsGAQUFBzABhhpodHRwOi8v
+b2NzcC50Y3MudGVyZW5hLm9yZzAeBgNVHREEFzAVghNoZWF0ZXIuY3MubWFuLmFj
+LnVrMA0GCSqGSIb3DQEBBQUAA4IBAQCIO7fl98dU24AfcCGyZDPA2zHi0coqAZbA
+SZ31z5IPezLXpPkpN/msiYuUkIx5DjWjzv9w/sAQ952YUGz0z7AFDamMcyETlMb+
+trWedNHk0FghwoQTNW+WXxBa9My8K3IeO1FOt58lKVay9aqVZjiumt+P3LKocXfP
+0cNAPNHR57j9MO+D0fWOCMfbfYk3jEuz1k6vMZomZi35tb61QQ/mYbva7EodBxRt
+HrzOsWPG1jgt32zRibnCc1C6cBry5BkWQ1/9dpJ2LHM6JVVknoRGYng+L91OLfj8
+8PB6BTrehrqH5fe5kcgW02XlezIkaKpzEYc4Jpdf817A1rOSVuBv
+-----END CERTIFICATE-----
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/main/resources/trusted-certificates/www.biocatalogue.org-revoked.pem
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/main/resources/trusted-certificates/www.biocatalogue.org-revoked.pem b/taverna-credential-manager-impl/src/main/resources/trusted-certificates/www.biocatalogue.org-revoked.pem
new file mode 100644
index 0000000..f687fb1
--- /dev/null
+++ b/taverna-credential-manager-impl/src/main/resources/trusted-certificates/www.biocatalogue.org-revoked.pem
@@ -0,0 +1,26 @@
+-----BEGIN CERTIFICATE-----
+MIIEdTCCA12gAwIBAgIQWKdgSd6Zw0PQcE4pbzsWZDANBgkqhkiG9w0BAQUFADA2
+MQswCQYDVQQGEwJOTDEPMA0GA1UEChMGVEVSRU5BMRYwFAYDVQQDEw1URVJFTkEg
+U1NMIENBMB4XDTEzMDgwNTAwMDAwMFoXDTE2MDgwNDIzNTk1OVowQjEhMB8GA1UE
+CxMYRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkMR0wGwYDVQQDExR3d3cuYmlvY2F0
+YWxvZ3VlLm9yZzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL++4x8O
+F1YaggcA9OMinMRMkzDHyMnDTDD6piy23nX1F7EetzvhZOWeuotrZRrRm9XnzJ+v
+JOcFXa8ibTZRKF9wdwxRqkH9RVtskYQWFO0oTIdFagRpceHJM2cfI+YLwxaNkekP
+zFhsT/m0Zql6WSD9sTzB/FApcaBkR+gQXP+bQyutxr8cvrwnpgJWYPjUr1jHIXbq
+ZxTwYE1ezeHM9zroO831C8r1PX/goWND6+cNccalsancXraMDwASphhu7LYniSCZ
+zRKwhssl7Xg8ytjkACC8nS4jeyUNmhKa8iPDJthkgGfhT9T+XzUj/NkGNm98IXtn
+m5puPjTaKAe7H90CAwEAAaOCAXEwggFtMB8GA1UdIwQYMBaAFAy9k2gM896ro0lr
+KzdXR+qQ47ntMB0GA1UdDgQWBBQkiYQZefzKYVzbL1td0qbF6uabRzAOBgNVHQ8B
+Af8EBAMCBaAwDAYDVR0TAQH/BAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYB
+BQUHAwIwIgYDVR0gBBswGTANBgsrBgEEAbIxAQICHTAIBgZngQwBAgEwOgYDVR0f
+BDMwMTAvoC2gK4YpaHR0cDovL2NybC50Y3MudGVyZW5hLm9yZy9URVJFTkFTU0xD
+QS5jcmwwbQYIKwYBBQUHAQEEYTBfMDUGCCsGAQUFBzAChilodHRwOi8vY3J0LnRj
+cy50ZXJlbmEub3JnL1RFUkVOQVNTTENBLmNydDAmBggrBgEFBQcwAYYaaHR0cDov
+L29jc3AudGNzLnRlcmVuYS5vcmcwHwYDVR0RBBgwFoIUd3d3LmJpb2NhdGFsb2d1
+ZS5vcmcwDQYJKoZIhvcNAQEFBQADggEBAA1ix/IzQ0mESvfXXX+Dwzx5fXzJ/Rnr
+q93pSBZnroPzpcV84PTE2O7jVi0QHPUsSTtQKp3NHk1zV8xEWR+DNYBVEecNuzcg
+NOXCXF3arXSR7eY1LNwrIaAzbrdxExKlwhPAhhQZ2hxcRX8wvsPT/+sZhlG8wEjj
+y7lg8YtdNjBrRIwYlAQBb1+ilFc7Pge+54B2aMDnv7boRt/XTYdL8XYjcOC2JlE6
+ETnNPD1bNk5Rg+nZwpzAqY+yKKdgk8jsWGr8/eJ88LtpzjZUILH7owU3EHQSQyTq
+T7gcAL+eBwRVfUXKatoB/1uTrQvJz8YHRMDULyIPGGh8rlhJtdAGLk8=
+-----END CERTIFICATE-----

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/main/resources/trusted-certificates/www.biodiversitycatalogue.org-revoked.pem
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/main/resources/trusted-certificates/www.biodiversitycatalogue.org-revoked.pem b/taverna-credential-manager-impl/src/main/resources/trusted-certificates/www.biodiversitycatalogue.org-revoked.pem
new file mode 100644
index 0000000..05b3926
--- /dev/null
+++ b/taverna-credential-manager-impl/src/main/resources/trusted-certificates/www.biodiversitycatalogue.org-revoked.pem
@@ -0,0 +1,29 @@
+-----BEGIN CERTIFICATE-----
+MIIE4zCCA8ugAwIBAgIPSNz7e2uWg8LSOeQaskiFMA0GCSqGSIb3DQEBBQUAMDYx
+CzAJBgNVBAYTAk5MMQ8wDQYDVQQKEwZURVJFTkExFjAUBgNVBAMTDVRFUkVOQSBT
+U0wgQ0EwHhcNMTIxMTIyMDAwMDAwWhcNMTUxMTIyMjM1OTU5WjCBpzELMAkGA1UE
+BhMCR0IxDjAMBgNVBAgTBVdhbGVzMRAwDgYDVQQHEwdDYXJkaWZmMRswGQYDVQQK
+ExJDYXJkaWZmIFVuaXZlcnNpdHkxMTAvBgNVBAsTKEJpb1ZlTCBCaW9kaXZlcnNp
+dHkgVmlydHVhbCBlLUxhYm9yYXRvcnkxJjAkBgNVBAMTHXd3dy5iaW9kaXZlcnNp
+dHljYXRhbG9ndWUub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA
+rPabZIqwVD+WqCt6WgJJuh40TLU50tiGipECf+4JwU45pz1VAI+HS8V9RcnlUhWs
+WCjCtl2XeBv7kxlMxGUZAZ3uCZGhqUuzC1g/G2nwsrsLv+Xo09setIXUinFFJB8G
+oSRhflZ8YfGPg26Q5Efmd+ecATSIyXMH7w9/IfJ/gHLsBrJjyXz4pTmjQ242jDEz
+Uf6u1kdDp/0moAcVXgCv4Ev1N8eDmvDYzQcD/fdjOD62xi1IEixKgiaMzvBM14gj
+ZuyCPLpc4naD+gfwz2ecZ4moWmUTOouaA5w54Z1d/6b08xJsysoE6B5YKAP2z27i
+iqA5YHySvhJ7AJ90dbg1mwIDAQABo4IBejCCAXYwHwYDVR0jBBgwFoAUDL2TaAzz
+3qujSWsrN1dH6pDjue0wHQYDVR0OBBYEFBsGmwvAkT9J7ehe+2x5cZ6zh/dPMA4G
+A1UdDwEB/wQEAwIFoDAMBgNVHRMBAf8EAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMB
+BggrBgEFBQcDAjAiBgNVHSAEGzAZMA0GCysGAQQBsjEBAgIdMAgGBmeBDAECAjA6
+BgNVHR8EMzAxMC+gLaArhilodHRwOi8vY3JsLnRjcy50ZXJlbmEub3JnL1RFUkVO
+QVNTTENBLmNybDBtBggrBgEFBQcBAQRhMF8wNQYIKwYBBQUHMAKGKWh0dHA6Ly9j
+cnQudGNzLnRlcmVuYS5vcmcvVEVSRU5BU1NMQ0EuY3J0MCYGCCsGAQUFBzABhhpo
+dHRwOi8vb2NzcC50Y3MudGVyZW5hLm9yZzAoBgNVHREEITAfgh13d3cuYmlvZGl2
+ZXJzaXR5Y2F0YWxvZ3VlLm9yZzANBgkqhkiG9w0BAQUFAAOCAQEAw86F5CulT1aY
+c3UrW2ndPNMwAkMHJApvJHBqYFCDZTjatZZOaMBG8Ka3IznIpskH9L5XSh+Af+px
+NYhtMxRpeLXjjisYyJIwomI4mtF4+35mv5zPAW6cgf0bMp0gt6CFPqpo42WcKzZW
+nasesR978XViPXhUJbN+KaW6dW1zZAB9kHE8jJ4COWpBKKBKQwiOhVQGvhgKfjYE
+txawV7OUiV5IS9h5FndFUqCipBcIDVhE8dJdLKnMNBo03HzgLFNHONM0zEpHkNPg
+dASnuVpol6ldJYnEUbDNY5EC//D7s7h6fJciAQMLbELVrNMjv7IK5i1YjFAGn27i
+CXrSjJd7ow==
+-----END CERTIFICATE-----

http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/246a16e2/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/CredentialManagerImplIT.java
----------------------------------------------------------------------
diff --git a/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/CredentialManagerImplIT.java b/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/CredentialManagerImplIT.java
new file mode 100644
index 0000000..593e223
--- /dev/null
+++ b/taverna-credential-manager-impl/src/test/java/net/sf/taverna/t2/security/credentialmanager/impl/CredentialManagerImplIT.java
@@ -0,0 +1,339 @@
+/*******************************************************************************
+ * Copyright (C) 2008-2010 The University of Manchester   
+ * 
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ * 
+ *  This program 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 program 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.security.credentialmanager.impl;
+
+import static org.junit.Assert.*;
+
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.security.Key;
+import java.security.KeyStore;
+import java.security.Security;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Random;
+
+import javax.net.ssl.HttpsURLConnection;
+
+import net.sf.taverna.t2.lang.observer.Observable;
+import net.sf.taverna.t2.lang.observer.Observer;
+import net.sf.taverna.t2.security.credentialmanager.CMException;
+import net.sf.taverna.t2.security.credentialmanager.KeystoreChangedEvent;
+import net.sf.taverna.t2.security.credentialmanager.MasterPasswordProvider;
+import net.sf.taverna.t2.security.credentialmanager.TrustConfirmationProvider;
+import net.sf.taverna.t2.security.credentialmanager.UsernamePassword;
+
+import org.apache.commons.io.FileUtils;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * Tests here require Java strong/unlimited cryptography policy to be installed
+ * so they are part of integration tests.
+ * 
+ * Java strong/unlimited cryptography policy is required to use the Credential Manager and
+ * the full security capabilities in Taverna. Java by default comes with the weak policy 
+ * that disables the use of certain cryto algorithms and bigger key sizes. Although 
+ * it is claimed that as of Java 6 the default policy is strong, we have seen otherwise, 
+ * so make sure you install it.
+ * 
+ * For Java 6, strong/unlimited cryptography policy can be downloaded 
+ * (together with the installation instructions) from:
+ * http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html
+ * 
+ * These tests use an existing keystore (in resources/security/t2keystore.ubr) and 
+ * truststore (in resources/security/t2truststore.ubr) that are not empty.
+ * 
+ * @author Alex Nenadic
+ *
+ */
+public class CredentialManagerImplIT {
+
+	private static CredentialManagerImpl credentialManager;
+	// Master password for Credential Manager's Keystore and Truststore
+	private static String masterPassword = "(cl%ZDxu66AN/{vNXbLF";  
+	private static DummyMasterPasswordProvider masterPasswordProvider;
+	private static File credentialManagerDirectory;
+	
+	private static UsernamePassword usernamePassword;
+	private static URI serviceURI;
+	private static UsernamePassword usernamePassword2;
+	private static URI serviceURI2;
+	private static UsernamePassword usernamePassword3;
+	private static URI serviceURI3;
+	
+	private static Key privateKey;
+	private static Certificate[] privateKeyCertChain;
+	private static URL privateKeyFileURL = CredentialManagerImplTest.class.getResource(
+			"/security/test-private-key-cert.p12");
+	private static final String privateKeyAndPKCS12KeystorePassword = "test"; // password for the test PKCS#12 keystore in resources
+	
+	private static X509Certificate trustedCertficateGoogle;
+	private static URL trustedCertficateGoogleFileURL = CredentialManagerImplTest.class.getResource(
+			"/security/google-trusted-certificate.pem");
+	private static X509Certificate trustedCertficateHeater;
+	private static URL trustedCertficateHeaterFileURL = CredentialManagerImplTest.class.getResource(
+			"/security/tomcat_heater_certificate.pem");
+	
+	private static Observer<KeystoreChangedEvent> keystoreChangedObserver;
+
+	/**
+	 * @throws java.lang.Exception
+	 */
+	@BeforeClass
+	@Ignore
+	public static void setUpBeforeCLass() throws Exception {
+
+		Security.addProvider(new BouncyCastleProvider());
+		
+		// Create some test username and passwords for services
+		serviceURI =  new URI("http://someservice");
+		usernamePassword = new UsernamePassword("testuser", "testpasswd");
+		serviceURI2 =  new URI("http://someservice2");
+		usernamePassword2 = new UsernamePassword("testuser2", "testpasswd2");
+		serviceURI3 =  new URI("http://someservice3");
+		usernamePassword3 = new UsernamePassword("testuser3", "testpasswd3");
+		
+		// Load the test private key and its certificate
+		File privateKeyCertFile = new File(privateKeyFileURL.getPath());
+		KeyStore pkcs12Keystore = java.security.KeyStore.getInstance("PKCS12", "BC"); // We have to use the BC provider here as the certificate chain is not loaded if we use whichever provider is first in Java!!!
+		FileInputStream inStream = new FileInputStream(privateKeyCertFile);
+		pkcs12Keystore.load(inStream, privateKeyAndPKCS12KeystorePassword.toCharArray());
+		// KeyStore pkcs12Keystore = credentialManager.loadPKCS12Keystore(privateKeyCertFile, privateKeyPassword);
+		Enumeration<String> aliases = pkcs12Keystore.aliases();
+		while (aliases.hasMoreElements()) {
+			// The test-private-key-cert.p12 file contains only one private key
+			// and corresponding certificate entry
+			String alias = aliases.nextElement();
+			if (pkcs12Keystore.isKeyEntry(alias)) { // is it a (private) key entry?
+				privateKey = pkcs12Keystore.getKey(alias,
+						privateKeyAndPKCS12KeystorePassword.toCharArray());
+				privateKeyCertChain = pkcs12Keystore.getCertificateChain(alias);
+				break;
+			}
+		}
+		inStream.close();
+		
+		// Load the test trusted certificate (belonging to *.Google.com)
+		File trustedCertFile = new File(trustedCertficateGoogleFileURL.getPath());		
+		inStream = new FileInputStream(trustedCertFile);
+		CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
+		trustedCertficateGoogle = (X509Certificate) certFactory.generateCertificate(inStream);
+		try{
+			inStream.close();
+		}
+		catch (Exception e) {
+			// Ignore
+		}
+		// Load the test trusted certificate (belonging to heater.cs.man.ac.uk)
+		File trustedCertFile2 = new File(trustedCertficateHeaterFileURL.getPath());		
+		inStream = new FileInputStream(trustedCertFile2);
+		trustedCertficateHeater = (X509Certificate) certFactory.generateCertificate(inStream);
+		try{
+			inStream.close();
+		}
+		catch (Exception e) {
+			// Ignore
+		}	
+		
+		credentialManager = new CredentialManagerImpl();
+
+//		// The code below sets up the Keystore and Truststore files and loads some data into them
+//		// and saves them into a temp directory. These files can later be used for testing the Credential
+//		// Manager with non-empty keystores.
+//		Random randomGenerator = new Random();
+//		String credentialManagerDirectoryPath = System
+//				.getProperty("java.io.tmpdir")
+//				+ System.getProperty("file.separator")
+//				+ "taverna-security-"
+//				+ randomGenerator.nextInt(1000000);
+//		System.out.println("Credential Manager's directory path: "
+//				+ credentialManagerDirectoryPath);
+//		credentialManagerDirectory = new File(credentialManagerDirectoryPath);
+//		credentialManager.setConfigurationDirectoryPath(credentialManagerDirectory);
+//		
+//		// Create the dummy master password provider
+//		masterPasswordProvider = new DummyMasterPasswordProvider();
+//		masterPasswordProvider.setMasterPassword(masterPassword);
+//		List<MasterPasswordProvider> masterPasswordProviders = new ArrayList<MasterPasswordProvider>();
+//		masterPasswordProviders.add(masterPasswordProvider);
+//		credentialManager.setMasterPasswordProviders(masterPasswordProviders);
+//		
+//		// Add some stuff into Credential Manager
+//		credentialManager.addUsernameAndPasswordForService(usernamePassword, serviceURI);
+//		credentialManager.addUsernameAndPasswordForService(usernamePassword2, serviceURI2);
+//		credentialManager.addUsernameAndPasswordForService(usernamePassword3, serviceURI3);
+//		credentialManager.addKeyPair(privateKey, privateKeyCertChain);
+//		credentialManager.addTrustedCertificate(trustedCertficate);
+
+		
+		// Set up a random temp directory and copy the test keystore files 
+		// from resources/security
+		Random randomGenerator = new Random();
+		String credentialManagerDirectoryPath = System
+				.getProperty("java.io.tmpdir")
+				+ System.getProperty("file.separator")
+				+ "taverna-security-"
+				+ randomGenerator.nextInt(1000000);
+		System.out.println("Credential Manager's directory path: "
+				+ credentialManagerDirectoryPath);
+		credentialManagerDirectory = new File(credentialManagerDirectoryPath);
+		if (!credentialManagerDirectory.exists()) {
+			credentialManagerDirectory.mkdir();
+		}
+		URL keystoreFileURL = CredentialManagerImplIT.class
+				.getResource("/security/t2keystore.ubr");
+		File keystoreFile = new File(keystoreFileURL.getPath());
+		File keystoreDestFile = new File(credentialManagerDirectory,
+				"taverna-keystore.ubr");
+		URL truststroreFileURL = CredentialManagerImplIT.class
+				.getResource("/security/t2truststore.ubr");
+		File truststoreFile = new File(truststroreFileURL.getPath());
+		File truststoreDestFile = new File(credentialManagerDirectory,
+				"taverna-truststore.ubr");
+		FileUtils.copyFile(keystoreFile, keystoreDestFile);
+		FileUtils.copyFile(truststoreFile, truststoreDestFile);
+		credentialManager.setConfigurationDirectoryPath(credentialManagerDirectory);
+		
+		// Create the dummy master password provider
+		masterPasswordProvider = new DummyMasterPasswordProvider();
+		masterPasswordProvider.setMasterPassword(masterPassword);
+		List<MasterPasswordProvider> masterPasswordProviders = new ArrayList<MasterPasswordProvider>();
+		masterPasswordProviders.add(masterPasswordProvider);
+		credentialManager.setMasterPasswordProviders(masterPasswordProviders);
+
+		// Set an empty list for trust confirmation providers
+		credentialManager.setTrustConfirmationProviders(new ArrayList<TrustConfirmationProvider>());
+		
+		keystoreChangedObserver = new Observer<KeystoreChangedEvent>() {		
+			@Override
+			public void notify(Observable<KeystoreChangedEvent> sender,
+					KeystoreChangedEvent message) throws Exception {
+				// TODO Auto-generated method stub
+			}
+		};
+		credentialManager.addObserver(keystoreChangedObserver);
+	}
+	
+	@AfterClass
+	@Ignore
+	// Clean up the credentialManagerDirectory we created for testing
+	public static void cleanUp(){
+
+		if (credentialManagerDirectory.exists()){
+			try {
+				FileUtils.deleteDirectory(credentialManagerDirectory);				
+				System.out.println("Deleting Credential Manager's directory: "
+						+ credentialManagerDirectory.getAbsolutePath());
+			} catch (IOException e) {
+				System.out.println(e.getStackTrace());
+			}	
+		}
+	}
+	
+	@Test
+	@Ignore
+	public void testCredentialManager() throws CMException, URISyntaxException, IOException{
+		
+		// There are 3 service username and password entries in the Keystore
+		List<URI> serviceList = credentialManager.getServiceURIsForAllUsernameAndPasswordPairs();
+		assertTrue(serviceList.size() == 3);
+		System.out.println();
+		assertTrue(serviceList.contains(serviceURI2));
+		
+		credentialManager.deleteUsernameAndPasswordForService(serviceURI3);
+		assertFalse(credentialManager.hasUsernamePasswordForService(serviceURI3));
+		
+		// There are 2 private/public key pair entries in the Keystore
+		credentialManager.hasKeyPair(privateKey, privateKeyCertChain);
+		
+		// There are Google's and heater.cs.man.ac's trusted certificates in the Truststore
+		credentialManager.hasTrustedCertificate(trustedCertficateGoogle);
+		// Open a HTTPS connection to Google
+		URL url = new URL("https://code.google.com/p/taverna/");
+		HttpsURLConnection conn;
+		conn = (HttpsURLConnection) url.openConnection();
+		// This should work
+		conn.connect();
+		assertEquals("HTTP/1.1 200 OK", conn.getHeaderField(0));
+		conn.disconnect();
+		
+		credentialManager.hasTrustedCertificate(trustedCertficateHeater);
+		// Open a HTTPS connection to heater
+		url = new URL("https://heater.cs.man.ac.uk:7443/");
+		conn = (HttpsURLConnection) url.openConnection();
+		// This should work
+		conn.connect();
+		assertEquals("HTTP/1.1 200 OK", conn.getHeaderField(0));
+		conn.disconnect();
+		
+	}
+	
+	public void generateKeystores() throws Exception{
+		
+		setUpBeforeCLass();
+		
+		// The code below sets up the Keystore and Truststore files and loads some data into them
+		// and saves them into a temp directory. These files can later be used for testing the Credential
+		// Manager with non-empty keystores.
+		Random randomGenerator = new Random();
+		String credentialManagerDirectoryPath = System
+				.getProperty("java.io.tmpdir")
+				+ System.getProperty("file.separator")
+				+ "taverna-security-"
+				+ randomGenerator.nextInt(1000000);
+		System.out.println("Credential Manager's Keystore and Truststore will be saved to: "
+				+ credentialManagerDirectoryPath);
+		credentialManagerDirectory = new File(credentialManagerDirectoryPath);
+		credentialManager.setConfigurationDirectoryPath(credentialManagerDirectory);
+		
+		// Create the dummy master password provider
+		masterPasswordProvider = new DummyMasterPasswordProvider();
+//		masterPasswordProvider.setMasterPassword(masterPassword);
+		masterPasswordProvider.setMasterPassword("uber");
+		List<MasterPasswordProvider> masterPasswordProviders = new ArrayList<MasterPasswordProvider>();
+		masterPasswordProviders.add(masterPasswordProvider);
+		credentialManager.setMasterPasswordProviders(masterPasswordProviders);
+		
+		// Add some stuff into Credential Manager
+		credentialManager.addUsernameAndPasswordForService(usernamePassword, new URI("http://heater.cs.man.ac.uk:7070/axis/services/HelloService-PlaintextPassword?wsdl"));
+
+//		credentialManager.addUsernameAndPasswordForService(usernamePassword, serviceURI);
+//		credentialManager.addUsernameAndPasswordForService(usernamePassword2, serviceURI2);
+//		credentialManager.addUsernameAndPasswordForService(usernamePassword3, serviceURI3);
+//		credentialManager.addKeyPair(privateKey, privateKeyCertChain);
+		credentialManager.addTrustedCertificate(trustedCertficateHeater);
+	}
+	
+	
+}