(*
$Id$
ISO TC184/SC4/WG12 N2925 - ISO/TS 10303-1017 Product identification - EXPRESS ARM
Supersedes ISO TC184/SC4/WG12 N1102
*)


SCHEMA Product_identification_arm;

USE FROM Product_categorization_arm;    -- ISO/TS 10303-1016


ENTITY Product;
  id : STRING;
  name : OPTIONAL STRING;
  description : OPTIONAL STRING;
END_ENTITY;

ENTITY Product_category_assignment;
  category : Product_category;
  products : SET[1:?] OF Product;
END_ENTITY;

FUNCTION types_of_product
 (obj : Product) : SET OF STRING; 
 LOCAL
 	category_assignments: BAG OF Product_category_assignment;
 	categories: SET OF STRING:=[];
 	i: INTEGER;
 END_LOCAL;
 
 category_assignments := USEDIN(obj,'PRODUCT_IDENTIFICATION_ARM.' + 'PRODUCT_CATEGORY_ASSIGNMENT.PRODUCTS');
    
 REPEAT i := LOINDEX(category_assignments) TO HIINDEX(category_assignments) BY 1;
       categories := categories + category_assignments[i].category.name;
 END_REPEAT;
 
 RETURN(categories);
       END_FUNCTION; 

END_SCHEMA;  -- Product_identification_arm
