(*
 * $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 N3145 - ISO/TS 10303-1268 Resource item - EXPRESS ARM
 by LKSoftWare GmbH for implementation purpose within IDA-STEP(TM)
*) 


SCHEMA Resource_item_xim;

USE FROM Classification_assignment_xim;    -- ISO/TS 10303-1114

USE FROM Value_with_unit_xim;    -- ISO/TS 10303-1054

USE FROM support_resource_schema (label, text);

USE FROM action_schema(
	action_method,
	action_resource,
	action_resource_relationship,
	action_resource_type,
	supported_item);

TYPE resource_assignment_item = EXTENSIBLE GENERIC_ENTITY SELECT;
END_TYPE; 

TYPE resource_item_classification_item_armx = EXTENSIBLE GENERIC_ENTITY SELECT BASED_ON classification_item WITH 
   (Resource_item, 
    Resource_item_assignment, 
    Resource_item_relationship);
END_TYPE; 

TYPE resource_item_select = EXTENSIBLE GENERIC_ENTITY SELECT;
END_TYPE; 

ENTITY Resource_group_relationship
  (* CONNOTATIONAL *) SUBTYPE OF (Resource_item_relationship);
  quantity : OPTIONAL measure_with_unit;
END_ENTITY;

ENTITY Resource_item
	(* CONNOTATIONAL *) SUBTYPE OF (action_resource);
	(* attributes are accessable from supertype 
  name : STRING;
  description : OPTIONAL STRING; *)
  resource_items : OPTIONAL SET[0:?] OF resource_item_select;
 DERIVE
  SELF\action_resource.kind  : action_resource_type := ?;
  SELF\action_resource.usage : SET [1:?] OF supported_item := ?;
END_ENTITY;

ENTITY Resource_item_assignment
	(* CONNOTATIONAL *) SUBTYPE OF (action_method);
  assigned_resource : Resource_item;
  item : resource_assignment_item;
 DERIVE
    SELF\action_method.name : label := 'resource management';
	SELF\action_method.consequence : text := 'resource item assignment';
	SELF\action_method.purpose : text := 'standard action method';
END_ENTITY;

ENTITY Resource_item_relationship
	(* CONNOTATIONAL *) SUBTYPE OF (action_resource_relationship);
	(* attributes are accessable from supertype
  name : STRING;
  description : OPTIONAL STRING; *)
  SELF\action_resource_relationship.relating_resource RENAMED relating : Resource_item;
  SELF\action_resource_relationship.related_resource RENAMED related   : Resource_item;
END_ENTITY;

END_SCHEMA;  -- Resource_item_xim
