awp.trg.swctr-to4.ade-cave(lx)-01.00/02.00 rev. a this document includes data that shall not be...
TRANSCRIPT
1
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
Advanced Weather Interactive Processing System II(AWIPS II)
AWIPS Development Environment (ADE)and the
Common AWIPS Visualization Environment(CAVE)
Module 3: Micro Engine and Scripts
2
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
Module 3: Micro Engine and Scripts
Module 3 Objectives• Learn Why the Micro Engine Exists and the Role It Plays
• Understand the Architectural Pattern of the Micro Engine
• Learn How to Write and Test Micro Engine Scripts
• Learn How to Extend the Micro Engine by Writing Micro Engine Tasks
• Learn About Future Evolution of The Micro Engine
3
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
uEngine Task Execution Pattern Breaks Up Execution Into Small Reusable Tasks
• uEngine Vision – Create an execution framework for generating custom products on
demand
– Customer systems can request products by script requests over a network
– The script performs small general units of work that get chained together to produce a customer product
4
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
uEngine Task Execution Pattern Breaks Up Execution Into Small Reusable Tasks
• uEngine Implementation – Runs out of an SOA services “ProductSrv” and “AutoBldSrv” that
are attached for I/O to ESB endpoints
– uEngine executes scripts in a XML language similar to “ANT”
– Utilizes the open source project “common-digester” for high-performance XML to object parsing
5
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
uEngine Used Out of Two SOA Services
IngestSrv PersistSrv IndexSrv ProductSrv
NotifySrv AutoBldSrvSubscribeSrv ColabrateSrv GridEditSrv
CAVEVisualization
Client
ADE 1.0 Services
Mbean Mbean Mbean Mbean
Mbean Mbean Mbean Mbean Mbean
JMX RemoteService Management
Client
ASCIIIngestSrvGridIngestSrvSBNSatIngestSrvRadarSrvLightingSrvProductSrv
FileSystemRDBMS via JDBC
Lucene – Reverse IdxSpatial R-Tree
uEngine ScriptsGrid Diagnostics
SubscriptionNotifyAlertNotify
Data RenderingNotify Response
CAVE ScriptingWx DrawingWx Warning
Data Interrogation
Delivered T03
Delivered T05
Enterprise Service Bus – HTTP, JMS, Virtual Memory, File Endpoints
Dissemination
AdapterSrv
Mbean
Exec AdapterHydro AdapterJini Adapter
Hydro Visualization
Delivered T04
uEngine Scripts
Services Independent of End Points
6
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
uEngine Design Concepts
• Idea originated out of ANT files– Think of uEngine tasks as being similar to ANT tasks inside <target>
– Most uEngine script tasks are “bodiless”
– Simplicity is guiding concept
– Tasks get executed from top to bottom in sequence, no controls
• Added Apache Commons Digester XML parser – Layered on SAX parsing
– Improves the performance of XML parsing
– Provides rule-based XML to Java Object mapping
7
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
uEngine Design Concepts
• Each Task defines its own parsing rules– Rules for a task can be changed with minimal impact on the micro
engine
– The abstract Task class provides convenience methods for many common rules
• Class bundle in uEngine identifies tasks– uEngine able to identify tasks included within its jar
– Enables new tasks to be added with a system build
– New tasks are “pluggable” – they do not require modifications to the existing uEngine
8
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
Commons Digester
<action name="ServiceGribImageDecode">
<termQuery>
<query name=“grid_type”
value=“22” />
</termQuery>
<degrib/>
<gribMap colorMap=“GribRGB” />
<colorImage colorMap=“GribRGB” />
<imageOut format=“png” />
<fileOut/>
<worldFileInfo/>
<makeServiceResponse />
</action>
uEngine Task Execution Pattern Common-Digester Based XML Rule Driven Parsing
<<ESB Service>>
ProductSrv
+receive()
{String output = (String) myLaunch.parseAndRun(msg);}
<<Java Class>>
Launcher+parseAndRun()
{action = DigesterSingleton.parse(reader);
action.executeTasks();}
<<Java Class>>
Action+executeTasks()
{Task task = i.next();
task.init(retObj);
retObj = task.execute();}
9
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
<action name="ServiceGribImageDecode"> <termQuery> <query name=“grid_type” value=“22” /> </termQuery>
<degrib/>
<gribMap colorMap=“GribRGB” />
<colorImage colorMap=“GribRGB” />
<imageOut format=“png” /> <fileOut/> <worldFileInfo/> <makeServiceResponse /></action>
uEngine Task Execution Pattern Connecting Units of Work Together - ChainDataType
termQuery query
degrib
gribMap colorMap
TaskXML child
elements
Input
ChainDataType
Output
ChainDataType
colorImage colorMap
imageOut format
fileOut
worldFileInfo
makeServiceResponse
<<abstract>>
Task+addRules(Digester)
+init(ChainDataType)
+ChainDataType execute()
Adding a new uEngine Task
1. Extend Task
2. Implement addRules()
3. Implement abstract methods
10
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
uEngine Task Execution Pattern Data Transformation Into Decision Aids - Scripting
mathScript
11
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
Writing and Testing uEngine Scripts
• General Rules– Remember the KISS principle – scripts generally create a single
product
– Script generally follow the Input-Process-Output (IPO) pattern
– Each script starts with a data query – you need to know the data that may available
12
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
Writing and Testing uEngine Scripts
• A Scripting Example
We want a script that will return the latest TAF for Omaha Eppley Airport. The ICAO for Omaha Eppley is KOMA. The data should be returned to the client as a raw TAF record.
• AnalysisIn this case, there is no processing to be performed. We simply retrieve the data and return it to the client. Two uEngine tasks are used:– termQuery, which is used to query the data store
– makeResponse, which returns the data to the client
13
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
Writing and Testing uEngine Scripts
• The Basic Tag Formats:– action – represents the script document. Encloses other tags.
<action name="…">
</action>
– termQuery – defines a query to the data store<termQuery>
<query name="…" value="…" />
</termQuery>
– makeResponse – prepares the data to return to the client<makeResponse returnMethod="…" />
14
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
Writing and Testing uEngine Scripts
• The Completed Script<action name="Get TAF">
<termQuery>
<query name="reportType" value="TAF" />
<query name="stationID" value="KOMA" />
</termQuery>
<makeResponse returnMethod="ascii" />
</action>
• This Returns the Raw Data to the Client
• Will Revisit This One on the Lab
15
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
Writing and Testing uEngine Scripts
• A Script Example
In this example, we again retrieve the latest TAF for KOMA, but in this case we will return the decoded report in XML format.
• Analysis
Two additional uEngine tasks are needed here:– decodeAscii, which is used to decode the record
– asciiXML, which converts the decoded report to XML format
• Note: To be useful, the client needs to “understand” the XML formatting.
16
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
Writing and Testing uEngine Scripts
• The Basic Tag Formats:– decodeAscii – runs the TAF decoder. We will revisit this one later
since it utilizes the plug-in pattern in performing the decoding.<decodeAscii />
– asciiXML – converts the decoded TAF to XML. This one also utilizes the plug-in pattern.<asciiXML />
• Note: Neither tag requires that the ascii report type be identified. This is part of the plug-in pattern.
17
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
Writing and Testing uEngine Scripts
• The Completed Script <action name="Get TAF">
<termQuery>
<query name="reportType" value="TAF" />
<query name="stationID" value="KOMA" />
</termQuery>
<decodeAscii />
<asciiXML />
<makeResponse returnMethod="ascii" />
</action>
• Will Revisit This One in the Lab
18
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
Writing and Testing uEngine Scripts
• Summary– Saw two example scripts that work with ASCII data
– More examples in the documentation included on the DVD
19
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
BREAK
20
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
Hands-On Micro Engine/Scripts
• Running the Development Version of EDEX
• Script Builder Web Page
• Running a Script
• Debugging a Script
• Script Editor Web Page
21
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
• Install EDEX on Development Computer
• To Start EDEX: Double Click the Start ActiveMQ, Start Mule, and Start Tomcat Icons on PC Desktop
• Linux Users: Start Edex From a Terminal
Running EDEX
3
2
1
22
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
Script Builder Web Page
• AWIPS ADE 0.1 Includes a Web Site That Can Be Used to Build/Debug uEngine Scripts– Does not have an empty editor
page; we will use the GRIB Retrieval Page
• Open the Browser.• Navigate to uEngineWeb Test
Page.• Click GRIB Retrieval Link.• Delete Contents of Blue Box.• Enter the Script to Test.
Steps:
23
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
Running a Script
Click the Get Image button
Enter the script into the blue box
24
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
Running a Script: Results
This is the TAF. The original formattingis retained, but notreflected on page.
25
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
Running a Script: Example 2
Click the Get Image button
Enter the script into the blue box
26
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
Running a Script: Results
This is the decoded TAF. XML formattingis hidden by the page rendering.
27
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
Debugging a Script
• uEngine Will Detect Common Scripting Errors– Invalid XML
– Invalid search parameters
– Missing tags
• This Error Caused by an Invalid (<degrib /> uEngine Script Tag
28
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
Script Editor Web Page
• AWIPS Test Driver Interface may be used as a script builder
• This interface used create scripts for this demo
• Expand the page to see the script
29
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
BREAK
30
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
Extending the uEngine by Adding New Tasks
• Steps Involved in Writing New uEngine Tasks
• Writing a “Hello World” Task
• Testing Your New Task
31
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
General Rules
• Remember the KISS principle – each task should perform a single job
• Most tasks extend Task. May also extend an intermediate class– Jython tasks extend JythonTask rather than Task, but JythonTask
extends Jython.
• Override the static addRules(Digester) method– At a minimum, call the static addBasicRules(…) method
• Implement the abstract init(ChainData), and execute() methods
• The abstract test(ChainData) method is currently deprecated and can be implemented by simply returning the input
32
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
The “Hello World” Task
• Problem Statement
We want to create a uEngine task so that a uEngine script can print a “Hello World” message.
• Analysis
In this case, we will interpret “print” as log a message. This allows for creation of a somewhat more useful task, one that will allow the script writer to log messages. For simplicity, the logging will be at “info” level.
33
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
The “Hello World” Task
• The XML Tag Syntax
<echo msg="…" />
The tag name will be echo. The text to be logged will be provided via the message attribute. The message will be static, i.e., it will be determined at the time the script is written.
• Log Output
Typical log output will be similar toINFO 2007-01-16 14:07:46, 964 [ProductSrv.2] tasks.Echo Message: Hello World!
34
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
The “Hello World” Task
• Basic Class Structure– Basic class generated by Eclipse
– Import statements added by Eclipse as needed
“msg” and setMsg() follow Java bean naming pattern.
35
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
The “Hello World” Task
• addRules(Digester) method:
• “Echo.class” specifies the class and is required since this is a static method
• Uses the rules method from Task and previously defined constants to simplify code
36
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
The “Hello World” Task
• The init(ChainData) and Test(ChainData) Methods
Init() simply saves its input for later, “dataChain” is provided by Task.
test() has nothing to do, so simply return the input.
37
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
The “Hello World” Task
• The Execute() Method– All the action takes place here
Use the logger to record the message
All Tasks return the dataChain.
38
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
The “Hello World” Task – Using Eclipse
Using the Eclipse Class Creation Wizard to create the basic class.
39
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
The “Hello World” Task – Using Eclipse
• At this point, you compile and deploy EDEX
• Once deployed, test the task in a uEngine script
40
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
The “Hello World” Task – Test Script
• Enter the test script as before, and click “Get Image”.
• Check the system log to see the message.
41
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
BREAK
42
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
Summary
• Future Evolution of the uEngine Design
43
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
Resources
• On the ADE 0.1 DVD:– micro_engine_task_readme.pdf– micro_engine_scripting_readme.pdf– generic message format.pdf– AWIPS_ADE_EDEX_Build_Procedure.pdf– JavaDoc documentation for plug-ins is available.
• On the Web:– Apache Commons Digester project:
• http://jakarta.apache.org/commons/digester /
– Apache Jakarta Commons project:• http://jakarta.apache.org/commons/ /
– Apache Ant project:• http://ant.apache.org/
44
AWP.TRG.SWCTR-TO4.ADE-CAVE(Lx)-01.00/02.00 Rev. A
This document includes data that shall not be duplicated, used, or disclosed – in whole or in part – outside the Government for any purpose other than to the extent provided in contract DG133W-05-CQ-1067. However, the Government shall have the right to duplicate, use, or disclose the data to the extent provided in the contract. This restriction does not limit the Government’s right to use information contained in this data if it is obtained from another source without restriction. The data subject to this restriction are contained in all sheets.
Jan. 16, 2007
BREAK