FUNCTION get_associated_mandatory_document_ids

(* SCHEMA step_merged_ap_schema; *)
-- IN AP242
FUNCTION get_associated_mandatory_document_ids
      (pdc : product_definition_context ) : SET OF STRING;
   LOCAL
      result : SET OF STRING := [];
      adrs_raw : SET OF applied_document_reference := bag_to_set(USEDIN(pdc, 'STEP_MERGED_AP_SCHEMA.APPLIED_DOCUMENT_REFERENCE.ITEMS'));
      adrs_filtered : SET OF applied_document_reference := [];
      ras : SET OF role_association;
      dpas : SET OF document_product_association;
   END_LOCAL;
      REPEAT i := 1 TO HIINDEX(adrs_raw);
         IF adrs_raw[i]\document_reference.role\object_role.name = 'mandatory' THEN
            adrs_filtered := adrs_filtered + adrs_raw[i];
         END_IF;
      END_REPEAT;
      REPEAT i := 1 TO HIINDEX(adrs_filtered);
         dpas := bag_to_set(USEDIN(adrs_filtered[i]\document_reference.assigned_document, 'STEP_MERGED_AP_SCHEMA.DOCUMENT_PRODUCT_ASSOCIATION.RELATING_DOCUMENT'));
         REPEAT j := 1 TO HIINDEX(dpas);
            IF 'STEP_MERGED_AP_SCHEMA.DOCUMENT_PRODUCT_EQUIVALENCE' IN TYPEOF(dpas[j]) THEN
               IF 'STEP_MERGED_AP_SCHEMA.PRODUCT_DEFINITION_FORMATION' IN TYPEOF(dpas[j]\document_product_association.related_product) THEN
                  result := result + dpas[j]\document_product_association.related_product\product_definition_formation.of_product\product.id;
               END_IF;
               IF 'STEP_MERGED_AP_SCHEMA.PRODUCT' IN TYPEOF(dpas[j].related_product) THEN
                  result := result + dpas[j]\document_product_association.related_product\product.id;
               END_IF;
            END_IF;
         END_REPEAT;
      END_REPEAT;
      RETURN (result);
END_FUNCTION;

Referenced By

Defintion get_associated_mandatory_document_ids is references by the following definitions:
DefinitionType
 valid_product_and_manufacturing_information_view_contexts RULE


[Top Level Definitions] [Exit]

Generated by STEP Tools® EXPRESS to HTML Converter
2020-07-28T17:02:20-04:00