(*
   $Id$
   ISO TC184/SC4/WG12 N4056 - ISO/TS 10303-1703 Model parameter - EXPRESS ARM
   Supersedes ISO TC184/SC4/WG12 N3492
*)

SCHEMA Model_parameter_arm;
USE FROM Activity_method_assignment_arm;	-- ISO/TS 10303-1249
USE FROM Characteristic_arm;	-- ISO/TS 10303-1654
USE FROM Classification_with_attributes_arm;	-- ISO/TS 10303-1111
USE FROM Independent_property_representation_arm;	-- ISO/TS 10303-1038
USE FROM Group_arm;	-- ISO/TS 10303-1113

REFERENCE FROM Specification_document_arm(get_document_definition);	-- ISO/TS 10303-1747

  TYPE mp_activity_method_item_select = EXTENSIBLE GENERIC_ENTITY SELECT BASED_ON activity_method_item WITH 
    (Test_method_based_parameter_assignment);
  END_TYPE; 

  TYPE mp_groupable_item = SELECT BASED_ON groupable_item WITH 
    (Group_relationship);
  END_TYPE; 

  TYPE mp_documented_element_select = EXTENSIBLE GENERIC_ENTITY SELECT BASED_ON documented_element_select WITH 
    (Model_parameter);
  END_TYPE; 

  ENTITY Category_model_parameter
    SUBTYPE OF (Model_parameter);
    INVERSE 
      associated_attribute : SET[1:1] OF Classification_attribute FOR attribute_definition;
  END_ENTITY;

  ENTITY Independent_property_with_unit 
    SUBTYPE OF (Independent_property);
      unit_of_measure: SET [1:?] OF Unit;
  END_ENTITY;

  ENTITY Model_parameter
    SUBTYPE OF (Independent_property);
      valid_range        : OPTIONAL SET[1:?] OF Value_range;
      default_value      : OPTIONAL scalar_or_coordinated_characteristics;
	DERIVE
      reference_document: SET[0:?] OF Document_definition :=
        get_document_definition(SELF, 'reference document', 
        'DOCUMENT_DEFINITION_ARM.DOCUMENT_DEFINITION');
	WHERE
      WR1 : EXISTS (reference_document) AND (SIZEOF(reference_document) = 1);
  END_ENTITY;

  ENTITY Parameter_assignment
    SUBTYPE OF (Independent_property_representation);
      SELF\Independent_property_representation.property: Model_parameter;
  END_ENTITY;

  ENTITY Parameter_assignment_override;
    overridden_parameter_assignment : Parameter_assignment;
    overriding_parameter_assignment : Parameter_assignment;
  END_ENTITY;

  ENTITY Schema_based_model_parameter
    SUBTYPE OF (Model_parameter);
      entity_name    : Independent_property;
      attribute_name : OPTIONAL Independent_property;
      schema_identifier : Independent_property;
    UNIQUE
      UR1 : entity_name, attribute_name, schema_identifier;
  END_ENTITY;

  ENTITY Product_specific_parameter_value_assignment;
      of_product         : Product;
      assigned_parameter : Parameter_assignment;
    DERIVE
      the_model_parameter : model_parameter := assigned_parameter\Independent_property_representation.property;
    UNIQUE
      UR1 : the_model_parameter, of_product;
  END_ENTITY;

  ENTITY Test_method_based_parameter_assignment
    SUBTYPE OF (Parameter_assignment);
    WHERE
      WR1 : SIZEOF(USEDIN(SELF,'ACTIVITY_METHOD_ASSIGNMENT_ARM.APPLIED_ACTIVITY_METHOD_ASSIGNMENT.ITEMS')) = 1;
  END_ENTITY;

END_SCHEMA;

