Author Topic: Creating ActivityInitial and ActivityFinal  (Read 15725 times)

Jeronimo

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Creating ActivityInitial and ActivityFinal
« on: January 03, 2011, 11:15:32 pm »
Hello,
I try to generate automatically some Activity Diagrams, but I see
no way how to create a ActivityInitial and a ActivityFinal node...
I thought I can specify this by the attribute "type" of the element.
But "ActivityInitial" and "ActivityFinal" is no valid type...
Is there any way to create this elements?

bests,
Jeronimo

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +564/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Creating ActivityInitial and ActivityFinal
« Reply #1 on: January 03, 2011, 11:26:05 pm »
Create a StateNode with subtype = 100 for ActivityInitial and 101 for ActivityFinal

Geert

Jeronimo

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Creating ActivityInitial and ActivityFinal
« Reply #2 on: January 03, 2011, 11:51:00 pm »
Dear Geert,
thank you very much for your quick help!  :)

vrieg

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Creating ActivityInitial and ActivityFinal
« Reply #3 on: June 06, 2023, 04:18:25 am »
I managed to add ActivityInitial and ActivityFinal to an ActivityDiagram. Is there a way to move those elements to a dedicated position? If I readout  diagramObject.left,  diagramObject.right,  diagramObject.top,  diagramObject.bottom of those element it simply returns 0,0,0,0.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8605
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Creating ActivityInitial and ActivityFinal
« Reply #4 on: June 06, 2023, 08:26:09 am »
I managed to add ActivityInitial and ActivityFinal to an ActivityDiagram. Is there a way to move those elements to a dedicated position? If I readout  diagramObject.left,  diagramObject.right,  diagramObject.top,  diagramObject.bottom of those element it simply returns 0,0,0,0.
In its wisdom, EA returns (or at least used to, haven't checked lately) the position last saved to disk, not the position on the live diagram.  So if you haven't saved the element yet, you'll get what you see.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +564/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Creating ActivityInitial and ActivityFinal
« Reply #5 on: June 06, 2023, 02:08:07 pm »
The easiest way is to create the diagramobject with the position string as name.
Something like DiagramObjects.AddNew("l=10;r=200;t=20;b=250", "")

Or update the left/right/top/bottom fields and remember to call Update() to save it to the database

Geert

vrieg

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Creating ActivityInitial and ActivityFinal
« Reply #6 on: June 07, 2023, 04:06:37 pm »
I could meanwhile find out the initial size of ActivityInitial and ActivityFinal
should be left= 10;right= 30;top = -10;bottom = -30;

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +564/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Creating ActivityInitial and ActivityFinal
« Reply #7 on: June 07, 2023, 04:41:42 pm »
For those wondering. If you select an element on a diagram, you can see it's exact coordinates on the bottom left.

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8605
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Creating ActivityInitial and ActivityFinal
« Reply #8 on: June 07, 2023, 09:00:09 pm »
For those wondering. If you select an element on a diagram, you can see its coordinates on the bottom left.

Geert
Are these the same values returned by the API?  Or is it still as it used to be that the API only returns the saved values?

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Creating ActivityInitial and ActivityFinal
« Reply #9 on: June 07, 2023, 09:41:11 pm »
I would "guess" that it's the value from the database and not a life value. You could just have tried this with a little script ;-)

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8605
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Creating ActivityInitial and ActivityFinal
« Reply #10 on: June 08, 2023, 08:13:46 am »
I would "guess" that it's the value from the database and not a life value. You could just have tried this with a little script ;-)

q.
I did!  But my code is nearly a decade old, so it may not be accessing the "latest and greatest".

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8078
  • Karma: +118/-20
    • View Profile
Re: Creating ActivityInitial and ActivityFinal
« Reply #11 on: June 08, 2023, 08:19:45 am »
I would "guess" that it's the value from the database and not a life value.
It's updated live while dragging an object.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8605
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Creating ActivityInitial and ActivityFinal
« Reply #12 on: June 09, 2023, 10:56:52 am »
I would "guess" that it's the value from the database and not a life value.
It's updated live while dragging an object.
The values on screen are, but are the values supplied via the API?  As I mentioned, our code (C# in an add-in) returns only the values last saved, regardless of the position of the item on the screen.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8078
  • Karma: +118/-20
    • View Profile
Re: Creating ActivityInitial and ActivityFinal
« Reply #13 on: June 09, 2023, 11:10:51 am »
Yes. I interpreted the comment that I replied to as being about the position displayed in the status bar and was responding only to that comment.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Creating ActivityInitial and ActivityFinal
« Reply #14 on: June 09, 2023, 07:11:59 pm »
Yes. I interpreted the comment that I replied to as being about the position displayed in the status bar and was responding only to that comment.
Now you made me stumble. Paolo was alking about the API and I was responding to the API behavior. Now you get back to that display on the screen?

q.