See the following code for example. How can I model different return values of a function in a UML Activity-Diagram?
typedef enum {CLOSED, OPEN, UNKNOWN} sw_state_t;
sw_state_t read_input(int index)
{
uint8_t sw_state;
if (spi_read(&sw_state) == STATUS_OK) {
if (sw_state & (1 << index))
return CLOSED;
else
return OPEN;
}
return UNKNOWN;
}
What I want to show is the value the function returns. What I have is an Activity block with one input ActivityParameter and one output ActivityParameter.
Update
Does the following diagram make sense?