Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Model execution of Blocks using events
Model execution of Blocks using events [message #1844348] Fri, 10 September 2021 09:31 Go to next message
Alberto Debiasi is currently offline Alberto DebiasiFriend
Messages: 84
Registered: March 2018
Member
Hello everybody,

How can I model in Papyrus a Block that is executed each time a specific event occurs?

I know that in the state machine, it is possible to use events and guards to change the state of the Block.

But my question is on a higher level: How can I model events that trigger the execution of the Block (not the transitions inside the state machine)?

In other words when a state machine should perform a step forward?

Thanks,
Alberto
Re: Model execution of Blocks using events [message #1844351 is a reply to message #1844348] Fri, 10 September 2021 12:16 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Use Cases?
Re: Model execution of Blocks using events [message #1844354 is a reply to message #1844351] Fri, 10 September 2021 13:36 Go to previous messageGo to next message
Alberto Debiasi is currently offline Alberto DebiasiFriend
Messages: 84
Registered: March 2018
Member
Use case:

In the system, each Block is indipendent. One block is executed every 10 seconds, another is executed every hour.
Re: Model execution of Blocks using events [message #1844355 is a reply to message #1844354] Fri, 10 September 2021 14:23 Go to previous messageGo to next message
Carsten Pitz is currently offline Carsten PitzFriend
Messages: 479
Registered: May 2015
Location: Germany
Senior Member
Even though this is more a generic SysML / UML question than a Papyrus specific, I try to give an answer here.
State transitionswithin a state machine can be triggered by time events. Each state has a entry, do and exit action. These actions might refer to operations within blocks.
For more information you might place a question in the Learn MBSE LinkedIn group.
/Carsten
Re: Model execution of Blocks using events [message #1844356 is a reply to message #1844355] Fri, 10 September 2021 14:28 Go to previous messageGo to next message
Alberto Debiasi is currently offline Alberto DebiasiFriend
Messages: 84
Registered: March 2018
Member
Thanks Carsten for the prompt reply.

So if the state machine has many transitions, should I put a trigger event to each of them.
Re: Model execution of Blocks using events [message #1844357 is a reply to message #1844356] Fri, 10 September 2021 14:38 Go to previous messageGo to next message
Carsten Pitz is currently offline Carsten PitzFriend
Messages: 479
Registered: May 2015
Location: Germany
Senior Member
This is more a matter of style. But the behavior is undefined if to or more outgoing transitions of a single state may trigger at the same time. UML does not restrict that, but the behavior is undefined. As far as I know Moka simply takes the first possible transition it finds.
/Carsten
Re: Model execution of Blocks using events [message #1844358 is a reply to message #1844357] Fri, 10 September 2021 14:44 Go to previous messageGo to next message
Carsten Pitz is currently offline Carsten PitzFriend
Messages: 479
Registered: May 2015
Location: Germany
Senior Member
But why do you expect to get many transitions?
You have a few timers that trigger scheduler tasks, which then trigger the services to start. That's the way schedulers generally are implemented.
/Carsten
Re: Model execution of Blocks using events [message #1844360 is a reply to message #1844358] Fri, 10 September 2021 14:58 Go to previous messageGo to next message
Carsten Pitz is currently offline Carsten PitzFriend
Messages: 479
Registered: May 2015
Location: Germany
Senior Member
Maybe the OSEK OS documentation is interesting to you, because it describes how to implement a simple static scheduler.
/Carsten
Re: Model execution of Blocks using events [message #1844407 is a reply to message #1844358] Mon, 13 September 2021 09:43 Go to previous messageGo to next message
Alberto Debiasi is currently offline Alberto DebiasiFriend
Messages: 84
Registered: March 2018
Member
I expect to get many transitions because in principle the block could have a complex behavior, with many states and many transitions.
Re: Model execution of Blocks using events [message #1844409 is a reply to message #1844407] Mon, 13 September 2021 10:40 Go to previous message
Carsten Pitz is currently offline Carsten PitzFriend
Messages: 479
Registered: May 2015
Location: Germany
Senior Member
In principle yes, but a so called god class is IMHO an anti pattern.
If it gets complex, a state within an UML state machine can be a a state machine itself. Given that you can build hierarchical state machines which are simpler to review and maintain.
/Carsten
Previous Topic:Stable Papyrus-CDO Update Site
Next Topic:Papyrus is not in the 2021-06 release train
Goto Forum:
  


Current Time: Fri Apr 19 21:08:38 GMT 2024

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

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

Back to the top