Skip to end of metadata
Go to start of metadata

This is part of the Activity Plugin Migration Guide

Summary of changes

Taverna 2Taverna 3Changes
java files
ExampleActivity.javaExampleActivity.java

Activity interface parameterized with JsonNode instead of ExampleActivityConfigBean

Port configuration moves to ExampleActivityFactory

ExampleActivityConfigBean.java-Removed
-ExampleActivityFactory.java

Added new class

ExampleActivityHealthChecker.javaExampleActivityHealthChecker.javaUses JsonNode instead of ExampleActivityConfigBean
resource files
META-INF/services/net.sf.taverna.t2.workflowmodel.health.HealthChecker-

Removed

-META-INF/spring/context-osgi.xmlAdded OSGi service registration
-META-INF/spring/context.xmlAdded OSGi service instantiation
-schema.jsonActivity configuration JSON schema
project files
pom.xmlpom.xml

Updates to dependency versions

Add jackson dependency (for JSON support)

pom.xml
  1. Change version of reference-api dependency to 2.0.1-SNAPSHOT
  2. Change version of workflowmodel-api dendency to 2.0.1-SNAPSHOT
  3. Add dependency for jackson-databind

  4. Update any test dependencies, such as:
    1. activity-test-utils to 2.0.1-SNAPSHOT
    2. workflowmodel-impl to 2.0.1-SNAPSHOT
  5. Add maven-bundle-plugin plugin (unless already added to parent pom) 

  6. Change packaging type to bundle 

schema.json

The JSON schema file specifies the configuration properties required by the activity.

  1. Add schema.json file to the project resources directory

     

  2. Add a property entry for each of the properties in the ExampleActivityConfigBean class

ExampleActivityFactory.java

An ActivityFactory is a new interface for Taverna 3 that is used by the Taverna Platform to create instances of activities.

  1. Add new class ExampleActivityFactory 

     

  2. Move any port creation code from ExampleActivity to ExampleActivityFactory. Note that port creation code is split into separate methods for inputs and outputs.

ExampleActivity.java
  1. Change ExampleActivity class in use JsonNode as super type parameter

  2. Update configure method and remove any port configuration code (which should have been moved to ExampleActivityFactory).

  3. Update code to read configuration properties form JsonNode.
ExampleActivityHealthChecker.java
  1. Update code to read configuration properties form JsonNode.
META-INF/spring/context-osgi.xml
  1. Create the Spring DM context-osgi.xml file. This is where services (created in the context.xml file) are registered with the OSGi service register and also where references to services exported by other modules are created.

  2. Add services to be exported by this module.

  3. Add references to services required by this module.

META-INF/spring/context.xml
  1. Create the Spring context.xml file. This is where services are instantiated and any services required from other modules are injected as properties.

  2. Create the services that will be registered with the OSGi service register in the context-osgi.xml file. 

ExampleActivityConfigBean.java

The config bean has been replaced by JSON configuration and is no longer used.

  1. Delete this file.
META-INF/services

The SPI configurations have been replaced by the Spring configurations.

  1. Delete this directory