API support for hierarchical components (How to get information about containment relations via API?)
From 6.0 it is possible to create components hierarchies (HC). So now we want to take the "containment relation" as a basis for the creation the Load Rule, which then creates the sandbox structure.
In other words: "if component B is a subcomponent of component A, then it will be loaded as ..../sandbox/A/B"
Question: Can you please provide us the HC related API documentation with some examples?
Thank you in advance!
2 answers
I'll look at putting together a code example, but a good starting point is IFlowNodeConnection#getComponentHierarchy. This will return a dictionary-like structure that you can traverse to determine the parent/child relationships.
[1] https://jazz.net/downloads/rational-team-concert/milestones/6.0M11?p=news#new-workspace-configuration
But given that this is an operation which multiple clients would like to perform, it is something which is definitely being discussed on the development team and we would like to enable users to be able to do this.
Comments
Hi DJ ... Note that what was being here was not whether there was an API like "GenerateLoadRulesFromConfigurationHierarchy() ... but rather what is the API for traversing the component hierarchy in a given stream/workspace. They can then use that plus knowledge of the syntax of load rule files to write out text to a file which can then be used as a load rule file. In other words, your other answer is the one they were looking for (Alexander: Please correct me if I got that wrong).
Hello DJ, hello Geoff,
yes the answer #1 is one in which we are more interested in. We have already a LR generator, which is creating LR depends on the name of the component. (Comp. Name represents the sandbox hierarchy)
If we would have access to the containment relation information from the components in a stream, we would switch over to the usage of the "containment" as a basis for the LR generation.
Ok, cool. I was hesitant to suggest manually constructing the Load Rules file but if you already have a process in place to do this, then the API on IFlowNodeConnection is likely what will interest you.
Internally, we've used the visitor pattern to walk the component hierarchies and find that pretty handy so you may choose to take a similar approach.
Let us know if you have any more questions.