Schema: management_resources_schema

Source : ISO 10303-41



SCHEMA management_resources_schema;

REFERENCE FROM action_schema;    -- ISO 10303-41

REFERENCE FROM application_context_schema   -- ISO 10303-41
  (library_context);

REFERENCE FROM approval_schema;    -- ISO 10303-41

REFERENCE FROM basic_attribute_schema   -- ISO 10303-41
  (get_role,
   object_role,
   role_association,
   role_select);

REFERENCE FROM certification_schema;    -- ISO 10303-41

REFERENCE FROM contract_schema;    -- ISO 10303-41

REFERENCE FROM date_time_schema;    -- ISO 10303-41

REFERENCE FROM document_schema;    -- ISO 10303-41

REFERENCE FROM effectivity_schema;    -- ISO 10303-41

REFERENCE FROM experience_schema;    -- ISO 10303-41

REFERENCE FROM external_reference_schema   -- ISO 10303-41
  (external_source);

REFERENCE FROM group_schema;    -- ISO 10303-41

REFERENCE FROM location_schema;    -- ISO 10303-41

REFERENCE FROM person_organization_schema;    -- ISO 10303-41

REFERENCE FROM qualifications_schema;    -- ISO 10303-41

REFERENCE FROM security_classification_schema;    -- ISO 10303-41

REFERENCE FROM support_resource_schema;    -- ISO 10303-41


TYPE assignment_object_select = EXTENSIBLE SELECT;
END_TYPE;

TYPE attribute_type = SELECT
   (label,
    text);
END_TYPE;

TYPE mrs_role_select = SELECT BASED_ON role_select WITH
   (action_assignment,
    action_request_assignment,
    approval_assignment,
    certification_assignment,
    contract_assignment,
    document_reference,
    effectivity_assignment,
    external_referent_assignment,
    group_assignment,
    name_assignment,
    security_classification_assignment);
END_TYPE;

ENTITY action_assignment
  ABSTRACT SUPERTYPE ;
  assigned_action : action;
DERIVE
  role : object_role := get_role(SELF);
WHERE
  WR1: SIZEOF(USEDIN(SELF, 'BASIC_ATTRIBUTE_SCHEMA.ROLE_ASSOCIATION.ITEM_WITH_ROLE')) <= 1;
END_ENTITY;

ENTITY action_method_assignment
  ABSTRACT SUPERTYPE ;
  assigned_action_method : action_method;
  role : action_method_role;
END_ENTITY;

ENTITY action_method_role;
  name : label;
  description : OPTIONAL text;
END_ENTITY;

ENTITY action_request_assignment
  ABSTRACT SUPERTYPE ;
  assigned_action_request : versioned_action_request;
DERIVE
  role : object_role := get_role(SELF);
WHERE
  WR1: SIZEOF(USEDIN(SELF, 'BASIC_ATTRIBUTE_SCHEMA.ROLE_ASSOCIATION.ITEM_WITH_ROLE')) <= 1;
END_ENTITY;

ENTITY approval_assignment
  ABSTRACT SUPERTYPE ;
  assigned_approval : approval;
DERIVE
  role : object_role := get_role(SELF);
WHERE
  WR1: SIZEOF(USEDIN(SELF, 'BASIC_ATTRIBUTE_SCHEMA.ROLE_ASSOCIATION.ITEM_WITH_ROLE')) <= 1;
END_ENTITY;

ENTITY assignment_object_relationship;
  id : OPTIONAL identifier;
  description : OPTIONAL text;
  relating : assignment_object_select;
  related : assignment_object_select;
  relation_type : STRING;
WHERE
  WR1: acyclic_assignment_object_relationship(SELF, [related], 'MANAGEMENT_RESOURCES_SCHEMA.ASSIGNMENT_OBJECT_RELATIONSHIP');
END_ENTITY;

ENTITY attribute_classification_assignment
  ABSTRACT SUPERTYPE ;
  assigned_class : group;
  attribute_name : label;
  role : classification_role;
END_ENTITY;

