I think the problem is that the BioJava Cookbook is out of date. I tried with BioJava version 1.7.1 (which is very old) and a beanshell works - see attached.

Alan


<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow"; version="1" 
producedBy="taverna-biodiversity-2.5.0"><dataflow 
id="993cd091-c014-4acd-b7b2-d7bf5d3e54a2" 
role="top"><name>Old_BioJava_for_tran</name><inputPorts><port><name>sequenceString</name><depth>0</depth><granularDepth>0</granularDepth><annotations><annotation_chain
 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
  <annotationAssertions>
    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
      <annotationBean 
class="net.sf.taverna.t2.annotation.annotationbeans.ExampleValue">
        
<text>GGTAGGTACCGCCCTAAGNCTCCTAATCCGAGCAGAACTANGCCAACCCGGAGCCCTTCTGGGAGACGAC
CAAATCTACAACGTAGTCGTTACGGCCCACGCCTTCGTAATAATCTTTTTCATAGTAATGCCAATCATAA
TCGGAGGATTCGGGAACTGACTAGTTCCTCTAATGATTGGGGCCCCAGACATAGCATTCCCTCGAATAAA
CAACATAAGCTTTTGACTACTACCACCATCATTCCTACTCCTAATAGCCTCCTCAACAGTAGAAGCAGGA
GCCGGAACCGGATGAACCGTGTACCCACCACTAGCTGGAAACCTGGCCCACGCCGGAGCCTCAGTAGACC
TAGCTATCTTCTCCCTACACCTAGCAGGTATCTCATCCATCCTGGGGGCAATTAACTTCATTACAACAGC
AATCAACATAAAACCACCCGCCCTCTCACAATACCAAACACCACTATTCGTGTGATCCGTCCTAATTACG
GCCGTACTACTCCTACTATCTCTCCCAGTACTAGCCGCCGGTATCACCATGCTACTCACAGACCGCAACC
TCAACACCACCTTCTTTGACCCAGCAGGAGGAGGAGACCCAGTACTATACCAGCACCTATTCTGATTCTT
CGGACACCCAGAAGTCTACATCCTAATTCTC</text>
      </annotationBean>
      <date>2014-07-17 19:58:43.883 UTC</date>
      <creators />
      <curationEventList />
    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
  </annotationAssertions>
</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain></annotations></port></inputPorts><outputPorts><port><name>out1</name><lastPredictedDepth>0</lastPredictedDepth><annotations
 
/></port><port><name>trimmed</name><lastPredictedDepth>0</lastPredictedDepth><annotations
 
/></port></outputPorts><processors><processor><name>Beanshell</name><inputPorts><port><name>sequenceString</name><depth>0</depth></port></inputPorts><outputPorts><port><name>out1</name><depth>0</depth><granularDepth>0</granularDepth></port><port><name>trimmed</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations
 
/><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>beanshell-activity</artifact><version>1.5</version></raven><class>net.sf.taverna.t2.activities.beanshell.BeanshellActivity</class><inputMap><map
 from="sequenceString" to="sequenceString" /></inputMap><outputMap><map 
from="trimmed" to="trimmed" /><map from="out1" to="out1" 
/></outputMap><configBean 
encoding="xstream"><net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean
 xmlns="">
  <inputs>
    
<net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
      <name>sequenceString</name>
      <depth>0</depth>
      <mimeTypes>
        <string>text/plain</string>
      </mimeTypes>
      <handledReferenceSchemes />
      <translatedElementType>java.lang.String</translatedElementType>
      <allowsLiteralValues>true</allowsLiteralValues>
    
</net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
  </inputs>
  <outputs>
    
<net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
      <name>out1</name>
      <depth>0</depth>
      <mimeTypes />
      <granularDepth>0</granularDepth>
    
</net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
    
<net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
      <name>trimmed</name>
      <depth>0</depth>
      <mimeTypes />
      <granularDepth>0</granularDepth>
    
</net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
  </outputs>
  <classLoaderSharing>workflow</classLoaderSharing>
  <localDependencies>
    <string>biojava.jar</string>
  </localDependencies>
  <artifactDependencies />
  <script>import org.biojava.bio.symbol.*;
import org.biojava.bio.seq.*;
 

String out1 = "failed";

