taverna-t2flow 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.rdoc ADDED
@@ -0,0 +1,16 @@
1
+ = Changes log for the T2Flow Ruby Gem
2
+
3
+ == Version 0.3.0
4
+
5
+ * Minor changes for ruby 1.9 compatibility.
6
+
7
+ == Version 0.2.0
8
+
9
+ * Updated the unit tests which can now be run by entering "ruby tests/run_tests.rb"
10
+ * Added the following methods to the T2Flow::Model class: coordinates, all_coordinates, name
11
+
12
+ == About this CHANGES file
13
+
14
+ This file is, at least in part, generated by the following command:
15
+
16
+ $ git log --pretty=format:"* %s" --reverse --no-merges <commit-hash>..
data/README.rdoc CHANGED
@@ -1,36 +1,41 @@
1
1
  = Taverna[http://taverna.sourceforge.net] 2 Interaction Gem
2
2
 
3
- Authors:: Mannie Tagarira, David Withers
4
- Version:: 0.2.0
5
- Contact:: mailto:mannie@mygrid.org.uk
6
- URL:: http://taverna.sourceforge.net/
3
+ Authors:: Robert Haines, Mannie Tagarira, David Withers
4
+ Contact:: mailto:support@mygrid.org.uk
5
+ URL:: http://www.taverna.org.uk/
7
6
  Licence:: LGPL 3 (See LICENCE or http://www.gnu.org/licenses/lgpl.html)
8
- Copyright:: (c) 2008-2009 University of Manchester, UK
9
-
10
-
7
+ Copyright:: (c) 2008-2012, University of Manchester, UK
11
8
 
12
9
  == Synopsis
13
10
 
14
- This is a Ruby library to support the interaction with Taverna[http://taverna.sourceforge.net] version 2 workflows (T2Flows). This relies on the functionality provided by the libxml library. To be able to utilise this gem to its full potential, you will need to have the following installed on your system.
11
+ This is a Ruby library to support the interaction with
12
+ Taverna[http://taverna.sourceforge.net] version 2 workflows (T2Flows). This
13
+ relies on the functionality provided by the libxml-ruby library. To be able
14
+ to utilise this gem to its full potential, you will need to have the following
15
+ installed on your system.
15
16
  - GraphViz[http://www.graphviz.org/Download.php] (a graph visualization package)
16
17
 
17
-
18
-
19
18
  == The T2Flow Model Implementation
20
19
 
21
- Much like the Taverna[http://taverna.sourceforge.net] 1 Scufl model, T2Flows contain Processors, Sinks, and Sources. T2Flows however, encapsulate these elements within Dataflow objects. A Dataflow objects is the container for all the different elements present within the Taverna[http://taverna.sourceforge.net] 2 workflows, hence a single T2Flow may have one or more dataflows. WorkflowDescriptions and Links, from the original Taverna[http://taverna.sourceforge.net] 1 workflows (Scufl), have been renamed in T2Flows to DataflowAnnotations and Datalinks respectively. DataflowAnnotations, however, allow for multiple titles, authors, and descriptions, as opposed to the single value attributes held for Scufls.
22
-
23
-
20
+ Much like the Taverna[http://taverna.sourceforge.net] 1 Scufl model, T2Flows
21
+ contain Processors, Sinks, and Sources. T2Flows however, encapsulate these
22
+ elements within Dataflow objects. A Dataflow objects is the container for all
23
+ the different elements present within the
24
+ Taverna[http://taverna.sourceforge.net] 2 workflows, hence a single T2Flow may
25
+ have one or more dataflows. WorkflowDescriptions and Links, from the original
26
+ Taverna[http://taverna.sourceforge.net] 1 workflows (Scufl), have been renamed
27
+ in T2Flows to DataflowAnnotations and Datalinks respectively.
28
+ DataflowAnnotations, however, allow for multiple titles, authors, and
29
+ descriptions, as opposed to the single value attributes held for Scufls.
24
30
 
25
31
  == Installation
26
32
  To install the Taverna 2 gem, type into your command prompt:
27
33
  [sudo] gem install taverna-t2flow
28
34
 
29
-
30
-
31
35
  == Usage
32
36
 
33
- To be able to generate at least a T2Flow model using the gem, you need to include in your ruby code the following lines:
37
+ To be able to generate at least a T2Flow model using the gem, you need to
38
+ include in your ruby code the following lines:
34
39
  require "t2flow/model.rb"
35
40
  require "t2flow/parser.rb"
36
41
 
@@ -42,7 +47,8 @@ Alternatively:
42
47
  foo = File.new("path/to/workflow/file", "r").read
43
48
  bar = T2Flow::Parser.new.parse(foo)
44
49
 
45
- You will then be able to use your T2Flow model to retrieve information about the workflow by invoking the different methods and attributes.
50
+ You will then be able to use your T2Flow model to retrieve information about
51
+ the workflow by invoking the different methods and attributes.
46
52
  bar.INVOKED
47
53
  ... where INVOKED is the method or attribute required.
48
54
 
@@ -55,17 +61,20 @@ You can also interact with remote workflows.
55
61
  To be enable you to draw images of the T2Flow, you need to include:
56
62
  require "t2flow/dot.rb"
57
63
 
58
- To be able to use any functionality included in "t2flow/dot.rb", you need to have GraphViz[http://www.graphviz.org/Download.php] installed on your system. Once this package has been installed, you may use the gem to draw an image showing the structure of the T2Flow as follows.
64
+ To be able to use any functionality included in "t2flow/dot.rb", you need to
65
+ have GraphViz[http://www.graphviz.org/Download.php] installed on your system.
66
+ Once this package has been installed, you may use the gem to draw an image
67
+ showing the structure of the T2Flow as follows.
59
68
  out_file = File.new("path/to/file/you/want/the/dot/script/to/be/written", "w+")
60
69
  T2Flow::Dot.new.write_dot(out_file, bar)
61
70
  `dot -Tpng -o"path/to/the/output/image" #{out_file.path}`
62
- The last line draws a PNG image using +out_file+. To learn more about dot, try typing into your command prompt:
71
+
72
+ The last line draws a PNG image using +out_file+. To learn more about dot,
73
+ try typing into your command prompt:
63
74
  % man dot
64
75
  or
65
76
  % dot -h
66
77
 
67
-
68
-
69
78
  == References
70
79
 
71
80
  [1] http://taverna.sourceforge.net
data/Rakefile ADDED
@@ -0,0 +1,54 @@
1
+ # Copyright (c) 2012 The University of Manchester, UK.
2
+ #
3
+ # See LICENCE file for details.
4
+ #
5
+ # Author: Robert Haines
6
+
7
+ require 'rubygems'
8
+ require 'rake'
9
+ require 'rake/clean'
10
+ require 'rake/tasklib'
11
+ require 'rake/testtask'
12
+ require 'rdoc/task'
13
+ require 'jeweler'
14
+
15
+ task :default => [:test]
16
+
17
+ T2FLOW_GEM_VERSION = "0.3.0"
18
+
19
+ Jeweler::Tasks.new do |s|
20
+ s.name = "taverna-t2flow"
21
+ s.version = T2FLOW_GEM_VERSION
22
+ s.authors = ["Robert Haines", "David Withers", "Mannie Tagarira"]
23
+ s.email = ["rhaines@manchester.ac.uk"]
24
+ s.homepage = "http://www.taverna.org.uk/"
25
+ s.platform = Gem::Platform::RUBY
26
+ s.summary = "Support for interacting with Taverna 2 workflows."
27
+ s.description = "This a gem developed by myGrid for the purpose of " +
28
+ "interacting with Taverna 2 workflows. An example use would be the " +
29
+ "image genaration for the model representing Taverna 2 workflows as " +
30
+ "used in myExperiment."
31
+ s.require_path = "lib"
32
+ s.test_file = "test/run_tests.rb"
33
+ s.has_rdoc = true
34
+ s.extra_rdoc_files = ["README.rdoc", "LICENCE", "CHANGES.rdoc"]
35
+ s.rdoc_options = ["-N", "--tab-width=2", "--main=README.rdoc"]
36
+ s.add_development_dependency('rake', '~> 0.9.2')
37
+ s.add_development_dependency('rdoc', '>= 3.9.4')
38
+ s.add_development_dependency('jeweler', '~> 1.8.3')
39
+ s.add_runtime_dependency('libxml-ruby', '>= 1.1.4')
40
+ end
41
+
42
+ Rake::TestTask.new do |t|
43
+ t.libs << "test"
44
+ t.test_files = FileList['test/run_tests.rb']
45
+ end
46
+
47
+ RDoc::Task.new do |r|
48
+ r.main = "README.rdoc"
49
+ lib = Dir.glob("lib/**/*.rb")
50
+ r.rdoc_files.include("README.rdoc", "LICENCE", "CHANGES.rdoc", lib)
51
+ r.options << "-t Taverna T2Flow Library version #{T2FLOW_GEM_VERSION}"
52
+ r.options << "-N"
53
+ r.options << "--tab-width=2"
54
+ end
data/lib/t2flow/model.rb CHANGED
@@ -198,6 +198,9 @@ module T2Flow # :nodoc:
198
198
  # The unique identifier of the dataflow.
199
199
  attr_accessor :dataflow_id
200
200
 
201
+ # The role of the workflow
202
+ attr_accessor :role
203
+
201
204
  # Creates a new Dataflow object.
202
205
  def initialize
203
206
  @annotations = DataflowAnnotation.new
@@ -266,6 +269,10 @@ module T2Flow # :nodoc:
266
269
 
267
270
  # Category for the biomoby service.
268
271
  attr_accessor :biomoby_category
272
+
273
+ # Value for string constants
274
+ attr_accessor :value
275
+
269
276
  end
270
277
 
271
278
 
data/lib/t2flow/parser.rb CHANGED
@@ -45,6 +45,7 @@ module T2Flow
45
45
 
46
46
  dataflow_obj = Dataflow.new
47
47
  dataflow_obj.dataflow_id = dataflow["id"]
48
+ dataflow_obj.role = dataflow["role"]
48
49
 
49
50
  dataflow.each do |elt|
50
51
  case elt.name
@@ -84,7 +85,8 @@ module T2Flow
84
85
 
85
86
  port.each do |elt|
86
87
  case elt.name
87
- when "name": source.name = elt.content
88
+ when "name"
89
+ source.name = elt.content
88
90
  when "annotations"
89
91
  elt.each do |ann|
90
92
  next if ann.nil? || ann.content.chomp.strip.empty?
@@ -115,7 +117,8 @@ module T2Flow
115
117
 
116
118
  port.each do |elt|
117
119
  case elt.name
118
- when "name": sink.name = elt.content
120
+ when "name"
121
+ sink.name = elt.content
119
122
  when "annotations"
120
123
  elt.each do |ann|
121
124
  next if ann.nil? || ann.content.chomp.strip.empty?
@@ -188,6 +191,8 @@ module T2Flow
188
191
  processor.biomoby_category = value_node.content
189
192
  when "script"
190
193
  processor.script = value_node.content
194
+ when "value"
195
+ processor.value = value_node.content
191
196
  when "inputs" # ALL ports present in beanshell
192
197
  value_node.each { |input|
193
198
  input.each { |x|
@@ -0,0 +1,76 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "taverna-t2flow"
8
+ s.version = "0.3.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Robert Haines", "David Withers", "Mannie Tagarira"]
12
+ s.date = "2012-05-02"
13
+ s.description = "This a gem developed by myGrid for the purpose of interacting with Taverna 2 workflows. An example use would be the image genaration for the model representing Taverna 2 workflows as used in myExperiment."
14
+ s.email = ["rhaines@manchester.ac.uk"]
15
+ s.extra_rdoc_files = [
16
+ "CHANGES.rdoc",
17
+ "LICENCE",
18
+ "README.rdoc"
19
+ ]
20
+ s.files = [
21
+ "CHANGES.rdoc",
22
+ "LICENCE",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "lib/t2flow/dot.rb",
26
+ "lib/t2flow/model.rb",
27
+ "lib/t2flow/parser.rb",
28
+ "taverna-t2flow.gemspec",
29
+ "test/fixtures/1000.t2flow",
30
+ "test/fixtures/1001.t2flow",
31
+ "test/fixtures/1002.t2flow",
32
+ "test/fixtures/1003.t2flow",
33
+ "test/fixtures/1004.t2flow",
34
+ "test/fixtures/996.t2flow",
35
+ "test/fixtures/997.t2flow",
36
+ "test/fixtures/998.t2flow",
37
+ "test/fixtures/999.t2flow",
38
+ "test/fixtures/basic.t2flow",
39
+ "test/fixtures/coordinated.t2flow",
40
+ "test/fixtures/linked.t2flow",
41
+ "test/fixtures/nested.t2flow",
42
+ "test/fixtures/processors.t2flow",
43
+ "test/run_tests.rb",
44
+ "test/test_bogus_workflows.rb",
45
+ "test/test_helper.rb",
46
+ "test/test_starter_pack_workflows.rb"
47
+ ]
48
+ s.homepage = "http://www.taverna.org.uk/"
49
+ s.rdoc_options = ["-N", "--tab-width=2", "--main=README.rdoc"]
50
+ s.require_paths = ["lib"]
51
+ s.rubygems_version = "1.8.10"
52
+ s.summary = "Support for interacting with Taverna 2 workflows."
53
+ s.test_files = ["test/run_tests.rb"]
54
+
55
+ if s.respond_to? :specification_version then
56
+ s.specification_version = 3
57
+
58
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
59
+ s.add_development_dependency(%q<rake>, ["~> 0.9.2"])
60
+ s.add_development_dependency(%q<rdoc>, [">= 3.9.4"])
61
+ s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
62
+ s.add_runtime_dependency(%q<libxml-ruby>, [">= 1.1.4"])
63
+ else
64
+ s.add_dependency(%q<rake>, ["~> 0.9.2"])
65
+ s.add_dependency(%q<rdoc>, [">= 3.9.4"])
66
+ s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
67
+ s.add_dependency(%q<libxml-ruby>, [">= 1.1.4"])
68
+ end
69
+ else
70
+ s.add_dependency(%q<rake>, ["~> 0.9.2"])
71
+ s.add_dependency(%q<rdoc>, [">= 3.9.4"])
72
+ s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
73
+ s.add_dependency(%q<libxml-ruby>, [">= 1.1.4"])
74
+ end
75
+ end
76
+
@@ -0,0 +1,244 @@
1
+ <workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.1.0"><dataflow id="fe9a837d-317c-4921-bace-bff3a9ffd837" role="top"><name>Fetch_PDB_flatfile_from_RCSB_server</name><inputPorts><port><name>pdbID</name><depth>0</depth><granularDepth>0</granularDepth><annotations><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
2
+ <annotationAssertions>
3
+ <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
4
+ <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.FreeTextDescription">
5
+ <text>PDB identifier such as '1crn'</text>
6
+ </annotationBean>
7
+ <date>2009-12-15 21:05:33.450 GMT</date>
8
+ <creators />
9
+ <curationEventList />
10
+ </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
11
+ </annotationAssertions>
12
+ </net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
13
+ <annotationAssertions>
14
+ <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
15
+ <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.ExampleValue">
16
+ <text>1crn</text>
17
+ </annotationBean>
18
+ <date>2009-12-15 21:05:16.196 GMT</date>
19
+ <creators />
20
+ <curationEventList />
21
+ </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
22
+ </annotationAssertions>
23
+ </net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain></annotations></port></inputPorts><outputPorts><port><name>pdbFlatFile</name><annotations /></port></outputPorts><processors><processor><name>AddPrefixToID</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.0</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 from="output" to="output" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
24
+ <localworkerName>org.embl.ebi.escience.scuflworkers.java.StringConcat</localworkerName>
25
+ <script>output = string1 + string2;</script>
26
+ <dependencies />
27
+ <classLoaderSharing>workflow</classLoaderSharing>
28
+ <localDependencies />
29
+ <artifactDependencies />
30
+ <inputs>
31
+ <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
32
+ <handledReferenceSchemes />
33
+ <translatedElementType>java.lang.String</translatedElementType>
34
+ <allowsLiteralValues>true</allowsLiteralValues>
35
+ <name>string1</name>
36
+ <depth>0</depth>
37
+ <mimeTypes>
38
+ <string>'text/plain'</string>
39
+ </mimeTypes>
40
+ </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
41
+ <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
42
+ <handledReferenceSchemes />
43
+ <translatedElementType>java.lang.String</translatedElementType>
44
+ <allowsLiteralValues>true</allowsLiteralValues>
45
+ <name>string2</name>
46
+ <depth>0</depth>
47
+ <mimeTypes>
48
+ <string>'text/plain'</string>
49
+ </mimeTypes>
50
+ </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
51
+ </inputs>
52
+ <outputs>
53
+ <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
54
+ <granularDepth>0</granularDepth>
55
+ <name>output</name>
56
+ <depth>0</depth>
57
+ <mimeTypes>
58
+ <string>'text/plain'</string>
59
+ </mimeTypes>
60
+ </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
61
+ </outputs>
62
+ </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.0</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="">
63
+ <maxJobs>1</maxJobs>
64
+ </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.0</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.0</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.0</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="">
65
+ <backoffFactor>1.0</backoffFactor>
66
+ <initialDelay>1000</initialDelay>
67
+ <maxDelay>5000</maxDelay>
68
+ <maxRetries>0</maxRetries>
69
+ </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.0</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><processor><name>AddSuffix</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.0</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 from="output" to="output" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
70
+ <localworkerName>org.embl.ebi.escience.scuflworkers.java.StringConcat</localworkerName>
71
+ <script>output = string1 + string2;</script>
72
+ <dependencies />
73
+ <classLoaderSharing>workflow</classLoaderSharing>
74
+ <localDependencies />
75
+ <artifactDependencies />
76
+ <inputs>
77
+ <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
78
+ <handledReferenceSchemes />
79
+ <translatedElementType>java.lang.String</translatedElementType>
80
+ <allowsLiteralValues>true</allowsLiteralValues>
81
+ <name>string1</name>
82
+ <depth>0</depth>
83
+ <mimeTypes>
84
+ <string>'text/plain'</string>
85
+ </mimeTypes>
86
+ </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
87
+ <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
88
+ <handledReferenceSchemes />
89
+ <translatedElementType>java.lang.String</translatedElementType>
90
+ <allowsLiteralValues>true</allowsLiteralValues>
91
+ <name>string2</name>
92
+ <depth>0</depth>
93
+ <mimeTypes>
94
+ <string>'text/plain'</string>
95
+ </mimeTypes>
96
+ </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
97
+ </inputs>
98
+ <outputs>
99
+ <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
100
+ <granularDepth>0</granularDepth>
101
+ <name>output</name>
102
+ <depth>0</depth>
103
+ <mimeTypes>
104
+ <string>'text/plain'</string>
105
+ </mimeTypes>
106
+ </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
107
+ </outputs>
108
+ </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.0</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="">
109
+ <maxJobs>1</maxJobs>
110
+ </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.0</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.0</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.0</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="">
111
+ <backoffFactor>1.0</backoffFactor>
112
+ <initialDelay>1000</initialDelay>
113
+ <maxDelay>5000</maxDelay>
114
+ <maxRetries>0</maxRetries>
115
+ </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.0</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>FetchPage</name><inputPorts><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.0</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivity</class><inputMap><map from="url" to="url" /></inputMap><outputMap><map from="image" to="image" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
116
+ <localworkerName>org.embl.ebi.escience.scuflworkers.java.WebImageFetcher</localworkerName>
117
+ <script>URL inputURL = null;
118
+ if (base != void) {
119
+ inputURL = new URL(new URL(base), url);
120
+ } else {
121
+ inputURL = new URL(url);
122
+ }
123
+
124
+ byte[] contents;
125
+ if (inputURL.openConnection().getContentLength() == -1) {
126
+ // Content size unknown, must read first...
127
+ byte[] buffer = new byte[1024];
128
+ int bytesRead = 0;
129
+ int totalBytesRead = 0;
130
+ InputStream is = inputURL.openStream();
131
+ while (bytesRead != -1) {
132
+ totalBytesRead += bytesRead;
133
+ bytesRead = is.read(buffer, 0, 1024);
134
+ }
135
+ contents = new byte[totalBytesRead];
136
+ } else {
137
+ contents = new byte[inputURL.openConnection().getContentLength()];
138
+ }
139
+ int bytesRead = 0;
140
+ int totalBytesRead = 0;
141
+ InputStream is = inputURL.openStream();
142
+ while (bytesRead != -1) {
143
+ bytesRead = is.read(contents, totalBytesRead, contents.length - totalBytesRead);
144
+ totalBytesRead += bytesRead;
145
+ if (contents.length==totalBytesRead) break;
146
+ }
147
+
148
+ image = contents;
149
+ </script>
150
+ <dependencies />
151
+ <classLoaderSharing>workflow</classLoaderSharing>
152
+ <localDependencies />
153
+ <artifactDependencies />
154
+ <inputs>
155
+ <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
156
+ <handledReferenceSchemes />
157
+ <translatedElementType>java.lang.String</translatedElementType>
158
+ <allowsLiteralValues>true</allowsLiteralValues>
159
+ <name>url</name>
160
+ <depth>0</depth>
161
+ <mimeTypes>
162
+ <string>'text/x-taverna-web-url'</string>
163
+ </mimeTypes>
164
+ </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
165
+ <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
166
+ <handledReferenceSchemes />
167
+ <translatedElementType>java.lang.String</translatedElementType>
168
+ <allowsLiteralValues>true</allowsLiteralValues>
169
+ <name>base</name>
170
+ <depth>0</depth>
171
+ <mimeTypes>
172
+ <string>'text/x-taverna-web-url'</string>
173
+ </mimeTypes>
174
+ </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
175
+ </inputs>
176
+ <outputs>
177
+ <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
178
+ <granularDepth>0</granularDepth>
179
+ <name>image</name>
180
+ <depth>0</depth>
181
+ <mimeTypes>
182
+ <string>'image/*'</string>
183
+ </mimeTypes>
184
+ </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
185
+ </outputs>
186
+ </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.0</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="">
187
+ <maxJobs>1</maxJobs>
188
+ </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.0</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.0</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.0</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="">
189
+ <backoffFactor>1.0</backoffFactor>
190
+ <initialDelay>1000</initialDelay>
191
+ <maxDelay>5000</maxDelay>
192
+ <maxRetries>0</maxRetries>
193
+ </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.0</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>RCSBPrefix</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.0</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="">
194
+ <value>http://www.rcsb.org/pdb/cgi/export.cgi/1CRN.pdb?format=PDB&amp;pdbId=</value>
195
+ </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.0</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="">
196
+ <maxJobs>1</maxJobs>
197
+ </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.0</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.0</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.0</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="">
198
+ <backoffFactor>1.0</backoffFactor>
199
+ <initialDelay>1000</initialDelay>
200
+ <maxDelay>5000</maxDelay>
201
+ <maxRetries>0</maxRetries>
202
+ </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.0</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>RCSBSuffix</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.0</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="">
203
+ <value>&amp;compression=None</value>
204
+ </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.0</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="">
205
+ <maxJobs>1</maxJobs>
206
+ </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.0</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.0</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.0</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="">
207
+ <backoffFactor>1.0</backoffFactor>
208
+ <initialDelay>1000</initialDelay>
209
+ <maxDelay>5000</maxDelay>
210
+ <maxRetries>0</maxRetries>
211
+ </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.0</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>AddPrefixToID</processor><port>string1</port></sink><source type="processor"><processor>RCSBPrefix</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>AddPrefixToID</processor><port>string2</port></sink><source type="dataflow"><port>pdbID</port></source></datalink><datalink><sink type="processor"><processor>AddSuffix</processor><port>string2</port></sink><source type="processor"><processor>RCSBSuffix</processor><port>value</port></source></datalink><datalink><sink type="processor"><processor>AddSuffix</processor><port>string1</port></sink><source type="processor"><processor>AddPrefixToID</processor><port>output</port></source></datalink><datalink><sink type="processor"><processor>FetchPage</processor><port>url</port></sink><source type="processor"><processor>AddSuffix</processor><port>output</port></source></datalink><datalink><sink type="dataflow"><port>pdbFlatFile</port></sink><source type="processor"><processor>FetchPage</processor><port>image</port></source></datalink></datalinks><annotations><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
212
+ <annotationAssertions>
213
+ <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
214
+ <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.Author">
215
+ <text>Tom Oinn</text>
216
+ </annotationBean>
217
+ <date>2009-12-15 21:05:51.281 GMT</date>
218
+ <creators />
219
+ <curationEventList />
220
+ </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
221
+ </annotationAssertions>
222
+ </net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
223
+ <annotationAssertions>
224
+ <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
225
+ <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.FreeTextDescription">
226
+ <text>Given an identifier such as '1crn' fetches the PDB format flatfile from the RCSB</text>
227
+ </annotationBean>
228
+ <date>2009-12-15 21:06:13.245 GMT</date>
229
+ <creators />
230
+ <curationEventList />
231
+ </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
232
+ </annotationAssertions>
233
+ </net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
234
+ <annotationAssertions>
235
+ <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
236
+ <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.DescriptiveTitle">
237
+ <text>Fetch PDB flatfile from RCSB server</text>
238
+ </annotationBean>
239
+ <date>2009-12-15 21:06:02.76 GMT</date>
240
+ <creators />
241
+ <curationEventList />
242
+ </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
243
+ </annotationAssertions>
244
+ </net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain></annotations></dataflow></workflow>