j.doe
j.doe

Reputation: 1254

How do you return a data object from a subactivity in a UML activity diagram?

I'm trying to create a subactivity that outputs a data object.

Currently, I have a subactivity, Prepare Pack, that adds a Joker card to the Card Pack data object, removes all twos, threes and fours from Card Pack and returns Card Pack.

enter image description here

To model an output I connected the subactivity to Card Pack data object with an arrow. Is this a valid way of illustrating that the subactivity returns Card Pack?

Upvotes: 2

Views: 694

Answers (1)

qwerty_so
qwerty_so

Reputation: 36313

So here is how I would model it. Given you have the sub-activity modeled with containing actions like this

enter image description here

the card deck is fed in via an object node and leaving via a second one. Another view shows that without the inner structure:

enter image description here

(Note that the lying 8 is a decoration from Enterprise Architect to show the the element is clickable and contains a diagram showing its inner structure.)

Now this activity can be used as invocation like this:

enter image description here

Upvotes: 1

Related Questions