RULE restrict_alternative_definition FOR (product_definition); LOCAL solution_definitions: SET OF product_definition := []; END_LOCAL; solution_definitions := QUERY( pd <* product_definition | (pd.frame_of_reference.name = 'alternative definition')); WHERE wr1: SIZEOF ( QUERY ( pd <* solution_definitions | ( SIZEOF ( QUERY ( pdr <* USEDIN ( pd , 'ALTERNATIVE_SOLUTION_MIM' + '.PRODUCT_DEFINITION_RELATIONSHIP.RELATED_PRODUCT_DEFINITION' ) | pdr.name = 'solution alternative definition' ) ) <>1 ) ) ) = 0; wr2: SIZEOF ( QUERY ( pd <* solution_definitions | NOT ( pd.name IN ['technical' , 'supplier' , 'technical supplier' , ''] ) ) ) = 0; wr3: SIZEOF ( QUERY ( pd <* solution_definitions | ( pd.name IN ['supplier' , 'technical supplier'] ) AND ( SIZEOF ( QUERY ( aoa <* USEDIN ( pd.formation , 'ALTERNATIVE_SOLUTION_MIM' + '.APPLIED_ORGANIZATION_ASSIGNMENT.ITEMS' ) | aoa.role.name = 'supplier' )) <>1 ) )) = 0; END_RULE; -- restrict_alternative_definition |
public class RRestrict_alternative_definition public int rWr3(SdaiContext _context) public int rWr2(SdaiContext _context) public int rWr1(SdaiContext _context) public int run(SdaiContext _context, A_string violations) |