Author Topic: Multiple instances of simple links  (Read 3214 times)

Dr.B

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Multiple instances of simple links
« on: February 11, 2010, 02:01:02 am »
What properties of a state machine do I need to change so that I can include multiple copies of that state machine (as substate machines) within any other state diagram?  When bringing these in as simple links, I receive a message that includes "Currently, only one instance is supported, so you cannot paste the element here".  When imported as instances, there are other implications to how links can/cannot be made.

Pete Kirkham

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Multiple instances of simple links
« Reply #1 on: February 19, 2010, 03:36:54 am »
Naively, if you have a state machine 'outer' with a nested machine 'inner', inner appears as a single state to outer.

At runtime, outer has a single active state.  That is the sum of information to the machine at a given level.

What I assume you are trying to achive is having two identical 'inner' states which have different transitions out of them depending on what transition was used to transition into them.

There is nothing in a state machine (unless you're using the history feature) to record where you came from. So in a simple state machine, you need an extra state to indicate this state of the system.

To model this in UML, model your two different paths through the shared state as two new statemachines, each of which contain a single state - the shared statemachine you are duplicating.

Or you could merge the two paths, and either set a flag or inspect history or whatever, but then you're modelling state as data, which kind-of goes against the point of having a statemachine.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Multiple instances of simple links
« Reply #2 on: February 19, 2010, 05:50:35 pm »
Pete,

You could also use entry (and exit) points to model the differences in transitions depending on where (at wich entry point) a state was entered.


Geert

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Multiple instances of simple links
« Reply #3 on: February 19, 2010, 06:02:11 pm »
You need to drag them in not as simple links, but as instances. Then you can use multiple instances of the same state machine as submachines within an outer state machine.

You won't have access to the states within the instances, however, but if you supply your submachine with enry and exit points, you can make them visible for the instances and use them as sources and targets for transitions in the outer state machine.