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

(* Based on ARM *)

SCHEMA Project_xim; 

USE FROM Date_time_xim;    -- ISO/TS 10303-1010

USE FROM Date_time_assignment_xim;    -- ISO/TS 10303-1014

USE FROM Event_xim;    -- ISO/TS 10303-1064

USE FROM Event_assignment_xim;    -- ISO/TS 10303-1364

USE FROM Person_organization_xim;    -- ISO/TS 10303-1011

USE FROM person_organization_schema(
	organizational_project,
	organizational_project_relationship);

USE FROM management_resources_schema(organizational_project_assignment);

USE FROM Project_mim;

USE FROM support_resource_schema(label, identifier);

ENTITY Project
  (* CONNOTATIONAL *) SUBTYPE OF (organizational_project);
  planned_start_date : OPTIONAL date_or_event;
  planned_end_date : OPTIONAL date_or_event;
  actual_start_date : OPTIONAL date_time_select; 
  actual_end_date : OPTIONAL date_time_select; 
  id_x : identifier;
  DERIVE
   SELF\organizational_project.id : identifier := id_x;
END_ENTITY;

ENTITY Project_assignment
  (* CONNOTATIONAL *) SUBTYPE OF (applied_organizational_project_assignment);
  SELF\Organizational_project_assignment.assigned_organizational_project RENAMED assigned_project : Project;
  role_x : STRING;
 DERIVE
  SELF\Organizational_project_assignment.role : organizational_project_role := ?;
END_ENTITY;

(* Added according request from Lothar, Eva *)
 ENTITY Project_assignment__work_program 
 	 SUBTYPE OF (Project_assignment);
	DERIVE
   SELF\Project_assignment.role_x : STRING := 'work program';
 END_ENTITY;


ENTITY Project_relationship
	SUPERTYPE OF (ONEOF (Project_relationship__sequence,
                         Project_relationship__decomposition,
                         Project_relationship__dependency,
                         Project_relationship__succession))
  (* CONNOTATIONAL *) SUBTYPE OF (organizational_project_relationship);
  	SELF\organizational_project_relationship.name RENAMED relation_type : STRING;
    SELF\Organizational_project_relationship.relating_organizational_project RENAMED relating_project : Project;
    SELF\Organizational_project_relationship.related_organizational_project RENAMED related_project : Project;
END_ENTITY;

ENTITY Project_relationship__sequence
  (* CONNOTATIONAL *) SUBTYPE OF (Project_relationship);
DERIVE
  SELF\Project_relationship.relation_type : STRING := 'sequence';
END_ENTITY;

ENTITY Project_relationship__decomposition
  (* CONNOTATIONAL *) SUBTYPE OF (Project_relationship);
DERIVE
  SELF\Project_relationship.relation_type : STRING := 'decomposition';
END_ENTITY;

ENTITY Project_relationship__dependency
  (* CONNOTATIONAL *) SUBTYPE OF (Project_relationship);
DERIVE
  SELF\Project_relationship.relation_type : STRING := 'dependency';
END_ENTITY;

ENTITY Project_relationship__succession
  (* CONNOTATIONAL *) SUBTYPE OF (Project_relationship);
DERIVE
  SELF\Project_relationship.relation_type : STRING := 'succession';
END_ENTITY;

END_SCHEMA;  -- Project_xim

