Contents > 7 SDMetrics Metamodel and XMI Transformation Files > 7.2 XMI Transformation Files > 7.2.2 XMI Transformations and Triggers > 7.2.2.5 Trigger Type "constant"

7.2.2.5 Trigger Type "constant"

This trigger instructs SDMetrics to insert a constant value for an attribute. For example, the SDMetrics metamodel differentiates the types of states (simple, initial, final, etc.) in a state diagram with an attribute "kind" of the metamodel element "state". Consider the following excerpt of the XMI transformations for UML simple states and final states:
<xmitransformation modelelement="state" 
   xmipattern="Behavioral_Elements.State_Machines.SimpleState">
   ... 
   <trigger name="kind" type="constant" attr="simple"/>
</xmitransformation>

<xmitransformation modelelement="state" 
   xmipattern="Behavioral_Elements.State_Machines.FinalState">
   ... 
   <trigger name="kind" type="constant" attr="final"/>
</xmitransformation>
The "attr" attribute specifies the value to be inserted for the metamodel attribute ("simple" for SimpleState, "final" for FinalState).