Book a Demo

Author Topic: Dashed-line Notation for Control Flow  (Read 7126 times)

henagon

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Dashed-line Notation for Control Flow
« on: March 23, 2015, 06:49:25 am »
Hi,

I'm a new user of EA (v11) and am utilising the SysML v1.3 toolbox.

I am creating an Activity Diagram, and have specified a Control Flow between two actions.

By default, EA shows the Control Flow as a solid line. This is identical to the way in which EA shows an Object Flow.

To add clarity to my diagram, I would like to show the Control Flow as a dashed-line.

This aligns with the SysML spec, and most example activity diagrams I have seen.

For example, see the dashed-line control flows on the left of this diagram (and compare with the solid-line object flows on the right):


Can anyone suggest how to achieve this with EA?

Kind regards,
henagon

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Dashed-line Notation for Control Flow
« Reply #1 on: March 23, 2015, 09:20:37 am »
Create a stereotype, give it this shape script, and apply the stereotype to all of your control flows

Code: [Select]
shape main
{
      noshadow=true;
      setlinestyle("DASH");
      moveto(0,0);
      lineto(100,0);
}

label middlebottomlabel
{
      print("");
}
The Sparx Team
[email protected]

henagon

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Dashed-line Notation for Control Flow
« Reply #2 on: March 23, 2015, 08:38:47 pm »
Hi KP,

Many thanks for your extremely swift response.

I have implemented your suggestion, and learnt a lot about stereotypes and Shape Script in the process - thank-you!

This 'almost' does what I need - but not quite.

I have a Control Flow defined from a decision node, with a guard specified, which by default looks like:


I would like to display the guard on the diagram, and style the Control Flow with a dashed-line.

Implementing your suggestion - the Control Flow has a dashed-line but the guard is not displayed:


I modified the Shape Script to remove the 'label middlebottomlabel { ... }' portion. The guard is now displayed, but unfortunately so is the stereotype name which adds significant clutter to the diagram:


Reading the description at this website https://leanpub.com/shapescript/read#leanpub-auto-hash-tags, I tried modifying the Shape Script with the following:
Code: [Select]
label middlebottomlabel { print("#guard#") }
Unfortunately this does not work - the guard is still not displayed.

Any ideas where I'm going wrong?

Kind regards,
henagon

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Dashed-line Notation for Control Flow
« Reply #3 on: March 23, 2015, 10:35:21 pm »
To suppress the control flow stereotype labels you could try

1) Open Diagram Properties
2) Select Connectors
3) Uncheck Show Stereotype Labels


Phil
Models are great!
Correct models are even greater!

henagon

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Dashed-line Notation for Control Flow
« Reply #4 on: March 23, 2015, 11:49:20 pm »
Hi Phil,

Perfect!



Many thanks,
henagon