Book a Demo

Author Topic: Do RelatedElement shape scripts work at all?  (Read 7712 times)

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Do RelatedElement shape scripts work at all?
« on: December 12, 2014, 10:13:35 pm »
Hi!


I'm working on a profile with some shape scripts, and I need to use the RelatedElement script -- but it doesn't seem to work. At all. Even copying the scripts from the help file gives no results.

Let's say I create a stereotype with the following shape script:
Code: [Select]
shape RelatedElement {
      SetCompartmentName("connections");
      AppendCompartmentText("Element.Name");
}

shape ChildElement {
      SetCompartmentName("kiddies");
      AppendCompartmentText("#Name#");
}
I then create an element (S) with that stereotype, plus one child element which I place inside it in the project browser.
I also create two other elements (X and Y). I draw a Dependency from X to S, and one from S to Y.

The diagram displays the "kiddies" compartment, and I can select presentation of it in the corresponding dialog, all's well.
But the "connections" compartment doesn't show up at all.

Is this thing simply not working, or am I doing something wrong?
I have tried the sample scripts exactly as they appear in the help file (with the check for connector type etc) -- no go. I've also tried just setting a fix text in the compartment -- nope-a-dope.

I'm on 1107, but there's no mention of any changes to the shape scripts anywhere in the 11.1 history.

Any clues?

Cheers,


/Uffe
« Last Edit: December 15, 2014, 09:50:54 pm by 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: Do RelatedElement shape scripts work at all?
« Reply #1 on: December 12, 2014, 11:28:16 pm »
I guess it does not work. Just tried the example in the help and it produces a black box for the class.

q.

P.S. In 9.3 it's not black. But else it does not show anything other that the stereotype.

P.P.S. ... simply since this did not exist in 9.3 ;D

P.P.P.S. In V10 it's black too but not listed in the help.
« Last Edit: December 12, 2014, 11:35:19 pm by qwerty »

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Do RelatedElement shape scripts work at all?
« Reply #2 on: December 12, 2014, 11:46:16 pm »
Yeah it was introduced in 1105, so it probably won't work before that. :)
Did you try it on 11.1?
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: Do RelatedElement shape scripts work at all?
« Reply #3 on: December 13, 2014, 03:54:34 am »
I used build 1107. But the V12 beta looks the same.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Do RelatedElement shape scripts work at all?
« Reply #4 on: December 15, 2014, 09:11:36 am »
Check the feature visibility (Ctrl+Shift+Y) and that the related element is not on the diagram.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Do RelatedElement shape scripts work at all?
« Reply #5 on: December 15, 2014, 05:22:32 pm »
That does not change anything. The class displays still as a solid black block. Just "eat your own dog food" and try the example from the help.

q.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Do RelatedElement shape scripts work at all?
« Reply #6 on: December 15, 2014, 09:50:34 pm »
Quote
Check the feature visibility (Ctrl+Shift+Y) and that the related element is not on the diagram.
Ah! Got it!

But the two behaviours are inconsistent.
  • In both cases, the compartment is not shown if the child / related element is in the same diagram.
  • With ChildElement, removing the element from the diagram makes the compartment show up immediately (in the diagram and in the feature visibility dialog).
  • With RelatedElement, on the other hand, you must close and reopen the diagram to see the compartment. Just saving it doesn't work. Opening the dialog seems to take longer, but the compartment is not in there. After closing and reopening the diagram, it works as expected.
I should clarify that I'm not getting any black blocks. When the compartment doesn't display, it's simply not there and the element displays as normal.

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: Do RelatedElement shape scripts work at all?
« Reply #7 on: December 16, 2014, 12:12:06 am »
So why do I see the black box? I use exactly the shape script from the help. It does not look right in any way.

q.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Do RelatedElement shape scripts work at all?
« Reply #8 on: December 16, 2014, 10:51:11 am »
Quote
So why do I see the black box?
If you look in the UML Types dialog, is the default fill colour for the stereotype set to "Black" or "Default"?
The Sparx Team
[email protected]

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Do RelatedElement shape scripts work at all?
« Reply #9 on: December 16, 2014, 04:56:55 pm »
Quote
That does not change anything. The class displays still as a solid black block. Just "eat your own dog food" and try the example from the help.
Using that analogy I would eat, drink, breath, sleep our own dog food.

Everyone here uses EA well beyond just testing new changes. That doesn't mean that I can copy every example from the help and use it just because you're having a problem.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Do RelatedElement shape scripts work at all?
« Reply #10 on: December 16, 2014, 09:16:48 pm »
Quote
Quote
So why do I see the black box?
If you look in the UML Types dialog, is the default fill colour for the stereotype set to "Black" or "Default"?
It's set to black. :o Why? Does that make sense?

q.