Issue 18254: Align OCL bodyExpression and UML bodyCondition (ocl2-rtf) Source: Model Driven Solutions (Dr. Edward Willink, ed(at)willink.me.uk) Nature: Clarification Severity: Minor Summary: OCL 12.10 awaits alignment with the UML 2.0 metamodel. Consequently, the relationship between a result-valued OCL bodyExpression and a Boolean-valued UML bodyCondition is unspecified. A common pragmatic resolution has been to equate the two and ignore the Boolean-valued requirement of a UML Constraint. In order to accommodate prevailing practice and also support UML's multiple out/inouts, suggest: Reinterpret the grammar prePostOrBodyDeclCS ::= ‘body’ (simpleNameCS)? ‘:’ OclExpressionCS such that the simpleNameCS is the name of the return parameter with 'result' as the anonymous default OclExpressionCS is a result-valued bodyExpression if OclExpressionCS does not reference the simpleNameCS or its defgault. OclExpressionCS is a Boolean-valued bodyCondition if the return parameter is referenced. [Allow multiple body declarations.] Thus "body: ..." is a shortform of "body result: ..." which is a shortform for "body result: result = ..." and body: ... body A: ... body B: ... could be the specification of a UML operation f(out a : A, inout b : B, in c : C) : Z Resolution: Revised Text: Actions taken: November 9, 2012: received issue Discussion: End of Annotations:===== m: webmaster@omg.org Date: 09 Nov 2012 02:54:59 -0500 To: Subject: Issue/Bug Report ******************************************************************************* Name: Edward Willink Employer: mailFrom: ed@willink.me.uk Terms_Agreement: I agree Specification: OCL Section: 12.10 FormalNumber: 12-01-01 Version: 2.3.1 Doc_Year: 2012 Doc_Month: January Doc_Day: Day Page: 182 Title: Align OCL bodyExpression and UML bodyCondition Nature: Clarification Severity: Minor CODE: 3TMw8 B1: Report Issue Description: OCL 12.10 awaits alignment with the UML 2.0 metamodel. Consequently, the relationship between a result-valued OCL bodyExpression and a Boolean-valued UML bodyCondition is unspecified. A common pragmatic resolution has been to equate the two and ignore the Boolean-valued requirement of a UML Constraint. In order to accommodate prevailing practice and also support UML's multiple out/inouts, suggest: Reinterpret the grammar prePostOrBodyDeclCS ::= .body. (simpleNameCS)? .:. OclExpressionCS such that the simpleNameCS is the name of the return parameter with 'result' as the anonymous default OclExpressionCS is a result-valued bodyExpression if OclExpressionCS does not reference the simpleNameCS or its defgault. OclExpressionCS is a Boolean-valued bodyCondition if the return parameter is referenced. [Allow multiple body declarations.] Thus "body: ..." is a shortform of "body result: ..." which is a shortform for "body result: result = ..." and body: ... body A: ... body B: ... could be the specification of a UML operation f(out a : A, inout b : B, in c : C) : Z