13.3. Flows
A flow type is both a binary association and an action type that classifies transfers of payloads between interacting occurrences, such as parts and actions. It has two ends, the first of which is the source, from which the payload comes, and the second of which is the target, to which the payload (an attribute value, item, part, etc.) is delivered. Flow types are KerML interactions.
A flow property (or "usage") is an action property that relates two properties (typically, part and action properties). Its values represent transfers (or flows).
There are three kinds of flow properties:
- A message flow property is always abstract (whether or not the abstract keyword is included explicitly in its declaration). It is typically used to model abstract logical message exchanges between parts, as in UML Sequence Diagrams. These message exchanges may then be realized in a more detailed model in the form of streaming or succession flows (or transfers from send actions to accept actions.
- A streaming flow property specifies the source and target of a transfer (and, optionally, the payload), but also identifies the source output property of the source from which the payload is obtained and the target input property of the target to which the payload is delivered.
- A succession flow property is both a flow property and a succession, where source and target are typically action steps. A succession flow is a streaming flow subject to the constraint that the transfer source must complete before the transfer starts, and the transfer must complete before the target can start.
An example of using a message flow property for modeling a message exchange between two parts via their respective "event occurrence" properties is the following:
part def Vehicle { attribute def ControlSignal; part controller { event occurrence sendControl; } part engine { event occurrence receiveControl; } message of ControlSignal from controller.sendControl to engine.receiveControl; }
An example of using a streaming flow property for modeling transfers of fuel quantities between a fuel tank part and an engine part via respective out/in properties is the following:
part def Vehicle { part fuelTank : FuelTank { out fuelOut : Fuel; } part engine : Engine { in fuelIn : Fuel; } flow fuelFlow : FuelFlow of flowingFuel : Fuel from fuelTank.fuelOut to engine.fuelIn; }
The streaming flow property can also be declared using the following short-hand:
flow fuelTank.fuelOut to engine.fuelIn;
An example of using a succession flow property for modeling the transfers of images as payloads between two actions via respective out/in parameters is the following:
action def TakePicture { action focus : Focus { out image : Image; } action shoot : Shoot { in image : Image; } succession flow focus.image to shoot.image; }
While flows often transfer payloads from output properties to input properties, they may also go from input properties to other input properties or from output properties to other output properties, as illustrated in the following artificial example:
part def Outer { port p1 { in a; } flow p1.a to inner.p2.a; part inner { port p2 { in a; } flow p2.a to p3.b; port p3 { out b; } } flow inner.p3.b to p4.b; port p4 { out b; } }