RULE indentured_list_method_identification_constraint

(* SCHEMA step_merged_ap_schema; *)
-- IN AP232
RULE indentured_list_method_identification_constraint FOR (applied_document_reference );
   LOCAL
      prpc : BAG OF product_related_product_category;
      d : document;
      p : product;
      dpa : BAG OF document_product_association;
      adr : SET OF applied_document_reference;
      pfd : product_or_formation_or_definition;
      result : BOOLEAN := TRUE;
   END_LOCAL;
      adr := applied_document_reference;
      REPEAT i := 1 TO SIZEOF(adr) BY 1;
         IF EXISTS(adr[i]\document_reference.role) THEN
            IF ((adr[i]\document_reference.role.name = 'indentured by document') OR (adr[i]\document_reference.role.name = 'indentured by item')) OR (adr[i]\document_reference.role.name = 'indentured by item and document') THEN
               d := adr[i]\document_reference.assigned_document;
               dpa := USEDIN(d, 'STEP_MERGED_AP_SCHEMA.' + 'DOCUMENT_PRODUCT_ASSOCIATION.RELATING_DOCUMENT');
               REPEAT j := 1 TO SIZEOF(dpa) BY 1;
                  pfd := dpa[j].related_product;
                  IF 'STEP_MERGED_AP_SCHEMA.PRODUCT' IN TYPEOF(pfd) THEN
                     p := pfd;
                  ELSE
                     IF 'STEP_MERGED_AP_SCHEMA.PRODUCT_DEFINITION_FORMATION' IN TYPEOF(pfd) THEN
                        p := pfd\product_definition_formation.of_product;
                     ELSE
                        IF 'STEP_MERGED_AP_SCHEMA.PRODUCT_DEFINITION' IN TYPEOF(pfd) THEN
                           p := pfd\product_definition.formation.of_product;
                        END_IF;
                     END_IF;
                  END_IF;
                  result := FALSE;
                  prpc := USEDIN(p, 'STEP_MERGED_AP_SCHEMA.' + 'PRODUCT_RELATED_PRODUCT_CATEGORY.PRODUCTS');
                  REPEAT k := 1 TO SIZEOF(prpc) BY 1;
                     IF (prpc[k].name = 'data definition exchange') OR (prpc[k].name = 'indentured data list') THEN
                        result := TRUE;
                     END_IF;
                  END_REPEAT;
               END_REPEAT;
            END_IF;
         END_IF;
      END_REPEAT;
   WHERE
      wr1:
         result;
END_RULE;

[Top Level Definitions] [Exit]

Generated by STEP Tools® EXPRESS to HTML Converter
2017-01-19T11:17:24-05:00