Activity diagram - Expansion Region - next iteration?

399 views
Skip to first unread message

cevi...@gmail.com

unread,
Nov 25, 2017, 3:08:00 AM11/25/17
to UML Forum
Hello Everyone!

I'm new to UML and now I have to create some activity diagrams. I hope I understand it quite well, but sometimes I'm not sure which solution satisfies the standard...

My problem now is: I have a list of rooms and I want to throw out rooms that are already booked at the given date (it's an university excercise;)). I've chosen Expansion Region because it seems to be exactly what I need - it does something for every item of the given collection, and I want to check every room for bookings... great. So, if the booking wasn't found, I put this room in a new collection (free rooms) in the output Expansion Node - ok.

And if it was found... I have few versions (at the pictures the ControlFlow arrows are thicker than ObjectFlow):

1. Put the Final Flow Node after the decision node. But Visual Paradigm doesn't allow me to finish an ObjectFlow inside the Expansion Region (outside it it's not a problem). The Fig. 1 shows that I could put the ControlFlow there, but standard 2.5 says "If the primary incoming edge of a DecisionNode is a ControlFlow, then all outgoing edges shall be ControlFlows and, if the primary incoming edge is an ObjectFlow, then all outgoing edges shall be ObjectFlows." [15.3.3.6 p. 387-388]. Not good... Or maybe Visual Paradigm is wrong and it should allow me to finish the ObjectFlow here?



2. Be a cheater and put there an action that takes an input argument - ObjectFlow, then do nothing with it (Fig. 2) and finish the iteration with sending ControlFlow to the FinalFlow Node? (by the way, standard says if there is an ActivityFinal Node inside the Expansion Region, it's finished - but not the whole Activity... But this says nothing about FinalFlow inside the Expansion Region - can we be sure what's its meaning then?). Anyway, I don't like this solution, I don't think it's elegant...



3. Leave only one output of the Decision Node (Fig. 3). But I suppose it breaks this rule: "In order to avoid non-deterministic behavior, the modeler should arrange that at most one guard evaluate to true for each incoming token." [15.3.3.6 p. 388] when the incoming token is "booking_found==true".



4. Have two output collections: free rooms and booked rooms (Fig. 4). When the Expansion Region finishes its work, the collection of booked rooms just go to the FinalFlow Node (no problem to put it here) and I take the collection of free rooms and use it like another objects outside the Expansion Region. My only doubt here is: why would I need to create two collections if I know from the beginning that I'll need only one of them in the future? If I needed both of them it would be a good solution, I think, but... you know what I mean, don't you? ;)

Could you, please, tell me which of the solutions above is the best one, or maybe I've missed something? The most important for me is the UML here, not the process. I want to know what to do with the Expansion Regions in the future :) So I need to know some kind of "instruction continue" (in C++) etc.

I'm sorry for such a long message and I hope the solution is simple :)
Thank you in advance!

Greetings,
Kamila Żelazna

PS
Well, I'm also not sure about output Expansion Nodes. I understand they don't wait forever if they're not given an incoming token ("On the other hand, if each execution may or may not produce a value, then the output collection will have fewer elements than the input collections and the ExpansionRegion will act as a kind of filter." [16.12.3, p.479]) but how does the Region know it's time to go to the next iteration if reaching the "output terminal" everytime is optional?
(I have some experience with programming language LabVIEW that is quite similar to modeling Activities but there are differences like this - in LabVIEW I couldn't make output terminals wait forever...)
activityDoubts.pdf
Auto Generated Inline Image 1
Auto Generated Inline Image 2
Auto Generated Inline Image 3
Auto Generated Inline Image 4
Reply all
Reply to author
Forward
0 new messages