Issue 13313: Issue: CallActionActivation cannot handle more than one concurrent call (fuml-ftf) Source: Model Driven Solutions (Mr. Ed Seidewitz, ed-s(at)modeldriven.com) 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.2.2.2 (CallActionActivation) Summary: A call action may fire multiple times concurrently. A call action activation needs to keep track of currently ongoing call executions, so that they can all be terminated if the call action activation is terminated. However, CallActionActivation::callExecution currently has a multiplicity upper bound of 1. Therefore, if a call action fires more than once concurrently, subsequent firings will incorrectly overwrite the reference to the callExecution from the first firing. Proposed resolution: Under associations, replace CallActionActivation::callExecution with: callExecutions: Execution [*] The set of execution objects for currently ongoing calls made through this call action activation. At the beginning of CallActionActivation::doAction, replace: this.callExecution = this.getCallExecution(); if (this.callExecution != null) { with: Execution callExecution = this.getCallExecution(); if (callExecution != null) { this.callExecutions.addValue(callExecution); Throughout CallActionActivation::doAction, replace with this.callExecution with callExection. At the end of CallActionActivation::doAction, replace: this.callExecution = null; with: this.removeCallExecution(callExecution); Replace the body of CallActionActivation::terminate with: // Terminate all call executions (if any), then terminate the call action activation (self). for (int i = 0; i < this.callExecutions.size(); i++) { Execution execution = this.callExecutions.getValue(i); execution.terminate(); } super.terminate(); Add the following operation: CallActionActivation::removeCallExecution(execution: Execution) // Remove the given execution from the current list of call executions. boolean notFound = true; int i = 1; while (notFound & i <= this.callExecutions.size()) { if (this.callExecutions.getValue(i-1) == execution) { this.callExecutions.removeValue(i-1); notFound = false; } } Resolution: Change the code as proposed Revised Text: In Subclause 8.6.2.2, under associations, replace CallActionActivation::callExecution with: callExecutions: Execution [*] The set of execution objects for currently ongoing calls made through this call action activation. At the beginning of CallActionActivation::doAction, replace: this.callExecution = this.getCallExecution(); if (this.callExecution != null) { with: Execution callExecution = this.getCallExecution(); if (callExecution != null) { this.callExecutions.addValue(callExecution); Throughout CallActionActivation::doAction, replace with this.callExecution with callExecution. At the end of CallActionActivation::doAction, replace: this.callExecution = null; with: this.removeCallExecution(callExecution); Replace the body of CallActionActivation::terminate with: // Terminate all call executions (if any), then terminate the call action activation (self). for (int i = 0; i < this.callExecutions.size(); i++) { Execution execution = this.callExecutions.getValue(i); execution.terminate(); } super.terminate(); Add the following operation: CallActionActivation::removeCallExecution(execution: Execution) // Remove the given execution from the current list of // call executions. boolean notFound = true; int i = 1; while (notFound & i <= this.callExecutions.size()) { if (this.callExecutions.getValue(i-1) == execution) { this.callExecutions.removeValue(i-1); notFound = false; } } Actions taken: January 21, 2009: received issue July 23, 2010: closed issue Discussion: End of Annotations:===== ubject: Issue: CallActionActivation cannot handle more than one concurrent call Date: Tue, 20 Jan 2009 17:49:42 -0500 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Issue: CallActionActivation cannot handle more than one concurrent call thread-index: Acl7UWGyYagEg6tXSQuMmI/coLT7RQ== From: "Ed Seidewitz" To: Specification: Semantics of a Foundation Subset for Executable UML Models, FTF . Beta 1 (ptc/08-11-03) Section: 8.6.2.2.2 (CallActionActivation) Summary: A call action may fire multiple times concurrently. A call action activation needs to keep track of currently ongoing call executions, so that they can all be terminated if the call action activation is terminated. However, CallActionActivation::callExecution currently has a multiplicity upper bound of 1. Therefore, if a call action fires more than once concurrently, subsequent firings will incorrectly overwrite the reference to the callExecution from the first firing. Proposed resolution: Under associations, replace CallActionActivation::callExecution with: callExecutions: Execution [*] The set of execution objects for currently ongoing calls made through this call action activation. At the beginning of CallActionActivation::doAction, replace: this.callExecution = this.getCallExecution(); if (this.callExecution != null) { with: Execution callExecution = this.getCallExecution(); if (callExecution != null) { this.callExecutions.addValue(callExecution); Throughout CallActionActivation::doAction, replace with this.callExecution with callExection. At the end of CallActionActivation::doAction, replace: this.callExecution = null; with: this.removeCallExecution(callExecution); Replace the body of CallActionActivation::terminate with: // Terminate all call executions (if any), then terminate the call action activation (self). for (int i = 0; i < this.callExecutions.size(); i++) { Execution execution = this.callExecutions.getValue(i); execution.terminate(); } super.terminate(); Add the following operation: CallActionActivation::removeCallExecution(execution: Execution) // Remove the given execution from the current list of call executions. boolean notFound = true; int i = 1; while (notFound & i <= this.callExecutions.size()) { if (this.callExecutions.getValue(i-1) == execution) { this.callExecutions.removeValue(i-1); notFound = false; } }