State machines and triggers within activities

Please use this forum for open discussions about Bouml.
Merci d'utiliser ce forum pour des discussions ouvertes à propos de Bouml.

State machines and triggers within activities

Postby mbenson » Tue 20 Feb 2018 20:34

What is the correct way to call a trigger within a Do bahavior? When I attempt it, I get into an infinite recursive loop situation. This appears to occur because when the trigger is called, it first calls _do, which calls the trigger, which calls _do, which calls the trigger, etc... I'm new to BOUML, though I've used other modeling tools for many years. In my opinion, calling a trigger within a state activity is normally a bad idea to begin with. Normally, I would use a transition with a guard condition instead, but I'm having another problem regarding guard conditions (in another thread). Is there a correct way to call triggers from within state activities?
mbenson
 
Posts: 3
Joined: Tue 20 Feb 2018 19:54

Re: State machines and triggers within activities

Postby Bruno Pagès » Tue 20 Feb 2018 20:51

Hello,

I see first your other thread and answered to it.

No the correct way for the code produced by the state machine generator is not to call a trigger in a do behavior, the trigger must be applied on the state machine (not a sub state) at the toplevel

Please refer to my other answer for more details
ImageAuthor of Bouml
Bruno Pagès
 
Posts: 562
Joined: Mon 20 Feb 2012 09:23
Location: France

Re: State machines and triggers within activities

Postby mbenson » Tue 20 Feb 2018 21:11

Yes, the questions were related. Thanks. That answers both.
mbenson
 
Posts: 3
Joined: Tue 20 Feb 2018 19:54


Return to Open discussions / Discussions ouvertes

Who is online

Users browsing this forum: No registered users and 1 guest

cron