(*
   $Id$
   ISO TC184/SC4/WG12 N3894 - ISO/TS 10303-1649 Assembly technology - EXPRESS ARM
   Supersedes ISO TC184/SC4/WG12 N3312
*)


SCHEMA Assembly_technology_arm;
	USE FROM Assembly_module_design_arm;	-- ISO/TS 10303-1636
	USE FROM Component_grouping_arm;	-- ISO/TS 10303-1656
	USE FROM Product_identification_extension_arm;	-- ISO/TS 10303-1738

 	TYPE at_external_identification_item = EXTENSIBLE GENERIC_ENTITY SELECT BASED_ON external_identification_item WITH  
		(Assembly_bond_definition);
	END_TYPE;

	TYPE at_material_item_select = EXTENSIBLE GENERIC_ENTITY SELECT BASED_ON material_item_select WITH
		(Assembly_bond_definition);
	END_TYPE;

  TYPE at_property_assignment_select = SELECT BASED_ON property_assignment_select WITH 
    (Assembly_bond_definition);
  END_TYPE; 

	TYPE at_requirement_assignment_item = EXTENSIBLE GENERIC_ENTITY SELECT BASED_ON requirement_assignment_item WITH 
	    (Assembly_joint);
	END_TYPE; 

  TYPE bond_feature = SELECT
    (Connection_zone_in_layout_template,
    Connection_zone_in_usage_view,
    Default_attachment_size_based_land_physical_template,
    Feature_definition_with_connection_area,
    Part_feature);
  END_TYPE;     
	
  TYPE degree_of_freedom = ENUMERATION OF
    (x,
     y,
     z,
     u,
     v,
     w);
  END_TYPE;

	SUBTYPE_CONSTRAINT process_specification_subtypes FOR Process_specification;   
		(ONEOF (Assembly_technology_specification,
		Fabrication_technology_specification));
	END_SUBTYPE_CONSTRAINT; 

  ENTITY Assembled_with_bonding
    SUBTYPE OF (Assembly_joint);
      default_bond_definition : Assembly_bond_definition;
    WHERE
      WR1 : SELF\Assembly_joint.assembly_feature_1.definition :=: default_bond_definition.bonded_feature_1;
      WR2 : SELF\Assembly_joint.assembly_feature_2.definition :=: default_bond_definition.bonded_feature_2;
  END_ENTITY;

  ENTITY Assembled_with_fasteners
    SUBTYPE OF (Assembly_joint);
      SELF\Assembly_joint.associated_assembly : Assembly_group_component;
  END_ENTITY;

  ENTITY Assembly_bond_definition;
      name                                    : STRING;   
      analytical_assembly_bond_representation : OPTIONAL SET[1:?] OF Analytical_model_application;
      associated_definition                   : Externally_defined_view_definition;
      bonded_feature_1                        : bond_feature;
      bonded_feature_2                        : bond_feature;
    INVERSE
      default_shape : SET[0:1] OF default_assembly_bond_shape_model FOR shape_characterized_definition;
	  bond_category	: External_source_identification FOR item;
	  bond_material : material_identification FOR items;      
    UNIQUE
      UR1 : name;
      UR2 : associated_definition;
    WHERE
      WR1 : bonded_feature_1 <> bonded_feature_2;
      WR2 : 'CONDUCTIVITY_MATERIAL_ASPECTS_ARM.'+ 'MATERIAL_IDENTIFICATION_WITH_CONDUCTIVITY_CLASSIFICATION' IN TYPEOF (bond_material);
      WR3 : NOT(('PHYSICAL_UNIT_USAGE_VIEW_ARM.PART_FEATURE' IN TYPEOF (bonded_feature_1)) XOR
        ('PHYSICAL_UNIT_USAGE_VIEW_ARM.PART_FEATURE' IN TYPEOF(bonded_feature_2)));
      WR4 : NOT(('PHYSICAL_UNIT_USAGE_VIEW_ARM.CONNECTION_ZONE_IN_USAGE_VIEW' IN TYPEOF (bonded_feature_1)) XOR 
        ('PHYSICAL_UNIT_USAGE_VIEW_ARM.CONNECTION_ZONE_IN_USAGE_VIEW' IN TYPEOF(bonded_feature_2)));
      WR5 : NOT((('PHYSICAL_LAYOUT_TEMPLATE_ARM.CONNECTION_ZONE_IN_LAYOUT_TEMPLATE' IN
        TYPEOF (bonded_feature_1)) OR
        ('FABRICATION_TECHNOLOGY_ARM.DEFAULT_ATTACHMENT_SIZE_BASED_LAND_PHYSICAL_TEMPLATE' IN TYPEOF
        (bonded_feature_1)) OR
        ('FEATURE_AND_CONNECTION_ZONE_ARM.FEATURE_DEFINITION_WITH_CONNECTION_AREA' IN TYPEOF(bonded_feature_2)))
        XOR 
        (('PHYSICAL_LAYOUT_TEMPLATE_ARM.CONNECTION_ZONE_IN_LAYOUT_TEMPLATE' IN TYPEOF(bonded_feature_2)) OR
        ('FABRICATION_TECHNOLOGY_ARM.DEFAULT_ATTACHMENT_SIZE_BASED_LAND_PHYSICAL_TEMPLATE' IN TYPEOF
        (bonded_feature_1)) OR
        ('FEATURE_AND_CONNECTION_ZONE_ARM.FEATURE_DEFINITION_WITH_CONNECTION_AREA' IN TYPEOF(bonded_feature_2))));      
  END_ENTITY;

  ENTITY Assembly_joint
    SUPERTYPE OF (Assembled_with_fasteners ANDOR
 Assembled_with_bonding)
    SUBTYPE OF (Component_feature_joint);
      SELF\Component_feature_joint.feature_1 RENAMED assembly_feature_1             : assembled_feature_select;
      SELF\Component_feature_joint.feature_2 RENAMED assembly_feature_2             : assembled_feature_select;
      SELF\Component_feature_joint.associated_definition RENAMED associated_assembly : assembly_module_or_assembly_group_component;
    UNIQUE
      UR1 : SELF\Shape_element.element_name,
        associated_assembly;
    WHERE
      WR1 : assembly_feature_1 :<>: assembly_feature_2;
      WR2 : ('ASSEMBLY_TECHNOLOGY_ARM.ASSEMBLED_WITH_FASTENERS' IN TYPEOF(SELF)) OR 
             (('ASSEMBLY_TECHNOLOGY_ARM.COMPONENT_FEATURE' IN TYPEOF(assembly_feature_1)) AND 
             (SIZEOF(QUERY(ay <* assembly_feature_1\Component_feature.associated_component\Assembly_component.occurrence_contexts | ay.related_view <> associated_assembly)) = 0));
      WR3 : ('ASSEMBLY_TECHNOLOGY_ARM.ASSEMBLED_WITH_FASTENERS' IN TYPEOF(SELF)) OR 
             (('ASSEMBLY_TECHNOLOGY_ARM.COMPONENT_FEATURE' IN TYPEOF(assembly_feature_2)) AND 
             (SIZEOF(QUERY(ay <* assembly_feature_2\Component_feature.associated_component\Assembly_component.occurrence_contexts | ay.related_view <> associated_assembly)) = 0));
  END_ENTITY;

  ENTITY Assembly_technology_specification
    SUBTYPE OF (Process_specification);
  END_ENTITY;

  ENTITY Component_mating_constraint_condition;
      name                          : STRING;  
      constraining_joint            : SET[1:3] OF Assembly_joint;
      constrained_degree_of_freedom : SET[1:6] OF degree_of_freedom;
      of_context                    : Part_design_view;
    UNIQUE
      UR1 : name,
 of_context;
  END_ENTITY;

  ENTITY Connection_zone_based_assembly_joint
    SUBTYPE OF (Assembly_joint);
      zone_1 : Connection_zone_in_design_view;
      zone_2 : Connection_zone_in_design_view;
    WHERE
      WR1 : zone_1 :<>: zone_2;
  END_ENTITY;

  ENTITY Default_assembly_bond_shape_model
    SUBTYPE OF (Geometric_model);
      shape_characterized_definition : Assembly_bond_definition;
    WHERE
      WR1 : NOT EXISTS(SELF\Representation.description);
      WR2 : SIZEOF(USEDIN(SELF, 'SHAPE_PROPERTY_ASSIGNMENT_ARM.SHAPE_DESCRIPTION_ASSOCIATION.REPRESENTATION'))=0;      
  END_ENTITY;

END_SCHEMA;

