(*
 * $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/
 *)

(*
   N - ISO/CD-TS - 10303- product_as_individual_assembly - EXPRESS ARM*)
(* UNDER DEVELOPMENT *)
SCHEMA Product_as_individual_assembly_xim;

USE FROM Generic_product_occurrence_xim;
-- USE FROM Part_view_definition_arm;
USE FROM Part_occurrence_xim;
USE FROM Product_as_individual_xim;

  ENTITY Physical_assembly_relationship 
    SUBTYPE OF (assembly_component_usage);
      SELF\product_definition_relationship.related_product_definition RENAMED physical_component : Product_as_individual_view;
      SELF\product_definition_relationship.relating_product_definition RENAMED physical_assembly : Product_as_individual_view; 
      is_realization_of : Product_occurrence; --item_instance;
    DERIVE
      SELF\product_definition_relationship.name : label := 'physical occurrence usage';
      SELF\product_definition_relationship.id : identifier := ?;
  END_ENTITY;

  ENTITY Product_as_individual_view_realization__pdr
    SUBTYPE OF (product_definition_relationship);
    SELF\product_definition_relationship.relating_product_definition RENAMED product_design    : Part_view_definition;
    SELF\product_definition_relationship.related_product_definition RENAMED individual_product : Product_as_individual_view;
  DERIVE
    individual_product_version : product_definition_formation := individual_product\Product_view_definition.defined_version;  
    SELF\product_definition_relationship.name : label := 'physical realization';
    SELF\product_definition_relationship.id : identifier := ?;
  UNIQUE
    UR1 : individual_product;
  WHERE
    WR1 : NOT('PRODUCT_AS_INDIVIDUAL_XIM.PRODUCT_DESIGN_VERSION_TO_INDIVIDUAL_ARMX' IN TYPEOF(individual_product_version))
      AND NOT('PRODUCT_AS_INDIVIDUAL_XIM.PRODUCT_DESIGN_TO_INDIVIDUAL_ARMX' IN TYPEOF(individual_product_version\product_definition_formation.of_product));
  END_ENTITY;

  ENTITY Product_as_individual_view_realization__cd
    SUBTYPE OF (configuration_design);
    SELF\configuration_design.configuration RENAMED product_design : configuration_item;
    SELF\configuration_design.design RENAMED individual_product    : Product_as_individual_view;
  DERIVE
    individual_product_version : product_definition_formation := individual_product\Product_view_definition.defined_version;  
  UNIQUE
    UR1 : individual_product;
  WHERE
    WR1 : NOT('PRODUCT_AS_INDIVIDUAL_XIM.PRODUCT_DESIGN_VERSION_TO_INDIVIDUAL_ARMX' IN TYPEOF(individual_product_version))
      AND NOT('PRODUCT_AS_INDIVIDUAL_XIM.PRODUCT_DESIGN_TO_INDIVIDUAL_ARMX' IN TYPEOF(individual_product_version\product_definition_formation.of_product));
  END_ENTITY;

END_SCHEMA;