ENTITY attribute_value_assignment
  ABSTRACT SUPERTYPE ;
  attribute_name : label;
  attribute_value : attribute_type;
  role : attribute_value_role;
END_ENTITY;

ENTITY attribute_value_role;
  name : label;
  description : OPTIONAL text;
END_ENTITY;

ENTITY certification_assignment
  ABSTRACT SUPERTYPE ;
  assigned_certification : certification;
DERIVE
  role : object_role := get_role(SELF);
WHERE
  WR1: SIZEOF(USEDIN(SELF, 'BASIC_ATTRIBUTE_SCHEMA.ROLE_ASSOCIATION.ITEM_WITH_ROLE')) <= 1;
END_ENTITY;

ENTITY classification_assignment
  ABSTRACT SUPERTYPE ;
  assigned_class : group;
  role : classification_role;
END_ENTITY;

ENTITY classification_assignment_relationship;
  id : OPTIONAL identifier;
  description : OPTIONAL text;
  relating : classification_assignment;
  related : classification_assignment;
  relation_type : STRING;
WHERE
  WR1: acyclic_classification_assignment_relationship(SELF, [related], 'MANAGEMENT_RESOURCES_SCHEMA.CLASSIFICATION_ASSIGNMENT_RELATIONSHIP');
END_ENTITY;

ENTITY classification_role;
  name : label;
  description : OPTIONAL text;
END_ENTITY;

ENTITY contract_assignment
  ABSTRACT SUPERTYPE ;
  assigned_contract : contract;
DERIVE
  role : object_role := get_role(SELF);
WHERE
  WR1: SIZEOF(USEDIN(SELF, 'BASIC_ATTRIBUTE_SCHEMA.ROLE_ASSOCIATION.ITEM_WITH_ROLE')) <= 1;
END_ENTITY;

ENTITY date_and_time_assignment
  ABSTRACT SUPERTYPE ;
  assigned_date_and_time : date_and_time;
  role : date_time_role;
END_ENTITY;

ENTITY date_assignment
  ABSTRACT SUPERTYPE ;
  assigned_date : date;
  role : date_role;
END_ENTITY;

ENTITY document_reference
  ABSTRACT SUPERTYPE ;
  assigned_document : document;
  source : label;
DERIVE
  role : object_role := get_role(SELF);
WHERE
  WR1: SIZEOF(USEDIN(SELF, 'BASIC_ATTRIBUTE_SCHEMA.ROLE_ASSOCIATION.ITEM_WITH_ROLE')) <= 1;
END_ENTITY;

ENTITY document_usage_constraint_assignment
  ABSTRACT SUPERTYPE ;
  assigned_document_usage : document_usage_constraint;
  role : document_usage_role;
END_ENTITY;

ENTITY document_usage_role;
  name : label;
  description : OPTIONAL text;
END_ENTITY;

ENTITY effectivity_assignment
  ABSTRACT SUPERTYPE ;
  assigned_effectivity : effectivity;
DERIVE
  role : object_role := get_role(SELF);
WHERE
  WR1: SIZEOF(USEDIN(SELF, 'BASIC_ATTRIBUTE_SCHEMA.ROLE_ASSOCIATION.ITEM_WITH_ROLE')) <= 1;
END_ENTITY;

ENTITY effectivity_context_assignment
  ABSTRACT SUPERTYPE ;
  assigned_effectivity_assignment : effectivity_assignment;
  role : effectivity_context_role;
END_ENTITY;

ENTITY effectivity_context_role;
  name : label;
  description : OPTIONAL text;
END_ENTITY;

ENTITY event_occurrence_assignment
  ABSTRACT SUPERTYPE ;
  assigned_event_occurrence : event_occurrence;
  role : event_occurrence_role;
END_ENTITY;

ENTITY event_occurrence_context_assignment
  ABSTRACT SUPERTYPE ;
  assigned_event_occurrence_assignment : event_occurrence_assignment;
  role : event_occurrence_context_role;
END_ENTITY;

ENTITY experience_assignment
  ABSTRACT SUPERTYPE ;
  id : identifier;
  name : label;
  description : OPTIONAL text;
  assigned_experience : experience;
  role : experience_role;
