Issue 18529: Feature values need to be created for private structural features of parent classifiers (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, RTF Beta (ptc/2012-10-18) Subclause: 8.3.2.2.25 StructuredValue The StructuredValue::createFeatureValues operation is described to “Create empty feature values for all structural features, direct and inherited, of the types of this structured value.” It does this by iterating through the members of all types of the given structured value, which includes inherited members. Unfortunately, structural values that are private members of parent classifiers are not inherited, but they also need to have feature values created in the structured value. Resolution: Update StructuredValue Agreed. However, in an AcceptEventAction, if isUnmarshall = true, then there are output pins only for the visible members (owned and inherited) of the accepted Signal. Currently, AcceptEventActionActivation places values from all the featureValues of a signal onto the output pins. This needs to be changed to only place the values of visible features onto the output pins. Revised Text: Note: The changes proposed here also support the resolution of Issue [1]FUML12-7. In 8.3.2.1, Figure 8.11, and the normative XMI, add the following operations to the class StructuredValue: getMemberValues ( ) : FeatureValue [*] addFeatureValues ( type : Classifier ) addFeatureValuesForType ( type : Classifier ) getValues ( feature : NamedElement, featureValues : FeatureValue [*] ) : Value [*] [Editor's Note: To be consistent with the text added in 8.3.2.2.25 below, the signatures for addFeatureValues and addFeatureValuesForType in Figure 8.11 should actually be addFeatureValues(oldFeatureValues : FeatureValue [*]) and addFeatureValuesForType(type : Classifier, oldFeatureValues : FeatureValue [*]).] In 8.3.2.2.25 StructuredValue, replace the body of the operation createFeatureValues with // Create empty feature values for all structural features of the types // of this structured value and all its supertypes (including private // features that are not inherited). this.addFeatureValues(new FeatureValueList()); And add the following operations (renumbering other operations appropriately): [1] addFeatureValues ( in oldFeatureValues : FeatureValue [0..*] ) // Add feature values for all structural features of the types // of this structured value and all its supertypes (including private // features that are not inherited). If a feature has an old feature // value in the given list, then use that to initialize the values of // the corresponding new feature value. Otherwise leave the values of // the new feature value empty. ClassifierList types = this.getTypes(); for (int i = 0; i < types.size(); i++) { Classifier type = types.getValue(i); this.addFeatureValuesForType(type, oldFeatureValues); } [2] addFeatureValuesForType ( in type : Classifier, in oldFeatureValues : FeatureValue [0..*]) /// Add feature values for all structural features of the given type and // all of its supertypes (including private features that are not // inherited). If a feature has an old feature value in the given list, // then use that to initialize the values of the corresponding new // feature value. Otherwise leave the values of the new feature value // empty. // Set feature values for the owned structural features of the given // type. (Any common structural values that have already been added // previously will simply have their values set again.) NamedElementList ownedMembers = type.ownedMember; for (int j = 0; j < ownedMembers.size(); j++) { NamedElement ownedMember = ownedMembers.getValue(j); if (ownedMember instanceof StructuralFeature) { this.setFeatureValue((StructuralFeature) ownedMember, this.getValues(ownedMember, oldFeatureValues), 0); } } // Add feature values for the structural features of the supertypes // of the given type. (Note that the feature values for supertype // features always come after the feature values for owned features.) ClassifierList supertypes = type.general; for (int i = 0; i < supertypes.size(); i++) { Classifier supertype = supertypes.getValue(i); this.addFeatureValuesForType(supertype, oldFeatureValues); } [6] getMemberValues ( ) : Value [0..*] // Return the feature values for this structured value that are for structural // features that are members of one of the types of the structured value. // (That is, they are owned are inherited, excluding private features of // supertypes that are not inherited.) FeatureValueList featureValues = this.getFeatureValues(); FeatureValueList memberValues = new FeatureValueList(); ClassifierList types = this.getTypes(); for (int i = 0; i < featureValues.size(); i++) { FeatureValue featureValue = featureValues.getValue(i); Boolean isMember = false; int j = 1; while (j <= types.size() & !isMember) { Classifier type = types.getValue(j-1); NamedElementList members = type.member; int k = 1; while (k <= members.size() & !isMember) { NamedElement member = members.getValue(k-1); isMember = featureValue.feature == member; k = k + 1; } j = j + 1; } if (isMember) { memberValues.addValue(featureValue); } } return memberValues; [7] getValues( in feature : NamedElement, featureValues : FeatureValue [0..*] ) : Value [0..*] // Return the values from the feature value in the given list for the // given feature. If there is no such feature value, return an empty // list. FeatureValue foundFeatureValue = null; int i = 1; while (foundFeatureValue == null & i <= featureValues.size()) { FeatureValue featureValue = featureValues.getValue(i-1); if (featureValue.feature == feature) { foundFeatureValue = featureValue; } i = i + 1; } ValueList values; if (foundFeatureValue == null) { values = new ValueList(); } else { values = foundFeatureValue.values; } return values; In 8.6.4.2.1 AcceptEventActionActivation, in operation accept, in the first statement of the else clause of the nested if statement, change signalInstance.getFeatureValues() to signalInstance.getMemberValues(). ---------------------------------------------------------------------------------------- [1] http://issues.omg.org/browse/FUML12-7 Actions taken: March 5, 2013: received issue October 8, 2015: Resolved December 22, 2015: closed issue Discussion: End of Annotations:===== m: Ed Seidewitz To: "issues@omg.org" Date: Tue, 5 Mar 2013 22:09:45 -0500 Subject: Feature values need to be created for private structural features of parent classifiers Thread-Topic: Feature values need to be created for private structural features of parent classifiers Thread-Index: Ac4aF+cdrbHwWKF5RR+ewPC7T0I0nQ== 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.225]|10.1.50.225|outbound.mailprotector.net|0.0|0.0|0|||0|0|0|0 X-Mailprotector-Results: null_ptr subject_50_chars subject_10_spaces clean X-Mailprotector-Score: 80 X-Mailprotector-IP-Analysis: 0, 10.1.50.225, Ugly c=0.813934 p=-0.976977 Source White X-Mailprotector-Scan-Diagnostics: 0-0-0-5916-c X-Mailprotector-ID: 038c1ee3-be87-456d-8791-4215a4e49230 X-Virus-Scanned: amavisd-new at omg.org X-Brightmail-Tracker: AAAAAQr+n5E= X-Brightmail-Tracker: AAAAAA== Specification: Semantics of a Foundational Subset for Executable UML Models (fUML), v1.1, RTF Beta (ptc/2012-10-18) Subclause: 8.3.2.2.25 StructuredValue The StructuredValue::createFeatureValues operation is described to .Create empty feature values for all structural features, direct and inherited, of the types of this structured value.. It does this by iterating through the members of all types of the given structured value, which includes inherited members. Unfortunately, structural values that are private members of parent classifiers are not inherited, but they also need to have feature values created in the structured value.