Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » How to specify those operations to be run in a transition?
How to specify those operations to be run in a transition? [message #621545] Tue, 12 June 2007 13:44
Eclipse UserFriend
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
Previous Topic:UMLPrimitiveTyes
Next Topic:How to specify SendSignalEvent?
Goto Forum:
  


Current Time: Thu Sep 26 05:03:52 GMT 2024

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

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

Back to the top