END_ENTITY;

ENTITY experience_role;
  id : identifier;
  name : label;
  description : OPTIONAL text;
END_ENTITY;

ENTITY experience_type_assignment
  ABSTRACT SUPERTYPE ;
  id : identifier;
  name : label;
  description : OPTIONAL text;
  assigned_experience_type : experience_type;
  role : experience_type_role;
END_ENTITY;

ENTITY experience_type_role;
  id : identifier;
  name : label;
  description : OPTIONAL text;
END_ENTITY;

ENTITY external_identification_assignment
  ABSTRACT SUPERTYPE
  SUBTYPE OF (identification_assignment);
  source : external_source;
END_ENTITY;

ENTITY external_identification_assignment_relationship;
  id : OPTIONAL identifier;
  description : OPTIONAL text;
  relating : external_identification_assignment;
  related : external_identification_assignment;
  relation_type : STRING;
WHERE
  WR1: acyclic_external_identification_assignment_relationship(SELF, [related], 'MANAGEMENT_RESOURCES_SCHEMA.EXTERNAL_IDENTIFICATION_ASSIGNMENT_RELATIONSHIP');
END_ENTITY;

ENTITY external_referent_assignment
  ABSTRACT SUPERTYPE ;
  assigned_name : label;
DERIVE
  role : object_role := get_role(SELF);
UNIQUE
  UR1: assigned_name;
WHERE
  WR1: SIZEOF(USEDIN(SELF, 'BASIC_ATTRIBUTE_SCHEMA.ROLE_ASSOCIATION.ITEM_WITH_ROLE')) <= 1;
END_ENTITY;

ENTITY group_assignment
  ABSTRACT SUPERTYPE ;
  assigned_group : group;
DERIVE
  role : object_role := get_role(SELF);
WHERE
  WR1: SIZEOF(USEDIN(SELF, 'BASIC_ATTRIBUTE_SCHEMA.ROLE_ASSOCIATION.ITEM_WITH_ROLE')) <= 1;
END_ENTITY;

ENTITY identification_assignment
  ABSTRACT SUPERTYPE ;
  assigned_id : identifier;
  role : identification_role;
END_ENTITY;

ENTITY identification_assignment_relationship;
  name : label;
  description : OPTIONAL text;
  relating_identification_assignment : identification_assignment;
  related_identification_assignment : identification_assignment;
END_ENTITY;

ENTITY identification_role;
  name : label;
  description : OPTIONAL text;
END_ENTITY;

ENTITY library_assignment
  ABSTRACT SUPERTYPE
  SUBTYPE OF (external_referent_assignment);
  frame_of_reference : library_context;
UNIQUE
  UR1: frame_of_reference;
END_ENTITY;

ENTITY location_assignment
  ABSTRACT SUPERTYPE ;
  id : identifier;
  name : label;
  description : OPTIONAL text;
  assigned_location : location;
  role : location_role;
END_ENTITY;

ENTITY location_representation_assignment
  ABSTRACT SUPERTYPE ;
  id : identifier;
  name : label;
  description : OPTIONAL text;
  represented_location : location;
  role : location_representation_role;
END_ENTITY;

ENTITY location_representation_role;
  id : identifier;
  name : label;
  description : OPTIONAL text;
END_ENTITY;

ENTITY location_role;
  id : identifier;
  name : label;
  description : OPTIONAL text;
END_ENTITY;

ENTITY name_assignment
  ABSTRACT SUPERTYPE ;
  assigned_name : label;
DERIVE
  role : object_role := get_role(SELF);
WHERE
  WR1: SIZEOF(USEDIN(SELF, 'BASIC_ATTRIBUTE_SCHEMA.ROLE_ASSOCIATION.ITEM_WITH_ROLE')) <= 1;
END_ENTITY;

ENTITY organization_assignment
  ABSTRACT SUPERTYPE ;
  assigned_organization : organization;
  role : organization_role;
END_ENTITY;

