Issue 18279: ReclassifyObjectAction does not preserve structural feature values (fuml-rtf) Source: Model Driven Solutions (Mr. Ed Seidewitz, ed-s(at)modeldriven.com) Nature: Uncategorized Issue Severity: Summary: Specification: Semantics of a Foundational Subset for Executable UML Models (fUML), v1.1 (ptc/2012-10-18) Subclause: 8.6.4.2.5 ReclassifyObjectActionActivation The UML 2.4.1 specification says, in Subclause 11.3.39, under the Semantics for ReclassifyObjectAction, that "'New' classifiers replace existing classifiers in an atomic step, so that structural feature values and links are not lost during the reclassification, when the 'old' and 'new' classifiers have structural features and associations in common." However, the behavior specified in ReclassifyObjectActionActivation does not act this way. Instead, all feature values for old classifiers are removed before the feature values for new classifiers are added, so any values for common structural features are lost. Resolution: Update ReclassifyObjectActionActivation Agreed. In addition, the semantics for a reclassify object action should ensure that private superclass attributes are removed or initialized as appropriate, consistent with the resolution to issue [1]FUML12-20. ---------------------------------------------------------------------------------------- [1] http://issues.omg.org/browse/FUML12-20 Revised Text: Note: This resolution presumes the resolution to issue [1]FUML12-20. In 8.6.4.2.5 ReclassifyObjectActionActivation, in operation doAction, replace the last line in the initial comments: // Add (empty) feature values to the referent object for the structural features of all added classifiers. with // Add feature values to the referent object for the structural // features of all added classifiers. // Any features that previously had values maintain those values, // while new features are initialized as being empty. In the first if statement, in the while statement, in the if statement that begins if (toBeRemoved), remove the statement object.removeFeatureValues(type); In the for statement, in the if statement that begins if (toBeAdded), remove the statements NamedElementList members = classifier.member; for (int k = 0; k < members.size(); k++) { NamedElement member = members.getValue(k); if (member instanceof StructuralFeature) { object.setFeatureValue((StructuralFeature) member, new ValueList(), 0); } } After the for statement, add the statements: FeatureValueList oldFeatureValues = object.getFeatureValues(); object.featureValues = new FeatureValueList(); object.addFeatureValues(oldFeatureValues); ---------------------------------------------------------------------------------------- [1] http://issues.omg.org/browse/FUML12-20 Actions taken: November 23, 2012: received issue October 8, 2015: Resolved December 22, 2015: closed issue Discussion: End of Annotations:===== m: Ed Seidewitz To: "issues@omg.org" Date: Fri, 23 Nov 2012 21:53:46 -0500 Subject: ReclassifyObjectAction does not preserve structural feature values Thread-Topic: ReclassifyObjectAction does not preserve structural feature values Thread-Index: Ac3J7d5QsGA9dUlZSJGD5KaXgzR9fw== Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US X-Mailprotector-Decision: deliver X-Mailprotector-Connection: TLSv1|[10.1.50.226]|10.1.50.226|outbound.mailprotector.net|0.0|0.0|0|||0|0|0|0 X-Mailprotector-Results: null_ptr subject_50_chars clean X-Mailprotector-Score: 60 X-Mailprotector-IP-Analysis: 0, 10.1.50.226, Ugly c=0.722693 p=-0.981998 Source White X-Mailprotector-Scan-Diagnostics: 0-0-0-6425-c X-Mailprotector-ID: ed74f5cb-754b-403f-ab3b-359cea5a24a1 Specification: Semantics of a Foundational Subset for Executable UML Models (fUML), v1.1 (ptc/2012-10-18) Subclause: 8.6.4.2.5 ReclassifyObjectActionActivation The UML 2.4.1 specification says, in Subclause 11.3.39, under the Semantics for ReclassifyObjectAction, that "'New' classifiers replace existing classifiers in an atomic step, so that structural feature values and links are not lost during the reclassification, when the 'old' and 'new' classifiers have structural features and associations in common." However, the behavior specified in ReclassifyObjectActionActivation does not act this way. Instead, all feature values for old classifiers are removed before the feature values for new classifiers are added, so any values for common structural features are lost.