Issue 17300: An activity final node should not fire if it is not offered any tokens (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.3 ActivityFinalNodeActivation ActivityFinalNodeActivation::fire(incomingTokens) currently terminates the activity node activation group containing the activity final node, even if incomingTokens is empty. This is normally not a problem, since fire is usually only called if at least one token has been offered. However, if the activity final node is in a loop node or a conditional clause with an incoming edge from the body of the loop node or clause, then, when the test for the loop node or clause is being executed, the body part is not yet activated. If the source of the incoming edge to the activity final node is a body part node that is not activated, then the edge will be ignored in determining whether the final node is enabled, resulting in the final node being considered enabled and, unless otherwise prevented, firing prematurely, terminating the enclosing loop node or conditional node. Resolution: Agreed. Note that the revised text below also includes a check for the final node having no incoming edges at all (which is valid), so that, in this case, it will fire when enabled, even though it will have no incoming tokens. Revised Text: In Subclause 8.5.2.2.3, in operation fire, surround the termination functionality in the if statement if (incomingTokens.size() > 0 | this.incomingEdges.size() == 0) { … } 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 21:36:15 -0400 Subject: An activity final node should not fire if it is not offered any tokens Thread-Topic: An activity final node should not fire if it is not offered any tokens Thread-Index: Ac0Xgl7EmQiHfDoIREOdDMxC5tSQDA== 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 subject_10_spaces clean X-Mailprotector-Score: 80 X-Mailprotector-IP-Analysis: 0, 10.1.50.226, Ugly c=0 p=0 Source New X-Mailprotector-Scan-Diagnostics: 0-0-0-7293-c X-Mailprotector-ID: 991fa4e1-f9b6-4006-af06-6c8a34d1644d Specification: Semantics of a Foundational Subset for Executable UML Models (fUML) (formal/2011-02-01) Subclause: 8.5.2.2.3 ActivityFinalNodeActivation ActivityFinalNodeActivation::fire(incomingTokens) currently terminates the activity node activation group containing the activity final node, even if incomingTokens is empty. This is normally not a problem, since fire is usually only called if at least one token has been offered. However, if the activity final node is in a loop node or a conditional clause with an incoming edge from the body of the loop node or clause, then, when the test for the loop node or clause is being executed, the body part is not yet activated. If the source of the incoming edge to the activity final node is a body part node that is not activated, then the edge will be ignored in determining whether the final node is enabled, resulting in the final node being considered enabled and, unless otherwise prevented, firing prematurely, terminating the enclosing loop node or conditional node. Date: Wed, 11 Apr 2012 17:27:39 +0000 From: "Chonoles, Michael J" Subject: RE: Ex: issue 17300 -- fUML RTF issue X-Originating-IP: [158.186.156.81] To: Juergen Boldt , "issues@omg.org" , "fuml-rtf@omg.org" Thread-Topic: Ex: issue 17300 -- fUML RTF issue Thread-Index: AQHNF/c5XOsxaT/MBUyDw6ZUyYaErJaV4EhA Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.6.7498,1.0.260,0.0.0000 definitions=2012-04-11_06:2012-04-11,2012-04-11,1970-01-01 signatures=0 Just a thought. If the activity final node has no predecessor, it should fire when its tightest encompassing region is entered. Does this count as an offered token or not? Mcihael From: Juergen Boldt [mailto:juergen@omg.org] Sent: Wednesday, April 11, 2012 11:13 AM To: issues@omg.org; fuml-rtf@omg.org Subject: Ex: issue 17300 -- fUML RTF issue From: Ed Seidewitz To: "issue@omg.org" Date: Tue, 10 Apr 2012 21:36:15 -0400 Subject: An activity final node should not fire if it is not offered any tokens Thread-Topic: An activity final node should not fire if it is not offered any tokens Thread-Index: Ac0Xgl7EmQiHfDoIREOdDMxC5tSQDA== 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 subject_10_spaces clean X-Mailprotector-Score: 80 X-Mailprotector-IP-Analysis: 0, 10.1.50.226, Ugly c=0 p=0 Source New X-Mailprotector-Scan-Diagnostics: 0-0-0-7293-c X-Mailprotector-ID: 991fa4e1-f9b6-4006-af06-6c8a34d1644d Specification: Semantics of a Foundational Subset for Executable UML Models (fUML) (formal/2011-02-01) Subclause: 8.5.2.2.3 ActivityFinalNodeActivation ActivityFinalNodeActivation::fire(incomingTokens) currently terminates the activity node activation group containing the activity final node, even if incomingTokens is empty. This is normally not a problem, since fire is usually only called if at least one token has been offered. However, if the activity final node is in a loop node or a conditional clause with an incoming edge from the body of the loop node or clause, then, when the test for the loop node or clause is being executed, the body part is not yet activated. If the source of the incoming edge to the activity final node is a body part node that is not activated, then the edge will be ignored in determining whether the final node is enabled, resulting in the final node being considered enabled and, unless otherwise prevented, firing prematurely, terminating the enclosing loop node or conditional node. Juergen Boldt Director, Member Services 140 Kendrick Street, Building A Suite 300 Needham, MA 02494 USA Tel: 781 444 0404 x 132 fax: 781 444 0320 www.omg.org From: Ed Seidewitz To: "Chonoles, Michael J" , Juergen Boldt , "issues@omg.org" , "fuml-rtf@omg.org" Date: Wed, 11 Apr 2012 14:16:43 -0400 Subject: RE: Ex: issue 17300 -- fUML RTF issue Thread-Topic: Ex: issue 17300 -- fUML RTF issue Thread-Index: AQHNF/c5XOsxaT/MBUyDw6ZUyYaErJaV4EhAgAAMpGM= 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 clean X-Mailprotector-Score: 40 X-Mailprotector-IP-Analysis: 0, 10.1.50.226, Ugly c=0 p=0 Source New X-Mailprotector-Scan-Diagnostics: 0-0-0-8124-c X-Mailprotector-ID: 3742fce8-0dc7-4eb9-8685-b64f9ba78c54 X-MIME-Autoconverted: from quoted-printable to 8bit by amethyst.omg.org id q3BIHx0b014440 Michael -- A good thought! Technically, yes, that does count as an offered token, since an activity node with no predecessor is considered to be enabled when its owning structured activity node fires. Such enabled nodes are all offered control tokens. However, some care has to be taken on handling this in the fUML execution model, because, while enabled nodes are triggered as receiving an offer, there is not any real token generated in that case. In my preliminary implementation of this, I not only added a check that the incoming tokens were empty, but also that the final node had at least one incoming edge. Only in that case would it not fire, so that it would still fire in the case you mention. This will be reflected in the formal resolution to the issue. -- Ed ________________________________________ From: Chonoles, Michael J [michael.j.chonoles@lmco.com] Sent: Wednesday, April 11, 2012 1:27 PM To: Juergen Boldt; issues@omg.org; fuml-rtf@omg.org Subject: RE: Ex: issue 17300 -- fUML RTF issue Just a thought. If the activity final node has no predecessor, it should fire when its tightest encompassing region is entered. Does this count as an offered token or not? Mcihael From: Juergen Boldt [mailto:juergen@omg.org] Sent: Wednesday, April 11, 2012 11:13 AM To: issues@omg.org; fuml-rtf@omg.org Subject: Ex: issue 17300 -- fUML RTF issue From: Ed Seidewitz > To: "issue@omg.org" > Date: Tue, 10 Apr 2012 21:36:15 -0400 Subject: An activity final node should not fire if it is not offered any tokens Thread-Topic: An activity final node should not fire if it is not offered any tokens Thread-Index: Ac0Xgl7EmQiHfDoIREOdDMxC5tSQDA== 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 subject_10_spaces clean X-Mailprotector-Score: 80 X-Mailprotector-IP-Analysis: 0, 10.1.50.226, Ugly c=0 p=0 Source New X-Mailprotector-Scan-Diagnostics: 0-0-0-7293-c X-Mailprotector-ID: 991fa4e1-f9b6-4006-af06-6c8a34d1644d Specification: Semantics of a Foundational Subset for Executable UML Models (fUML) (formal/2011-02-01) Subclause: 8.5.2.2.3 ActivityFinalNodeActivation ActivityFinalNodeActivation::fire(incomingTokens) currently terminates the activity node activation group containing the activity final node, even if incomingTokens is empty. This is normally not a problem, since fire is usually only called if at least one token has been offered. However, if the activity final node is in a loop node or a conditional clause with an incoming edge from the body of the loop node or clause, then, when the test for the loop node or clause is being executed, the body part is not yet activated. If the source of the incoming edge to the activity final node is a body part node that is not activated, then the edge will be ignored in determining whether the final node is enabled, resulting in the final node being considered enabled and, unless otherwise prevented, firing prematurely, terminating the enclosing loop node or conditional node. Juergen Boldt Director, Member Services 140 Kendrick Street, Building A Suite 300 Needham, MA 02494 USA Tel: 781 444 0404 x 132 fax: 781 444 0320 www.omg.org [http://www.omg.org/images/signature-2.gif] From: "Bock, Conrad" To: Juergen Boldt , "issues@omg.org" , "fuml-rtf@omg.org" Date: Wed, 11 Apr 2012 14:47:59 -0400 Subject: RE: Ex: issue 17300 -- fUML RTF issue Thread-Topic: Ex: issue 17300 -- fUML RTF issue Thread-Index: AQHNF/c5XOsxaT/MBUyDw6ZUyYaErJaV4EhAgAAWyvA= Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Michael, > If the activity final node has no predecessor, it should > fire when its tightest encompassing region is entered. Does > this count as an offered token or not? Final nodes are supposed to have incoming edges, even though there's no constraint saying this currently. Conrad From: Ed Seidewitz To: "Bock, Conrad" CC: Juergen Boldt , "issues@omg.org" , "fuml-rtf@omg.org" Date: Thu, 12 Apr 2012 16:21:27 -0400 Subject: RE: Ex: issue 17300 -- fUML RTF issue Thread-Topic: Ex: issue 17300 -- fUML RTF issue Thread-Index: AQHNF/c5XOsxaT/MBUyDw6ZUyYaErJaV4EhAgAAWyvCAAax1wA== 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.225]|10.1.50.225|outbound.mailprotector.net|-0.98753|0.934314|0|white|ugly|8607|54|0|0 X-Mailprotector-Results: null_ptr clean X-Mailprotector-Score: 40 X-Mailprotector-IP-Analysis: 0, 10.1.50.225, Ugly c=0.934314 p=-0.98753 Source White X-Mailprotector-Scan-Diagnostics: 0-0-0-2658-c X-Mailprotector-ID: ea3a7282-c50d-4f4e-a846-085f7cf11065 X-MIME-Autoconverted: from quoted-printable to 8bit by amethyst.omg.org id q3CKLasv019265 Conrad -- Yeah, I agree with you that a final node without an incoming edge doesn't make much sense. But, since it is currently allowed, we should give it consistent semantics in fUML. -- Ed -----Original Message----- From: Bock, Conrad [mailto:conrad.bock@nist.gov] Sent: Wednesday, April 11, 2012 2:48 PM To: Juergen Boldt; issues@omg.org; fuml-rtf@omg.org Subject: RE: Ex: issue 17300 -- fUML RTF issue Michael, > If the activity final node has no predecessor, it should > fire when its tightest encompassing region is entered. Does > this count as an offered token or not? Final nodes are supposed to have incoming edges, even though there's no constraint saying this currently. Conrad