(*
 * $Id$
 *
 * JSDAI(TM), a way to implement STEP, ISO 10303
 * Copyright (C) 1997-2008, LKSoftWare GmbH, Germany
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License
 * version 3 as published by the Free Software Foundation (AGPL v3).
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * JSDAI is a registered trademark of LKSoftWare GmbH, Germany
 * This software is also available under commercial licenses.
 * See also http://www.jsdai.net/
 *)

(*
   Derived from ISO TC184/SC4/WG12 N3220 - ISO/TS 10303-1023 Part view definition - EXPRESS ARM
   by LKSoftWare GmbH for implementation purpose within IDA-STEP(TM)
*)

(* Based on ARM *) 


SCHEMA Part_view_definition_xim;

USE FROM Part_and_version_identification_xim;    -- ISO/TS 10303-1022

USE FROM Product_view_definition_xim;    -- ISO/TS 10303-1019

USE FROM support_resource_schema(text);

USE FROM application_context_schema(application_context_element);

ENTITY Part_view_definition
  (* CONNOTATIONAL *) SUBTYPE OF (Product_view_definition);
  SELF\Product_view_definition.defined_version : Part_version;
(* GL Added to reflect mapping constraint *)  
 WHERE
  WR1 : SELF\Product_view_definition.initial_context\application_context_element.name = 'part definition';
END_ENTITY;

RULE part_view_definition_constraint FOR 
(Product_definition);
WHERE
  WR1: SIZEOF ( QUERY ( pvd <* Product_definition | ( NOT ( 'Part_view_definition_xim.' + 'PART_VIEW_DEFINITION' IN TYPEOF (pvd) ) ) AND ( 'Part_view_definition_xim.' + 'PART_VERSION' IN TYPEOF ( pvd.formation) ) ) ) =0 ;
END_RULE; 

END_SCHEMA;  -- Part_view_definition_xim

