mannie-taverna-t2flow 0.0.5 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +1 -1
- data/Release_Notes.rdoc +6 -5
- data/lib/t2flow/model.rb +110 -40
- data/lib/t2flow/parser.rb +12 -0
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
= Taverna[http://taverna.sourceforge.net] 2 Interaction Gem
|
2
2
|
|
3
3
|
Authors:: Emmanuel Tagarira, David Withers
|
4
|
-
Version:: 0.0
|
4
|
+
Version:: 0.1.0
|
5
5
|
Contact:: mailto:emmanuel.tagarira@student.manchester.ac.uk
|
6
6
|
URL:: http://taverna.sourceforge.net/
|
7
7
|
Licence:: LGPL 3 (See LICENCE or http://www.gnu.org/licenses/lgpl.html)
|
data/Release_Notes.rdoc
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
-
= Version 0.0
|
2
|
-
|
3
|
-
== Bug fixes
|
4
|
-
- BioMart services now return a type value instead of nil when processor.type is invoked.
|
1
|
+
= Version 0.1.0
|
2
|
+
Released:: Monday, September 14, 2009
|
5
3
|
|
6
4
|
== Added Functionality
|
7
|
-
-
|
5
|
+
- Retrieval of processors directly connected/linked to the given processor.
|
6
|
+
=== New instance method in T2Flow::Model
|
7
|
+
get_processor_links(processor)
|
8
|
+
=== New supporting object T2Flow::ProcessorLinks
|
data/lib/t2flow/model.rb
CHANGED
@@ -28,13 +28,12 @@ module T2Flow # :nodoc:
|
|
28
28
|
|
29
29
|
# Retrieve ALL the processors containing beanshells within the workflow.
|
30
30
|
def beanshells
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
}
|
37
|
-
return beanshells
|
31
|
+
self.all_processors.select { |x| x.type == "beanshell" }
|
32
|
+
end
|
33
|
+
|
34
|
+
# Retrieve ALL processors of that are webservices WITHIN the model.
|
35
|
+
def web_services
|
36
|
+
self.all_processors.select { |x| x.type =~ /wsdl|soaplab|biomoby/i }
|
38
37
|
end
|
39
38
|
|
40
39
|
# Retrieve the datalinks from the top level of a nested workflow.
|
@@ -46,12 +45,8 @@ module T2Flow # :nodoc:
|
|
46
45
|
# Retrieve ALL the datalinks within a nested workflow
|
47
46
|
def all_datalinks
|
48
47
|
links = []
|
49
|
-
@dataflows.each { |dataflow|
|
50
|
-
|
51
|
-
links << link
|
52
|
-
}
|
53
|
-
}
|
54
|
-
return links
|
48
|
+
@dataflows.each { |dataflow| links << dataflow.datalinks }
|
49
|
+
return links.flatten
|
55
50
|
end
|
56
51
|
|
57
52
|
# Retrieve the annotations specific to the workflow. This does not return
|
@@ -69,12 +64,8 @@ module T2Flow # :nodoc:
|
|
69
64
|
# Retrieve ALL the processors found in a nested workflow
|
70
65
|
def all_processors
|
71
66
|
procs =[]
|
72
|
-
@dataflows.each { |dataflow|
|
73
|
-
|
74
|
-
procs << proc
|
75
|
-
}
|
76
|
-
}
|
77
|
-
return procs
|
67
|
+
@dataflows.each { |dataflow| procs << dataflow.processors }
|
68
|
+
return procs.flatten
|
78
69
|
end
|
79
70
|
|
80
71
|
# Retrieve the sources(inputs) to the workflow
|
@@ -85,12 +76,8 @@ module T2Flow # :nodoc:
|
|
85
76
|
# Retrieve ALL the sources(inputs) within the workflow
|
86
77
|
def all_sources
|
87
78
|
sources =[]
|
88
|
-
@dataflows.each { |dataflow|
|
89
|
-
|
90
|
-
sources << source
|
91
|
-
}
|
92
|
-
}
|
93
|
-
return sources
|
79
|
+
@dataflows.each { |dataflow| sources << dataflow.sources }
|
80
|
+
return sources.flatten
|
94
81
|
end
|
95
82
|
|
96
83
|
# Retrieve the sinks(outputs) to the workflow
|
@@ -101,18 +88,64 @@ module T2Flow # :nodoc:
|
|
101
88
|
# Retrieve ALL the sinks(outputs) within the workflow
|
102
89
|
def all_sinks
|
103
90
|
sinks =[]
|
104
|
-
@dataflows.each { |dataflow|
|
105
|
-
|
106
|
-
sinks << sink
|
107
|
-
}
|
108
|
-
}
|
109
|
-
return sinks
|
91
|
+
@dataflows.each { |dataflow| sinks << dataflow.sinks }
|
92
|
+
return sinks.flatten
|
110
93
|
end
|
111
94
|
|
112
95
|
# Retrieve the unique dataflow ID for the top level dataflow.
|
113
96
|
def model_id
|
114
97
|
self.main.dataflow_id
|
115
98
|
end
|
99
|
+
|
100
|
+
# For the given dataflow, return the beanshells and/or services which
|
101
|
+
# have direct links to or from the given processor.
|
102
|
+
# If no dataflow is specified, the top-level dataflow is used.
|
103
|
+
# This does a recursive search in nested workflows.
|
104
|
+
# == Usage
|
105
|
+
# my_processor = model.processor[0]
|
106
|
+
# linked_processors = model.get_processors_linked_to(my_processor)
|
107
|
+
# processors_feeding_into_my_processor = linked_processors.sources
|
108
|
+
# processors_feeding_from_my_processor = linked_processors.sinks
|
109
|
+
def get_processor_links(processor)
|
110
|
+
return nil unless processor
|
111
|
+
proc_links = ProcessorLinks.new
|
112
|
+
|
113
|
+
# SOURCES
|
114
|
+
sources = self.all_datalinks.select { |x| x.sink =~ /#{processor.name}:.+/ }
|
115
|
+
proc_links.sources = []
|
116
|
+
|
117
|
+
# SINKS
|
118
|
+
sinks = self.all_datalinks.select { |x| x.source =~ /#{processor.name}:.+/ }
|
119
|
+
proc_links.sinks = []
|
120
|
+
temp_sinks = []
|
121
|
+
sinks.each { |x| temp_sinks << x.sink }
|
122
|
+
|
123
|
+
# Match links by port into format
|
124
|
+
# my_port:name_of_link_im_linked_to:its_port
|
125
|
+
sources.each do |connection|
|
126
|
+
link = connection.sink
|
127
|
+
connected_proc_name = link.split(":")[0]
|
128
|
+
my_connection_port = link.split(":")[1]
|
129
|
+
|
130
|
+
if my_connection_port
|
131
|
+
source = my_connection_port << ":" << connection.source
|
132
|
+
proc_links.sources << source if source.split(":").size == 3
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
sinks.each do |connection|
|
137
|
+
link = connection.source
|
138
|
+
connected_proc_name = link.split(":")[0]
|
139
|
+
my_connection_port = link.split(":")[1]
|
140
|
+
|
141
|
+
if my_connection_port
|
142
|
+
sink = my_connection_port << ":" << connection.sink
|
143
|
+
proc_links.sinks << sink if sink.split(":").size == 3
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
return proc_links
|
148
|
+
end
|
116
149
|
end
|
117
150
|
|
118
151
|
|
@@ -121,22 +154,22 @@ module T2Flow # :nodoc:
|
|
121
154
|
# elements of the workflows; processors, sinks, sources, etc...
|
122
155
|
class Dataflow
|
123
156
|
# This returns a DataflowAnnotation object.
|
124
|
-
|
157
|
+
attr_accessor :annotations
|
125
158
|
|
126
159
|
# Retrieve the list of processors specific to the dataflow.
|
127
|
-
|
160
|
+
attr_accessor :processors
|
128
161
|
|
129
162
|
# Retrieve the list of datalinks specific to the dataflow.
|
130
|
-
|
163
|
+
attr_accessor :datalinks
|
131
164
|
|
132
165
|
# Retrieve the list of sources specific to the dataflow.
|
133
|
-
|
166
|
+
attr_accessor :sources
|
134
167
|
|
135
168
|
# Retrieve the list of sinks specific to the dataflow.
|
136
|
-
|
169
|
+
attr_accessor :sinks
|
137
170
|
|
138
171
|
# Retrieve the list of coordinations specific to the dataflow.
|
139
|
-
|
172
|
+
attr_accessor :coordinations
|
140
173
|
|
141
174
|
# The unique identifier of the dataflow.
|
142
175
|
attr_accessor :dataflow_id
|
@@ -156,8 +189,8 @@ module T2Flow # :nodoc:
|
|
156
189
|
@processors.select { |x| x.type == "beanshell" }
|
157
190
|
end
|
158
191
|
end
|
159
|
-
|
160
|
-
|
192
|
+
|
193
|
+
|
161
194
|
|
162
195
|
# This is the (shim) object within the workflow. This can be a beanshell,
|
163
196
|
# a webservice, a workflow, etc...
|
@@ -172,7 +205,7 @@ module T2Flow # :nodoc:
|
|
172
205
|
# A string for the type of processor, e.g. beanshell, workflow, webservice, etc...
|
173
206
|
attr_accessor :type
|
174
207
|
|
175
|
-
# For processors that have type
|
208
|
+
# For processors that have type "dataflow", this is the the reference
|
176
209
|
# to the dataflow. For all other processor types, this is nil.
|
177
210
|
attr_accessor :dataflow_id
|
178
211
|
|
@@ -185,9 +218,46 @@ module T2Flow # :nodoc:
|
|
185
218
|
|
186
219
|
# This is a list of outputs that the processor can produce.
|
187
220
|
attr_accessor :outputs
|
221
|
+
|
222
|
+
# For processors of type "arbitrarywsdl", this is the URI to the location
|
223
|
+
# of the wsdl file.
|
224
|
+
attr_accessor :wsdl
|
225
|
+
|
226
|
+
# For processors of type "arbitrarywsdl", this is the operation invoked.
|
227
|
+
attr_accessor :wsdl_operation
|
228
|
+
|
229
|
+
# For soaplab and biomoby services, this is the endpoint URI.
|
230
|
+
attr_accessor :endpoint
|
231
|
+
|
232
|
+
# Authority name for the biomoby service.
|
233
|
+
attr_accessor :biomoby_authority_name
|
234
|
+
|
235
|
+
# Service name for the biomoby service. This is not necessarily the same
|
236
|
+
# as the processors name.
|
237
|
+
attr_accessor :biomoby_service_name
|
238
|
+
|
239
|
+
# Category for the biomoby service.
|
240
|
+
attr_accessor :biomoby_category
|
188
241
|
end
|
189
242
|
|
190
243
|
|
244
|
+
# This object is returned after invoking model.get_processor_links(processor)
|
245
|
+
# . The object contains two lists of processors. Each element consists of:
|
246
|
+
# the input or output port the processor uses as a link, the name of the
|
247
|
+
# processor being linked, and the port of the processor used for the linking,
|
248
|
+
# all seperated by a colon (:) i.e.
|
249
|
+
# my_port:name_of_processor:processor_port
|
250
|
+
class ProcessorLinks
|
251
|
+
# The processors whose output is fed as input into the processor used in
|
252
|
+
# model.get_processors_linked_to(processor).
|
253
|
+
attr_accessor :sources
|
254
|
+
|
255
|
+
# A list of processors that are fed the output from the processor (used in
|
256
|
+
# model.get_processors_linked_to(processor) ) as input.
|
257
|
+
attr_accessor :sinks
|
258
|
+
end
|
259
|
+
|
260
|
+
|
191
261
|
|
192
262
|
# This is the annotation object specific to the dataflow it belongs to.
|
193
263
|
# A DataflowAnnotation contains metadata about a given dataflow element.
|
data/lib/t2flow/parser.rb
CHANGED
@@ -162,6 +162,18 @@ module T2Flow
|
|
162
162
|
|
163
163
|
activity_node.each do |value_node|
|
164
164
|
case value_node.name
|
165
|
+
when "wsdl"
|
166
|
+
processor.wsdl = value_node.content
|
167
|
+
when "operation"
|
168
|
+
processor.wsdl_operation = value_node.content
|
169
|
+
when /endpoint/i
|
170
|
+
processor.endpoint = value_node.content
|
171
|
+
when /servicename/i
|
172
|
+
processor.biomoby_service_name = value_node.content
|
173
|
+
when /authorityname/i
|
174
|
+
processor.biomoby_authority_name = value_node.content
|
175
|
+
when "category"
|
176
|
+
processor.biomoby_category = value_node.content
|
165
177
|
when "script"
|
166
178
|
processor.script = value_node.content
|
167
179
|
when "inputs" # ALL ports present in beanshell
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mannie-taverna-t2flow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emmanuel Tagarira
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire: t2flow
|
10
10
|
bindir: bin
|
11
11
|
cert_chain:
|
12
|
-
date: 2009-09-
|
12
|
+
date: 2009-09-14 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|