SysML State Machine

219 views
Skip to first unread message

Sonali Arora

unread,
Jul 6, 2020, 1:03:48 PM7/6/20
to SysML Forum
Hello everyone!

I am modelling a state machine in SysML using Papyrus. I am trying to use the Opaque Behaviour to define the entry exit or do activity of the state. Does anybody have a good example of an Opaque Behaviour implemented somewhere? Or how can I go around it?

Any help related to the Opaque Behavior will be helpful. Thank you!

Cheers
Sonali

jozsef bedocs

unread,
Jul 9, 2020, 9:41:49 PM7/9/20
to SysML Forum
Hi Sonali.  Thank you for the question.  

An Opaque Behavior is a type of action, not an activity.  Activities contain actions.  You will need to create an activity to populate the value for an entry, exit or do property of a state.  The outcome of an Opaque Behavior is defined by the code that it contains.  On rare occasions, an action defies the use of the other standardized action types; the language provides a mechanism to create a customized action.  

Also, be careful in the use of entry, exit and do properties; they are often misused.  Often people place an activity in the value of an entry property that should be on the transition.  If the behavior is really a response to the transition, then the behavior should be called on the transition.  If a state has multiple entry points, remember that the activity called by the entry property executes every time the state becomes active, no matter which entry point.  Similarly, a state may contain multiple exit points, and every time a state is about to become inactive, the exit activity is executed.  And also remember that while a state is active, the do activity is continuously being executed.  This can have implications depending on whether state machines are set up to execute to completion or not.

I realize this is way more than you asked and I hope it is useful.

Sonali Arora

unread,
Jul 12, 2020, 12:31:43 PM7/12/20
to SysML Forum
Hi Jozsef,

Thank you so much for such an informative reply. I will create an activity for the entry, exit or do property of a state.


Sonali

Sonali Arora

unread,
Jul 12, 2020, 12:31:54 PM7/12/20
to SysML Forum
Hi Jozsef,

Another quick question about STM. Is it a good practice to use a different behaviour diagram to populate the value for an entry, exit or do of a state? Or I should stick to the same type of diagram i.e. use a state machine diagram to to define the behaviour of a specific state? What would you suggest?

TIA and Cheers


On Friday, July 10, 2020 at 3:41:49 AM UTC+2, jozsef bedocs wrote:

geoff

unread,
Jul 13, 2020, 10:45:09 AM7/13/20
to SysML Forum
Hi Sonali,

One excellent resource for behavior modeling guidance in the UML and SysML is available from the web site of Conrad Bock <http://www.conradbock.org>

Numerous papers have been authored by Conrad on the topic.  He is an internationally recognized expert and provides great insights into the languages.

I suggest to first read < http://www.conradbock.org/omg/ad/2018-03-02.pdf > slide deck and the related paper < http://www.jot.fm/issues/issue_2011_01/article3.pdf >.

Regards,
Geoff

jozsef bedocs

unread,
Jul 13, 2020, 3:45:35 PM7/13/20
to SysML Forum
Hi Sonali. 

These questions can be interpreted in many ways.  In most (but not all) models, the value field of an entry, exit or do property contains an Activity.  People often confuse states and activities.  A state is a condition of the containing block; an activity is a set of actions taken by the containing block.  Think of a state machine as a controller that calls activities; the state machine is the road-map for activities performed by the containing block.  

Sonali Arora

unread,
Jul 14, 2020, 10:05:58 PM7/14/20
to SysML Forum
Hi Jozsef,

I think I understand it a bit better now. Thank you!

Regards
Sonali


On Monday, July 13, 2020 at 9:45:35 PM UTC+2, jozsef bedocs wrote:

Sonali Arora

unread,
Jul 14, 2020, 10:06:23 PM7/14/20
to SysML Forum
Hi Geoff!

Thank you so much for this resource.

Cheers
Sonali
Reply all
Reply to author
Forward
0 new messages