File tree Expand file tree Collapse file tree
20. Asynchronous Messaging Expand file tree Collapse file tree File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change 11package 'Interaction Example-1' {
22 import 'Event Occurrence Example'::*;
33
4- attribute def SetSpeed;
5- attribute def SensedSpeed;
6- attribute def FuelCommand;
4+ item def SetSpeed;
5+ item def SensedSpeed;
6+ item def FuelCommand;
77
88 occurrence def CruiseControlInteraction {
99 ref part :>> driver;
Original file line number Diff line number Diff line change 11package 'Interaction Example-2' {
22 import 'Event Occurrence Example'::*;
33
4- attribute def SetSpeed;
5- attribute def SensedSpeed;
6- attribute def FuelCommand;
4+ item def SetSpeed;
5+ item def SensedSpeed;
6+ item def FuelCommand;
77
88 occurrence def CruiseControlInteraction {
99
Original file line number Diff line number Diff line change 1+ package 'Message Payload Example' {
2+ import 'Event Occurrence Example'::*;
3+
4+ item def SetSpeed;
5+ item def SensedSpeed;
6+ item def FuelCommand {
7+ attribute fuelFlow : ScalarValues::Real;
8+ }
9+
10+ part def EngineController;
11+
12+ part vehicle1 :> vehicle {
13+ part engineController : EngineController {
14+ event occurrence fuelCommandReceived;
15+ then event occurrence fuelCommandForwarded;
16+ }
17+ }
18+
19+ occurrence def CruiseControlInteraction {
20+ ref part :>> driver;
21+ ref part vehicle :>> vehicle1;
22+
23+ message setSpeedMessage of SetSpeed
24+ from driver.setSpeedSent to vehicle.cruiseController.setSpeedReceived;
25+
26+ then message sensedSpeedMessage of SensedSpeed
27+ from vehicle.speedometer.sensedSpeedSent to vehicle.cruiseController.sensedSpeedReceived;
28+
29+ then message fuelCommandMessage of fuelCommand : FuelCommand
30+ from vehicle.cruiseController.fuelCommandSent to vehicle.engineController.fuelCommandReceived;
31+
32+ then message fuelCommandForwardingMessage of fuelCommand : FuelCommand = fuelCommandMessage.fuelCommand
33+ from vehicle.engineController.fuelCommandForwarded to vehicle.engine.fuelCommandReceived;
34+
35+ }
36+ }
You can’t perform that action at this time.
0 commit comments