Book a Demo

Author Topic: Simple Counter, Complex thinking  (Read 4265 times)

GeeBhawllar

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Simple Counter, Complex thinking
« on: December 05, 2012, 03:59:40 am »
Hello all,

I am stuck, I need help

I have an activity diagram that contains some action elements in swim lanes. Some swim lanes have more than one partition.

I am trying to count the number of action items in each swimlane and then save it in a temporary csv file, one value for each swim lane.

Each swim lane has a different weight to be attached to it, i hope to do a computation based on the swimlane and the number of action items, I also hope to bring the final result back into an element in EA.

Can anyone help? :D

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Simple Counter, Complex thinking
« Reply #1 on: December 05, 2012, 06:38:30 pm »
Gee,


There's a difference between ActivityPartitions and Swimlanes. If you are using ActivtiyPartitions then EA should nest the actions in the appropriate ActivityPartition when you move them on such a partition on the diagram.
So you can get a list of action if you use the Elements collection of the ActivityPartition Element.
But beware, this only counts for ActivityPartitions, not for swimlanes. Swimlanes in EA are a purely visual thing, they don’t really represent anything. If you really need to know something about which element is shown on which swimlanes you'll have to compare the coordinates of the swimlanes with those of the DiagramObjects for the Actions -> not fun. ::)

If I were you I would ban the use of swimlanes in favor of ActivityPartitions.

Geert

Paulus

  • EA User
  • **
  • Posts: 152
  • Karma: +0/-0
    • View Profile
Re: Simple Counter, Complex thinking
« Reply #2 on: December 05, 2012, 07:07:22 pm »
I agree with Geert, but if you want to give it a try: i created an SQL some time ago that does something similar: it determines text elements contained within a boundary element 'Toelichting' on a diagram.

That should get you started.

Here's the SQL string (in vbscript):

Code: [Select]
Dim RTFGEN_SQL_DGM_REMARKSFORDGM: RTFGEN_SQL_DGM_REMARKSFORDGM = _
" select tlo.Note as REMARK" &_
" from t_diagram d" &_
"            ,t_diagramobjects do" &_
"            ,t_object o" &_
"            ,t_diagramobjects tl" &_
"            ,t_object tlo" &_
" where  tlo.object_id = tl.Object_ID" &_
"            and tl.diagram_id = d.diagram_id" &_
"            and o.object_id = do.object_id" &_
"            and do.diagram_id = d.diagram_id" &_
"            and o.Name = 'Toelichting' and o.object_type = 'Boundary'" &_
"            and tlo.object_type in ('Note','Text')" &_
"            and tl.RectTop <= do.RectTop " &_
"            and tl.RectLeft >= do.RectLeft" &_
"            and tl.RectRight <= do.RectRight" &_
"            and tl.RectBottom >= do.RectBottom" &_
"            and d.ea_guid = '{0}'"

GeeBhawllar

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Simple Counter, Complex thinking
« Reply #3 on: December 06, 2012, 02:06:55 am »
Thanks!!!