String trimmed = "not trimmed";
    try {
trimmed = sequenceString.replaceAll("\\s","");

int trimmedLength = trimmed.length();

while ((trimmed.length() % 3) != 0) {
        trimmed += "X"; 
}
      //create a DNA SymbolList
      SymbolList symL = DNATools.createDNA(trimmed);


 
      //transcribe to RNA (after biojava 1.4 use this method instead)
      symL = DNATools.toRNA(symL);
 
      //translate to protein
      symL = RNATools.translate(symL);


         out1 = symL.seqString();
 
      //prove that it worked
           System.out.println(symL.seqString());
     }catch (Exception ex) {
 
 
      out1 = ex.getMessage();
     }
</script>
  <dependencies />
</net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean></configBean><annotations
 
/></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.5</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean
 
encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig
 xmlns="">
  <maxJobs>1</maxJobs>
</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.5</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean
 encoding="xstream"><null xmlns="" 
/></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.5</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean
 encoding="xstream"><null xmlns="" 
/></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.5</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean
 
encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig
 xmlns="">
  <backoffFactor>1.0</backoffFactor>
  <initialDelay>1000</initialDelay>
  <maxDelay>5000</maxDelay>
  <maxRetries>0</maxRetries>
</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.5</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean
 encoding="xstream"><null xmlns="" 
/></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port
 name="sequenceString" depth="0" 
/></cross></strategy></iteration></iterationStrategyStack></processor></processors><conditions
 /><datalinks><datalink><sink 
type="processor"><processor>Beanshell</processor><port>sequenceString</port></sink><source
 type="dataflow"><port>sequenceString</port></source></datalink><datalink><sink 
type="dataflow"><port>out1</port></sink><source 
type="processor"><processor>Beanshell</processor><port>out1</port></source></datalink><datalink><sink
 type="dataflow"><port>trimmed</port></sink><source 
type="processor"><processor>Beanshell</processor><port>trimmed</port></source></datalink></datalinks><annotations><annotation_chain_2_2
 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
  <annotationAssertions>
    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
      <annotationBean 
class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
        <identification>2e11e416-302b-47ea-8e82-d62d64f2fcdd</identification>
      </annotationBean>
      <date>2014-07-17 19:53:27.851 UTC</date>
      <creators />
      <curationEventList />
    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
  </annotationAssertions>
</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2
 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
  <annotationAssertions>
    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
      <annotationBean 
class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
        <identification>67fcba29-9c34-4091-9210-b13606f43f64</identification>
      </annotationBean>
      <date>2014-07-17 20:11:29.433 UTC</date>
      <creators />
      <curationEventList />
    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
  </annotationAssertions>
</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2
 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
  <annotationAssertions>
    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
      <annotationBean 
class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
        <identification>8ee5f85e-d75c-4c42-a794-3de3baab0d36</identification>
      </annotationBean>
      <date>2014-07-17 20:08:49.427 UTC</date>
      <creators />
      <curationEventList />
    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
  </annotationAssertions>
</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain
 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
  <annotationAssertions>
    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
      <annotationBean 
class="net.sf.taverna.t2.annotation.annotationbeans.DescriptiveTitle">
        <text>Old BioJava for transeq</text>
      </annotationBean>
      <date>2014-07-17 20:22:35.35 UTC</date>
      <creators />
      <curationEventList />
    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
  </annotationAssertions>
</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain
 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
  <annotationAssertions>
    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
      <annotationBean 
class="net.sf.taverna.t2.annotation.annotationbeans.Author">
        <text>Alan R Williams</text>
      </annotationBean>
      <date>2014-07-17 20:22:21.184 UTC</date>
      <creators />
      <curationEventList />
    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
  </annotationAssertions>
</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain><annotation_chain_2_2
 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
  <annotationAssertions>
    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
      <annotationBean 
class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
        <identification>9f3b3c87-fc19-420c-b9a5-e0992bb9d837</identification>
      </annotationBean>
      <date>2014-07-17 20:21:27.551 UTC</date>
      <creators />
      <curationEventList />
    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
  </annotationAssertions>
</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2
 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
  <annotationAssertions>
    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
      <annotationBean 
class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
        <identification>77f7d0a8-c087-471c-8587-85f8f43ac7ef</identification>
      </annotationBean>
      <date>2014-07-17 20:10:50.832 UTC</date>
      <creators />
      <curationEventList />
    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
  </annotationAssertions>
