Book a Demo

Author Topic: Shape Script for Transition  (Read 4156 times)

richi

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Shape Script for Transition
« on: March 29, 2008, 01:06:24 am »
Hy @ll,

I want to extend Statecharts - Transitions for priorities. Therefore I defined my one Stereotype (extend it from Meta Class “Transition”) and added a Tagged Value “Priority”. Now I want to show this Priority in the Statechart. I defined the following Shape Script:
Code: [Select]
shape main
{
   noshadow = true;
   // hide the stereotype used to draw this shapescript
   HideLabel("middlebottom");
   lineto(100,0);
}

shape source
{
   // composition diamond
   noshadow = true;
   setfillcolor(getUserBorderColor());
  
   println("#TAG:Priority#");
  
}

shape target
{
   // generalisation arrow
  
   noshadow = true;
   setfillcolor(getUserBorderColor());
   startpath();
   moveto(0,0);
   lineto(10,-5);
   lineto(10,5);
   lineto(0,0);
   endpath();
   fillandstrokepath();
}
When I choose in “UML Types” – Windows (Settings -> UML…) the Base Class “Transition” for my Stereotype noting happens!
But when I choose <all> as Base Class everything works fine and my Priority is shown in the diagram.
The problem is that I wanted to use this Shape Script together with a ToolBox Profile and there the Stereotype is extended from Meta Class “Transition”.

Is there an error in my Shape Script?

Thanks.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Shape Script for Transition
« Reply #1 on: April 01, 2008, 08:26:36 am »
If your shape script works when you select <all> then the problem isn't with your shape script.

It appears that the Base Class of Transition isn't recognised and as a result EA is thinking that your stereotype doesn't apply to the target.  If you can't use the shape script when applying it to a profile, then send a bug report to sparx systems support.
« Last Edit: April 01, 2008, 08:26:51 am by simonm »

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Shape Script for Transition
« Reply #2 on: April 01, 2008, 10:31:25 pm »
And do so now. It looks like Sparx is getting back to something like the regular schedule for new build releases. If you report this immediately there is a chance we'll see a resolution by May. [Assuming it is just a question of adding Transition to some list someplace.]
No, you can't have it!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Shape Script for Transition
« Reply #3 on: April 02, 2008, 09:05:41 am »
There's certainly something going wrong here. Try using "stateflow" for the base class instead of "transition", I think that will work. ("transition" should work but doesn't - please send in a bug report and someone will investigate why).
The Sparx Team
[email protected]