Reading Attributes

Stages allows to configure attributes in the metamodel.

Assume that the following attribute types are configured in your PKitConfig.xml file:

 <attributeTypes>
 <attributeType ident="important_type" type="BOOLEAN" />
 <attributeType ident="identifier_type" type="STRING" />
 <attributeType ident="phaseState" type="SELECTION">
   <option ident="future" defaultOption="true"/>
   <option ident="active"/>
   <option ident="completed"/>
   </attributeType>
 </attributeTypes>

and your metamodel configuration contains a process attribute like:

 <processtype ident="unified_configuration">
  <attributes>
   <attribute typeIdent="phaseState"/>
 </attributes>

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

2. Create a result column Attribute

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

4. Set your current Metric to an existing metric in a Stages project

This example shows:

var process =
 pkit.getCurrentProject().getEntities("containsProcess@SYSTEM");
if (process.length !=0 ) {
 var attribute_values = process[0]
 .getAttribute("phaseState").getProperty("databaseValue")
 .toString();
 dataset.setColumnValue("Attribute",attribute_values);
 dataset.storeResultRow();
}