RULE product_version_requires_person_organization

(* SCHEMA step_merged_ap_schema; *)
-- IN AP232
RULE product_version_requires_person_organization FOR (product_definition_formation );
   LOCAL
      apos : BAG OF applied_person_and_organization_assignment;
      found : BOOLEAN;
      apoa : BAG OF applied_organization_assignment;
      pdf : SET OF product_definition_formation;
      result : BOOLEAN := TRUE;
   END_LOCAL;
      pdf := product_definition_formation;
      REPEAT i := 1 TO SIZEOF(pdf) BY 1;
         apos := USEDIN(pdf[i], 'STEP_MERGED_AP_SCHEMA.' + 'APPLIED_PERSON_AND_ORGANIZATION_ASSIGNMENT.ITEMS');
         found := FALSE;
         REPEAT j := 1 TO SIZEOF(apos) BY 1;
            IF EXISTS(apos[j].role) THEN
               IF (apos[j].role.name = 'creator') OR (apos[j].role.name = 'id owner') THEN
                  found := TRUE;
               END_IF;
            END_IF;
         END_REPEAT;
         IF found THEN
            result := TRUE;
            ESCAPE;
         END_IF;
         apoa := USEDIN(pdf[i], 'STEP_MERGED_AP_SCHEMA.' + 'APPLIED_ORGANIZATION_ASSIGNMENT.ITEMS');
         REPEAT j := 1 TO SIZEOF(apoa) BY 1;
            IF EXISTS(apoa[j].role) THEN
               IF (apoa[j].role.name = 'creator') OR (apoa[j].role.name = 'id owner') THEN
                  found := TRUE;
               END_IF;
            END_IF;
         END_REPEAT;
         IF NOT found THEN
            result := FALSE;
            ESCAPE;
         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