FUNCTION acyclic_organization_type_relationship
(relation : organization_type_relationship, relatives : SET [0:?] OF organization_type, specific_relation : STRING) : BOOLEAN;
LOCAL x : SET OF organization_type_relationship; END_LOCAL;
IF relation.relating_organization_type IN relatives THEN RETURN (FALSE); END_IF; x := QUERY(orgtyp <* bag_to_set(USEDIN(relation.relating_organization_type, 'PERSON_ORGANIZATION_SCHEMA.' + 'ORGANIZATION_TYPE_RELATIONSHIP.' + 'RELATED_ORGANIZATION_TYPE')) | specific_relation IN TYPEOF(orgtyp)); REPEAT i := 1 TO HIINDEX(x); IF NOT acyclic_organization_type_relationship(x[i], relatives + relation.relating_organization_type, specific_relation) THEN RETURN (FALSE); END_IF; END_REPEAT; RETURN (TRUE); END_FUNCTION; -- acyclic_organization_type_relationship
|