Page 1 of 1

Decision nodes in the activity diagrams

PostPosted: Tue Dec 02, 2014 4:13 pm
by esa.heikkinen@tut.fi
Hello

I have hard to understand how should the decisions nodes work in activity diagrams (with simulation).

I want to make the branching depends on value of certain class-variable (Boolean-type: True or False).

Are there exist some good example (*.mdzip) how to do that ?
I found there are lot of examples in samples/simulation-directory of magicdraw, but which one could be suitable for my case ?

Re: Decision nodes in the activity diagrams

PostPosted: Thu Dec 04, 2014 3:37 am
by kritsana_u
Dear Esa,

Here is the sample model which show you how to use the decision node in simulation.
In Cameo Simulation Toolkit, you can use the decision node both with and without the decision input.

- If the incoming edge of the decision node is a control flow and you use the decision node without the decision input, Cameo Simulation Toolkit will evaluate the guard condition of each outgoing edge. Cameo Simulation Toolkit will go to the first outgoing edge whose guard condition is true.
- If the incoming edge of the decision node is an object flow and if you use the decision node without the decision input, Cameo Simulation Toolkit will evaluate the guard condition on each outgoing edge (control flow) and it will go to the edge that the result of evaluation is equal to the token flowing through the incoming edge.
- If the incoming edge of the decision node is a control flow and you use the decision node with the decision input (decision input must have one return parameter), Cameo Simulation Toolkit will evaluate the decision input for the value of return parameter. Then, it will compare the value of the return parameter with the value specified on the guard of each outgoing edge. Cameo Simulation Toolkit will go to the edge whose guard condition has the same value as the value of return parameter of the decision input.

System.png


- You can also use the decision node with decision input when the incoming edge is an object flow. The token flowing through the incoming edge will be passed to the decision input as an argument. You can see more information about decision node, decision input and decision input flow in the OMG UML Superstructure Specification.

Best regards,

Kritsana U.

You can also use the decision node with the