(*
 * $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 N - ISO/CD-TS 10303-xxxx Work breakdown - EXPRESS ARM
   by LKSoftWare GmbH for implementation purpose within IDA-STEP(TM)
*)

SCHEMA Work_breakdown_xim;

USE FROM Contract_xim;    --  ISO/TS 10303-1062
USE FROM Product_breakdown_xim;    --  ISO/TS 10303-1248
USE FROM Project_xim;    --  ISO/TS 10303-1061

USE FROM Work_breakdown_mim;

TYPE wbs_deliverable_item = EXTENSIBLE SELECT;
END_TYPE; 

TYPE wbs_or_wbs_element = SELECT
   (Work_breakdown_element_definition, 
    Work_breakdown_structure_version);
END_TYPE; 

ENTITY Contract_for_wbs
  SUBTYPE OF (applied_contract_assignment);
   section_reference : STRING;
   SELF\applied_contract_assignment.items RENAMED wbs_or_element : SET[1:1] OF wbs_or_wbs_element;
END_ENTITY;

-- Open question, SEDS
ENTITY WBS_deliverable;
  deliverable : wbs_deliverable_item;
  description : OPTIONAL STRING;
  id : STRING;
  name : STRING;
  specifed_by : OPTIONAL Contract_for_wbs;
  wbs_or_element : wbs_or_wbs_element;
END_ENTITY;

ENTITY WBS_element_precedence
  SUBTYPE OF (product_definition_relationship);
  SELF\Product_definition_relationship.related_product_definition RENAMED predecessor : Work_breakdown_element_definition;
  SELF\Product_definition_relationship.relating_product_definition RENAMED successor : Work_breakdown_element_definition;
END_ENTITY;

ENTITY WBS_for_project
  SUBTYPE OF (Project_assignment);
   SELF\Project_assignment.items RENAMED describing_wbs : SET[1:1] OF wbs_or_wbs_element;
END_ENTITY;

ENTITY Work_breakdown_context_armx
  SUBTYPE OF (Breakdown_context_armx, work_breakdown_context);
  SELF\Breakdown_context_armx.breakdown : Work_breakdown_structure_version;
  SELF\Breakdown_context_armx.breakdown_element : Work_breakdown_element_definition;
END_ENTITY;

ENTITY Work_breakdown_element
  SUBTYPE OF (Breakdown_element);
END_ENTITY;

ENTITY Work_breakdown_element_definition
  SUBTYPE OF (Breakdown_element_definition);
  SELF\Product_view_definition.defined_version : Work_breakdown_element_version;
END_ENTITY;

ENTITY Work_breakdown_element_usage_armx
  SUBTYPE OF (Breakdown_element_usage_armx, work_breakdown_element_usage);
  SELF\Breakdown_element_usage_armx.child_element : Work_breakdown_element_definition;
  SELF\Breakdown_element_usage_armx.parent_element : Work_breakdown_element_definition;
END_ENTITY;

ENTITY Work_breakdown_element_version
  SUBTYPE OF (Breakdown_element_version);
  SELF\product_definition_formation.of_product : Work_breakdown_element;
END_ENTITY;

ENTITY Work_breakdown_structure
  SUBTYPE OF (Breakdown);
END_ENTITY;

ENTITY Work_breakdown_structure_version
  SUBTYPE OF (Breakdown_version);
  SELF\product_definition_formation.of_product : Work_breakdown_structure;
END_ENTITY;

END_SCHEMA;  -- Work_breakdown_xim
