Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » StateMachine - Transitions
StateMachine - Transitions [message #1829312] Wed, 01 July 2020 11:02 Go to next message
Malvina Latifaj is currently offline Malvina LatifajFriend
Messages: 11
Registered: June 2020
Junior Member
Hey everyone! I created a DSL for state machines in XText and now I am trying to use Sirius. This is my diagram. index.php/fa/38458/0/

My problem is when I try to create an edge relation for transitions , they do not show. The ones I have primarely defined are showing, but when I click on a source state and on a target state no line is created. These are the screenshots on my diagram, on how I created the transitions and on how I am trying to create new ones.
index.php/fa/38459/0/
index.php/fa/38460/0/
index.php/fa/38461/0/
Re: StateMachine - Transitions [message #1829314 is a reply to message #1829312] Wed, 01 July 2020 11:51 Go to previous messageGo to next message
Emmanuel Chebbi is currently offline Emmanuel ChebbiFriend
Messages: 123
Registered: February 2018
Senior Member
Have you checked whether the underlying model has new transitions? I suspect that they are not created at all because of a typo in your change context rule: aql: source.eContainer()
Re: StateMachine - Transitions [message #1829315 is a reply to message #1829314] Wed, 01 July 2020 11:56 Go to previous messageGo to next message
Malvina Latifaj is currently offline Malvina LatifajFriend
Messages: 11
Registered: June 2020
Junior Member
I believe there was a typo as when I was trying to create transitions nothing would happen, I had nothing to save. But now after I made the change as you suggested, I click on two states, the arrow connecting the two states does not show, but it shows that there are changes that can be saved. When I try to save it it shows this:
An internal error occurred during: "Saving Models for project SiriusTest".
Could not serialize Transitions:
Transitions.name is required to have a value, but it does not.
Transitions.condition is required to have a value, but it does not.
Transitions.action is required to have a value, but it does not.
Semantic Object: StateMachine.transitions[7]->Transitions
URI: platform:/resource/SiriusTest/spec1.statemachine
Context: Transitions returns Transitions
Re: StateMachine - Transitions [message #1829316 is a reply to message #1829315] Wed, 01 July 2020 12:12 Go to previous messageGo to next message
Emmanuel Chebbi is currently offline Emmanuel ChebbiFriend
Messages: 123
Registered: February 2018
Senior Member
The error is explicit: you have to provide a value for the name, condition and action attributes; I guess that those EAttributes have a lower bound of 1 in your Ecore metamodel (meaning they are mandatory). You can:

  • Set the lower bound to 0 if those attributes are actually optional (in the .ecore),
  • Set the empty string as the default value of those attributes (in the .ecore), so that they are not null when a new Transition is created,
  • Use Sirius' Set operation to set those attributes a value when you create the Transitions (in the .odesign).

Regarding why the arrows are not shown there may be a mistake in the Set operation's properties. Make sure that:

  • Feature name is either enterstate or exitstate
  • Value expression is either var:source or var:target (see documentation's screenshots).
Re: StateMachine - Transitions [message #1829317 is a reply to message #1829316] Wed, 01 July 2020 12:16 Go to previous messageGo to next message
Emmanuel Chebbi is currently offline Emmanuel ChebbiFriend
Messages: 123
Registered: February 2018
Senior Member
If those attributes are mandatory and if you want the user to provide them when the Transition is created then you can also call a Java service that would show a form that can be filled by the user.
Re: StateMachine - Transitions [message #1829318 is a reply to message #1829316] Wed, 01 July 2020 12:17 Go to previous message
Malvina Latifaj is currently offline Malvina LatifajFriend
Messages: 11
Registered: June 2020
Junior Member
Thank you very much! It worked now as my mistake was that as a feature name I had var:source and var:target. Thank you once again! :)
Previous Topic:How to accelerate opening editors using DialectUIManager?
Next Topic:Generating code with Acceleo from Sirius digram model
Goto Forum:
  


Current Time: Thu Apr 25 06:32:45 GMT 2024

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

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

Back to the top