Now I have just modelled an iterating-over-all-elements loop with an expansion region/nodes, which is pretty clean and beautiful.Ĭonclusion: imho, in some cases, these structured nodes can help, sometimes simple things are better. However I can imagine that for expressing a larger (maybe >4 cases) switch-case construct, which UML lacked so far, a kind of multi-conditional node (as I have seen somewhere) might be cleaner than a long chain of decision nodes (is 1? no, else - is 2? no, else - is 3?.).Īnd for a long time, I have been looking for a better loop construct which expresses the intention better than a loop made of decision nodes (see some early and still erroneous attempts here: ). See UML 2.5 spec, figures 14.25 for examples. A sequence diagram is a Unified Modeling Language (UML) diagram that showcases the interactions between the objects in a system in sequential order. Alternatively, the condition may be placed inside the diamond and the guard expressions near the control flows would then be true and false (note the equals sign). I agree that a simple decision node is much clearer to read than a conditional node box, because to have 'test' and 'body' in two stacked compartments, visibly interrupting the control flow (connectors!), lets one stumble. One flow has condition and the other has condition false. My interpretation of that would be that the test (and any tests on predecessorClauses) would then act as a guard on that flow. It's also possible to have a control flow directly from the outside into a body. I assume you then want to specify an else body in the second body section.Add an action out an output pin with the value true for the second test.In the properties of the conditional node, create a second clause.In the properties of the conditional node, set that output pin as the "decider" of the first clause.Change the decision node into an action placing the value of NOT(actual position = next position) onto an output pin.Move the control flow from your decision to a new initial node inside the body (removing the guard).Move the target for the control flow from your message directly to the conditional node.This ensures that at least one body will always be executed for the ConditionalNode.Īlterations to your model that I would make for (my interpretation of) conformance) are: The body section for such a Clause will be enabled if and only if no other body section in the ConditionalNode is enabled. Quote: An “else” Clause is a Clause that is a successor to all other clauses in the ConditionalNode and whose test section always results in true. ![]() ![]() (test+body) So an if-else needs to be one clause with a condition, and a second (successorClause) where the condition is always true. The UML specification clearly defines a conditional node as a collection of ordered clauses. (The decision is what is driving it, not the conditional node) In your example, the conditional node may as well not exist. Qwerty - This is at least mostly a valid activity diagram. The following is based on a reasonable ability to read and understand the UML specification and knowledge of EA. ![]() WARNING - This is outside of the scope of my personal usage.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |