|EWL - Update UML statemachine model [message #1084389]
||Sun, 11 August 2013 08:59
| Amin Rezaee
Registered: April 2013
Location: Shiraz, Iran
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 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:
//TODO: oTransition.`guard` = (LS==someName );
How I can do this?
[Updated on: Sun, 11 August 2013 09:00]
Report message to a moderator
|Re: EWL - Update UML statemachine model [message #1087478 is a reply to message #1086133]
||Thu, 15 August 2013 14:04
| Antonio Garcia-Dominguez
Registered: January 2010
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 .
Powered by FUDForum
. Page generated in 0.04081 seconds