Book a Demo

Author Topic: state diagram  (Read 4634 times)

MikeH

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
state diagram
« on: October 27, 2003, 10:08:01 am »
I'm learning to create state diagram with EA. For a state, where do I fill in entry/exit conditions? Also, what are 'Require' and 'Constrains' for in the object properties dialog screen? It seems to me EA's manual does not give step/step explanations on how to create these elements.

Mike Huang

Tjerk

  • EA User
  • **
  • Posts: 231
  • Karma: +1/-0
    • View Profile
Re: state diagram
« Reply #1 on: October 28, 2003, 01:55:22 am »
Hi Mike,

The entry and exit conditions should be modelled in the transition arrows. Rightclick on the arrow and there you will find events, conditions and actions.

The Require and Constrains are there to capture requirements and contraints that apply to the object. These are "internal", meaning for that object only. You could also insert external requirements, which could apply for e.g. more than one object.

The explanation is a bit short, but I'm not quite sure what your questions / uncertainties are.

Greetings,
Tjerk

Jos Fries

  • EA User
  • **
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: state diagram
« Reply #2 on: November 02, 2003, 08:57:02 am »
Hello Tjerk,

I think Mike is referring to the state actions (entry and exit actions, internal transitions, activities and deferred events). I was wondering where these could be defined myself too.

Greetings,
Jos Fries

Tjerk

  • EA User
  • **
  • Posts: 231
  • Karma: +1/-0
    • View Profile
Re: state diagram
« Reply #3 on: November 03, 2003, 01:29:42 am »
Hi Jos,

Internal transitions should be modelled in sub statemachines with internal states (build 650 of EA includes so called Sub-Machines, creating them, also creates a state diagram under the Sub-Machine). I guess that entry and exit actions and deferring events can (should?) be modelled with activity diagrams that model the behaviour of one state (right click on state in projectbrowser, New Child Diagram).

Greetings,
Tjerk

Jos Fries

  • EA User
  • **
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: state diagram
« Reply #4 on: November 05, 2003, 11:48:44 am »
Hallo Tjerk!

Thank you for your answer. It sounds however as workarounds for functionality that seems to be missing in Enterprise Architect. Paragraph 2.12.2.10 in the UML (1.4) specification states that a State has the following Associations: defferableEvent, entry, exit, doActivity and internalTransition. The way these elements should be shown in a state-diagram is described in paragraph 3.75.2 of the same spec. Am I correct that this functionality is not available? (In that case I can submit a feature request  :))

Kind regards,

Jos Fries

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: state diagram
« Reply #5 on: November 05, 2003, 04:22:24 pm »
From my reading of 1.5 I think (!) what you are after is creating state flow association from and to the same state with the event set to "entry" or "exit" and any constraints on the transition as the guard.

Considering a simple LED flasher with states red, yellow and green and transitions between the states based on internal (to the state) timer values, say red/yellow=5000, yellow/green=2000,green/red=4000.  These transitions can be modelled as flows with the guards "timer=5000", "timer=2000" and "timer=4000" respectively.  At the entry to each state we need to perform the action "reset timer and turn on LED", and at the exit we need the action "turn of LED".  These can be shown on the state diagram as flows from and to the same state with events and actions set appropriately.

Sorry I cant include a picture that makes this so obvious.
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

Jos Fries

  • EA User
  • **
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: state diagram
« Reply #6 on: November 08, 2003, 02:02:42 am »
Ah, I found what I was looking for! The state actions are described by means of a state operation (select the state, right click, select Operations). In the operations menu then the type of the action can be selected (Do Action, On Entry, On Exit, On Event). The action to take can then be specified via the Behaviour tab of the menu.

Thank you all for your answers!

Jos Fries