Hi! As always. full links are great..
https://github.com/ThilinaManamgoda/incubator-taverna-common-activities/blob/stream/taverna-cwl-activity-ui/src/main/java/org/apache/taverna/cwl/ui/serviceprovider/CwlServiceProvider.java#L50 looks to me like it should work, except for the shared variable "result" which would not be thread-safe to be accessed by the lambdas from a parallel stream. You don't need to keep the List,now you can instead do callBack.partialResults(Arrays.asList(result)); (or even look at using partialResults together with stream's .collect()/.reduce() methods - but that might slow down appearance in the UI) Instead of e.printStackTrace(); you can do callBack.warning() or callBack.fail() and then the error should be both logged and shown in the UI. In general using e.printStackTrace() is a bad idea beyond examples. In Taverna we (still) use log4j 1, so it's quite easy to do logging. If there's an exception that you log, then you should also return right away, so you don't keep getting NullPointerException on the lines below when the variable didn't get initialized. Can you reduce catch (Exception e) {} to the actual exception that could happen? On 24 June 2016 at 01:25, Thilina Manamgoda <[email protected]> wrote: > Hi, > > i have tried this and this is the implementation > https://github.com/ThilinaManamgoda/incubator-taverna-common-activities/tree/stream > . Any comments on how can i improve it more or change ?. > > Can you provide me the instruction to run this plugin inside the Taverna > workbench. At the moment i test the plugin using tutorial plugin provied in > the taverna developer tutorial. Also if you can explain how to redirect the > System.out.println() inside the plugin into Eclipse console would be great. > > regards, > Thilina. -- Stian Soiland-Reyes Apache Taverna (incubating), Apache Commons http://orcid.org/0000-0001-9842-9718
