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

Triggering event services



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

Specification

The triggerService attribute for an event Service specifies that anther service should be triggered by the module which was notified of this service. Serveral conditions are also required:
  • The triggered service must also be an event service
  • The module must provide the triggered service
  • A method which must be invoked prior to the triggered service invocation must be provided in the module
If any of these conditions is not fulfilled, the module will silenty do nothing after being notified (but its notification will be performed normally).

By default the triggered service must be of the same namespace of the service which declared it, or not having any namespace. It is possible to specify a specific namespace for the triggered service by using the triggerServiceURI attribute.

Specifying the triggering method

There are two ways to define the method to be invoked before triggering the service:
  • By specifying the default method which will be called by default if the service triggering an event service
  • By specifying the entry point which will be called for the service triggering an event service
Note that the framework will take care of the effective invocation, so you do not need to call invoke() yourself.

Example

Suppose that we have the following services declaration:
      <services>
         <event name="directTo" triggerService="directed">  
            <data name="waypoint" type="int" />                 
         </event>
         <event name="directed">  
            <data name="waypoint" type="int" />                 
         </event>                                 
      </services>
In that case upon the notification of the directTo service for a module, the directed service will be triggered.

For the module to effectively trigger the directed service, you can define the method as default with:
      <module name="FMS">
        <implementation path="org.da.myModule" >
            <initEntryPoint method="init" />
            <defaultReceiveEntryPoint method="subscribe" />
            <defaultTriggerEntryPoint method="trigger" />
         </implementation>
         <interfaces>
            <eventReceived service="directTo" >
               <triggerEntryPoint method="trigger" />
            </eventReceived>
            <eventSend service="directed" />
         </interfaces>   
      </module>
Or define it as an entry point of the directTo service:
      <module name="FMS">
        <implementation path="org.da.myModule" >
            <initEntryPoint method="init" />
            <defaultReceiveEntryPoint method="subscribe" />
         </implementation>
         <interfaces>
            <eventReceived service="directTo" >
               <triggerEntryPoint method="trigger" />
            </eventReceived>
            <eventSend service="directed" />
         </interfaces>   
      </module>

See also


Categories: concepts

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