|
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) |