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

TacticalenvModel tutorial



This tutorial explains how to use a tacticalEnv Application and a tacticalenvModel Application.

Overview

In this tutorial, we will use one tacticalEnv Application, a tacticalenvModel Application, and one userInputs application to show the services sent by the application.
tacticalenvtuto2

Overview

Architecture

Services

We will only use the world service provided by the tacticalEnv Application, and the worldModel service, provided by the tacticalenvModel Application:
      <services>
         <namespace uri="http://dassault-aviation.com/tacticalenv">
            <event name="world">
               <data name="feba" type="feba" />
               <data name="targets" type="targetArray" />
               <data name="zones" type="zoneArray" />
               <data name="corridors" type="corridorArray" />
               <data name="bases" type="baseArray" />
               <data name="threats" type="threatArray" />
               <data name="elements" type="elementArray" />
            </event>
            <event name="worldModel">
               <data name="feba" type="febaObject" />
               <data name="targets" type="targets" />
               <data name="zones" type="zones" />
               <data name="corridors" type="corridors" />
               <data name="bases" type="bases" />
               <data name="threats" type="threats" />
               <data name="elements" type="elements" />
            </event>
         </namespace>
      </services>

Types

We will use the types for our world service. See the types for this tutorial.

Architecture

We will in this case define two applications:
      <applications>
         <deployment>
            <lib url="tacticalEnvCommon.jar" />
         </deployment>
         <application name="tacticalenv">
            <deployment>
               <lib url="tacticalEnv.jar" />
               <lib url="tacticalEnvModel.jar" />
            </deployment>
            <modules>
               <module name="tacticalenv">
                  <interfaces>
                     <eventSend service="world" uri="http://dassault-aviation.com/tacticalenv"/>
                  </interfaces>
               </module>
               <module name="tacticalenvModel">
                  <interfaces>
                     <eventReceived service="world" uri="http://dassault-aviation.com/tacticalenv"/>
                     <eventSend service="worldModel" uri="http://dassault-aviation.com/tacticalenv"/>
                  </interfaces>
               </module>
            </modules>
         </application>
         <application name="userInputs">
            <deployment>
               <lib url="userInputs.jar" />
            </deployment>
            <module name="userInputs" >
               <interfaces>
                  <eventReceived service="worldModel" uri="http://dassault-aviation.com/tacticalenv"/>
               </interfaces>
            </module>
         </application>
      </applications>
See the applications specification for this tutorial.

Alternative architecture declaration


You don't need to define explicitly the interfaces used by the two modules becausre by default all of the interfaces defined in the built-in modules will be used in your architecture. You can then simplify your atchitecture by:
      <applications>
         <deployment>
            <lib url="tacticalEnvCommon.jar" />
         </deployment>
         <application name="tacticalenv">
            <deployment>
               <lib url="tacticalEnv.jar" />
               <lib url="tacticalEnvModel.jar" />
            </deployment>
         </application>
         <application name="userInputs">
            <deployment>
               <lib url="userInputs.jar" />
            </deployment>
            <module name="userInputs" >
               <interfaces>
                  <eventReceived service="worldModel" uri="http://dassault-aviation.com/tacticalenv"/>
               </interfaces>
            </module>
         </application>
      </applications>

ClassLoader constraint


You will need to explicitly declare the tacticalEnvCommon.jar jar file at the root level of the applications declaration because you use it in another application.

Properties

As for the first tacticalenvModel tutorial, the properties file specifies the path of the scenario for the tacticalEnv Application:
      <properties>
         <application name="tacticalenv">
            <module name="tacticalenv">
               <moduleProperty key="scenario" value="config.xml" />
            </module>
         </application>
      </properties>

Starting the framework

To start the framework, we must start the framework with our filelist.xml file for our configuration[1]
We can also forget the config argument and specify the filelist after the start
:
      java -jar protoframework.jar config=filelist.xml
One Window for the userInputs application will appear:
tactenvTuto2UserInputs
As you see, the http://dassault-aviation.com/tacticalenv:worldModel service has already been received at start so you see the following log in the userInputs application GUI:
tactenvTuto2UserInputs2
If you click on the http://dassault-aviation.com/tacticalenv:worldModel service in the userInputs GUI, you will see the content of the service:
tacticalenvtuto21

Notes

  1. ^ We can also forget the config argument and specify the filelist after the start

See also


Categories: tutorials

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