Issue 13544: [FUML] 8.6.3.2.4 CreateLinkActionActivation.doAction() (fuml-ftf) Source: NASA (Dr. Nicolas F. Rouquette, nicolas.f.rouquette(at)jpl.nasa.gov) Nature: Uncategorized Issue Severity: Summary: Specification: Semantics of a Foundation Subset for Executable UML Models, FTF – Beta 1 (ptc/08-11-03) Section: 8.6.3.2.4 CreateLinkActionActivation Summary: CreateLinkActionActivation.doAction() creates a Link object and sets its features according to the link end data specified in the CreateLinkAction; however, the link type is not set to the association. Proposed resolution: Change the end of the CreateLinkActionActivation.doAction() method from: ExtensionalValueList extent = this.getExecutionLocus().getExtent(this.getAssociation()); for (int i = 0; i < extent.size(); i++) { ExtensionalValue value = extent.getValue(i); Link link = (Link) value; boolean noMatch = true; int j = 1; while (noMatch & j <= endDataList.size()) { LinkEndCreationData endData = endDataList.getValue(j - 1); if (endData.isReplaceAll & this.endMatchesEndData(link, endData)) { link.destroy(); noMatch = false; } j = j + 1; } } Link newLink = new Link(); for (int i = 0; i < endDataList.size(); i++) { LinkEndCreationData endData = endDataList.getValue(i); int insertAt = 0; if (endData.insertAt != null) { insertAt = ((UnlimitedNaturalValue) (this.getTokens(endData.insertAt).getValue(0))).value.naturalValue; } newLink.setFeatureValue(endData.end, this.getTokens(endData.value), insertAt); } this.getExecutionLocus().add(newLink); To: Association linkAssociation = this.getAssociation(); ExtensionalValueList extent = this.getExecutionLocus().getExtent(linkAssociation); for (int i = 0; i < extent.size(); i++) { ExtensionalValue value = extent.getValue(i); Link link = (Link) value; boolean noMatch = true; int j = 1; while (noMatch & j <= endDataList.size()) { LinkEndCreationData endData = endDataList.getValue(j - 1); if (endData.isReplaceAll & this.endMatchesEndData(link, endData)) { link.destroy(); noMatch = false; } j = j + 1; } } Link newLink = new Link(); for (int i = 0; i < endDataList.size(); i++) { LinkEndCreationData endData = endDataList.getValue(i); int insertAt = 0; if (endData.insertAt != null) { insertAt = ((UnlimitedNaturalValue) (this.getTokens(endData.insertAt).getValue(0))).value.naturalValue; } newLink.setFeatureValue(endData.end, this.getTokens(endData.value), insertAt); } newLink.type = linkAssociation; this.getExecutionLocus().add(newLink); Resolution: Change the code as (essentially) as proposed. Revised Text: In CreateLinkActionActivation::doAction(), change: ExtensionalValueList extent = this.getExecutionLocus().getExtent(this.getAssociation()); to: Association linkAssociation = this.getAssociation(); ExtensionalValueList extent = this.getExecutionLocus().getExtent(linkAssociation); And after: Link newLink = new Link(); add: newLink.type = linkAssociation; Actions taken: February 22, 2009: received issue July 23, 2010: closed issue Discussion: End of Annotations:===== m: "Rouquette, Nicolas F" To: "issues@omg.org" CC: Ed Seidewitz , Scott Cinnamond Date: Sun, 22 Feb 2009 17:44:26 -0800 Subject: [FUML] 8.6.3.2.4 CreateLinkActionActivation.doAction() Thread-Topic: [FUML] 8.6.3.2.4 CreateLinkActionActivation.doAction() Thread-Index: AcmVWEKztjtV6q0VQfOTk0d4JwXUwQ== Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US X-Source-IP: altvirehtstap02.jpl.nasa.gov [128.149.137.73] X-Source-Sender: nicolas.f.rouquette@jpl.nasa.gov X-AUTH: Authorized Specification: Semantics of a Foundation Subset for Executable UML Models, FTF . Beta 1 (ptc/08-11-03) Section: 8.6.3.2.4 CreateLinkActionActivation Summary: CreateLinkActionActivation.doAction() creates a Link object and sets its features according to the link end data specified in the CreateLinkAction; however, the link type is not set to the association. Proposed resolution: Change the end of the CreateLinkActionActivation.doAction() method from: ExtensionalValueList extent = this.getExecutionLocus().getExtent(this.getAssociation()); for (int i = 0; i < extent.size(); i++) { ExtensionalValue value = extent.getValue(i); Link link = (Link) value; boolean noMatch = true; int j = 1; while (noMatch & j <= endDataList.size()) { LinkEndCreationData endData = endDataList.getValue(j - 1); if (endData.isReplaceAll & this.endMatchesEndData(link, endData)) { link.destroy(); noMatch = false; } j = j + 1; } } Link newLink = new Link(); for (int i = 0; i < endDataList.size(); i++) { LinkEndCreationData endData = endDataList.getValue(i); int insertAt = 0; if (endData.insertAt != null) { insertAt = ((UnlimitedNaturalValue) (this.getTokens(endData.insertAt).getValue(0))).value.naturalValue; } newLink.setFeatureValue(endData.end, this.getTokens(endData.value), insertAt); } this.getExecutionLocus().add(newLink); To: Association linkAssociation = this.getAssociation(); ExtensionalValueList extent = this.getExecutionLocus().getExtent(linkAssociation); for (int i = 0; i < extent.size(); i++) { ExtensionalValue value = extent.getValue(i); Link link = (Link) value; boolean noMatch = true; int j = 1; while (noMatch & j <= endDataList.size()) { LinkEndCreationData endData = endDataList.getValue(j - 1); if (endData.isReplaceAll & this.endMatchesEndData(link, endData)) { link.destroy(); noMatch = false; } j = j + 1; } } Link newLink = new Link(); for (int i = 0; i < endDataList.size(); i++) { LinkEndCreationData endData = endDataList.getValue(i); int insertAt = 0; if (endData.insertAt != null) { insertAt = ((UnlimitedNaturalValue) (this.getTokens(endData.insertAt).getValue(0))).value.naturalValue; } newLink.setFeatureValue(endData.end, this.getTokens(endData.value), insertAt); } newLink.type = linkAssociation; this.getExecutionLocus().add(newLink); n Nicolas.