2

UML/SysML Activity Diagrams - Can a Decision Node element be hanging? (i.e., no (visible) incoming edge.)

I have quite a large activity diagram with three main parallel object flows (with merging data, just to make it even more complicated) until activity completion.

Towards the end of the activity, I have a Decision Node element that selects (based on some "global" variable) which of the parallel object flows provides the activity output. For the selection I used a Decision Node element.

As a temporary simplification, I did not add the usual incoming edge to the Decision node. I left it "hanging in the air". Although the meanning is intuitive, is this allowed in strict UML/SysML?

The reason why I did it (obviously...), is that to add the incoming edge I would have to add 3 more edges (from the 3 parallel flows) and also a few more joins -- which makes an already busy diagram, even busier.

And no - I can't split it into sub-diagrams. It is what it is.

2 Answers 2

4

(Update due to @Axel's comment) If a decision node has no ingoing edge it will immediately fire a token.

UML 2.5.1 states on p. 378

nodes that do not have incoming edges and require no input data to execute are immediately enabled.

It's questionable that the condition of a decision note can be understood by anyone if it's starting out of nowhere.

It's futile to refrain from splitting. If your diagram gets that large it can not be read by anyone and will be useless. So either you get to the point where you can cut it into manageable pieces or you are at the wrong place. There is no king's way (Euclide).

Sign up to request clarification or add additional context in comments.

9 Comments

I agree that a diagram should be cut in manageable pieces. However, the decisionnode would not be dead but fire a token immediately: UML 2.5.1 nodes that do not have incoming edges and require no input data to execute are immediately enabled. I guess, this is also not what avi wanted. Therefore, I would model the edges, but hide them in the diagram. Of course, this will confuse the readers, so it should be made clear in the description. And there should be a diagram, where all edges are shown. There is nothing wrong in having multiple diagrams for one activity.
@AxelScheithauer Oh! I was not aware of that. I will fix my answer.
@AxelScheithauer Re-reading I wonder whether a DecisionNode would need input in order to execute since it (usually) decides on a prepended action doing some check.
There could be a decision input flow from the prepended action. But this is optional. You could say, this inputflow has been omitted for brevity. However, the guards could instead also simply evaluate a global variable.
Hi all - Thank you all so much for yoiur answers.
|
2

Per UML 2.5.1, section 15.3.3.6, Decision Nodes, pg 390:

A DecisionNode shall have at least one and at most two incoming ActivityEdges, and at least one outgoing ActivityEdge. If it has two incoming edges, then one shall be identified as the decisionInputFlow, the other being called the primary incoming edge.

Additionally, it is the token on the primary incoming edge that traverses the outgoing edge in which the guard evaluates to true. If the decision node has only one incoming edge and the incoming is an object flow the value of that token is used to evaluate the guards. If the node has a decision input flow the value of that token is used in the evaluation of the guards only. Bottom line is a decision node SHALL have at least one incoming edge, and if it has only one incoming edge it is the primary incoming edge. If you don't include an incoming edge it is semantically incorrect.

3 Comments

You are right. There is even a formal constraint incoming_outgoing_edges to this effect. However, many tools don't enforce this rule and honestly, it would be very annoying to get all these error messages. What is the interpretation of a formally incorrect activity? You could say, an incorrect activity is meaningless. Or you could read between the lines of the specification. I read there, that such decision nodes get a token. But of course, in between the lines the ink is invisible, so it is open to debate. PS: The Cameo simulation engine will not give it a token.
Hi, > Bottom line is a decision node SHALL have at least one incoming edge, I agree. But I might hide (elide) it (because, as mentioned above, it seems it brings with it a mechanism comprising 3 additional incoming edges). Thanks.
Thanks everybody for all the answers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.