Please provide a way to add Fork without Join (but with Merge) in Activity diagrams

0 votes
asked Dec 22, 2016 in Wanted features by Jens (140 points)
edited Dec 22, 2016 by Jens

A fork node does not require join. In the UML model, both nodes are independent from each other. I want to draw a diagram, in which I "split up" a flow using a join, but I do not want a join node to combine the flows again but a simple merge node instead. From the semantic point of view (activity diagrams use petri net semantics) this should be no problem, you can read the join as and and the merge as or. That is, I want to model that I split up a flow (into two flows), and I do not need both flows to process but only one.

In PlantUML, the fork requires an endfork. Basically, I want to use an endmerge or something like that.

Asciiart:

    |------+
    |      v
o-->|      <>-->O
    |      ^
    |------+

Like that:

An alternative solution would be to add a joinspec, like that:

1 Answer

0 votes
answered Dec 22, 2016 by plantuml (295,760 points)

So here is a beta version https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

In this beta, we support the following syntax:

@startuml
start
fork
:action 1;
fork again
:action 2;
end merge
stop
@enduml

We have just added the end merge syntax.
The code of the beta is really quick and dirty. It works only with 2 branches (for the moment).
The drawing result is the one that you are expecting. Is this correct?
However we really don't like the syntax.

What about using a new join keyword instead, so that we can have:

@startuml
start
join
:action 1;
join again
:action 2;
end join
stop
@enduml

Does it sound better to you ?

commented Dec 22, 2016 by Jens (140 points)
Whau! The first example is exactly what I was looking for, thank you very much!

I also like the syntax of both examples:
- "fork" or "join" just create the node which contains outgoing edges
- "fork again" / "join again" define new outgoing edges
- "end merge" / "end join" defines the node with the incoming edges
I think this is perfectly fine.

And the same is working with split (and split again / end split). I like that.

Oh, end then if you introduce another features like "edges" (with "edges again" and "edges end") which creates a node with multiple outgoing (or incoming) edges, then its very close to the UML spec. (example: http://imgur.com/a/n4vDy )

Thank you very much for the quick reply and solution! I'm really impressed!
commented Dec 22, 2016 by plantuml (295,760 points)
Ok, as I said we did it very quickly and in a dirty way.
We really have to refactor our code, and adding "edges/edges again/edges end" should be easy then.
We are having several days off now, so you probably won't hear any news before next year.
I'll post a message here when next beta version will be ready.
Thanks also for your suggestion!
commented Jun 27, 2018 by Michael W.
Any news on this one?
commented Feb 20, 2019 by Frédéric Guérin
As of 2019-02-20, the "end merge" feature does not work with swimlanes :(
...