Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » State machine diagram - Check / Guard [State activity/status]
State machine diagram - Check / Guard [State activity/status] [message #1763586] Wed, 17 May 2017 16:12 Go to next message
Bas Har is currently offline Bas HarFriend
Messages: 18
Registered: May 2017
Junior Member
Hello,
In State Machine diagram, is it possible to add a guard to a transition to check if a state is active?
I found the following in MathWorks.com:
https://www.mathworks.com/help/stateflow/ug/checking-state-activity.html?requestedDomain=www.mathworks.com
Does papyrus have the same ability? If so, How can I implement it?
Thank you.

I am using Papyrus Neon 2, SysML 1.4.
Re: State machine diagram - Check / Guard [State activity/status] [message #1763679 is a reply to message #1763586] Thu, 18 May 2017 14:09 Go to previous messageGo to next message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 461
Registered: March 2011
Location: Paris Saclay, France
Senior Member
Currently, Papyrus does not support this option as there is no standardized way to handle it.

A workaround is to create a Boolean class attribute, set it to true in the entry action code of a state and back to false in the exit action. In the guard of a trigger, the value of this attribute can be checked.
Re: State machine diagram - Check / Guard [State activity/status] [message #1766759 is a reply to message #1763679] Mon, 26 June 2017 23:24 Go to previous message
Bas Har is currently offline Bas HarFriend
Messages: 18
Registered: May 2017
Junior Member
Appreciate your replay.

Sorry for not following up promptly.

Based on your advice, I add a Boolean attribute to my class (Block), I was able to check its value in a Transition guard as an Opaque Expression, with correct syntax highlighting by Papyrus.

But, I was not able to set the value, I tried to use OCL in Opaque Behavior in:
1. A Transition Effect
2. A State Entry action
3. A State Exit action
None of which worked, once I close the window, it shows "Opaque Behavior: null" in the diagram and when I open it, the OCL expression is gone.

I looked around, and it felt something like:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=493799

I am using Papyrus Neon 2, SysML 1.4.

Thank you.

[Updated on: Mon, 10 July 2017 09:27]

Report message to a moderator

Previous Topic:importing extended requirements in SysML req table
Next Topic:Usability: Location of Team Provider menu for submodules
Goto Forum:
  


Current Time: Tue Apr 16 18:53:26 GMT 2024

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

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

Back to the top