(*
   $Id$
   ISO TC184/SC4/WG12 N4063 - ISO/TS 10303-1705 Functional usage view - EXPRESS MIM
   Supersedes ISO TC184/SC4/WG12 N3343
*)
SCHEMA Functional_usage_view_mim;

USE FROM Analytical_model_mim;	-- ISO/TS 10303-1603
USE FROM Network_functional_design_view_mim;	-- ISO/TS 10303-1704
USE FROM Shape_property_assignment_mim;    -- ISO/TS 10303-1032	

USE FROM document_schema(document_type);

USE FROM product_property_definition_schema
	(shape_aspect,
	shape_aspect_relationship);

USE FROM material_property_definition_schema(property_definition_relationship);


  TYPE nfuv_groupable_item = EXTENSIBLE GENERIC_ENTITY SELECT BASED_ON groupable_item WITH 
    (shape_aspect);
  END_TYPE;

  ENTITY functional_terminal_group
    SUBTYPE OF (group);
    UNIQUE
      UR1: SELF\group.name;
  END_ENTITY;

  ENTITY functional_unit
    SUBTYPE OF (product_definition, product_definition_shape);
    DERIVE
      SELF\property_definition.definition : functional_unit := SELF;
    WHERE
      WR1: SIZEOF (USEDIN (SELF, 'BASIC_ATTRIBUTE_SCHEMA.' +'NAME_ATTRIBUTE.NAMED_ITEM')) = 0;
      WR2: NOT EXISTS(SELF\property_definition.description);
  END_ENTITY;

  ENTITY functional_unit_terminal_definition
    SUBTYPE OF (shape_aspect);
      SELF\shape_aspect.of_shape : functional_unit;
  END_ENTITY;

  ENTITY make_from_functional_unit_terminal_definition_relationship
    SUBTYPE OF (shape_aspect, shape_aspect_relationship);
    UNIQUE
      UR1: SELF\shape_aspect_relationship.relating_shape_aspect, 
        SELF\shape_aspect_relationship.related_shape_aspect;
    WHERE
      WR1: relating_shape_aspect.of_shape :<>: 
        related_shape_aspect.of_shape;
      WR2: SELF\shape_aspect.product_definitional = FALSE;
  END_ENTITY;

  ENTITY scalar_terminal_definition_link
    SUBTYPE OF (shape_aspect,shape_aspect_relationship);
      SELF\shape_aspect_relationship.relating_shape_aspect : functional_unit_terminal_definition;
    UNIQUE
      UR1: related_shape_aspect, relating_shape_aspect;
    WHERE
      WR1: SELF\shape_aspect_relationship.related_shape_aspect :<>:
        SELF\shape_aspect_relationship.relating_shape_aspect;
  END_ENTITY; 

END_SCHEMA;

