Home
Categories
Dictionary
Glossary
Download
Project Details
Changes Log
What Links Here
FAQ
License

Event Service



An event Service is a service which handle the sending of valued events from providers to subscribers. An event Service:
  • Can have one or several providers
  • Can have one or several subscribers

Overview

The following diagram shows the architecture of an event Service:
  • During configuration, one or several provider can be active, and one or several subscribers can be associated with the Service
  • During runtime, when the service is invoked by a provider, all the subscribers will be notified

eventservice

Data management

Contrary to a publish Service the datas sent alongside the Service will always have their default value before the invocation of the Service. Only those modified by the provider prior to the invocation will have a specific value. It means that if you want to modify values for the datas associated with the event, you must do so for every data which must not have its default value. For example, if you have a Service containing 2 datas:
  • latitude
  • longitude
And the default values for these datas are 0, then you should set the values for both latitude and longitude each time you send the event.

Note that by default the

Declaring the Service

Declaring an event Service is simple: you only have to define the Service name and ID (as for all Services), and the datas which are associated with the event. For example:
      <services>
         <event name="directTo" id="1" >  
            <data name="waypoint" type="int" />                    
         </event>                  
      </services>
Note that it is allowed to have an event Service without any associated datas.

See also services configuration.

Triggering anbother service


It is possible to specify that upon the notification of an event Service, another event Service must be triggered.

Configure how the service datas are handled


By default datas are handled as specified by the general eventServicesCopyDatas framework property

It is possible to override this behavior by the copyDatas attribute of the service. For example:
      <services>
         <event name="directTo" copyDatas="true" >  
            <data name="waypoint" type="int" />         
         </event >                  
      </services>

Interfacing with the Service

Main Article: service implementation

Declaring how the Service is used for a module[1]
If the module is a provider or a subscriber of the Service
is specified in the module configuration for the Module. The declaration is to be performed under the interfaces element for the module configuration:
  • If the module is providing the service, declare an eventSend element
  • If the module is subscribing to the service, declare an eventReceived element
For example:
      <module name="theSender" >
         <interfaces>
            <eventSend service="myEvent"/>
         </interfaces> 
      </module> 
      <module name="theReceiver" >
         <interfaces>
            <eventReceived service="myEvent"/>
         </interfaces> 
      </module>

Use cases

The event Service use case is typically cases where you want to send events associated with datas. An event Service must be invoked when states of the system change[2]
Nothing prevents modules to send events very often of even cyclically, but in this case the publish Service would be much more adapted
. For example, you can define an event Service to invoke a DirectTo order demanding the aircraft to go to a specified Waypoint.

DirectTo example

Consider an order demanding the aircraft to go to a specified Waypoint. We would have the directTo service definition:
      <services>
         <event name="directTo" id="1" >  
            <data name="waypoint" type="int" />         
         </event >                  
      </services>
And the LeftDisplay, RightDisplay and FlightManagementSystem modules definition:
      <applications>
         <application name="aircraft" id="1">
            <modules>
               <module name="LeftDisplay" id="1" > 
                  <interfaces>
                     <eventSend service="directTo" attach="attach"/>
                  </interfaces>             
               </module>
               <module name="RightDisplay" id="2" > 
                  <interfaces>
                     <eventSend service="directTo" attach="attach"/>
                  </interfaces>             
               </module>               
               <module name="FlightManagementSystem" id="3" >          
                  <interfaces>
                     <eventReceived service="directTo"/>
                  </interfaces>            
               </module>                                             
            </modules>
         </application>          
      </applications>
The LeftDisplay and RightDisplay modules provide the directTo Service (for example when clicking on a "DirectTo" button on the Display). The FlightManagementSystem module is notified of the event, allowing it to perform a "DirectTo" to the specified Waypoint.

eventexample

Notes

  1. ^ If the module is a provider or a subscriber of the Service
  2. ^ Nothing prevents modules to send events very often of even cyclically, but in this case the publish Service would be much more adapted

See also


Categories: concepts

Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence