RULE distribution_notice_approval_requires_supporting_data

(* SCHEMA step_merged_ap_schema; *)
-- IN AP232
RULE distribution_notice_approval_requires_supporting_data FOR (applied_approval_assignment );
   LOCAL
      ap : approval;
      aca : BAG OF applied_classification_assignment;
      found : BOOLEAN;
      aaa : SET OF applied_approval_assignment;
      apo : BAG OF approval_person_organization;
      result : BOOLEAN := TRUE;
   END_LOCAL;
      aaa := applied_approval_assignment;
      REPEAT i := 1 TO SIZEOF(aaa) BY 1;
         IF EXISTS(aaa[i].role) THEN
            IF aaa[i].role.name = 'distribution notice' THEN
               ap := aaa[i].assigned_approval;
               found := FALSE;
               IF LENGTH(ap.level) > 0 THEN
                  found := TRUE;
               END_IF;
               apo := USEDIN(ap, 'STEP_MERGED_AP_SCHEMA.' + 'APPROVAL_PERSON_ORGANIZATION.AUTHORIZED_APPROVAL');
               REPEAT j := 1 TO SIZEOF(apo) BY 1;
                  IF apo[j].role.role = 'distribution authorization' THEN
                     found := TRUE;
                  END_IF;
               END_REPEAT;
               aca := USEDIN(ap, 'STEP_MERGED_AP_SCHEMA.' + 'APPLIED_CLASSIFICATION_ASSIGNMENT.ITEMS');
               REPEAT j := 1 TO SIZEOF(aca) BY 1;
                  IF EXISTS(aca[j]\classification_assignment.role) THEN
                     IF (aca[j]\classification_assignment.role.name = 'distribution notice code') AND ('STEP_MERGED_AP_SCHEMA.CLASS' IN TYPEOF(aca[j]\classification_assignment.assigned_class)) THEN
                        found := TRUE;
                     END_IF;
                  END_IF;
               END_REPEAT;
               IF NOT found THEN
                  result := FALSE;
               END_IF;
            END_IF;
         END_IF;
      END_REPEAT;
   WHERE
      wr1:
         result;
END_RULE;

[Top Level Definitions] [Exit]

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