Book a Demo

Author Topic: How to show object states in Activity diagram?  (Read 6217 times)

johnm9

  • EA User
  • **
  • Posts: 52
  • Karma: +0/-0
    • View Profile
How to show object states in Activity diagram?
« on: May 27, 2008, 06:03:55 pm »
The standard UML should allow showing the object states in the activity diagram with a square blanket. How can this be done in EA?

Paul Lotz

  • EA User
  • **
  • Posts: 248
  • Karma: +1/-0
    • View Profile
Re: How to show object states in Activity diagram?
« Reply #1 on: May 28, 2008, 03:48:44 am »
You can show the state of an object in an activity diagram using the following method.

Drag an object onto the diagram.  Right-click on the object and choose Advanced|Set Object State... from the pop-up menu (or click Ctrl+Shift+S).  Enter a state in the "Set Instance State" dialog.

Is this what you want?

Paul

Paul Lotz

  • EA User
  • **
  • Posts: 248
  • Karma: +1/-0
    • View Profile
Re: How to show object states in Activity diagram?
« Reply #2 on: May 28, 2008, 06:21:43 am »
Hmm...  it doesn't seem that this is set up quite right to show multiple state transitions on the same diagram, since if we try to create a new instance of the object (to which we will assign a new state) EA responds with a dialog:  "This diagram already contains an instance of the element you are trying to paste.  Currently, only one instance is supported, so you cannot paste the element here.")

This is quite unfortunate.  Is there a way around this?  (For the moment I am using an object with the name of the state.  This works to indicate when more than one state is possible--albeit less cleanly--but does not work to show when two or more paths result in the same state....)

I see that is possible to create two objects with the same name and assign each of them a different state.  Then the diagram looks right anyway....
« Last Edit: May 28, 2008, 06:26:25 am by pauljlotz »

johnm9

  • EA User
  • **
  • Posts: 52
  • Karma: +0/-0
    • View Profile
Re: How to show object states in Activity diagram?
« Reply #3 on: May 28, 2008, 12:07:46 pm »
Thanks Paul, u definitely solved my problem. As I'm modeling business objects flow between systems, I don't need the object to exist more than once in the diagram. I just would like to following the standard UML notation for defining object states (in square blanket) and u have helped me.

thankyou!!

peter.zrnko

  • EA User
  • **
  • Posts: 253
  • Karma: +0/-0
    • View Profile
Re: How to show object states in Activity diagram?
« Reply #4 on: May 29, 2008, 12:34:45 am »
Hold Ctrl when draging an Element from the Project browser and then select "Paste as Instance of Element". In this way you can place more instances of an element in one Diagram.

The problem is that there are two kinds of "instances"
  • UML instaces of UML elements
  • diagram instances
UML instances can be created in the way I've discibed (or in the context menu of an element Advanced / Convert to Instance). UML instance ones created can befound in Project browser.
A diagram instance is created every time you put something on a diagram whether it is an UML element or UML instance of UML element.

Having this in mind, the dialog message you have mentioned could be writen like this:

"This diagram already contains an diagram instance of the element you are trying to paste.  Currently, only one diagram instance is supported, so you cannot paste the element here."
Peter

Paul Lotz

  • EA User
  • **
  • Posts: 248
  • Karma: +1/-0
    • View Profile
Re: How to show object states in Activity diagram?
« Reply #5 on: May 29, 2008, 02:20:25 am »
Peter,

The method you describe (dragging with Ctrl) does not work in the case of objects on an activity diagram.

Paul

peter.zrnko

  • EA User
  • **
  • Posts: 253
  • Karma: +0/-0
    • View Profile
Re: How to show object states in Activity diagram?
« Reply #6 on: May 29, 2008, 04:28:08 pm »
I've tried it and it works in class, sequence and activity diagram as well.
See Paste from the Project Browser.
Peter

Paul Lotz

  • EA User
  • **
  • Posts: 248
  • Karma: +1/-0
    • View Profile
Re: How to show object states in Activity diagram?
« Reply #7 on: May 30, 2008, 02:11:08 am »
Peter,

I am guessing we are not talking about the same thing here.  What you describe works in general for diagram elements on the diagrams you describe, but we are talking specifically about the object elements that appear in activity diagrams (and not in sequence or class diagrams).  From my tests we can only have one instance of an object element on a given activity diagram at this time.

My test: I add an Object element to an activity diagram.  I try to drag the Object to the diagram from the Project Browser.  Whether or not I hold down Ctrl I get the same dialog box from EA telling me I can't do this.

Please let me know if I am missing something.

Paul

peter.zrnko

  • EA User
  • **
  • Posts: 253
  • Karma: +0/-0
    • View Profile
Re: How to show object states in Activity diagram?
« Reply #8 on: May 30, 2008, 04:30:47 pm »
Quote
My test: I add an Object element to an activity diagram.  I try to drag the Object to the diagram from the Project Browser.  Whether or not I hold down Ctrl I get the same dialog box from EA telling me I can't do this.
You are right. There can be only one instance of an Object element in one Diagram (in current version of EA).
Sorry I didn't understand you clearly.
Peter