RULE unique_gdt_element_id_constraint

(* SCHEMA step_merged_ap_schema; *)
-- IN AP242
RULE unique_gdt_element_id_constraint FOR (product_definition_shape, dimensional_location, dimensional_size, shape_aspect, shape_aspect_relationship );
   LOCAL
      bss : BAG OF STRING := [];
      ds : SET OF dimensional_size := QUERY (ds <* dimensional_size| EXISTS(ds\dimensional_size.id));
      sa : SET OF shape_aspect := QUERY (sa <* shape_aspect| EXISTS(sa\shape_aspect.id));
      sar : SET OF shape_aspect_relationship := QUERY (sar <* shape_aspect_relationship| EXISTS(sar\shape_aspect_relationship.id));
      ssa : SET OF shape_aspect := [];
      pass : BOOLEAN := TRUE;
   END_LOCAL;
      REPEAT ii := 1 TO SIZEOF(product_definition_shape) BY 1 WHILE pass;
         bss := [];
         ssa := bag_to_set(USEDIN(product_definition_shape[ii], 'STEP_MERGED_AP_SCHEMA.' + 'SHAPE_ASPECT.' + 'OF_SHAPE'));
         REPEAT i := 1 TO SIZEOF(ds) BY 1;
            IF ds[i]\dimensional_size.applies_to IN ssa THEN
               bss := bss + ds[i]\dimensional_size.id;
            END_IF;
         END_REPEAT;
         REPEAT i := 1 TO SIZEOF(sa) BY 1;
            IF sa[i] IN ssa THEN
               bss := bss + sa[i]\shape_aspect.id;
            END_IF;
         END_REPEAT;
         REPEAT i := 1 TO SIZEOF(sar) BY 1;
            IF sar[i]\shape_aspect_relationship.relating_shape_aspect IN ssa THEN
               bss := bss + sar[i]\shape_aspect_relationship.id;
            END_IF;
         END_REPEAT;
         IF SIZEOF(bag_to_set(bss)) <> SIZEOF(bss) THEN
            pass := FALSE;
         END_IF;
      END_REPEAT;
   WHERE
      wr1:
         pass;
END_RULE;

[Top Level Definitions] [Exit]

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