archimate sprites with "-" in them

0 votes
asked Jan 19, 2021 in Question / help by Marten

Hi,

I want to draw an archimate diagram with some "interface" and "interface-required"
However the syntax does not seem to like sprites with "-" in them, so "interface-required" will not work.

Is there a way to make this work without "wrapping" (e.g. rectangl) them in a new symbol? 

This works fine 


rectangle "hello" as hello
interface "provider" as provider

provider -- hello


This does not. 
 

rectangle "hello" as hello
interface "provider" as provider
interface-required "req" as req
provider -- hello
req -- hello


Cheers

/Marten

commented Jan 20, 2021 by Martin (6,780 points)

I think you're confusing sprites and shapes.  Interface and Interface-require are both available as sprites - which go inside shapes (usually rectangles).

There is a special shape called archimate which draws a rectangle and lets you specify the sprite a bit easier:

archimate #technology "text" as A <<interface>>

But you can use any plantuml shape, such as rectangle, with a slightly different syntax:

rectangle #technology "text" as A <<$archimate/interface>>

For example you can use the 'cloud' shape :

cloud #technology "text" as A <<$archimate/interface>>

Now what I think has confused you is that there is actually a shape called interface (for use in the Deployment style diagrams).   So the following works:

interface #technology "text" as B <<$archimate/interface>>

(for some reason I had to draw it twice to get the sprite, probably a bug! to do with the shape not being big enough to contain the sprite)

However there is no shape called interface-required.  In fact only a few sprite names and shape names coincide (eg actor, component, node).  The majority of the archimate sprite names do not exist as shapes.  And many shape names (eg control, entity, stack) don't exist as sprite names.

Hope this helps.

PS

'label' is an empty shape, so you can display just the icons, but they are a bit small.

PPS

The wonderful thing about PlantUML is that although it looks simple, the number of permutations of features is incredible.  For example I found you can do this!  (I'm not suggesting it is useful for you, but it's amazing that you can do it!)

commented Jan 20, 2021 by Marten
Indeed I did not understand the difference between sprites and shapes.
This was very helpful.

Thanks a bunch

Cheers
/Marten
commented Jan 20, 2021 by The-Lu (37,840 points)

Hello all,

The only downside is that it is not vectorial, and that we see the pixels...
It will be perhaps good to have a port on SVG...

Regards,
Th.

1 Answer

0 votes
answered Jan 19, 2021 by The-Lu (37,840 points)

Hello M.

If you want, you can use stereotype ('<<' and '>>')  for that, as:

@startuml
rectangle "hello" as hello
interface "provider" as provider
interface "req" as req <<required>>
provider -- hello
req -- hello
@enduml


[See on online server]

If that can help,
Regards,
Th.

commented Jan 19, 2021 by Marten

Hi Th

Thanks for the answer, but it's not quite what I'm after or I'm miss-understanding something.  I want to use "interface-required" and not "interface" and the stereotype does not help here, If I place "interface-required" first as in

interface-required "foo" as foo

it's a syntax error. I can use the "interface-required" sprite only if I embed it in another sprite that does not have a "-" in it, ie as done here https://plantuml.com/archimate-diagram

commented Jan 19, 2021 by The-Lu (37,840 points)

Hello M.

Here is an example with archimate stereotype [See the full documentation on https://plantuml.com/archimate-diagram], with:

interface "req1" as req1 <<$archimate/interface-required>>

or

archimate #Business "req2" as req2 <<interface-required>>
@startuml
rectangle "hello" as hello
interface "provider" as provider
interface "req1" as req1 <<$archimate/interface-required>>
archimate #Business "req2" as req2 <<interface-required>>
provider -- hello
req1 -- hello
req2 -- hello
@enduml


[See on online server]

If that can help,
Regards,
Th.

commented Jan 20, 2021 by Marten
Thanks! That helps

Cheers

/M
...