Author Topic: Understanding Sequence Diagrams in detail  (Read 1743 times)

MouseOfLight

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Understanding Sequence Diagrams in detail
« on: May 05, 2022, 09:36:09 pm »
Dear All,

i'm new to the forum - therefore please correct me of something doesn't fit...

i'm currently analysing the behaviour of sequence diagrams. I would like to understand when a lifeline is activated or deactivated.
My current understandig is:

 - EA has a builtin logic which defines when a lifeline is activated or deactivated
 - the user can modify this behaviour through the user interface - extend activation or end activation or ...
 - these user modifications are stored in the database - in PDATA4 and connector.StateFlags.

Currently i'm retrieving these parameters from the database and the object model:

Code: [Select]
// Get PDATA4 from sql database - 1 means "is-return" is set and lifeline is deactivated
entry = Repository.SQLQuery ("SELECT PDATA4 FROM t_connector WHERE Connector_ID = " + connector.ConnectorID);

// Get value from PDATA4
isReturn = getValue ("<PDATA4>", "</PDATA4>", entry);

// get stateflags
entry = connector.StateFlags;

// check for keywords related to activation
activate    = getValue ("Activation=", ";", entry);
extendUp    = getValue ("ExtendActivationUp=", ";", entry);
actStopUp   = getValue ("StopActivation=", ";", entry);
actEndUp    = getValue ("EndActivation=", ";", entry);
actInitiate = getValue ("Initiate=", ";", entry);

...
// Here comes the "magic" ...
if ((activate == 0) &&
(isReturn  == 0) &&
(actStopUp == 0) &&
(actEndUp  == 0) &&
(extendUp  == 0) )
{
-> activate lifeline
} else
{
-> deactivate lifeline
}

But what i miss are the rules according to what are the unmodified lifelines are activated or deactivated.

Is there a description available?

Try and error leads to an extensive statemachine ... which will be probably faulty.

Best regards

Mouse
« Last Edit: May 05, 2022, 09:40:29 pm by MouseOfLight »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Understanding Sequence Diagrams in detail
« Reply #1 on: May 05, 2022, 10:33:39 pm »
Prepare for the statemachine. A lifeline starts from top and only when a create message is used then you have the object creation at th message and else on top. The final destruction is controlled by some option (good luck in finding it in the option jungle) where you can turn off garbage collection. This is on by default which is why after the last message EA renders the X for object destruction. There is also a way to send a delete message which will render the X prematurely.

q.