Issue 8308: Section: 13.3.14 (uml2-rtf) Source: (, ) Nature: Clarification Severity: Minor Summary: Add OCL notation or a note that OCL is unable define a notation for the constraints. Resolution: see above Revised Text: In constraints section of 13.3.14: Add OCL to constraints: [1] A function behavior has at least one output parameter. self.ownedParameters->select(p| p.direction=#out or p.direction=#inout or p.direction=#return)->size() >= 1 Editor’s note: incorrect constraint uses old # notation; changed to OCL 2 notation and simplified [2] The types of parameters are all data types, which may not nest anything but other datatypes. def: hasAllDataTypeAttributes(d : DataType) : Boolean = d.ownedAttribute->forAll(a| a.type.oclIsTypeOf(DataType) and hasAllDataTypeAttributes(a.type)) self.ownedParameters->forAll(p|p.type.notEmpty() and p.oclIsTypeOf(DataType) and hasAllDataTypeAttributes(p)) Editor’s note: Not entered, because this is ancorrectly written OCL constraint; hasAllDataTypes should be an operation on something like an instance of data type; in OCL, operations are invoked on objects. A proper way to write this would likely be: (self.ownedParameters->notEmpty()) implies (self.ownedParameters->forAll(p| (p.type->notEmpty()) implies (p.type.oclIskKindOf(DatatType) and p.type.hasAllDataTypeAttributes())) Additional Operations The operation hasAllDataTypeAttributes returns true if the transitive closure of all attributes of the the data type are also kinds of DataType DataType::hasAllDataTypeAttributes () : Boolean; result = if (self.ownedAttribute->notEmpty()) then (self.ownedAttribute->forAll (a | a.type->notEmpty() implies a.type.hasAllDataTypeAttributes())) else Boolean::true Actions taken: February 22, 2005: received issue August 23, 2006: closed issue Discussion: Regarding the solution below, what about recursive nesting level (e.g., the attributes of the attributes)? -- ThomasWeigert - 19 May 2005 Good question. I've changed the OCL slightly and introduced a recursive function. Please check! I'm not sure what happens if d.ownedAttributes is a empty set? Does it evaluate to true? -- Tim Weilkiens - 20 May 2005 Fixed recursive function to work on the type of the ownedAttributes not the attributes themselves. Fixed first constraint to test the size() of the select result. -- PeteRivett - 28 Jun 2005 End of Annotations:===== m: webmaster@omg.org Date: 22 Feb 2005 14:16:59 -0500 To: Subject: Issue/Bug Report -------------------------------------------------------------------------------- Name: Jane Messenger Company: U. S. Geological Survey mailFrom: jmessenger@usgs.gov Notification: Yes Specification: Superstructure Section: 13.3.14 FormalNumber: ptc/04-10-02 Version: 2.0 Draft Adopted RevisionDate: 10/08/2004 Page: 479 Nature: Clarification Severity: Minor HTTP User Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461) Description Add OCL notation or a note that OCL is unable define a notation for the constraints. Issue 8308: Section: 13.3.14 Issue summary Add OCL notation or a note that OCL is unable define a notation for the constraints. Discussion Regarding the solution below, what about recursive nesting level (e.g., the attributes of the attributes)? -- ThomasWeigert - 19 May 2005 Good question. I've changed the OCL slightly and introduced a recursive function. Please check! I'm not sure what happens if d.ownedAttributes is a empty set? Does it evaluate to true? -- Tim Weilkiens - 20 May 2005 Revised Test In constraints section of 13.3.14: Add OCL to constraints: [1] A function behavior has at least one output parameter. self.ownedParameters->select(p|p.direction=#out or p.direction=#inout) >= 1 [2] The types of parameters are all data types, which may not nest anything but other datatypes. def: hasNestedDataTypes(d : DataType) : Boolean = d.ownedAttribute->forAll(a|a.oclIsTypeOf(DataType) and hasNestedDataTypes(a)) self.ownedParameters->forAll(p|p.type.notEmpty() and p.oclIsTypeOf(DataType) and hasNestedDataTypes(p)) Resolution Issue 8308: Section: 13.3.14 Issue summary Add OCL notation or a note that OCL is unable define a notation for the constraints. Discussion Regarding the solution below, what about recursive nesting level (e.g., the attributes of the attributes)? -- ThomasWeigert - 19 May 2005 Good question. I've changed the OCL slightly and introduced a recursive function. Please check! I'm not sure what happens if d.ownedAttributes is a empty set? Does it evaluate to true? -- Tim Weilkiens - 20 May 2005 Fixed recursive function to work on the type of the ownedAttributes not the attributes themselves. Fixed first constraint to test the size() of the select result. -- PeteRivett - 28 Jun 2005 Revised Test In constraints section of 13.3.14: Add OCL to constraints: [1] A function behavior has at least one output parameter. self.ownedParameters->select(p|p.direction=#out or p.direction=#inout)->size() >= 1 [2] The types of parameters are all data types, which may not nest anything but other datatypes. def: hasNestedDataTypes(d : DataType) : Boolean = d.ownedAttribute->forAll(a|a.type.isEmpty() or ( a.type.oclIsTypeOf(DataType) and hasNestedDataTypes(a.type))) self.ownedParameters->forAll(p|p.type.notEmpty() and p.oclIsTypeOf(DataType) and hasNestedDataTypes(p)) Resolution To: "Thomas Weigert" Cc: conrad.bock@nist.gov, "'uml2rtf'" Subject: RE: Proposals for Ballot 6 X-Mailer: Lotus Notes Release 6.0.1CF1 March 04, 2003 From: Branislav Selic Date: Wed, 20 Jul 2005 08:02:49 -0400 X-MIMETrack: Serialize by Router on D25ML01/25/M/IBM(Release 6.5.4|March 27, 2005) at 07/20/2005 08:02:50, Serialize complete at 07/20/2005 08:02:50 Thanks for the quick turnaround, Thomas. Conrad and others: If these changes are put in, can I reinstate the updated resolution proposals 8027 and 8308 into ballot 6? (NB: If I don't hear any opposition, I will do so.) Bran "Thomas Weigert" 07/19/2005 06:47 PM To Branislav Selic/Ottawa/IBM@IBMCA, cc "'uml2rtf'" Subject RE: Proposals for Ballot 6 Bran, Conrad, Integrated suggestions on 8027. Conrad, Integrated your change on 8308. I hope your reformulations are right with your OCL... Thanks, Th. -----Original Message----- From: Branislav Selic [mailto:bselic@ca.ibm.com] Sent: Tuesday, July 19, 2005 2:46 PM To: conrad.bock@nist.gov; Thomas Weigert Cc: uml2rtf Subject: RE: Proposals for Ballot 6 Conrad, In reply to your e-mail: > Just a reminder of the comments I sent last week. In > particular, see 8027, 8028, 8308. The resolution to issue 8028 has already been withdrawn from ballot 6. A few additional comments on the other two. > - Issue 8027 (Connector multiplicity notation) > Suggested rewording: > > In 9.3.7., sub-section Notation, replace "These adornments > specify properties of the association typing the connector." by > "These adornments specify properties of the association typing > the connector, if that association was inferred. Otherwise, > they show properties of that association, or specializations of > these on the connector." This sounds like an acceptable rewording to me that is more precise and also conforms to the one proposed. But, I am proposing an even more refined one below. Thomas? > BTW, what does it mean to "infer" an association for a connector? How about: "In cases where there is no explicit association in the model typing the connector, these adornments specify the multiplicities of an implicit association. Otherwise...etc." > - Issue 8308: Section: 13.3 > > This was intended to refer to return parameters (got confused with > output pins): > > [1] A function behavior has at least one output parameter. > > self.ownedParameters->select(p|p.direction=#out or > p.direction=#inout)->size() >= 1 > > I guess it could be generalized to: > > [1] A function behavior has at least one output parameter. > > self.ownedParameters->select(p|p.direction=#out or > p.direction=#inout or p.direction=#return)->size() >= 1 > > > In the second one, hasNestedDataTypes allows empty types for data > type attributes, which are not allowed by the text of the > constraint. Also the name hasNestedDataTypes implies there must > be nested datatypes. > > [2] The types of parameters are all data types, which may not > nest anything but other datatypes. > > def: hasNestedDataTypes(d : DataType) : Boolean = > d.ownedAttribute->forAll(a| > a.type.isEmpty() > or (a.type.oclIsTypeOf(DataType) > and hasNestedDataTypes(a.type))) > > self.ownedParameters->forAll(p|p.type.notEmpty() and > p.oclIsTypeOf(DataType) and hasNestedDataTypes(p)) > > Suggested revision: > > [2] The types of parameters are all data types, which may not > nest anything but other datatypes. > > def: hasAllDataTypeAttributes(d : DataType) : Boolean = > d.ownedAttribute->forAll(a| a.type.oclIsTypeOf(DataType) > and > hasAllDataTypeAttributes(a.type)) > > self.ownedParameters->forAll(p|p.type.notEmpty() and > p.oclIsTypeOf(DataType) and hasAllDataTypeAttributes(p)) > > The OCL spec is a bit unclear on whether forall over an empty > collection is true, but it says it's false if one of the them is > false, so I hope if there are none, then its true. That's the > usual convention. I doubt if Thomas has objections to these revisions. Cheers...Bran