Welcome to PlantUML Q&A, where you can ask questions and receive answers from other members of the community.

You can also submit new features request and vote for them.

Partitions (group of actions) in Activity Diagram Beta

0 votes

Hello,

I would like to have partitions that could represent groups of actions, or "activities".

Example:

partition ":go up the stairs;" {

 :go up first step;
 :go up second step;
 if (tired) then(yes)
   :stop a bit;
 endif
 :go up last steps
}

The idea of partition (which I want to distinguish from swimlane), is included in the old syntax of activity diagrams.

Is it also currently present in the syntax of activity diagrams BETA? Otherwise I'd like to ask that it be implemented.

Note: this "partition" feature could be used as well to embed the whole activity inside a partition frame, and not just a subgroup of actions.

asked May 29, 2014 in Wanted features by villarejo (350 points)

1 Answer

0 votes

Wow this is great!

One issue is that partitions are not independant

 

partition ":go up the stairs;" {
 
 :go up first step;
 :go up second step;
 if (tired) then(yes)
   :stop a bit;
 endif
 :go up last steps
}
 
partition ":go up the stairs;" {
 
 :go up first step;
 :go up second step;
 if (tired) then(yes)
   :stop a bit;
 endif
 :go up last steps
}
 
answered Aug 20, 2014 by Luc Trudeau (460 points)
Actually, there is missing ";" on the ":go up last steps", which cause this strange & unexpected behaviour...

Corrected version:

@startuml
partition ":go up the stairs;" {

 :go up first step;
 :go up second step;
 if (tired) then(yes)
   :stop a bit;
 endif
 :go up last steps;
}


partition ":go up the stairs;" {

 :go up first step;
 :go up second step;
 if (tired) then(yes)
   :stop a bit;
 endif
 :go up last steps;
}
@enduml

http://www.plantuml.com/plantuml/png/pSx13OCm38NXkwTuuWGha6dIng6MgiIApG4XTYULW1bw_PxrongRYqij6EQbObNuXs4UfLaOi1FXyjp5-y8Q7ZD-rv9kb8pHfN6QVf4oRcmJ0PZDgoBY9Twlk2J9J-4RhwW5EeX8_-cV4m00
Nice. Thank you. Partitions work great.
Thanks!, still there's an arrow between both partitions. If it was possible to trigger the isKilled() method by using a special notation this would solve the problem

For example:
@startuml
partition ":go up the stairs;" {

 :go up first step;
 :go up second step;
 if (tired) then(yes)
   :stop a bit;
 endif
 :go up last steps)
}


partition ":go up the stairs;" {

 :go up first step;
 :go up second step;
 if (tired) then(yes)
   :stop a bit;
 endif
 :go up last steps)
}
@enduml

Notice the ")" instead of ";" in " :go up last steps)". I've already hacked it, but I can't modify the activitycommand regex. My mental regex parser needs more training :)
Yes, some regex have been generated by random, and once they are working, we do not modify them any more :-)

Speaking about arrows, there is a working feature that we are going to document soon (this is already working):
@startuml
:foo1;
-> You can put text on arrows;
if (test) then
  -[#blue]->
  :foo2;
  -[#green]-> The text can
  also be on several lines
  and **very** long...;
  :foo3;
else
  -[#black]->
  :foo4;
endif
-[#gray]->
:foo5;
@enduml

http://www.plantuml.com/plantuml/form?url=HSmz3i8m38RXFQUmn0AHCl2tr59FmO8GGzewj2AAgyGHS7iI2cBq-rbFuvYtg4mBPyxGsm1p5X1w2d006oC_4gh9mLeeoGPafA00p6NL-KnNqvQZASOEbtgBHA5aE8sqCDNKkcC_Q8tVxpqgyeb-aEtlV-bGjZ1CJdqq-wfBxKTy0m00

Rather than using ")" [this begins to be too cryptic somehow], we are thinking about extending the -[#color]-> notation to something like:

:foo1;
nolink
:foo2;

In this case "nolink" would mean that there are no arrow between foo1 and foo2.
What do you think about it ?
Sounds great!

Will it also be possible to position partitions? Something like top, left, right, or bottom?

Let me know if I can help.
Support This Project Offer 250 Mo! Follow PlantUML on Twitter
...