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

UserInputs tutorial



The userInputs tutorial is based on the first tutorial, but the publishModule is replaced by the userInputs built-in application.

Overview

In the first tutorial, we had two modules, both of which implemented in Java:
  • The PublishModule module increments or decrements a value cyclically
  • The EventModule module allows to click on a toggle to set if the first module should increment or decrement the value, and shows the value
We will replace the PublishModule by the userInputs application.

Architecture

The first tutorial had two applications coded in Java:
  • The first PublishModule which:
    • Increment or decrement the value
    • Publish cyclically the value
    • Listen to the toggle event to set if the value should increment or decrement
  • The second EventModule which:
    • Subscribe to the published value and show this value
    • Show a toggle and sends an event when the user clicks on this toggle

tuto1java
We will replace the PublishModule by the userInputs application:
userinputstutorial

XML configuration

Only the applications.xml XML file has to be modified.

Applications definition

We will change the applications.xml XML file, by replacing the PublishModule configuration by userInputs:
      <applications>
         <application name="eventAppli" id="1">
            <deployment>
               <lib url="samplesEvent.jar" />
            </deployment>
            <modules>
               <module name="EventModule" id="1" > 
                  <implementation path="org.da.samples.protoframework.event.EventModule" >
                     <initEntryPoint method="init" />
                     <defaultReceiveEntryPoint method="subscribe" />
                  </implementation>
                  <interfaces>
                     <eventSend service="event" attach="attach"/>
                     <subscribe service="published" />
                  </interfaces>             
               </module>
            </modules>
         </application>      
         <application name="userInputs" id="23">
            <deployment>
               <lib url="userInputs.jar" />
            </deployment>
            <modules>
               <module name="userInputs" id="1" > 
                  <interfaces>
                     <eventReceived service="event"/>
                     <push service="published" attach="attach"/>
                  </interfaces>             
               </module>
            </modules>
         </application>       
      </applications>

Starting the framework

We start the framework exactly as for the first tutorial:
  • Now the message Service "event" notified is shown on the log area each time you press on the button
  • The value of the counter does not increment or decrement automatically anymore, but when "published" service is invoked through the GUI

tuto1

See also


Categories: tutorials

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