Book a Demo

Author Topic: Component shape scripts - working or not ?  (Read 4666 times)

Oliver F.

  • EA User
  • **
  • Posts: 573
  • Karma: +2/-1
  • Aren´t we all in the model business ?
    • View Profile
    • Karl Storz homepage
Component shape scripts - working or not ?
« on: January 08, 2009, 03:47:19 am »
Maybe it is just me, but I am having a hard time to make my shape script work on stereotyped components and interfaces.

Results when applied on usecase types are very good, however on components and interfaces it seems to be a no-go.

Before I file that bug - can someone please try out the following shape script (including decorations) on a stereotyped component just to see whether it works in general or not ? I do not even get blue and red rectangles to see.

Code: [Select]

shape main
{
      setFillColor(0,0,255);
      rectangle(20,20,100,100);      
}

decoration linkeddocument
{
      setFillColor(255,0,0);
      rectangle(0,0,100,100);
               
      /*if (hasproperty("haslinkeddocument","true"))
      {
         image("document.png",10,10,70,90);
      }*/
}

Thanks in advance.

Oliver

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Component shape scripts - working or not ?
« Reply #1 on: January 08, 2009, 08:44:19 am »
Hi Oliver,

Yes, it works for me (EA 7.1.834). Can't think of any reason why it wouldn't, but a couple of things you might check: does your component element have multiple stereotypes? does the stereotype with your shape script extend the base class "component"?
The Sparx Team
[email protected]

Oliver F.

  • EA User
  • **
  • Posts: 573
  • Karma: +2/-1
  • Aren´t we all in the model business ?
    • View Profile
    • Karl Storz homepage
Re: Component shape scripts - working or not ?
« Reply #2 on: January 08, 2009, 07:41:16 pm »
Quote
Hi Oliver,

Yes, it works for me (EA 7.1.834). Can't think of any reason why it wouldn't, but a couple of things you might check: does your component element have multiple stereotypes? does the stereotype with your shape script extend the base class "component"?

Thanks for the answer- it at least pushed me in a certain direction.
I was able to fix it- all stereotypes also appeared under the Settings->UML dialog which seemed to confuse EA. I have no idea whether this is how it is intended to be- imho stereotypes from profiles should not appear in the stereotype settings menu or at least they should not confuse EA when deciding which one to use.

Another things I noticed: Shapescripts are not applied to interfaces when they are shown using circle notation.
This is annoying if the intention of a decoration is to show a conditional state (in my case: has LinkedDocument) which is not shown then.

I file a bug report for this.

Regards,

Oliver

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Component shape scripts - working or not ?
« Reply #3 on: January 09, 2009, 11:21:51 am »
Quote
Another things I noticed: Shapescripts are not applied to interfaces when they are shown using circle notation.
This is annoying if the intention of a decoration is to show a conditional state (in my case: has LinkedDocument) which is not shown then.

I file a bug report for this.
Yes please!

Paolo
« Last Edit: January 09, 2009, 11:28:33 am by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!