Issue 1517: set_<referencename> needs StructuralError (mof-rtf) Source: (, ) Nature: Revision Severity: Minor Summary: Summary: The set_<referencename> defined in the Reference Template (7.3.8) needs to be changed to allow StructuralError to be raised in some cases where upper = 1. Resolution: resolved Revised Text: Actions taken: June 10, 1998: received issue May 8, 2000: closed issue Discussion: The case where "upper == 1" is the following: association A { role set [X..Y] of Type1 role1; // any consistent X and Y role set [Z..1] of Type2 role2; // Z == 0 or 1 } type Type1 { ... known my_ref projects role1 of A; } type Type2 { ... } When you use set_my_ref() to create / modify a link, it may be necessary to raise Structural-Error in the following circumstances: • X != 0 may need to signal underflow; e.g. if t1.my_ref() has a value t2, this means there must have been a <t1, t2>. Replacing this with <t1, t3can cause the number of T1's related to t2 to drop below X. • Y != '*' may need to signal overflow; e.g. whether or not t1.my_ref() has a value, adding <t1, t2> can cause the number of T1's related to t2 to exceed Y. It seems that the only case where StructuralError can never be raised is when X == 0 AND Y == *. Proposed resolution: 1. The IDL mapping problem is fixed by the proposed solution to issue 1085; i.e. the "rolled up" ConstraintError. 2. The semantics described above need to be documented. Implementation: The set_<reference> templates in Section 5.8.12, “Reference Tem-plate,” on page 5-81 all raise MofError (which subsumes Struc-turalError) as a by-product of resolving “Issue 1085: Consider a better approach to generated exceptions (mof-rtf)”. Added text to Section 5.8.10, “Association Template,” on page 5-60 to make it ex-plicit that multi-valued References must be given the correct number of values. Done [KR]. End of Annotations:===== Return-Path: To: mof-rtf@omg.org, issues@omg.org Subject: MOF-RTF issue: set_ needs StructuralError Date: Wed, 10 Jun 1998 14:37:40 +1000 From: Stephen Crawley Source: DSTC (Dr. Stephen Crawley, crawley@dstc.edu.au) Nature: Revision Severity: Minor Summary: The set_ defined in the Reference Template (7.3.8) needs to be changed to allow StructuralError to be raised in some cases where upper = 1. Additional Text: The case were "upper = 1" is the following: association A { role set [X..Y] of Type1 role1; // any consistent X and Y role set [Z..1] of Type2 role2; // Z = 0 or 1 } type Type1 { ... known my_ref projects role1 of A; } type Type2 { ... } When you use set_my_ref() to create / modify a link, it may be necessary to raise StructuralError in the following circumstances: a) X != 0 may need to signal underflow. e.g. if t1.my_ref() has a value t2, this means there must have been a . Replacing this with can cause the number of T1's related to t2 to drop below X. b) Y != '*' may need to signal overflow. e.g. whether or not t1.my_ref() has a value, adding can cause the number of T1's related to t2 to exceed Y. c) Z = 1 may need to signal underflow. e.g. calling t1.set_my_ref(nil) will delete the link and will cause the number of T2's related to t1 drop to zero. It seems that the only case where StructuralError can never be raised is when X = 0 AND Y = * AND Z = 0.