Issue 17298: ExpansionRegionActivation isReady condition is too strong (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) (formal/2011-02-01) Subclause: 8.5.4.2.3 ExpansionRegionActivation The specification for ExpansionRegionActivation::isReady() requires that each of the input expansion nodes for an expansion region have the same (non-zero) number of values offered to it before the expansion region can fire. In particular, this means that if an expansion region receives null tokens representing “empty collections”, then the expansion region will not fire. This may seem to be the same as having the expansion region fire and do nothing, except that, if the region does not actually fire, then it does not offer control tokens on any outgoing control flows and any node downstream of those flows will be inhibited from firing. This does not like a reasonable limiting case of expansion region semantics on “empty” collections, and, in fact, it seems to violate what would be expected from the semantics of expansion regions as described in the full UML spec. The requirement for all input expansion nodes to have the same number of values also seems to strong, requiring careful sizing of all expansion inputs lest the region not be able to fire. Instead, the size of the smallest input collection could be used to govern the number of executions of the body of the expansion region, to insure there are parallel inputs available from each input expansion node for each body execution. Resolution: agreed Revised Text: In Section 8.5.4.2.3, in operation takeOfferedTokens, before the second for loop, add the statement: int n = this.numberOfValues(); Within the second for loop, replace the statements TokenSet tokenSet = new TokenSet(); tokenSet.tokens = expansionNodeActivation.takeTokens(); with TokenList tokens = expansionNodeActivation.takeTokens(); TokenSet tokenSet = new TokenSet(); int j = 1; while (j <= n) { tokenSet.tokens.add(tokens.getValue(j-1)); j = j + 1; } Remove the (overriding) operation isReady (and remove it in Figure 8.29). In operation runGroup, in the second for loop, replace the statement groupInput.addToken(tokenSet.tokens .getValue(activationGroup.index - 1)); with if (tokenSet.tokens.size() >= activationGroup.index) { groupInput.addToken(tokenSet.tokens .getValue(activationGroup.index - 1)); } And replace the entire specification for the operation numberOfValues with // Return the number of values to be acted on by the expansion region of // this activation, which is the minimum of the number of values offered // to each of the input expansion nodes of the activation. ExpansionRegion region = (ExpansionRegion) (this.node); ExpansionNodeList inputElements = region.inputElement; int n = this.getExpansionNodeActivation(inputElements.getValue(0)) .countOfferedValues(); int i = 2; while (i <= inputElements.size()) { int count = this.getExpansionNodeActivation( inputElements.getValue(i - 1)).countOfferedValues(); if (count < n) { n = count; } i = i + 1; } return n; Actions taken: April 10, 2012: received issue January 7, 2013: closed issue Discussion: End of Annotations:===== m: Ed Seidewitz To: "issue@omg.org" Date: Tue, 10 Apr 2012 20:25:56 -0400 Subject: ExpansionRegionActivation isReady condition is too strong Thread-Topic: ExpansionRegionActivation isReady condition is too strong Thread-Index: Ac0Xd+EOCFVW+RLiRV2U5sl0UgwyFw== 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|0|0|new|ugly|0|0|0|0 X-Mailprotector-Results: null_ptr subject_50_chars clean X-Mailprotector-Score: 60 X-Mailprotector-IP-Analysis: 0, 10.1.50.226, Ugly c=0 p=0 Source New X-Mailprotector-Scan-Diagnostics: 0-0-0-9056-c X-Mailprotector-ID: 37ff3dc9-68ed-453a-bc34-59bbce665a0b Specification: Semantics of a Foundational Subset for Executable UML Models (fUML) (formal/2011-02-01) Subclause: 8.5.4.2.3 ExpansionRegionActivation The specification for ExpansionRegionActivation::isReady() requires that each of the input expansion nodes for an expansion region have the same (non-zero) number of values offered to it before the expansion region can fire. In particular, this means that if an expansion region receives null tokens representing .empty collections., then the expansion region will not fire. This may seem to be the same as having the expansion region fire and do nothing, except that, if the region does not actually fire, then it does not offer control tokens on any outgoing control flows and any node downstream of those flows will be inhibited from firing. This does not like a reasonable limiting case of expansion region semantics on .empty. collections, and, in fact, it seems to violate what would be expected from the semantics of expansion regions as described in the full UML spec. The requirement for all input expansion nodes to have the same number of values also seems to strong, requiring careful sizing of all expansion inputs lest the region not be able to fire. Instead, the size of the smallest input collection could be used to govern the number of executions of the body of the expansion region, to insure there are parallel inputs available from each input expansion node for each body execution.