2
votes

while learning UML activity diagrams I saw some different explanations about the object flow and am kind of confused.

enter image description here

Consider the naive picture above with the UML 2.2 semantics. Every time this activity "Robot do sth" is called, a robot should go to its working position and process the workpiece. Afterwards, the robot will go back to the idle position and the processed workpiece would be sent back through the output parameter.

The problem here is just, is the object flow from the input parameter treated as a precondition for the action "processing" besides the control flow above it? Or similarly, will the "processing" action take place, if the input control flow is hit by a token but there is no workpiece ready on the input object flow?

1

1 Answers

2
votes

Things can happen in parallel. When the Activity is started, the robot turns (first action) and then waits for a workpiece to arrive before commencing work. There can be zero to many workpieces waiting. The robot will only take one workpiece and process it. Then after turning once again the activity stops. No matter how many workpieces are piled up. Only when the activity is started the robot will take another workpiece.

So yes, having at least one workpiece is a precondition for Action Processing, but not for the Activity.