You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@taverna.apache.org by Thilina Manamgoda <ma...@gmail.com> on 2016/06/26 14:34:59 UTC

CWL port name

Hi,


Any suggestions on how can i make a good port names in Taverna workbench.
Because if the port name in CWL tool is too long it's going to be a
problem.

1.What is the suitable number of characters that port name can have.

2. Removing space is one approach can anyone suggest more ?


regards,
Thlina.

Re: CWL port name

Posted by Stian Soiland-Reyes <st...@apache.org>.
On 27 June 2016 at 17:05, Thilina Manamgoda <ma...@gmail.com> wrote:
> Hi,
>
> 1. what is the dependency maven definition of  org.apache.taverna.scufl2.api
> (importing in maven)

See
https://taverna.incubator.apache.org/download/language/


> 2."(Perhaps such a utility method could be added to taverna-language)" can
> add a utility method to org.apache.taverna.scufl2.api achieve this.

Yes, feel free to have a go!

https://github.com/apache/incubator-taverna-language/blob/master/taverna-scufl2-api/src/main/java/org/apache/taverna/scufl2/api/common/Scufl2Tools.java

is probably the best home (collection of various util-like methods for SCUFL2)



> 3. inside the "configure" method in CWLDummyActivity after adding input
> ports using "addInput" method  i should call the "getInputPorts().
> addWithUIniqueName() ". Am i correct ?

Uh oh, sorry, I forgot the cwl-browse is still in Taverna 2, which
don't have addWithUniqueName(). In Taverna 3 the *-ui works only in
SCUFL2-land with activity descriptions, not with the engine's
Activity.

Perhaps it's time we start thinking about the upgrade.. here's how
Taverna 3's REST activity get its ports:

https://github.com/apache/incubator-taverna-common-activities/blob/master/taverna-rest-activity/src/main/java/org/apache/taverna/activities/rest/RESTActivityFactory.java


But if you have the dependency on taverna-scufl2-api (from above), then you can
make your own org.apache.taverna.scufl2.api.activity.Activity and add
SCUFL2 InputActivityPort to it using addWithUniqueName(),


The first half of this code would then be reusable in a new Taverna 3
CWLActivityFactory (the engine would do the mapping only when running
the workflow)



-- 
Stian Soiland-Reyes
Apache Taverna (incubating), Apache Commons
http://orcid.org/0000-0001-9842-9718

Re: CWL port name

Posted by Thilina Manamgoda <ma...@gmail.com>.
Hi,

1. what is the dependency maven definition of  org.apache.taverna.scufl2.api
(importing in maven)

2."(Perhaps such a utility method could be added to taverna-language)" can
add a utility method to org.apache.taverna.scufl2.api achieve this.

3. inside the "configure" method in CWLDummyActivity after adding input
ports using "addInput" method  i should call the "getInputPorts().
addWithUIniqueName() ". Am i correct ?


regards,
Thilina.

On Mon, Jun 27, 2016 at 8:38 PM, Stian Soiland-Reyes <st...@apache.org>
wrote:

> How about say.. 40 characters? Anything more would look weird on the
> diagram..
>
> This regular expression instance can help you filter away weird characters:
>
> https://github.com/apache/incubator-taverna-language/blob/master/taverna-scufl2-api/src/main/java/org/apache/taverna/scufl2/api/common/Named.java#L36
>
> https://taverna.incubator.apache.org/javadoc/taverna-language/org/apache/taverna/scufl2/api/common/Named.html#INVALID_NAME
>
>
> You should be able to use it as say
>
> import org.apache.taverna.scufl2.api.common.Named;
> portName = Named.INVALID_NAME.matcher(cwlName).replaceAll("_");
>
>
> (Perhaps such a utility method could be added to taverna-language)
>
>
> You can then use processor.getInputPorts().addWithUIniqueName() which
> will rename the port to have a suffix number (2 or higher) if needed
> to avoid duplicates. (the final name is returned)
>
>
> https://taverna.incubator.apache.org/javadoc/taverna-language/org/apache/taverna/scufl2/api/common/NamedSet.html
>
> On 26 June 2016 at 15:34, Thilina Manamgoda <ma...@gmail.com> wrote:
> > Hi,
> >
> >
> > Any suggestions on how can i make a good port names in Taverna workbench.
> > Because if the port name in CWL tool is too long it's going to be a
> > problem.
> >
> > 1.What is the suitable number of characters that port name can have.
> >
> > 2. Removing space is one approach can anyone suggest more ?
> >
> >
> > regards,
> > Thlina.
>
>
>
> --
> Stian Soiland-Reyes
> Apache Taverna (incubating), Apache Commons
> http://orcid.org/0000-0001-9842-9718
>

Re: CWL port name

Posted by Stian Soiland-Reyes <st...@apache.org>.
How about say.. 40 characters? Anything more would look weird on the diagram..

This regular expression instance can help you filter away weird characters:
https://github.com/apache/incubator-taverna-language/blob/master/taverna-scufl2-api/src/main/java/org/apache/taverna/scufl2/api/common/Named.java#L36
https://taverna.incubator.apache.org/javadoc/taverna-language/org/apache/taverna/scufl2/api/common/Named.html#INVALID_NAME


You should be able to use it as say

import org.apache.taverna.scufl2.api.common.Named;
portName = Named.INVALID_NAME.matcher(cwlName).replaceAll("_");


(Perhaps such a utility method could be added to taverna-language)


You can then use processor.getInputPorts().addWithUIniqueName() which
will rename the port to have a suffix number (2 or higher) if needed
to avoid duplicates. (the final name is returned)

https://taverna.incubator.apache.org/javadoc/taverna-language/org/apache/taverna/scufl2/api/common/NamedSet.html

On 26 June 2016 at 15:34, Thilina Manamgoda <ma...@gmail.com> wrote:
> Hi,
>
>
> Any suggestions on how can i make a good port names in Taverna workbench.
> Because if the port name in CWL tool is too long it's going to be a
> problem.
>
> 1.What is the suitable number of characters that port name can have.
>
> 2. Removing space is one approach can anyone suggest more ?
>
>
> regards,
> Thlina.



-- 
Stian Soiland-Reyes
Apache Taverna (incubating), Apache Commons
http://orcid.org/0000-0001-9842-9718