After some more searching through the codebase and speaking with Alan 
(thank you!) I have found out how to do this - 
net.sf.taverna.t2.workflowmodel.utils.Tools class helps with finding the 
Processor to which the ActivityInputPort / ActivityOutputPort in the 
contextual selection belongs.

Example code:

Dataflow currentDataflow = (Dataflow) 
ModelMap.getInstance().getModel(ModelMapConstants.CURRENT_DATAFLOW);
Collection<Processor> processors = 
Tools.getProcessorsWithActivityInputPort(currentDataflow, 
activityInputPort);

The first line assumes that contextual selection is done in the current 
workflow, which is definitely the case, because contextual selections 
are only available for the current workflow.

Thank you,
Sergey


On 17/03/2010 03:34, Sergejs Aleksejevs wrote:
> Hello,
>
> I am trying to create contextual views for input/output ports of WSDL
> processors (in the Design perspective).
>
> Selections on the input/output ports of WSDL processors provide my
> ContextualViewFactory with ActivityInputPort / ActivityOutputPort
> objects. Looking through the codebase I didn't find a way to get hold of
> a Processor object to which the selected port belongs.
>
> I've also found that there are ProcessorInputPort  / ProcessorOutputPort
> type, but it seems that there is no connection between these and
> ActivityInputPort / ActivityOutputPort objects (they only share name and
> depth attributes).
>
> I hope that I simply didn't find a way to do the lookup and this is at
> all possible.
>
> Thank you,
> Sergey
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> taverna-hackers mailing list
> [email protected]
> Web site: http://www.taverna.org.uk
> Mailing lists: http://www.taverna.org.uk/taverna-mailing-lists/
> Developers Guide: http://www.mygrid.org.uk/tools/developer-information
>    


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
taverna-hackers mailing list
[email protected]
Web site: http://www.taverna.org.uk
Mailing lists: http://www.taverna.org.uk/taverna-mailing-lists/
Developers Guide: http://www.mygrid.org.uk/tools/developer-information

Reply via email to