Issue 17291: ForkNodeActivation does not clear its tokens on termination (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.2.2.11 ForkNodeActivation Unlike other control nodes, a fork node actually holds forked tokens pending their acceptance by downstream nodes. Therefore, when a ForkNodeActivation terminates, it needs to clear its held tokens, similarly to an ObjectNodeActivation. It currently does not do this, which means, if it is fired repeatedly in a loop node, and not all of its held tokens are accepted on previous iterations, it will be spuriously holding extra tokens on subsequent iterations. Adding the following overriding method to ForkNodeActivation is sufficient, because ActivityNodeActivation::clearTokens() repeatedly withdraws held tokens until none are left, which will work even for multiply forked tokens. public void terminate() { // Remove any offered tokens and terminate. this.clearTokens(); super.terminate(); } // terminate Resolution: agreed Revised Text: In Figure 8.27, add the (overriding) operation “terminate()” to the class ForkNodeActivation, and add the following specification for it in Subclause 8.5.2.2.11: terminate() // Remove any offered tokens and terminate. this.clearTokens(); super.terminate(); Actions taken: April 6, 2012: received issue January 7, 2013: closed issue Discussion: End of Annotations:===== m: Ed Seidewitz To: "issue@omg.org" Date: Fri, 6 Apr 2012 00:32:38 -0400 Subject: ForkNodeActivation does not clear its tokens on termination Thread-Topic: ForkNodeActivation does not clear its tokens on termination Thread-Index: Ac0TrOlGhOWHuFMwQmeUGIrfvRxhcA== 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.995768|0.83513|0|white|ugly|3301|7|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.83513 p=-0.995768 Source White X-Mailprotector-Scan-Diagnostics: 0-0-0-8139-c X-Mailprotector-ID: ae8c9518-be67-4f73-b7b6-d487991b4a34 Specification: Semantics of a Foundational Subset for Executable UML Models (fUML) (formal/2011-02-01) Subclause: 8.5.2.2.11 ForkNodeActivation Unlike other control nodes, a fork node actually holds forked tokens pending their acceptance by downstream nodes. Therefore, when a ForkNodeActivation terminates, it needs to clear its held tokens, similarly to an ObjectNodeActivation. It currently does not do this, which means, if it is fired repeatedly in a loop node, and not all of its held tokens are accepted on previous iterations, it will be spuriously holding extra tokens on subsequent iterations. Adding the following overriding method to ForkNodeActivation is sufficient, because ActivityNodeActivation::clearTokens() repeatedly withdraws held tokens until none are left, which will work even for multiply forked tokens. public void terminate() { // Remove any offered tokens and terminate. this.clearTokens(); super.terminate(); } // terminate