HighCharts for Taverna Workflow Management System

I gave an introduction in my previous post about what Taverna and HighCharts are.

Lets begin…

How to Install Taverna Workbench?

You can download Taverna from the download page of their website. I recommend reading the quick start guide to get general information about it if you are not a Taverna workflow designer yet.

First Step

Now lets create a Beanshell which creates a HTML containing a chart information. I’m going to start with Basic Line chart.
html_data beanshell connected to the a workflow output

The Beanshell at this point doesn’t have any inputs and it has only 1 output which is HTML data and it is connected to a workflow output. I rename the Beanshell to html_data.


The HTML Script

I’m using JQuery 1.7 for this implementation so I’ve defined the HTML structure and converted that to the Java multiple line format. The source is available in pastebin.

Write to file and open in the browser

For writing the data to file a write_text_file local processor in Taverna is being used. I created a Beanshell which returns the temp directory and  a filename appended to it. This is the script for this Beanshell:

file_path= System.getProperty("java.io.tmpdir")+ System.getProperty("file.separator")+ "chart.html";

Now I need to create another Beanshell open the written file it in the default browser. The beanshell script is as below:

import java.awt.Desktop;
import java.io.File;
java.awt.Desktop desktop = java.awt.Desktop.getDesktop();
File file= new File(file_path);
desktop.open(file);

My workflow now looks like this :

hard coded basic line chart workflowRefactoring Time!!

Everything is now hard coded. I should  parameterize them .

First, I parameterize the data by using a string constants and then change it to a list (maybe!).

The html_data beanshell now accepts data from its inputs.

The next step is to make workflow to accept data as a list and show it to the workflow.

[This blog post is being edited…]

Advertisements