Skinparam not working on Activity (old syntax / new syntax) embedded into partition

0 votes
asked Aug 6, 2019 in Question / help by Mike (140 points)
edited Aug 6, 2019 by Mike

Hi,

I try to customize partition and its embedded activity but I don't succeeded ...

I start with the working script :

@startuml

skinparam  partition {
   BackgroundColor<<bluepartition>> blue
}

skinparam  activity {
   BackgroundColor<<redactivity>> red
}


partition "My Partition" <<bluepartition>> {

}
@enduml

If I test the customize of an embedded activity only, it is also working :

@startuml

skinparam  partition {
   BackgroundColor<<bluepartition>> blue
}

skinparam  activity {
   BackgroundColor<<redactivity>> red
}


partition "My Partition"  {
(*) --> Activity 1
--> Activity 2 <<redactivity>>
--> (*)
}
@enduml

But when I customize everything, it is failing :

@startuml

skinparam  partition {
   BackgroundColor<<bluepartition>> blue
}

skinparam  activity {
   BackgroundColor<<redactivity>> red
}


partition "My Partition" <<bluepartition>> {
(*) --> Activity 1
--> Activity 2 <<redactivity>>
--> (*)
}
@enduml

If I try to only customize the partition it also failed :

@startuml

skinparam  partition {
   BackgroundColor<<bluepartition>> blue
}

skinparam  activity {
   BackgroundColor<<redactivity>> red
}


partition "My Partition" <<bluepartition>> {
(*) --> Activity 1
--> Activity 2
--> (*)
}
@enduml

I also try the new activity syntax : ok for the partition customization only :

@startuml

skinparam  partition {
   BackgroundColor<<bluepartition>> blue
}

skinparam  activity {
   BackgroundColor<<redactivity>> red
}


partition "My Partition" <<bluepartition>> {
start
:Activity 1;
:Activity 2;
stop
}
@enduml

But I can't success to customize the new activity syntax with <<redactivity>>

Can someone can help me or explain me the limitation ?

Thank you in advance.

Mike

1 Answer

0 votes
answered Aug 6, 2019 by plantuml (295,000 points)
selected Aug 6, 2019 by Mike
 
Best answer

This is due to some incomplete implementation.

We have fixed this is last beta http://beta.plantuml.net/plantuml.jar so that now you can have:

@startuml
skinparam  partition {
  BackgroundColor<<bluepartition>> blue
}

skinparam  activity {
  BackgroundColor<<redactivity>> red
}

partition "My Partition" <<bluepartition>> {
start
#green:Activity 1;
<<redactivity>>:Activity 2;
stop
}
@enduml

and

@startuml
skinparam  partition {
   BackgroundColor<<bluepartition>> blue
}
skinparam  activity {
   BackgroundColor<<redactivity>> red
}

partition "My Partition" <<bluepartition>> {
(*) --> Activity 1 <<redactivity>>
--> Activity 2
--> (*)
}
@enduml

Is this what you were looking for ?

commented Aug 6, 2019 by Mike (140 points)
I am just trying this BETA version updating manually the Visual Studio Code plugin, dans the result is exactly what I am looking for !!!

I will wait now for an official release !

Thanks for your feedback
commented Aug 16, 2019 by wickedpygmy
Thanks for this great fix!

Just to let you know that it seems to not work well in combination with the multiline text feature. But it works okay if lines are split using \n instead.
commented Aug 16, 2019 by plantuml (295,000 points)
Could you post a short example with the multiline text not working ?

It would help us to fix it!

Thanks!
commented Jan 11, 2020 by CALUM Polwart

It doesn't look like Multi-line code has been fixed.  it works if you manually insert \n in the code but that makes for far less readable code.  I'm expecting to have non-geeks working on my diagrams (I may regret that!) so want to have custom colours (e.g. MyGreen)  but want:

<< MyGreen >>:All on one

line or breaks

unless using \\n to break lines;

to work and certainly on quickly testing at liveuml.com it isn't playing

@startuml

skinparam activity {
  BackgroundColor<< MyGreen >> #3CBC3C
}

<< MyGreen >>:All on one line or breaks;
<< MyGreen >>:All on one\nline or breaks\nunless using \\n to break lines;
#Green:Split over
Two lines;
#3CBC3C:Split over
Two lines;

@enduml

...