Book a Demo

Author Topic: Shape script: child element of child element  (Read 4701 times)

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Shape script: child element of child element
« on: August 16, 2017, 10:43:12 pm »
Hey all,


I'm writing a shape script for an activity, which is intended to contain a composite activity diagram with sub-activities in partitions.

The shape script essentially lists the child activities in a custom compartment. Problem is, when the child activities are placed hierarchically below their partitions, as they should be, they're dropped from the compartment.

It appears the ChildElement shape is only triggered for immediate children of the parent element, not for grandchildren.

Is there a way to get this to work?

Cheers,


/Uffe
My theories are always correct, just apply them to the right reality.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Shape script: child element of child element
« Reply #1 on: August 17, 2017, 12:05:00 am »
I guess not. You might work with embedded diagrams to get around this.

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Shape script: child element of child element
« Reply #2 on: August 17, 2017, 09:40:06 am »
Hey all,


I'm writing a shape script for an activity, which is intended to contain a composite activity diagram with sub-activities in partitions.

The shape script essentially lists the child activities in a custom compartment. Problem is, when the child activities are placed hierarchically below their partitions, as they should be, they're dropped from the compartment.

It appears the ChildElement shape is only triggered for immediate children of the parent element, not for grandchildren.

Is there a way to get this to work?

Cheers,


/Uffe
Hi Uffe,

Just to be clear what you are saying... 

If I have activity P with children C1 C2 C3 and C1 has children G11 G12.  Are you saying that if you place P on a diagram, the compartment will show only C1 C2 and C3.  If you then put C1 on the diagram, then the compartment will only show C2 C3.

If so, then I believe this is by design.  In a number of places, EA has decided, erroneously, that it doesn't need to show stuff in the various compartments (custom or not) of the element.

As regards not seeing G11 and G12 ever, I don't think you can create a context within the shapescript to get you two elements out.

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

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Shape script: child element of child element
« Reply #3 on: August 17, 2017, 06:34:39 pm »
If I have activity P with children C1 C2 C3 and C1 has children G11 G12.  Are you saying that if you place P on a diagram, the compartment will show only C1 C2 and C3.  If you then put C1 on the diagram, then the compartment will only show C2 C3.

Not quite. I never put C1 on the diagram. P is an activity, and G11-12 are activities, but C1-3 are partitions. They are shown in P's composite diagram (which doesn't contain P). I want G11-12 to be listed in P's compartment in the diagram that contains P.

My ChildElement shape checks the child element type and only adds child activities -- not child partitions -- to the compartment. If C1-3 are immediate children of P (not in a partition) they show up in the compartment, but if they're contained in a partition they don't.

I guess another way of asking the question would be: can I write a recursive ChildElement shape?

Quote
As regards not seeing G11 and G12 ever, I don't think you can create a context within the shapescript to get you two elements out.

Yeah, I haven't found a way either. Could with an Add-In, but that's not an option. Suucks.


/Uffe
My theories are always correct, just apply them to the right reality.