RULE restrict_alternative_definition FOR (product_definition, product_definition_context); WHERE wr1: SIZEOF ( QUERY ( pd <* product_definition | ( pd. frame_of_reference.name = 'alternative definition' ) AND ( SIZEOF ( QUERY ( pdr <* USEDIN ( pd , 'AUTOMOTIVE_DESIGN.'+'PRODUCT_DEFINITION_RELATIONSHIP.'+ 'RELATED_PRODUCT_DEFINITION' ) | pdr. name = 'solution alternative definition' ) ) <>1 ) ) ) =0; wr2: SIZEOF ( QUERY ( pd <* product_definition | ( pd. frame_of_reference.name = 'alternative definition' ) AND NOT ( pd. name IN ['technical' , 'supplier' , 'final' , 'technical supplier' , 'technical final' , 'supplier final' , 'technical supplier final' , ''] ) ) ) =0; wr3: SIZEOF ( QUERY ( pd <* product_definition | ( pd. frame_of_reference.name = 'alternative definition' ) AND ( pd. name IN ['supplier' , 'technical supplier' , 'supplier final' , 'technical supplier final' ] ) AND ( SIZEOF ( QUERY ( aoa <* USEDIN ( pd.formation , 'AUTOMOTIVE_DESIGN.'+'APPLIED_ORGANIZATION_ASSIGNMENT.'+ 'ITEMS' ) | aoa. role.name ='supplier' ) ) <>1 ) ) ) =0; wr4: SIZEOF ( QUERY ( pd <* product_definition | ( pd. frame_of_reference.name = 'alternative definition' ) AND ( pd. name IN ['final' , 'technical final' , 'supplier final' , 'technical supplier final' ] ) AND ( SIZEOF ( QUERY ( pdr <* USEDIN ( pd , 'AUTOMOTIVE_DESIGN.'+'PRODUCT_DEFINITION_RELATIONSHIP.'+ 'RELATING_PRODUCT_DEFINITION' ) | pdr. name = 'final specification' ) ) =0 ) AND ( SIZEOF ( QUERY ( pd <* USEDIN ( pd , 'AUTOMOTIVE_DESIGN.'+'PROPERTY_DEFINITION.'+ 'DEFINITION' ) | SIZEOF ( QUERY ( pdr <* USEDIN ( pd , 'AUTOMOTIVE_DESIGN.'+'PROPERTY_DEFINITION_REPRESENTATION.'+ 'DEFINITION' ) | ( pdr. used_representation.name = 'final item characteristics' ) AND ( SIZEOF ( QUERY ( i <* pdr. used_representation.items | 'AUTOMOTIVE_DESIGN.'+ 'DESCRIPTIVE_REPRESENTATION_ITEM' IN TYPEOF ( i ) ) ) = SIZEOF ( pdr. used_representation.items ) ) AND ( SIZEOF ( pdr. used_representation.items ) >=2 ) AND ( SIZEOF ( QUERY ( i <* pdr. used_representation.items | i.name = 'final item status' ) ) =1 ) ) ) >0 ) ) =0 ) ) ) =0; END_RULE; -- restrict_alternative_definition |
public class RRestrict_alternative_definition public int rWr4(SdaiContext _context) public int rWr3(SdaiContext _context) public int rWr2(SdaiContext _context) public int rWr1(SdaiContext _context) public int run(SdaiContext _context, A_string violations) |