Hi.
Let's suppose to have this diagram:

In order to accept the testcase, the requirement 6809 must be satisfied.
I'm writing a script that creates a test-case document, that list every test case and, for ever test case, it shows a list of all requirements that must be satisfied in order to solve it.
I would like to have something like:
Test case feature_TestCase2 depends on following requirements:
- #6803 Create 2D polygon
- #6809 2D polygon style
In order to do it, I need to retrieve the list of test cases, that I do with following jscript code:
function createTestCaseList(generator, requirements)
{
var query = "SELECT * FROM ea_map.t_object where Stereotype = 'testcase';";
var result = Repository.SQLQuery(query);
var xmlDoc = new ActiveXObject("MSXML2.DOMDocument.6.0");
xmlDoc.async = false;
xmlDoc.loadXML(result);
var nodes = xmlDoc.getElementsByTagName("Object_ID");
for (var j=0; j < nodes.length; j++) {
if (nodes.item(j).text != "") {
var testcase = Repository.GetElementByID(nodes.item(j).text);
if (testcase != null) {
//Here I've the test case
}
}
}
}At this point, I need to retrieve the list of requirements associated to the test case. I can query the
t_connector table I suppose, but with a direct query I can find only requirements that are directly connected to it, in the image only the #6803 one... I can try to find it recursively but I'm worried to go into a loop in some cases.
How can I check all requirements connected directly and indirectly to the test case?