Issue 17396: Errors in ReduceActionActivation::doAction (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.0 (formal/2011-02-02) Subclause: 8.6.4.2.6 ReduceActionActivation The specification for ReduceActionActivation::doAction has a number of errors. 1. The test “input1 != null” should be “input1 == null”. 2. The test for “parameter.direction == ParameterDirectionKind.out” should also test for a parameter direction of return. 3. After the execution of the reducer behavior, parameterValue1 should not be set to the resulting ParameterValue. Instead, only parameterValue1.values should be set to the resulting values (parameterValue1.parameter should remain unchanged as being equal to input1). 4. There is no abstract syntax constraint that the output of the reducer cannot be empty. The semantics for a reduce action should take into account the possibility of the reducer returning no value and not try to feed an empty input into the next reducer call. Resolution: Agreed. A reasonable approach for dealing with the reducer returning an empty value is to simply start the reduction computation over with the remaining values in the list. Revised Text: In Subclause 8.6.4.2.6, in the doAction operation: 1. Nested within the first while loop, change the condition “input1 != null” to “input1 == null”. 2. Also nested within the first while loop, change the condition “parameter.direction == ParameterDirectionKind.out” to “parameter.direction == ParameterDirectionKind.out | parameter.direction == ParameterDirectionKind.return_”. 3. Within the second while loop, change the statement parameterValue1 = this.currentExecution.getParameterValue(output); to parameterValue1.values = this.currentExecution.getParameterValue(output).values; 4. Within the second while loop, after the statement “j = j + 1”, add: if (parameterValue1.values.isEmpty() & j <= values.size()) { parameterValue1.values.add(values.getValue(j - 1)); j = j + 1; } Actions taken: May 25, 2012: received issue January 7, 2013: closed issue Discussion: End of Annotations:===== m: Ed Seidewitz To: "issue@omg.org" Date: Fri, 25 May 2012 00:08:03 -0400 Subject: Errors in ReduceActionActivation::doAction Thread-Topic: Errors in ReduceActionActivation::doAction Thread-Index: Ac06Kifx/JlUUMsWSLG+jlWf6qpAmg== 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.996542|0.840057|0|white|ugly|3464|6|0|0 X-Mailprotector-Results: null_ptr clean X-Mailprotector-Score: 40 X-Mailprotector-IP-Analysis: 0, 10.1.50.226, Ugly c=0.840057 p=-0.996542 Source White X-Mailprotector-Scan-Diagnostics: 0-0-0-7204-c X-Mailprotector-ID: 0397bef0-3bc6-45f4-aea5-a0a9b361dab3 Specification: Semantics of a Foundational Subset for Executable UML Models (fUML), v1.0 (formal/2011-02-02) Subclause: 8.6.4.2.6 ReduceActionActivation The specification for ReduceActionActivation::doAction has a number of errors. 1. The test .input1 != null. should be .input1 == null.. 2. The test for .parameter.direction == ParameterDirectionKind.out. should also test for a parameter direction of return. 3. After the execution of the reducer behavior, parameterValue1 should not be set to the resulting ParameterValue. Instead, only parameterValue1.values should be set to the resulting values (parameterValue1.parameter should remain unchanged as being equal to input1). 4. There is no abstract syntax constraint that the output of the reducer cannot be empty. The semantics for a reduce action should take into account the possibility of the reducer returning no value and not try to feed an empty input into the next reducer call.