</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2
 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
  <annotationAssertions>
    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
      <annotationBean 
class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
        <identification>619b0c27-d587-4a14-a0ad-fbd0c3a716ca</identification>
      </annotationBean>
      <date>2014-07-17 20:18:25.240 UTC</date>
      <creators />
      <curationEventList />
    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
  </annotationAssertions>
</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2
 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
  <annotationAssertions>
    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
      <annotationBean 
class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
        <identification>65c4e216-de81-4d34-b475-c3b9599e2edc</identification>
      </annotationBean>
      <date>2014-07-17 19:54:37.770 UTC</date>
      <creators />
      <curationEventList />
    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
  </annotationAssertions>
</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2
 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
  <annotationAssertions>
    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
      <annotationBean 
class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
        <identification>3d8e472a-2e55-4436-b2fc-9decc682b8d8</identification>
      </annotationBean>
      <date>2014-07-17 20:13:15.469 UTC</date>
      <creators />
      <curationEventList />
    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
  </annotationAssertions>
</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2
 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
  <annotationAssertions>
    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
      <annotationBean 
class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
        <identification>2398fa68-5982-4f8c-acdd-7a14f2d7f02f</identification>
      </annotationBean>
      <date>2014-07-17 19:58:54.782 UTC</date>
      <creators />
      <curationEventList />
    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
  </annotationAssertions>
</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2
 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
  <annotationAssertions>
    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
      <annotationBean 
class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
        <identification>072dfe2d-d66a-4e21-9664-f1d996295e40</identification>
      </annotationBean>
      <date>2014-07-17 20:03:37.935 UTC</date>
      <creators />
      <curationEventList />
    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
  </annotationAssertions>
</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2
 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
  <annotationAssertions>
    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
      <annotationBean 
class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
        <identification>993cd091-c014-4acd-b7b2-d7bf5d3e54a2</identification>
      </annotationBean>
      <date>2014-07-17 20:22:50.481 UTC</date>
      <creators />
      <curationEventList />
    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
  </annotationAssertions>
</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2
 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
  <annotationAssertions>
    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
      <annotationBean 
class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
        <identification>6439437c-8198-4341-8dd0-889a9d7ac3b8</identification>
      </annotationBean>
      <date>2014-07-17 20:02:05.676 UTC</date>
      <creators />
      <curationEventList />
    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
  </annotationAssertions>
</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2
 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
  <annotationAssertions>
    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
      <annotationBean 
class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
        <identification>940c54f2-e311-47b1-b8e9-d9fce6c9e76c</identification>
      </annotationBean>
      <date>2014-07-17 20:03:00.895 UTC</date>
      <creators />
      <curationEventList />
    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
  </annotationAssertions>
</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2
 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
  <annotationAssertions>
    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
      <annotationBean 
class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
        <identification>f9cb8f73-1436-40f3-a55b-7317db27f64c</identification>
      </annotationBean>
      <date>2014-07-17 20:04:30.807 UTC</date>
      <creators />
      <curationEventList />
    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
  </annotationAssertions>
</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2
 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
  <annotationAssertions>
    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
      <annotationBean 
class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
        <identification>aff44bad-c7fa-4224-98ba-499e3a2c8311</identification>
      </annotationBean>
      <date>2014-07-17 19:45:23.455 UTC</date>
      <creators />
      <curationEventList />
    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
  </annotationAssertions>
</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2
 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
  <annotationAssertions>
    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
      <annotationBean 
class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
        <identification>e50cc8ee-34ea-41bb-b170-9b80eadbf9f1</identification>
      </annotationBean>
      <date>2014-07-17 20:01:07.284 UTC</date>
      <creators />
      <curationEventList />
    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
  </annotationAssertions>
</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2
 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
  <annotationAssertions>
    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
      <annotationBean 
class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
        <identification>7a402ab4-c5e4-4a16-88c4-cc469d2e236f</identification>
      </annotationBean>
      <date>2014-07-17 19:55:32.983 UTC</date>
      <creators />
      <curationEventList />
    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
  </annotationAssertions>
</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
taverna-users mailing list
[email protected]
[email protected]
Web site: http://www.taverna.org.uk
Mailing lists: http://www.taverna.org.uk/about/contact-us/

Reply via email to