(*
 * $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 design_management(Design_management_arm, Design_management_mim);*)


entity_mapping Add_design_object_management_relationship(Add_design_object_management_relationship, design_object_management_relationship_action);

mapping_constraints;
design_object_management_relationship_action <= 
action
{action.name = 'add'}

end_mapping_constraints;

attribute_mapping current_design_object(current_design_object, $PATH, managed_design_object);
design_object_management_relationship_action <= 
action <-
action_assignment.assigned_action
action_assignment => design_object_management_assignment 
{design_object_management_assignment =>
current_design_object_assignment}
design_object_management_assignment.items ->
managed_design_object

end_attribute_mapping;

attribute_mapping current_design_object(current_design_object, , Product_view_definition);

design_object_management_relationship_action <= 
action <-
action_assignment.assigned_action
action_assignment => design_object_management_assignment 
{design_object_management_assignment =>
current_design_object_assignment}
design_object_management_assignment.items ->
managed_design_object = product_definition
product_definition
				
end_attribute_mapping;


end_entity_mapping;
(*
entity_mapping Approval_assignment(Approval_assignment, applied_approval_assignment)
extended;

attribute_mapping items(items, , Frozen_assignment_armx);

					approval_item *> design_management_approval_item
					design_management_approval_item = frozen_assignment
				
end_attribute_mapping;

end_entity_mapping;
*)
entity_mapping Change_design_object_management_relationship(Change_design_object_management_relationship, design_object_management_relationship_action);

mapping_constraints;
design_object_management_relationship_action <= 
action
{action.name = 'change'}

end_mapping_constraints;

attribute_mapping current_design_object(current_design_object, $PATH, managed_design_object);
design_object_management_relationship_action <= 
action <-
action_assignment.assigned_action
action_assignment => design_object_management_assignment 
{design_object_management_assignment =>
current_design_object_assignment}
design_object_management_assignment.items ->
managed_design_object

end_attribute_mapping;

attribute_mapping current_design_object(current_design_object, , Product_view_definition);

design_object_management_relationship_action <= 
action <-
action_assignment.assigned_action
action_assignment => design_object_management_assignment 
{design_object_management_assignment =>
current_design_object_assignment}
design_object_management_assignment.items ->
managed_design_object = product_definition
product_definition
				
end_attribute_mapping;

attribute_mapping previous_design_object(previous_design_object, $PATH, managed_design_object);
design_object_management_relationship_action <= 
action <-
action_assignment.assigned_action
action_assignment => design_object_management_assignment 
{design_object_management_assignment =>
previous_design_object_assignment}
design_object_management_assignment.items ->
managed_design_object

end_attribute_mapping;

attribute_mapping previous_design_object(previous_design_object, , Product_view_definition);

design_object_management_relationship_action <= 
action <-
action_assignment.assigned_action
action_assignment => design_object_management_assignment 
{design_object_management_assignment =>
previous_design_object_assignment}
design_object_management_assignment.items ->
managed_design_object = product_definition
product_definition
				
end_attribute_mapping;

attribute_mapping attribute_name(attribute_name, object_role.name);
design_object_management_relationship_action <= 
action <-
action_assignment.assigned_action
action_assignment.role ->
object_role
object_role.name					

end_attribute_mapping;

end_entity_mapping;

entity_mapping Delete_design_object_management_relationship(Delete_design_object_management_relationship, design_object_management_relationship_action);

mapping_constraints;
design_object_management_relationship_action <= 
action
{action.name = 'delete'}

end_mapping_constraints;

attribute_mapping previous_design_object(previous_design_object, $PATH, managed_design_object);
design_object_management_relationship_action <= 
action <-
action_assignment.assigned_action
action_assignment => design_object_management_assignment 
{design_object_management_assignment =>
previous_design_object_assignment}
design_object_management_assignment.items ->
managed_design_object

end_attribute_mapping;

attribute_mapping previous_design_object(previous_design_object, , Product_view_definition);

design_object_management_relationship_action <= 
action <-
action_assignment.assigned_action
action_assignment => design_object_management_assignment 
{design_object_management_assignment =>
previous_design_object_assignment}
design_object_management_assignment.items ->
managed_design_object = product_definition
product_definition
				
end_attribute_mapping;

end_entity_mapping;

entity_mapping Design_object_management_relationship(Design_object_management_relationship, design_object_management_relationship_action);

mapping_constraints;
design_object_management_relationship_action <= 
action
{(action.name = 'add')
(action.name = 'change')
(action.name = 'design dependent')
(action.name = 'delete')}

end_mapping_constraints;

end_entity_mapping;

entity_mapping Frozen_assignment_armx(Frozen_assignment_armx, frozen_assignment);

mapping_constraints;
frozen_assignment <=
approval_assignment

end_mapping_constraints;

attribute_mapping frozen_item(frozen_item, $PATH, managed_design_object);
frozen_assignment
frozen_assignment.items[i] ->
managed_design_object

end_attribute_mapping;

attribute_mapping frozen_item(frozen_item, , Product_view_definition);

frozen_assignment
frozen_assignment.items[i] ->
managed_design_object
managed_design_object = product_definition
product_definition
				
end_attribute_mapping;

end_entity_mapping;

entity_mapping View_dependent_design_object_management_relationship(View_dependent_design_object_management_relationship, design_object_management_relationship_action);

mapping_constraints;
design_object_management_relationship_action <= 
action
{action.name = 'design dependent'}

end_mapping_constraints;

attribute_mapping current_design(current_design, $PATH, Product_view_definition);
design_object_management_relationship_action <= 
action <-
action_assignment.assigned_action
action_assignment => design_object_management_assignment 
{design_object_management_assignment =>
current_design_assignment}
design_object_management_assignment.items ->
product_definition

end_attribute_mapping;

attribute_mapping previous_design(previous_design, $PATH, Product_view_definition);
design_object_management_relationship_action <= 
action <-
action_assignment.assigned_action
action_assignment => design_object_management_assignment 
{design_object_management_assignment =>
previous_design_assignment}
design_object_management_assignment.items ->
product_definition

end_attribute_mapping;

end_entity_mapping;
(*end_schema_mapping;*)
