The SCUFL2 API provides Java classes that can be used independently from Taverna to inspect, modify and generate SCUFL2 workflows.

Overview

The code and definitions for SCUFL2 are kept in the GitHub project scufl2.

Modules

Official modules:

Experimental modules:

Maven

The simplest way to use the SCUFL2 API is to use Maven 3 (Maven 2 should also work) and the myGrid Maven repository. See the example pom.xml.

In short, add:

<properties>
	<scufl2.version>0.9.1</scufl2.version>
</properties>
<repositories>
	<repository>
		<releases />
		<snapshots>
			<enabled>false</enabled>
		</snapshots>
		<id>mygrid-repository</id>
		<name>myGrid Repository</name>
		<url>http://www.mygrid.org.uk/maven/repository</url>
	</repository>
</repositories>
<dependencies>
	<dependency>
		<groupId>uk.org.taverna.scufl2</groupId>
		<artifactId>scufl2-api</artifactId>
		<version>${scufl2.version}</version>
	</dependency>
	<dependency>
		<groupId>uk.org.taverna.scufl2</groupId>
		<artifactId>scufl2-t2flow</artifactId>
		<version>${scufl2.version}</version>
	</dependency>
	<dependency>
		<groupId>uk.org.taverna.scufl2</groupId>
		<artifactId>scufl2-rdfxml</artifactId>
		<version>${scufl2.version}</version>
	</dependency>
</dependencies>

The <property> scufl2.version used above allows you to consistently upgrade to later versions of SCUFL2. Note that the version number above might not be the latest, see #Release notes.

Source code

You should not need to compile the SCUFL2 API for most uses, as the Maven deployment even includes the source code for retrieval by tools like Eclipse using the m2e plugin.

The simplest way to retrieve the current version of the SCUFL2 API is using [git|http://git-scm.com/:

Note that this will by default check out the master branch, which represents the latest SNAPSHOT version of the API, which might not be stable or backwards-compatible.

To inspect the code of the latest release, use git tag and git checkout:

: stain@ralph /tmp/93/scufl2; *git tag*
0.9
0.9.1
eclipse-xsd-bug

: stain@ralph /tmp/93/scufl2; *git checkout 0.9.1*
Note: checking out '0.9.1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at b507cc2... [maven-release-plugin]  copy for tag scufl2-0.9.1

: stain@ralph /tmp/93/scufl2 ;

Alternatively you can download a tagged release as a ZIP or TAR ball from:

Unpack using your favourite archiver, but don't use the ZIP support of Windows Explorer, as it occasionally don't unpack all files.

Building

After installing Java JDK (6 or later) and Maven (2.2 or later), simply run:

This will build each module and run their tests, producing JARs like `scufl2-api/target/scufl2-api-0.9.1.jar`.

The build does not yet produce a single scufl2.jar for non-Maven users. This is planned for the 1.0 release. See #Usage below on how to use the JARs independently.

First time you build Scufl2 this might download dependencies needed for compilation. These have separate open source licenses, but should be compatible with LGPL. None of the dependencies are neccessary for using the compiled SCUFL2 API.

Some of the experimental modules are not built automatically, to build them separately, run the same command from within their folder.

Release notes

Usage

The simplest way to use the SCUFL2 API is as Maven dependencies. See #Maven above.

Typical use of the Scufl2 API will depend on the three modules scufl2-api, scufl2-t2flow and scufl2-rdfxml.

All Scufl2 modules are also valid OSGi bundles.

If you don't use Maven, you can alternatively copy and add the JARs from these modules to your classpath:

Note that version numbers above might not be the latest, see #Release notes

JavaDocs

Examples

Examples of using the Scufl2 API are available as a separate Github project scufl2-examples.

Also see the scufl2-validation folder of the SCUFL2 API source code for examples of usage.

The best classes to start using would be `uk.org.taverna.scufl2.api.io.WorkflowBundleIO` and `uk.org.taverna.scufl2.api.container.WorkflowBundle`.

Example of converting .t2flow to .wfbundle:

    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.WriterException;

    // ..
    
    WorkflowBundleIO io = new WorkflowBundleIO();
    File t2File = new File("workflow.t2flow");
    File scufl2File = new File("workflow.wfbundle");
    WorkflowBundle wfBundle = io.readBundle(t2File, "application/vnd.taverna.t2flow+xml");
    io.writeBundle(wfBundle, scufl2File, "application/vnd.taverna.scufl2.workflow-bundle");