Issue 13546: 8.6.4.2.1 [5]AcceptEventActionActivation::accept(in signalInstance:SignalInstance) (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.4.2.1 AcceptEventActionActivation Summary: The AcceptEventActionActivation::accept() unconditionally places values on output pins even if the action does not have any output pin. Proposed resolution: Change the operation from: // Accept a signal occurance for the given signal instance. // If the action does not unmarshall, then place the signal instance on // the result pin. // If the action does unmarshall, then get the feature values of the // signal instance, and place the values for each feature on the // corresponding output pin. // Concurrently fire all output pins while offering a single control // token. // If there are no incoming edges, then re-register this accept event // action execution with the context object. AcceptEventAction action = (AcceptEventAction) (this.node); OutputPinList resultPins = action.result; Debug.println("[accept] action = " + action.name + ", signalinstance = " + signalInstance); if (this.running) { if (!action.isUnmarshall) { ValueList result = new ValueList(); result.addValue(signalInstance); this.putTokens(resultPins.getValue(0), result); } else { FeatureValueList featureValues = signalInstance.getFeatureValues(); for (int i = 0; i < featureValues.size(); i++) { FeatureValue featureValue = featureValues.getValue(i); OutputPin resultPin = resultPins.getValue(i); this.putTokens(resultPin, featureValue.values); } } this.sendOffers(); this.waiting = false; Debug.println("[fire] Checking if " + this.node.name + " should fire again..."); // if (this.isReady()) { // this.fire(); // } this.receiveOffer(); } } To: // Accept a signal occurance for the given signal instance. // If the action does not unmarshall, then place the signal instance on // the result pin, if any. // If the action does unmarshall, then get the feature values of the // signal instance, and place the values for each feature on the // corresponding output pin, if any. // Concurrently fire all output pins, if any, while offering a single control // token. // If there are no incoming edges, then re-register this accept event // action execution with the context object. AcceptEventAction action = (AcceptEventAction) (this.node); OutputPinList resultPins = action.result; Debug.println("[accept] action = " + action.name + ", signalinstance = " + signalInstance); if (this.running) { if (resultPins.size() > 0) { if (!action.isUnmarshall) { ValueList result = new ValueList(); result.addValue(signalInstance); this.putTokens(resultPins.getValue(0), result); } else { FeatureValueList featureValues = signalInstance.getFeatureValues(); for (int i = 0; i < featureValues.size(); i++) { FeatureValue featureValue = featureValues.getValue(i); OutputPin resultPin = resultPins.getValue(i); this.putTokens(resultPin, featureValue.values); } } } this.sendOffers(); this.waiting = false; Debug.println("[fire] Checking if " + this.node.name + " should fire again..."); // if (this.isReady()) { // this.fire(); // } this.receiveOffer(); } } Resolution: If isUnmarshall is true, then the action is required to have output pins corresponding to any signal attributes, and the specification is already correct in this case. It is only in the case that isUnmarshall is false that the specification is incorrect in assuming that there must be an output pin. Revised Text: In the introductory comment for AcceptEventActionActivation::accept, at the end of the sentence: // If the action does unmarshall, then get the feature values of the // signal instance, and place the values for each feature on the // corresponding output pin. add “if any”. In the code, change this.putTokens(resultPins.getValue(0), result); to if (this.resultPins.size() > 0) { this.putTokens(resultPins.getValue(0), result); } Actions taken: February 25, 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: Wed, 25 Feb 2009 13:04:10 -0800 Subject: 8.6.4.2.1 [5]AcceptEventActionActivation::accept(in signalInstance: SignalInstance) Thread-Topic: 8.6.4.2.1 [5]AcceptEventActionActivation::accept(in signalInstance: SignalInstance) Thread-Index: AcmXjJqxEHJqDePgSZ6ycz9KEUWVaA== Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US X-Source-IP: ums-smtp.jpl.nasa.gov [128.149.137.72] 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.4.2.1 AcceptEventActionActivation Summary: The AcceptEventActionActivation::accept() unconditionally places values on output pins even if the action does not have any output pin. Proposed resolution: Change the operation from: // Accept a signal occurance for the given signal instance. // If the action does not unmarshall, then place the signal instance on // the result pin. // If the action does unmarshall, then get the feature values of the // signal instance, and place the values for each feature on the // corresponding output pin. // Concurrently fire all output pins while offering a single control // token. // If there are no incoming edges, then re-register this accept event // action execution with the context object. AcceptEventAction action = (AcceptEventAction) (this.node); OutputPinList resultPins = action.result; Debug.println("[accept] action = " + action.name + ", signalinstance = " + signalInstance); if (this.running) { if (!action.isUnmarshall) { ValueList result = new ValueList(); result.addValue(signalInstance); this.putTokens(resultPins.getValue(0), result); } else { FeatureValueList featureValues = signalInstance.getFeatureValues(); for (int i = 0; i < featureValues.size(); i++) { FeatureValue featureValue = featureValues.getValue(i); OutputPin resultPin = resultPins.getValue(i); this.putTokens(resultPin, featureValue.values); } } this.sendOffers(); this.waiting = false; Debug.println("[fire] Checking if " + this.node.name + " should fire again..."); // if (this.isReady()) { // this.fire(); // } this.receiveOffer(); } } To: // Accept a signal occurance for the given signal instance. // If the action does not unmarshall, then place the signal instance on // the result pin, if any. // If the action does unmarshall, then get the feature values of the // signal instance, and place the values for each feature on the // corresponding output pin, if any. // Concurrently fire all output pins, if any, while offering a single control // token. // If there are no incoming edges, then re-register this accept event // action execution with the context object. AcceptEventAction action = (AcceptEventAction) (this.node); OutputPinList resultPins = action.result; Debug.println("[accept] action = " + action.name + ", signalinstance = " + signalInstance); if (this.running) { if (resultPins.size() > 0) { if (!action.isUnmarshall) { ValueList result = new ValueList(); result.addValue(signalInstance); this.putTokens(resultPins.getValue(0), result); } else { FeatureValueList featureValues = signalInstance.getFeatureValues(); for (int i = 0; i < featureValues.size(); i++) { FeatureValue featureValue = featureValues.getValue(i); OutputPin resultPin = resultPins.getValue(i); this.putTokens(resultPin, featureValue.values); } } } this.sendOffers(); this.waiting = false; Debug.println("[fire] Checking if " + this.node.name + " should fire again..."); // if (this.isReady()) { // this.fire(); // } this.receiveOffer(); } } - Nicolas.