ENTITY organization_type_assignment
  ABSTRACT SUPERTYPE ;
  id : identifier;
  name : label;
  description : OPTIONAL text;
  assigned_organization_type : organization_type;
  role : organization_type_role;
END_ENTITY;

ENTITY organization_type_role;
  id : identifier;
  name : label;
  description : OPTIONAL text;
END_ENTITY;

ENTITY organizational_project_assignment
  ABSTRACT SUPERTYPE ;
  assigned_organizational_project : organizational_project;
  role : organizational_project_role;
END_ENTITY;

ENTITY organizational_project_role;
  name : label;
  description : OPTIONAL text;
END_ENTITY;

ENTITY person_and_organization_assignment
  ABSTRACT SUPERTYPE ;
  assigned_person_and_organization : person_and_organization;
  role : person_and_organization_role;
END_ENTITY;

ENTITY person_assignment
  ABSTRACT SUPERTYPE ;
  assigned_person : person;
  role : person_role;
END_ENTITY;

ENTITY person_type_assignment
  ABSTRACT SUPERTYPE ;
  id : identifier;
  name : label;
  description : OPTIONAL text;
  assigned_person_type : person_type;
  role : person_type_role;
END_ENTITY;

ENTITY person_type_definition_assignment
  ABSTRACT SUPERTYPE ;
  id : identifier;
  name : label;
  description : OPTIONAL text;
  assigned_person_type_definition : person_type_definition;
  role : person_type_definition_role;
END_ENTITY;

ENTITY person_type_definition_role;
  id : identifier;
  name : label;
  description : OPTIONAL text;
END_ENTITY;

ENTITY person_type_role;
  id : identifier;
  name : label;
  description : OPTIONAL text;
END_ENTITY;

ENTITY position_in_organization_assignment
  ABSTRACT SUPERTYPE ;
  id : identifier;
  name : label;
  description : OPTIONAL text;
  assigned_position_in_organization : position_in_organization;
  role : position_in_organization_role;
END_ENTITY;

ENTITY position_in_organization_role;
  id : identifier;
  name : label;
  description : OPTIONAL text;
END_ENTITY;

ENTITY position_in_organization_type_assignment
  ABSTRACT SUPERTYPE ;
  id : identifier;
  name : label;
  description : OPTIONAL text;
  assigned_position_in_organization_type : position_in_organization_type;
  role : position_in_organization_type_role;
END_ENTITY;

ENTITY position_in_organization_type_role;
  id : identifier;
  name : label;
  description : OPTIONAL text;
END_ENTITY;

ENTITY qualification_assignment
  ABSTRACT SUPERTYPE ;
  id : identifier;
  name : label;
  description : OPTIONAL text;
  assigned_qualification : qualification;
  role : qualification_role;
END_ENTITY;

ENTITY qualification_role;
  id : identifier;
  name : label;
  description : OPTIONAL text;
END_ENTITY;

ENTITY qualification_type_assignment
  ABSTRACT SUPERTYPE ;
  id : identifier;
  name : label;
  description : OPTIONAL text;
  assigned_qualification_type : qualification_type;
  role : qualification_type_role;
END_ENTITY;

ENTITY qualification_type_role;
  id : identifier;
  name : label;
  description : OPTIONAL text;
END_ENTITY;

ENTITY security_classification_assignment
  ABSTRACT SUPERTYPE ;
  assigned_security_classification : security_classification;
DERIVE
  role : object_role := get_role(SELF);
WHERE
  WR1: SIZEOF(USEDIN(SELF, 'BASIC_ATTRIBUTE_SCHEMA.ROLE_ASSOCIATION.ITEM_WITH_ROLE')) <= 1;
END_ENTITY;

ENTITY time_assignment
  ABSTRACT SUPERTYPE ;
  assigned_time : local_time;
  role : time_role;
END_ENTITY;

ENTITY time_interval_assignment
  ABSTRACT SUPERTYPE ;
  assigned_time_interval : time_interval;
  role : time_interval_role;
END_ENTITY;

