Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » EWL - Update UML statemachine model
EWL - Update UML statemachine model [message #1084389] Sun, 11 August 2013 12:59 Go to next message
Amin Rezaee is currently offline Amin Rezaee
Messages: 18
Registered: April 2013
Location: Shiraz, Iran
Junior Member

Hello All,

I am working on updating UML statemachine model using EWL and I have some problem in some part of my implementation.
My problem is about adding guard and effect to transitions of my uml statemachine diagram.
I define new transition with following code:

var oTransition = new Transition;

Then I set values for some properties of this transition with following lines:

oTransition.container = oContainingRegion;
oTransition.source = oSourceState;
oTransition.target = oTargetState;
oTransition.name = 'SomeName';

Also I must to set effect of this transition with this statement:

LS=oSourceState.name

LS is one variable of type String that value of this variable is the name of source state of this transition. Now I want to add this statement in effect of "oTransition", but I don't know how?
Notice: "oTransition" may has other effect and I need to add "LS=oSourceState.name" in effect of "oTransition" without omitting current transition effect.

//TODO: oTransition.effect = oTransition.effect and (LS=oSourceState.name);

Also I have some problem in adding guard of transition. I need to add below constraint in my transition guard:

LS==someName

//TODO: oTransition.`guard` = (LS==someName );

How I can do this?

Best Regards,
Amin

[Updated on: Sun, 11 August 2013 13:00]

Report message to a moderator

Re: EWL - Update UML statemachine model [message #1085053 is a reply to message #1084389] Mon, 12 August 2013 11:39 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-Dominguez
Messages: 309
Registered: January 2010
Senior Member
It's a bit difficult to understand what you're trying to do without having the metamodel. Could you explain the changes you intend to do in terms of your metamodel?

In particular, please describe more in detail how you represent the "effect" of a transition, and the "statements". If you run into errors, please tell us the concrete error messages as well.
Re: EWL - Update UML statemachine model [message #1085242 is a reply to message #1085053] Mon, 12 August 2013 16:41 Go to previous messageGo to next message
Amin Rezaee is currently offline Amin Rezaee
Messages: 18
Registered: April 2013
Location: Shiraz, Iran
Junior Member

Dear Antonio Garcia,

My source and target metamodel is UML metamodel for UML statemachine. I want to add effect and guard for transitions of my uml statemachine model.
The definition of transition in UML statemachine metamode is like below:

trigger [guard] / effect
------------------------->

To browse the UML metamodel you can use the EPackage Registry view [1].

[1] http://eclipse.org/epsilon/doc/articles/epackage-registry-view/

I do not encounter with any errors (I do not set any value for guard of effect of my newly created transitions).

Best Regards,
Amin
Re: EWL - Update UML statemachine model [message #1086028 is a reply to message #1085242] Tue, 13 August 2013 18:00 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-Dominguez
Messages: 309
Registered: January 2010
Senior Member
Dear Amin,

I see. Can you provide a pair of source and target models, for reference?

Best regards,
Antonio
Re: EWL - Update UML statemachine model [message #1086133 is a reply to message #1086028] Tue, 13 August 2013 21:36 Go to previous messageGo to next message
Amin Rezaee is currently offline Amin Rezaee
Messages: 18
Registered: April 2013
Location: Shiraz, Iran
Junior Member

Dear Antonio Garcia,

With regardless of what I want to doing and what is my source and target model, consider that I want to define one new UML statemachine transition and add below value for effect and guard of my transition, respectively:

effect = (LS = 'someName')
guard = (LS=='someName')

How I can do these in ewl?
I use have below source code:

var oTransition = new Transition; // define one transition
//TODO: oTransition.`guard` = (LS=='someName')
//TODO: oTransition.effect = (LS='someName')

Best Regards,
Amin
Re: EWL - Update UML statemachine model [message #1087478 is a reply to message #1086133] Thu, 15 August 2013 18:04 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-Dominguez
Messages: 309
Registered: January 2010
Senior Member
Normally, when I need to transform a model in a particular way, the quickest way to find out the code I need to write is to use the regular model editors to do it manually, and then use the Exeed model editor to find out exactly which types I have to use and which attributes and structural features I need to change. For that, the "Show Structural Info" in the Exeed menu of the Exeed editor is really useful (screenshot attached).

This is usually faster than looking at the EPackage Registry view, especially with complex metamodels such as UML. With all this information, I only have to write the appropriate EOL code and then use it from the EWL wizard.

Anyway, I went ahead and created manually a model with a transition, and then wrote a simple EOL fragment that will add a transition from A to B with an OpaqueExpression as guard and an OpaqueBehavior as effect. I hope you can use it as a reference Smile.
Re: EWL - Update UML statemachine model [message #1088107 is a reply to message #1087478] Fri, 16 August 2013 15:37 Go to previous messageGo to next message
Amin Rezaee is currently offline Amin Rezaee
Messages: 18
Registered: April 2013
Location: Shiraz, Iran
Junior Member

Dear Antonio Garcia,

Thank you for your very useful guidance.

I want to set the value of my String Variable(LS) in the effect of my transition and compare the value of this variable with some name in the guard of other transitions. How I can identify that LS is one string variable? In your example, can you add one value assignment for one string variable (LS) in effect of transition (DoSomething in your code --> LS = 'SomeStringValue')?

Best Regards,
Amin
Re: EWL - Update UML statemachine model [message #1089840 is a reply to message #1088107] Mon, 19 August 2013 10:14 Go to previous message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-Dominguez
Messages: 309
Registered: January 2010
Senior Member
I'm afraid that's more of an UML question than one about Epsilon itself. You should refer to the UML specification and the UML forum to see how to model that Smile.
Previous Topic:Eugenia creating nested Shape Figure
Next Topic:Define UML property
Goto Forum:
  


Current Time: Fri Oct 24 15:46:24 GMT 2014

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

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