Developer information - Developing a Template

Introduction

This section outlines how to develop a template.

Uniqueness constraints

There are some circumstances where a combination of attribute values can be used to uniquely identify an instance of an EXPRESS entity in a given data set. These circumstances are normatively declared by a uniqueness constraint.

There two ways in which the constraint can be defined.

An example of the XML for the first case is:

      <unique_rule_attribute name="Unique product_category">
          <description>Product_category.name = 'part'</description>
          <unique_attribute entity="Product_category" attribute="name" value="Part"/>
      </unique_rule_attribute>
    

This results in the following constraint being displayed:

Unique constraint: Unique product_category
There shall be at most one instance of the entity (Product_category) with the attribute (name="Part") instantiated in the data set.

An example of the XML for the second case is:

      <unique_rule_param name="Unique view_definition_context">
      <unique_param param="domain"/>
      <unique_param param="domain_ecl_id"/>
      <unique_param param="life_cycle_stage"/>
      <unique_param param="life_cycle_stage_ecl_id"/>
      <unique_entity ref_param_in_path="contxt"/>
      </unique_rule_param>
    

This results in the following constraint being displayed:

Unique constraint: Unique view_definition_context
There shall be at most one instance of the entity (View_definition_context) within the data set uniquely identified by a combination of the following template parameters: domain, domain_ecl_id, life_cycle_stage, life_cycle_stage_ecl_id. The instance is referenced by the following template parameter: contxt.