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


SCHEMA Resource_management_xim;

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

USE FROM Location_assignment_xim;    -- ISO/TS 10303-1277

USE FROM Required_resource_xim;    -- ISO/TS 10303-1267

USE FROM Resource_item_xim;    -- ISO/TS 10303-1268

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

USE FROM action_schema(
	action,
	action_relationship);

USE FROM process_property_schema(action_property);

TYPE managed_resource_location_assignment_select = EXTENSIBLE GENERIC_ENTITY SELECT BASED_ON location_assignment_select WITH 
   (Managed_resource);
END_TYPE; 

TYPE resource_management_classification_item_armx = EXTENSIBLE GENERIC_ENTITY SELECT BASED_ON classification_item WITH 
   (Managed_resource, 
    Managed_resource_relationship, 
    Resource_event, 
    Resource_event_correspondence_relationship, 
    Resource_event_relationship);
END_TYPE; 

ENTITY Decreasing_resource_event
  (* CONNOTATIONAL *) SUBTYPE OF (Resource_event);
END_ENTITY;

ENTITY Increasing_resource_event
  (* CONNOTATIONAL *) SUBTYPE OF (Resource_event);
END_ENTITY;

ENTITY Managed_resource
	(* CONNOTATIONAL *) SUBTYPE OF (action_resource);
	(* attributes are accessable from supertype
  name : STRING;
  description : OPTIONAL STRING; *)
  quantity : OPTIONAL measure_with_unit;
  item : Resource_item;
 DERIVE
  SELF\action_resource.usage : SET [1:?] OF supported_item := ?;
END_ENTITY;

ENTITY Managed_resource_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 : Managed_resource;
  SELF\action_resource_relationship.related_resource RENAMED related   : Managed_resource;
 DERIVE
  SELF\action_resource_relationship.name : label := 'managed resource relationship';
END_ENTITY;

ENTITY Resource_event
  ABSTRACT SUPERTYPE 
  (* CONNOTATIONAL *) SUBTYPE OF (action);
  (* attributes are accessable from supertype
  name : STRING;
  description : OPTIONAL STRING; *)
  quantity : OPTIONAL measure_with_unit;
  resource : Managed_resource;
 DERIVE
  SELF\action.chosen_method : action_method := ?;
END_ENTITY;

ENTITY Resource_event_correspondence_relationship
	(* CONNOTATIONAL *) SUBTYPE OF (action_property);
	(* attribute is accessable from supertype
  description : OPTIONAL STRING; *)
  SELF\action_property.definition RENAMED relating : Resource_event;
  related : Required_resource;
 DERIVE
  SELF\action_property.name : label := 'resource event correspondence relationship';
END_ENTITY;

ENTITY Resource_event_relationship
	(* CONNOTATIONAL *) SUBTYPE OF (action_relationship);
	(* attribute is accessable from supertype
  description : OPTIONAL STRING; *)
  SELF\action_relationship.relating_action RENAMED relating : Resource_event;
  SELF\action_relationship.related_action RENAMED  related  : Resource_event;
 DERIVE
  SELF\action_relationship.name : label := 'resource event relationship';
END_ENTITY;

END_SCHEMA;  -- Resource_management_arm
