RULE restrict_product_definition_for_mating_tree FOR (product_definition); WHERE wr1: SIZEOF ( QUERY ( pd <* product_definition | ( SIZEOF ( QUERY ( pdca <* USEDIN ( pd , 'AUTOMOTIVE_DESIGN.'+'PRODUCT_DEFINITION_CONTEXT_ASSOCIATION.'+ 'DEFINITION' ) | pdca. frame_of_reference.name = 'mating definition' ) ) =1 ) AND ( SIZEOF ( QUERY ( pdr <* USEDIN ( pd , 'AUTOMOTIVE_DESIGN.'+'PRODUCT_DEFINITION_RELATIONSHIP.'+ 'RELATING_PRODUCT_DEFINITION' ) | pdr. name = 'mating membership' ) ) <>2 ) ) ) =0; wr2: SIZEOF ( QUERY ( pd <* product_definition | ( SIZEOF ( QUERY ( pdca <* USEDIN ( pd , 'AUTOMOTIVE_DESIGN.'+'PRODUCT_DEFINITION_CONTEXT_ASSOCIATION.'+ 'DEFINITION' ) | pdca. frame_of_reference.name = 'mating definition' ) ) =1 ) AND NOT ( {1<= SIZEOF ( QUERY ( pdr <* USEDIN ( pd , 'AUTOMOTIVE_DESIGN.'+'PRODUCT_DEFINITION_RELATIONSHIP.'+ 'RELATING_PRODUCT_DEFINITION' ) | ( pdr. name = 'mating membership' ) AND ( pdr. related_product_definition.frame_of_reference. name = 'part occurrence' ) ) ) <=2} ) ) ) =0; wr3: SIZEOF ( QUERY ( pd <* product_definition | ( SIZEOF ( QUERY ( pdca <* USEDIN ( pd , 'AUTOMOTIVE_DESIGN.'+'PRODUCT_DEFINITION_CONTEXT_ASSOCIATION.'+ 'DEFINITION' ) | pdca. frame_of_reference.name = 'mating definition' ) ) =1 ) AND ( SIZEOF ( QUERY ( pdr <* USEDIN ( pd , 'AUTOMOTIVE_DESIGN.'+'PRODUCT_DEFINITION_RELATIONSHIP.'+ 'RELATING_PRODUCT_DEFINITION' ) | ( pdr. name = 'mating membership' ) AND ( SIZEOF ( QUERY ( pdca <* USEDIN ( pdr. related_product_definition , 'AUTOMOTIVE_DESIGN.PRODUCT_DEFINITION_CONTEXT_ASSOCIATION.DEFINITION' ) | pdca. frame_of_reference.name = 'mating definition' ) ) =1 ) ) ) >1 ) ) ) =0; END_RULE; -- restrict_product_definition_for_mating_tree |
public class RRestrict_product_definition_for_mating_tree public int rWr3(SdaiContext _context) public int rWr2(SdaiContext _context) public int rWr1(SdaiContext _context) public int run(SdaiContext _context, A_string violations) |