Reading Subprojects

This example shows how to collect data from all projects (or all subprojects).

1. Create a report with a Stages Data Source and a Data Set.

2. Copy the Data Set script from the example into your Data Set.

/* Iterate through all projects */
getChilds(pkit.getRootProject());
/* Iterate through all subprojects */
//getChilds(pkit.getCurrentProject());
function getChilds(project)
{
 var myprojects =
 project.getEntities("hierarchy::hierarchic@LOCAL,targetrole=children");
 for each (myproject in myprojects)
 {
 saveColumn(myproject);
 getChilds(myproject);
 }
}
function saveColumn(project)
{
 var metamodel = project.getEntities("containsProcess@SYSTEM");
 if (metamodel.length> 0 ) {
 /* do seomthing */
 }
}