Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: Gladio on October 27, 2015, 07:38:59 pm

Title: Object and Control - Flows
Post by: Gladio on October 27, 2015, 07:38:59 pm
Hi all,

I'm kind of confused regarding the usage of Object and Control-Flows in UML.

An Object-Flow is defined as following:
"An object flow is an activity edge that only passes object and data tokens."
Control-Flows are defined as:
"A control flow is an edge that starts an activity node after the previous one is finished."

Problem:
I wanted to model the following scenario:
Action1 (executed first) is passing data to Action2 (executed after Action1).

(http://up.picr.de/23523437au.png)

Question:
1. Is it enough to model this scenario via an Object-Flow (2nd approach in the image)? My concern regarding this procedure is, that an Object-Flow is not the right way to model an "execution-flow" (Control-Flow.
2. Or, do I have to (or can I) connect them with both Flows, an Object and Control-Flow as it is done in the image above, to show the flow of data and control?

Thanks..
Title: Re: Object and Control - Flows
Post by: qwerty on October 27, 2015, 10:38:26 pm
The first shows that the execution goes from 1 to 2. The second shows that an object is passed from 1 to 2. This way it implicitly tells the reader that the execution also passes over from 1 to 2 (to process the passed object). I guess formally correct would be the third combination. But everybody would stumble over this and better understand the second variant. YMMV

Here is what Superstructures says to Controlflow
Quote
A ControlFlow is an ActivityEdge traversed by control tokens or object tokens of control type, which are use to control the execution of ExecutableNodes.

and to Objectflow
Quote
An ObjectFlow is an ActivityEdge that is traversed by object tokens that may hold values. Object flows also support multicast/receive, token selection from object nodes, and transformation of tokens.

Does that confuse enough?
q.
Title: Re: Object and Control - Flows
Post by: Gladio on October 27, 2015, 11:09:56 pm
According to the descriptions, I'd suggest that the last example with both flows, object and control, should be modelled.  :-/
Title: Re: Object and Control - Flows
Post by: qwerty on October 28, 2015, 02:44:49 am
Yes. But honestly I'd favor the middle one. I'd use the latest only if object and control flow reach different actions.

q.
Title: Re: Object and Control - Flows
Post by: Gary on October 28, 2015, 03:04:11 am
It also depends on the "timing" of the inputs. If the object can arrive before the control then you would use both as 2 can only execute if both the object and control tokens have arrived.
Gary
Title: Re: Object and Control - Flows
Post by: KP on October 28, 2015, 10:12:12 am
Quote
2. Or, do I have to (or can I) connect them with both Flows, an Object and Control-Flow as it is done in the image above, to show the flow of data and control?
I can't see your image, but no, don't do that. An Object Flow is also (for want of a better word) "controlling" in that it tells the target node to "do something with this token", so you can think of one as a Control Flow with payload.
Title: Re: Object and Control - Flows
Post by: qwerty on October 28, 2015, 10:50:34 am
KP, your firewall also seems to block your avatar. I just see a question mark icon.

q.
Title: Re: Object and Control - Flows
Post by: Gladio on October 28, 2015, 07:42:47 pm
Thanks a lot for your feedback!!!