Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to find a IComponentHandle by name in a stream?

How find a IComponentHandle by name in a stream?

I can use  findComponents of IWorkspaceManager  to get component, but if two streams have same component with name, how can I tell it?

Of course, I can use IWorkspaceConnection to filter stream, and get all components of IWorkspaceConnection. Then loop all component to filter the component out. But it cost too much time to compare all comopoent in stream.

So if any other easy method/api can be called to find out component by component name in a stream directly?

0 votes



One answer

Permanent link
I can use findComponents of IWorkspaceManager to get component, but if two streams have same component with name, how can I tell it?
I assume you mean the components are not the same (different UUID) but have the same name.

I don't think there's any useful API for finding a component by name in this instance. It's more reliable to refer to a component by its UUID.

If you're only starting with the component name, you'll have to fetch all the components in the stream and do the processing client-side.

Another possibility is using the findComponents call and get all the components from the stream then running a comparison check on the UUID. This might be faster depending on the number of components with the same name and if the findComponents result doesn't have multiple components in the stream.

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,952

Question asked: Dec 11 '12, 5:22 a.m.

Question was seen: 4,462 times

Last updated: Dec 11 '12, 9:53 a.m.

Confirmation Cancel Confirm