Author Topic: Activity Diagramm: Structured Activity - Loop Node  (Read 3125 times)

hglathe

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Activity Diagramm: Structured Activity - Loop Node
« on: June 18, 2009, 02:18:41 am »
Hi

How is it possible to define the setup, test and body sections (with Enterprise Architect) when I add a Structured Activity with Stereotype <<Loop>> (a Loop Node).



The documentation describes the loop node as follows:
"Loop node - represents a sequence of activities that are - or can be - repeated on the same object." ... "The OMG UML specification (UML Superstructure Specification, v2.1.1, pp. 384-385) states:

A loop node is a structured activity node that represents a loop with setup, test, and body sections.

Each section is a well-nested subregion of the activity whose nodes follow any predecessors of the loop and precede any successors of the loop. The test section may precede or follow the body section. The setup section is executed once on entry to the loop, and the test and body sections are executed repeatedly until the test produces a false value. The results of the final execution of the test or body are available after completion of execution of the loop.".

Thanks in advance, Helko

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Activity Diagramm: Structured Activity - Loop
« Reply #1 on: June 18, 2009, 07:35:01 am »
Hi Helko,

In the EA Help index, loop up Structured Activity. That should set you on the correct track.

HTH, David
No, you can't have it!

hglathe

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: Activity Diagramm: Structured Activity - Loop
« Reply #2 on: June 18, 2009, 05:11:17 pm »
Hi David.

No sorry, but the Help Index tracks me to the help content I've already found when right clicking on a structured activity element.

Information about types of structured activities and particular what types of sections a loop activity has is described their. But no further information on how a define such sections.

Regards, Helko

philchudley

  • EA User
  • **
  • Posts: 686
  • Karma: +17/-0
  • UML/EA Principal Consultant / Trainer
    • View Profile
Re: Activity Diagramm: Structured Activity - Loop
« Reply #3 on: June 18, 2009, 08:42:06 pm »
There are two approaches, but I would use the following:

1) Create an Activity (not a Structured Acivity) element on the diagram and set its stereotype to loop
2) Right-click the Activity and select Advanced | Partition Activity
3) Create three partitions labelled setup body test
4) You can now resize the Activity and partitions as required
5) Using Actions, create Action elements inside the partitions to model each section of the iteration

Note this is not exact to OMG specifications, but I think you'll find it close enough.

Cheers
Phil
follow me on Twitter

@SparxEAGuru

hglathe

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: Activity Diagramm: Structured Activity - Loop
« Reply #4 on: June 18, 2009, 08:56:22 pm »
Ok - Thank you!

It's a compromise but it works.

But when using a Conditional Activity this solution will not be working, because a Conditional Node may have lots of clauses. And each will be subdivided into a test and body section (SubPartitions needed).

Or is their also a solution to model a Conditional Activity?

Regards, Helko


philchudley

  • EA User
  • **
  • Posts: 686
  • Karma: +17/-0
  • UML/EA Principal Consultant / Trainer
    • View Profile
Re: Activity Diagramm: Structured Activity - Loop
« Reply #5 on: June 18, 2009, 09:13:11 pm »
I think this originates in a Sparx misunderstanding of "Structured Activity" which they have implemented as a "Composite Activity" (one that links to another diagram -- should this be the fork symbol and not the spectical symbol? That's another question!)

I would guess that Sparx's approach in using their variations of the Structured Activity Conditional, Loop Sequential, is not to follow the OMG spec at all!  :) Since this gives a stereotyped Structured Activity linked to child diagram. This would involve modelling the conditional, loop and sequential logic on separate diagrams.

With reagrds to the "workaround" applying to a conditional activity, then as we are just dropping elements onto other elements, could create a Loop Activity separately on the diagram and then drag and drop this into a conditional partition. Similarly with nested conditionals.

You are absoultely correct in that nested partitions cannot be created in an Activity.

Not ideal workarounds, but the best we can achieve at the momment.
follow me on Twitter

@SparxEAGuru