RULE restrict_part_occurrence FOR (product_definition, product_definition_occurrence_relationship); WHERE wr1: SIZEOF ( QUERY ( pd <* product_definition | ( pd. frame_of_reference.name = 'part occurrence' ) AND ( NOT ( pd. name IN [ 'single instance' , 'selected instance' , 'quantified instance' , 'specified instance' ] ) ) ) ) =0; wr2: SIZEOF ( QUERY ( pd <* product_definition | ( pd. frame_of_reference.name = 'part occurrence' ) AND ( SIZEOF ( QUERY ( pdr <* USEDIN ( pd , 'AUTOMOTIVE_DESIGN.'+'PRODUCT_DEFINITION_RELATIONSHIP.'+ 'RELATED_PRODUCT_DEFINITION' ) | pdr. name = 'definition usage' ) ) <>1 ) AND ( SIZEOF ( QUERY ( cd <* USEDIN ( pd , 'AUTOMOTIVE_DESIGN.'+'CONFIGURATION_DESIGN.'+ 'DESIGN' ) | ( cd. name = 'occurrence usage definition' ) AND ( NOT ( 'AUTOMOTIVE_DESIGN.'+ 'PRODUCT_IDENTIFICATION' IN TYPEOF ( cd. configuration ) ) ) ) ) <>1 ) ) ) =0; wr3: SIZEOF ( QUERY ( pd <* product_definition | ( pd. frame_of_reference.name = 'part occurrence' ) AND ( SIZEOF ( QUERY ( cd <* USEDIN ( pd , 'AUTOMOTIVE_DESIGN.'+'PRODUCT_DEFINITION_RELATIONSHIP.'+ 'RELATED_PRODUCT_DEFINITION' ) | ( 'AUTOMOTIVE_DESIGN.'+ 'PRODUCT_DEFINITION_USAGE' IN TYPEOF ( cd ) ) ) ) =0 ) AND ( SIZEOF ( USEDIN ( pd , 'AUTOMOTIVE_DESIGN.'+'PRODUCT_DEFINITION_OCCURRENCE_RELATIONSHIP.'+ 'OCCURRENCE' ) ) =0 ) ) ) =0; wr4: SIZEOF ( QUERY ( pd <* product_definition | ( pd. frame_of_reference.name = 'part occurrence' ) AND ( pd. name = 'selected instance' ) AND ( SIZEOF ( QUERY ( prd <* USEDIN ( pd , 'AUTOMOTIVE_DESIGN.PROPERTY_DEFINITION.DEFINITION' ) | ( prd. name = 'occurrence selection' ) AND ( SIZEOF ( QUERY ( pdr <* USEDIN ( prd , 'AUTOMOTIVE_DESIGN.PROPERTY_DEFINITION_REPRESENTATION.DEFINITION' ) | ( pdr. used_representation.name = 'selection criteria' ) AND ( SIZEOF ( pdr. used_representation.items ) =2 ) AND ( SIZEOF ( QUERY ( i <* pdr. used_representation.items | ( SIZEOF ( ['AUTOMOTIVE_DESIGN.'+ 'MEASURE_REPRESENTATION_ITEM' , 'AUTOMOTIVE_DESIGN.'+ 'VALUE_RANGE']* TYPEOF ( i ) ) =1 ) AND ( i.name = 'selection quantity' ) ) ) =1 ) AND ( SIZEOF ( QUERY ( i <* pdr. used_representation.items | ( 'AUTOMOTIVE_DESIGN.'+ 'DESCRIPTIVE_REPRESENTATION_ITEM' IN TYPEOF ( i ) ) AND ( i.name = 'selection control' ) ) ) =1 ) ) ) =1 ) ) ) =0 ) ) ) =0; wr5: SIZEOF ( QUERY ( pd <* product_definition | ( pd. frame_of_reference.name = 'part occurrence' ) AND ( pd. name = 'quantified instance' ) AND ( SIZEOF ( QUERY ( ppd <* USEDIN ( pd , 'AUTOMOTIVE_DESIGN.'+'PROPERTY_DEFINITION.'+ 'DEFINITION' ) | ( ppd. name = 'occurrence quantity' ) AND ( SIZEOF ( QUERY ( pdr <* USEDIN ( ppd , 'AUTOMOTIVE_DESIGN.'+'PROPERTY_DEFINITION_REPRESENTATION.'+ 'DEFINITION' ) | ( pdr. used_representation.name ='quantity' ) AND ( SIZEOF ( pdr. used_representation.items ) =1 ) AND ( SIZEOF ( QUERY ( i <* pdr. used_representation.items | ( 'AUTOMOTIVE_DESIGN.'+ 'MEASURE_REPRESENTATION_ITEM' IN TYPEOF ( i ) ) AND ( i.name = 'quantity measure' ) ) ) =1 ) ) ) =1 ) ) ) =0 ) ) ) =0; wr6: SIZEOF ( QUERY ( pd <* product_definition | ( pd. frame_of_reference.name = 'part occurrence' ) AND ( pd. name = 'specified instance' ) AND ( SIZEOF ( QUERY ( pdor <* USEDIN ( pd , 'AUTOMOTIVE_DESIGN.'+'PRODUCT_DEFINITION_OCCURRENCE_RELATIONSHIP.'+ 'OCCURRENCE' ) | 'AUTOMOTIVE_DESIGN.'+ 'SPECIFIED_HIGHER_USAGE_OCCURRENCE' IN TYPEOF ( pdor. occurrence_usage ) ) ) =0 ) ) ) =0; END_RULE; -- restrict_part_occurrence |
public class RRestrict_part_occurrence public int rWr6(SdaiContext _context) public int rWr5(SdaiContext _context) 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) |