As Thomas Kilian described here, normal behavior of nodes of Activity diagrams with tokens is:
A node becomes active when at all of its incoming
InformationFlow connectors
a token has arrived. When the node finalizes it sends single tokens along all its outgoing InformationFlow connectors.
But also he added:
There are special nodes like fork and merge which behave a bit different
I know that behavior of "merge" node differs because it becomes immediately active by receiving first token and accepts one among several alternate flows. But what is the difference between behavior of fork/join nodes with tokens with normal behavior?
Merge
- andDecisionNode
s look the same, but are different elements: .In a diagram you can only distinguish both by looking at the incoming and outgoing
InformationFlow
s. The first has multiple incoming and one outgoing while the second has the opposite relation. AMergeNode
accepts any incoming token and forwards it directly to its single outgoingInformationFlow
. So unlikeAction
s it will not wait for all tokens. TheDecisionNode
in contrast accepts only a single token and lets it pass to only one of its outgoingInformationFlow
s. It is the modeler's responsibility to set guards in a way that only one evaluates to true. If there are more (or even unguarded)InformationFlow
s the token will take any arbitrary free route.Fork
andJoin
are also two different elements which look the same: (or vertically).You can also distinguish them by the number of in-/outgoing
InformationFlow
s.Fork
has one in and multiple out andJoin
vice versa. AFork
will send as many tokens as it has outgoingInformationFlow
s once a token arrives at its single incomingInformationFlow
. TheJoin
will (likeAction
s) wait for tokens arrive at all of its incomingInformationFlow
s. Only then it will emerge a single token at its single outgoingInformationFlow
.So while
Merge
- andDecisionNode
s control the flow of a single token (execution path)Fork
andJoin
are used to start and synchronize parallel execution paths.