How to specify those operations to be run in a transition? [message #621545] |
Tue, 12 June 2007 13:44 |
Eclipse User |
|
|
|
Originally posted by: formatzeh.gmx.de
Hi Hi,
I have some problems with transitions. So I try to explain what I mean.
In UML the syntax of a transition looks like this:
transitionName[guard]/classMethod^foreignMethod
classMethod is a method of the class which owns the StateMachine and can
be run when the transition is reached. And foreignMethod is a method of
another Class which can be executed when the transition is reached. But
how do I specify those methods?
my try for classMethod:
Package pack = UMLFactory.eINSTANCE.createPackage();
pack.setName("package");
Class classA = pack.createOwnedClass("classA", false);
classA.setPackage(pack);
Operation opA = classA.createOwnedOperation("runThis", null, null);
//...some other elements
StateMachine machine = UMLFactory.eINSTANCE.createStateMachine();
//...creation of the StateMachine
Transition trans = UMLFactory.eINSTANCE.createTransition();
//...source, target
Activity activity = UMLFactory.eINSTANCE.createActivity();
activity.setName("activity");
activity.setSpecification(opA);
trans.setEffect(activity);
// add StateMachine to Class
classA.allOwnedElements().add(machine);
is it correct to model what I want in that way? And how to model the
foreignMethod?
Thank you.
Gilbert
|
|
|
Powered by
FUDForum. Page generated in 0.02426 seconds