Class: T2Flow::Model
- Inherits:
-
Object
- Object
- T2Flow::Model
- Defined in:
- lib/t2flow/model.rb
Overview
The model for a given Taverna 2 workflow.
Instance Attribute Summary collapse
-
#dataflows ⇒ Object
The list of all the dataflows that make up the workflow.
-
#dependencies ⇒ Object
The list of any dependencies that have been found inside the workflow.
Instance Method Summary collapse
-
#annotations ⇒ Object
Retrieve the annotations within the workflow.
-
#beanshells ⇒ Object
Retrieve ALL the processors containing beanshells within the workflow.
-
#dataflow(df_id) ⇒ Object
Retrieve the dataflow with the given ID.
-
#dataflow_id ⇒ Object
Retrieve the unique dataflow ID for the top level dataflow.
-
#initialize ⇒ Model
constructor
Creates an empty model for a Taverna 2 workflow.
-
#sinks ⇒ Object
Retrieve the sinks/outputs to the workflow.
-
#sources ⇒ Object
Retrieve the sources/inputs to the workflow.
-
#top_level ⇒ Object
Retrieve the top-level dataflow ie the MAIN (containing) dataflow.
Constructor Details
#initialize ⇒ Model
Creates an empty model for a Taverna 2 workflow.
14 15 16 |
# File 'lib/t2flow/model.rb', line 14 def initialize @dataflows = [] end |
Instance Attribute Details
#dataflows ⇒ Object
The list of all the dataflows that make up the workflow.
8 9 10 |
# File 'lib/t2flow/model.rb', line 8 def dataflows @dataflows end |
#dependencies ⇒ Object
The list of any dependencies that have been found inside the workflow.
11 12 13 |
# File 'lib/t2flow/model.rb', line 11 def dependencies @dependencies end |
Instance Method Details
#annotations ⇒ Object
Retrieve the annotations within the workflow. In the event that the workflow is nested, retrieve the top-level annotations.
43 44 45 |
# File 'lib/t2flow/model.rb', line 43 def annotations @dataflows[0].annotations end |
#beanshells ⇒ Object
Retrieve ALL the processors containing beanshells within the workflow.
30 31 32 33 34 35 36 37 38 |
# File 'lib/t2flow/model.rb', line 30 def beanshells beanshells = [] @dataflows.each { |dataflow| dataflow.beanshells.each { |bean| beanshells << bean } } return beanshells end |
#dataflow(df_id) ⇒ Object
Retrieve the dataflow with the given ID
24 25 26 27 |
# File 'lib/t2flow/model.rb', line 24 def dataflow(df_id) df = @dataflows.select { |x| x.dataflow_id == df_id } return df[0] end |
#dataflow_id ⇒ Object
Retrieve the unique dataflow ID for the top level dataflow.
58 59 60 |
# File 'lib/t2flow/model.rb', line 58 def dataflow_id @dataflows[0].dataflow_id end |
#sinks ⇒ Object
Retrieve the sinks/outputs to the workflow
53 54 55 |
# File 'lib/t2flow/model.rb', line 53 def sinks @dataflows[0].sinks end |
#sources ⇒ Object
Retrieve the sources/inputs to the workflow
48 49 50 |
# File 'lib/t2flow/model.rb', line 48 def sources @dataflows[0].sources end |
#top_level ⇒ Object
Retrieve the top-level dataflow ie the MAIN (containing) dataflow
19 20 21 |
# File 'lib/t2flow/model.rb', line 19 def top_level @dataflows[0] end |