Book a Demo

Author Topic: State machine transition with multiple operations  (Read 6674 times)

Michael Rufer

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
State machine transition with multiple operations
« on: May 05, 2010, 07:48:28 pm »
I would like to asign multiple operations to the transition effect. But I can only select one operation as soon as I select the "Effect is a Behavior" checkbox. Is this behaviour intended or am I doing something wrong?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: State machine transition with multiple operati
« Reply #1 on: May 05, 2010, 08:55:05 pm »
Michael,

We have had this same issue, and we've overcome it using a tagged value with definition:
Code: [Select]
Type=RefGUID;
Values=Operation;
AppliesTo=StateFlow;
This allows us to add multiple tagged values to the stateflow, and select a different operation in each tagged value.
I first used the RefGUIDList, to be able to link multiple operations to one tagged value, but that wasn't very practical in use.

Geert

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: State machine transition with multiple operati
« Reply #2 on: May 05, 2010, 08:58:38 pm »
It's probably intended.

If you want to see your transition being labelled with multiple operations in your diagram: I think it's not possible.

If you need a link to multiple operations in your model: you can select an activity instead of an operation, and this activity can contain multiple actions (each of which can be linked to an operation).

Anyway: are you sure it's a good idea to have more than one operation as effect of a transition? The model (or diagram) would not specify how these operations are to be executed (in parallel? sequentially?) Wouldn't it be wiser to change your model so that you have one operation for each effect?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: State machine transition with multiple operati
« Reply #3 on: May 05, 2010, 09:02:01 pm »
Quote
Anyway: are you sure it's a good idea to have more than one operation as effect of a transition? The model (or diagram) would not specify how these operations are to be executed (in parallel? sequentially?) Wouldn't it be wiser to change your model so that you have one operation for each effect?

Frank, I agree with your point of view.

Geert

Van Lepthien

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: State machine transition with multiple operati
« Reply #4 on: May 13, 2010, 05:32:37 am »
The UML 2.1 definition of effect in a Transition:

effect: Behavior[0..1] Specifies an optional behavior to be performed when the transition fires.

So allowing at most one conforms to the UML spec.

ChrisBD

  • EA User
  • **
  • Posts: 60
  • Karma: +0/-0
    • View Profile
Re: State machine transition with multiple operati
« Reply #5 on: May 13, 2010, 11:04:37 pm »
Isn't this why you have entry and exit behaviour for states (although they can seriously increase the complexity of your model)?