FUNCTION acyclic_assignment_object_relationship
 (relation : assignment_object_relationship; relatives : SET[1:?] OF assignment_object_select; specific_relation : STRING) : BOOLEAN;
  LOCAL
  x : SET OF assignment_object_relationship;
    END_LOCAL;
      IF relation.relating IN relatives
  THEN
    RETURN(FALSE);
  END_IF;
      x := QUERY(aor
                 <* bag_to_set(USEDIN(relation.relating, 'MANAGEMENT_RESOURCES_SCHEMA.ASSIGNMENT_OBJECT_RELATIONSHIP.RELATED'))
                 | specific_relation IN TYPEOF(aor));
      REPEAT i := 1 TO HIINDEX(x);
    IF NOT acyclic_assignment_object_relationship(x[i], relatives + relation.relating, specific_relation)
    THEN
      RETURN(FALSE);
    END_IF;
  END_REPEAT;
      RETURN(TRUE);
END_FUNCTION;

FUNCTION acyclic_classification_assignment_relationship
 (relation : classification_assignment_relationship; relatives : SET[1:?] OF classification_assignment; specific_relation : STRING) : BOOLEAN;
  LOCAL
  x : SET OF classification_assignment_relationship;
    END_LOCAL;
      IF relation.relating IN relatives
  THEN
    RETURN(FALSE);
  END_IF;
      x := QUERY(car
                 <* bag_to_set(USEDIN(relation.relating, 'MANAGEMENT_RESOURCES_SCHEMA.CLASSIFICATION_ASSIGNMENT_RELATIONSHIP.RELATED'))
                 | specific_relation IN TYPEOF(car));
      REPEAT i := 1 TO HIINDEX(x);
    IF NOT acyclic_classification_assignment_relationship(x[i], relatives + relation.relating, specific_relation)
    THEN
      RETURN(FALSE);
    END_IF;
  END_REPEAT;
      RETURN(TRUE);
END_FUNCTION;

FUNCTION acyclic_external_identification_assignment_relationship
 (relation : external_identification_assignment_relationship; relatives : SET[1:?] OF external_identification_assignment; specific_relation : STRING) : BOOLEAN;
  LOCAL
  x : SET OF external_identification_assignment_relationship;
    END_LOCAL;
      IF relation.relating IN relatives
  THEN
    RETURN(FALSE);
  END_IF;
      x := QUERY(eiar
                 <* bag_to_set(USEDIN(relation.relating, 'MANAGEMENT_RESOURCES_SCHEMA.EXTERNAL_IDENTIFICATION_ASSIGNMENT_RELATIONSHIP.RELATED'))
                 | specific_relation IN TYPEOF(eiar));
      REPEAT i := 1 TO HIINDEX(x);
    IF NOT acyclic_external_identification_assignment_relationship(x[i], relatives +
                                                                         relation.relating, specific_relation)
    THEN
      RETURN(FALSE);
    END_IF;
  END_REPEAT;
      RETURN(TRUE);
END_FUNCTION;

FUNCTION acyclic_identification_assignment_relationship
 (relation : identification_assignment_relationship; relatives : SET[1:?] OF identification_assignment; specific_relation : STRING) : BOOLEAN;
  LOCAL
  x : SET OF identification_assignment_relationship;
    END_LOCAL;
      IF relation.relating_identification_assignment IN relatives
  THEN
    RETURN(FALSE);
  END_IF;
      x := QUERY(ia
                 <* bag_to_set(USEDIN(relation.relating_identification_assignment, 'MANAGEMENT_RESOURCES_SCHEMA.IDENTIFICATION_ASSIGNMENT_RELATIONSHIP.RELATED_IDENTIFICATION_ASSIGNMENT'))
                 | specific_relation IN TYPEOF(ia));
      REPEAT i := 1 TO HIINDEX(x);
    IF NOT acyclic_identification_assignment_relationship(x[i], relatives +
                                                                relation.relating_identification_assignment, specific_relation)
    THEN
      RETURN(FALSE);
    END_IF;
  END_REPEAT;
      RETURN(TRUE);
END_FUNCTION;

END_SCHEMA;  -- management_resources_schema