Drawing decision and merge nodes
About this task
decision nodes show branching conditions.
A decision node can have only one incoming flow and two or more outgoing
flows. The outgoing flows are labeled with a distinct guard condition
and no event trigger. A predefined guard, denoted [else]
,
can be used for no more than one outgoing flow.
A merge node combines different flows to a common target.
Procedure
- To draw a decision node, click the decision node button .
- Click, or click-and-drag, in the diagram to position the decision node where you want it.
- Draw at least two actions that will become targets of the outgoing flows.
- Draw an incoming flow from the source action to the decision node.
- Draw and label the outgoing flows from the decision node to the target actions.
- To draw a merge node, click the merge node button .
- Click in the diagram to place the junction at the intended location.
- Draw flows going into, and one flow going out of the junction.
- Label the flows if you want.
Results
The following diagram shows the following
behavior: When the phone rings, if someone picks up on the other end,
you can talk; otherwise, you must leave a message. The decision node
represents the decision point. In other words, after the PhoneRings()
operation,
if SomeonePicksUp
resolves to True
,
the Talk()
operation is called. Otherwise, the LeaveMessage()
operation
is called.
Use the Display Options window to determine whether to display the name, label, or nothing for the decision node.