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

(*schema_mapping person_organization_assignment(Person_organization_assignment_arm, Person_organization_assignment_mim);*)

uof_mapping Organization_or_person_in_organization_assignment(Organization_or_person_in_organization_assignment);

entity_mapping organization_or_person_in_organization_assignment_select(organization_or_person_in_organization_assignment_select, ( 
			(applied_organization_assignment)
			)( 
			(applied_person_and_organization_assignment)
			));

mapping_constraints;
(
			(applied_organization_assignment <= organization_assignment)
	    )(
			(applied_person_and_organization_assignment <= person_and_organization_assignment)
	    )
end_mapping_constraints;

attribute_mapping assigned_entity(assigned_entity, $PATH, Organization);

			applied_organization_assignment <= organization_assignment
			organization_assignment.assigned_organization -> organization
			
end_attribute_mapping;

attribute_mapping assigned_entity(assigned_entity, $PATH, person_and_organization);

			applied_person_and_organization_assignment <= person_and_organization_assignment
			person_and_organization_assignment.assigned_person_and_organization -> person_and_organization
			
end_attribute_mapping;

attribute_mapping role(role, (
			   (organization_role.name)
			 )(
			   (person_and_organization_role.name)
			 ));
(				
					(organization_assignment
					 organization_assignment.role -> organization_role
					 organization_role
					 organization_role.name)
				)(						
			  (person_and_organization_assignment
			 		person_and_organization_assignment.role -> person_and_organization_role
					person_and_organization_role
					person_and_organization_role.name)
				)
end_attribute_mapping;

attribute_mapping items(items, ($PATH)($PATH), person_and_organization_item,);
(
			 (applied_organization_assignment.items[i] -> organization_item)
				)(
			 (applied_person_and_organization_assignment.items[i] -> person_and_organization_item)
				)
end_attribute_mapping;

end_entity_mapping;
end_uof_mapping;

(*end_schema_mapping;*)
