Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Papyrus for Real Time » How to add Multiple Triggers & How to avoid multiple Transitions (same source to same target)
icon5.gif  How to add Multiple Triggers & How to avoid multiple Transitions (same source to same target) [message #1759125] Thu, 06 April 2017 16:00 Go to next message
reza ahmadi is currently offline reza ahmadiFriend
Messages: 47
Registered: September 2016
Member
Hi,

I have a couple of questions about modeling in Papyrus-RT. Thanks for any idea.

Q1: I wonder if this is how to create multiple triggers for a transition T (in order for transition T to fire, all of its triggers must happen and in a desirable order):
In "Trigger" tab select multiple protocol messages from ports and the sequence of selected messages in "Trigger" tab is indeed the required order in order for the transition fire.

Q2: If a transition from state1 to state2 can fire by any messages of a protocol (either m1, m2 or mn), how to specify that (except for adding many transitions from state1 to state2). I mean, is it possible to have one transition with multiple triggers assigned to it (which one of the triggers should at least fire in order for the transition to take place) Let's assume the entry/exit action codes are similar (e.g. empty). Thanks.


Thanks.

[Updated on: Thu, 06 April 2017 20:33]

Report message to a moderator

Re: How to add Multiple Triggers & How to avoid multiple Transitions (same source to same target [message #1759163 is a reply to message #1759125] Thu, 06 April 2017 23:52 Go to previous messageGo to next message
Peter Cigehn is currently offline Peter CigehnFriend
Messages: 49
Registered: September 2014
Member
Hi,

When a transition have multiple triggers then in practice there is an OR between them, i.e. any single one of the triggers can cause the transition to be taken. So regarding your Q2 that is exactly how multiple triggers for a transition works. If you have a transition that you want shall be taken for any protocol message received on a port, then you can select the * in the trigger creation dialog. The * is a "catch all" which gets triggered disregarding which protocol message is received (on one or more ports). So instead of individually selecting all protocol messages (which in practice creates multiple triggers, one for each selected protocol message), you can select * only and you now only have one single trigger.

Considering this, the way to solve your Q1 is to explicitly model the desired order between multiple triggers using multiple states and transitions, to make it clear in your state machine which the expected order between the triggers actually are.

Hope this helps,

/Peter Cigéhn
Re: How to add Multiple Triggers & How to avoid multiple Transitions (same source to same target [message #1759166 is a reply to message #1759163] Fri, 07 April 2017 00:35 Go to previous messageGo to next message
Peter Cigehn is currently offline Peter CigehnFriend
Messages: 49
Registered: September 2014
Member
Hi again,

I just realized that we have had an unfortunate regression in the trigger creation dialog. The intention, and what I also implicitly referred to in my previous response, is that the create trigger dialog should allow multiple protocol messages to be selected, which in practice then creates multiple triggers at once when the dialog is dismissed, i.e. one for each selected protocol message. This should be a convenient way to create multiple triggers at once, without having to bring up the create trigger dialog multiple times. I have written bug 514904 to track this unfortunate regression.

So in the current 0.9 release you are able to only select one protocol message, and to be able to create multiple triggers for a transition, you need to bring up the create trigger dialog multiple times (using the green + button above the trigger table in the properties view for a transition).

Hope this clarifies my previous response in case it became confusing.

/Peter Cigéhn
Re: How to add Multiple Triggers & How to avoid multiple Transitions (same source to same target [message #1759200 is a reply to message #1759166] Fri, 07 April 2017 15:13 Go to previous message
reza ahmadi is currently offline reza ahmadiFriend
Messages: 47
Registered: September 2016
Member
Thanks, Peter. That fully answers my question.
Previous Topic:Papyrus-RT v0.9 is available
Next Topic:Problem with attaching Port to Capsule
Goto Forum:
  


Current Time: Thu Apr 25 22:23:12 GMT 2024

Powered by FUDForum. Page generated in 0.02918 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top