It's all about the answers!

Ask a question

API support for hierarchical components (How to get information about containment relations via API?)

Alexander Schulz (1122) | asked Jun 03 '15, 8:36 a.m.
edited Jun 03 '15, 3:10 p.m. by DJ Houghton (2663)
Hello SCM team,

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

permanent link
DJ Houghton (2663) | answered Jun 03 '15, 3:09 p.m.
Hi Alexander, since hierarchical components is a new feature we're still flushing out the documentation before the official release but you can see an introduction in the New and Noteworthy here [1].

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.


permanent link
DJ Houghton (2663) | answered Jun 08 '15, 2:34 p.m.
Hi Alexander, unfortunately I've confirmed that we don't yet have APIs which will allow you to create Load Rules files based on an existing component hierarchy in the repository. There are some Load Rules creation commands available with the Command-Line Interface, but they examine your current sandbox and generate a file from what you have loaded. (and it is not yet hierarchical component aware)

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.

Geoffrey Clemm commented Jun 08 '15, 10:09 p.m.

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).

Alexander Schulz commented Jun 09 '15, 4:52 a.m.

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.

DJ Houghton commented Jun 09 '15, 8:44 a.m.

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.

Your answer

Register or 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.