Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Table of Contents

From the story: http://www.mygrid.org.uk/dev/issues/browse/T2-9

Note

Information on this page might be outdated as it was written before the release of Taverna 2.0.

Review current code

Activities

Activity serialization exists in Tools (in maelstrom-impl). XML generated looks like:

Code Block
<activity>
	<class>
		net.sf.taverna.t2.activities.stringconstant.StringConstantActivity
	</class>
	<inputMap />
	<outputMap>
		<map from="value" to="value" />
	</outputMap>
	<java version="1.5.0_13" class="java.beans.XMLDecoder">
		<object
			class="net.sf.taverna.t2.activities.stringconstant.StringConstantConfigurationBean">
			<void property="value">
				<string>XXX</string>
			</void>
		</object>
	</java>
</activity>

or

Code Block
<activity>
	<class>
		net.sf.taverna.t2.activities.beanshell.BeanshellActivity
	</class>
	<inputMap />
	<outputMap>
		<map from="out" to="out" />
	</outputMap>
	<java version="1.5.0_13" class="java.beans.XMLDecoder">
		<object
			class="net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean">
			<void property="outputPortDefinitions">
				<void method="add">
					<object
						class="net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean">
						<void property="depth">
							<int>1</int>
						</void>
						<void property="granularDepth">
							<int>1</int>
						</void>
						<void property="mimeTypes">
							<object class="java.util.ArrayList">
								<void method="add">
									<string>l('text/plain')</string>
								</void>
							</object>
						</void>
						<void property="name">
							<string>out</string>
						</void>
					</object>
				</void>
			</void>
			<void property="script">
				<string>
					List out = new ArrayList(); out.add("one");
					out.add("two"); out.add("three");
				</string>
			</void>
		</object>
	</java>
</activity>

Dispatch Stack

Dispatch layers are currently serialized to XML. To serialize the stack, we need iterate over each layer and wrap in a <dispatch stack/> element.

example XML for a layer is:

Code Block
<layer>
	<class>
		net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize
	</class>
	<java version="1.5.0_13" class="java.beans.XMLDecoder">
		<object
			class="net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig">
			<void property="maximumJobs">
				<int>1</int>
			</void>
		</object>
	</java>
</layer>

TODO 

Gotcha's

Some notes about things that might potentially go wrong .....

  • The above example XML's where generated when running in non Raven mode, so do not generate details about the Raven artifact to use. This needs checking against running in Raven mode.
  • Java XML allows arbitary code to be executed - so switched to using XStream - needs checking that it works with Raven runtime (i.e. the pom suitably declared its dependencies).

Nested workflows

DataflowActivity has a Dataflow as an attribute of its internal configuration bean.

Rather than generate the <java>...</java> java.bean autogenerated XML for this configuration bean, it needs to be treated differently. It should add an element to indicate there is a dataflow, together with a URI like identifier, and then if add the serialized nested dataflow XML later in the overall XML document.

i.e. (very rough)

Code Block
workflow
  - <dataflow role="top">
    - <processor>
      - <activity>
        - <dataflow ref=XXX role="nested">
      - <activity>
         - <dataflow ref=YYY role="nested">
  - <dataflow id="XXX">
    - ...
  - <dataflow id="YYY">
    - ...

Content type and file extension

The official (but not yet IANA registered) content-type for Taverna 2 workflows is application/vnd.taverna.t2flow+xml and the extension .t2flow is used by Taverna 2.0.

The xmlns namespace is http://taverna.sf.net/2008/xml/t2flow

XML Schema

The official XML schema has not yet been fully developed, but an observational draft has been started to describe the format. Note that as the final format has not been finalized this is also work in progress, and might not fully describe current workflows saved from Taverna 2.