On Wed, Sep 1, 2010 at 10:13, Andreas Truszkowski <[email protected]> wrote: > I think you mean that I want to merge an input of depth 1 to depth 0. That > is not correct. As the attached picture shows, the previously executed > services were invoced several times through the sdf file reader. But I need > the filtered data (from the subgraph filter service) in one single step for > the reaction enumeration service. So the data collector should catch all > data coming from the subgraph filter service and push it forward once. Here > is the source of the data collector: > > public Map<String, T2Reference> work(Map<String, T2Reference> inputs, > AsynchronousActivityCallback callback) > throws CDKTavernaException { > Map<String, T2Reference> outputs = new HashMap<String, > T2Reference>(); > InvocationContext context = callback.getContext(); > ReferenceService referenceService = context.getReferenceService(); > List<byte[]> dataArray = (List<byte[]>) > referenceService.renderIdentifier(inputs.get(this.INPUT_PORTS[0]), > byte[].class, > context);
What you need to do in DataCollector, if you want to receive each Subgraphisomorphism_filter-value as they are produced, is to have it specify input port depth 1, with granular depth 0. Alternatively you can set both at depth 1 - in which case it's called once. You can then iterate over the incoming list using the reference service. If you request a lower granular depth, Taverna will deliver the individual values to you one at the time as they are produced, and then finally deliver the parent list (at depth 1) (as in the 1-1 case) - in which case you can deliver your output. In your code you only populate the RESULT_PORTS[0] output port in the final case - which is not correct - you always need to provide values for all declared output ports. (That is unless you are also doing granular depth outputs - for instance you could have both streaming inputs and outputs, but with an additional tidy-up-case for the last item, or a non-streaming output port which you populate in the end) -- Stian Soiland-Reyes, myGrid team School of Computer Science The University of Manchester ------------------------------------------------------------------------------ This SF.net Dev2Dev email is sponsored by: Show off your parallel programming skills. Enter the Intel(R) Threading Challenge 2010. http://p.sf.net/sfu/intel-thread-sfd _______________________________________________ taverna-hackers mailing list [email protected] Web site: http://www.taverna.org.uk Mailing lists: http://www.taverna.org.uk/about/contact-us/ Developers Guide: http://www.taverna.org.uk/developers/
