Title: Creating an AP233 Systems Engineering Scripting Language in Ruby
1Creating an AP233 Systems Engineering Scripting
Language in Ruby
- David Price
- 8th NASA/ESA PDE Workshop
- April 2006
2Background
- Background
- Doing AP233-based proof-of-concept converters
between UML/SysML, DoDAF/CADM and AP233 using
XSLT - Need something more powerful than XSLT
- Trying to use only free or open-source software
- Several years off-and-on efforts to make
EXPRESS/STEP available to a widespread community - Eagerly awaiting for tools to ease my workload
- NASA presentation on ideas around open-source SE
tools - See the next three slides
3(No Transcript)
4(No Transcript)
5(No Transcript)
6(No Transcript)
7AP233 Scope
requirements
breakdowns
PDM
product structure
config control
static structure
system sub-system
text-based
person org
functional breakdown
WBS
security
property-based
behaviour
link to analysis
state-based
verification validation
model presentation
function-based
Legend
risk
measurement
Complete
Edition 2
8DoDAF CADM/AP233 Project
- Purpose
- Evaluate feasibility of system architecture data
exchange using emerging ISO AP233 Systems
Engineering standard - Not a fully validated design effort
- Provide a body of work that future efforts can
build upon
9Proving this path
10(No Transcript)
11DoDAF Views Coverage
12AP233 Systems Engineering
- On-schedule for AP233 modules to go out for ISO
ballot starting in the summer - Committee Draft ballot (July-October 2006)
- After ballot completes, workshops are held to
address ballot comments - AP233 modules should be published 1Q2007
- The complete AP233 Application Protocol that
includes Business Use Cases, etc. takes a bit
longer
Critical Testing Happens Here
ISO Ballot
13AP233 Testing
- AP233 Development Team is working strategy for
critical testing - Includes internal team testing
- Includes approaching vendors to participate
- AP233 Team developing a test harness
- Fitting into the test harness is now the main
focus for the DODAF CADM/AP233 demo work
14AP233 Test harness
Test data creation tools
Visio Freemind Excel UML 2/SysML CADM examples
XML
AP233 XML
Translate via
XSLT Ruby Java
Import/Export
Repository
Web Viewers, Graphical Viewers and Available SE
Tools
15Many things are coming together
Critical Testing Happens Here
ISO Ballot
16Goals
- Add to tools available for testing and quick
prototyping of AP233 - AP233 has very few rules so EXPRESS
structure-only tools are OK - Keep it simple, simple, simple for people using
the tools - Be available on Windows, Linux, Mac OS (at least)
- Simplify introduction of AP233 to
non-STEP-literate community - Do more with less effort
17Sounds good to me
- From Should Ruby Be Added to Your Programming
Repertoire? By W. Jason Gilmore - 100 object-oriented
- dynamically typed
- devoid of superfluous syntactical requirements
such as indentation and semi-colons - replete with libraries for facilitating
practically any conceivable task - Ruby (and Rails) mantras
- DRY Dont Repeat Yourself
- Convention over Configuration
18Details (From Gilmore)
- Has capabilities expected of full-featured
languages - text file processing, string manipulation,
networking, exception handling, and language
extendability - Supports wide variety of platforms
- UNIX flavors, Windows 95/98/NT/Me/2000/XP, and
Mac OS X - Web application development opportunities through
mod_ruby - Apache module for embedding the Ruby interpreter
into the Apache Web server - A database-independent interface similar to
Perl's DBI module - DB2, InterBase, mSQL, MySQL, Oracle, PostgreSQL,
SQLite, etc.
19More Details (From Gilmore)
- Create cross-platform GUI-based applications via
projects like wxRuby - Easy package and application management using
RubyGems. - RubyGems operates similarly to the inestimably
useful Perl CPAN, enabling complete control over
packages through a convenient console interface. - Built-in support for Web Services through
packages such as RSS and soap. - A hyper-active user community.
- See Ruby Application Archive and RubyForge for a
sampling of the hundreds of projects
20From why's (poignant) guide to ruby
21Project 1 EXPRESS-Ruby-XML
- EXPRESS-as-XML input
- Generate Ruby code to read/write XML (Part 28
Edition 2) - Working today
- Entity and Multiple inheritance (Ruby uses
modules for this) - 1-D Aggregate of Entity instance, String,
Integer, Real - Select types (only through dynamic typing)
- Validation not in Ruby code, use the XML Schema
- Not included yet
- Rename in redeclared attribute
- Defined types (except through dynamic typing)
- n-D Aggregates
- Exact Part 28 E2 DIS XML
22Example State definition
23Generated Ruby modules
module State_definition___module attr_accessor
name attr_accessor description end module
State_definition_relationship___module
attr_accessor name attr_accessor
description attr_accessor relating
attr_accessor related end module
State_transition_definition___module end
24Generated Ruby Classes
class State_definition include
State_definition___module _at__at_entity
'State_definition' _at__at_attr___name 'Name'
_at__at_attr___description 'Description'
_at__at_State_definition___count 0 def initialize
_at__at_State_definition___count 1 _at_p28id
'id-State_definition-' _at__at_State_definition___co
unt.to_s end def writeP28 p28file
e___added p28file.root.add_element('ap233State_
definition', 'id' gt _at_p28id) if name !
nil a___name e___added.add_element('Nam
e') a___name.text name end
25Using the API
create a model container for the data
instances mydata AP233Model___data.new
create two State definitions s1
AP233State_definition.new s1.name "Initial
State" s2 AP233State_definition.new s2.name
"Final State" create a State transition
between them st1 AP233State_transition_definit
ion.new st1.name "I to F" st1.relating
s1 st1.related s2 put all instances in
the model container mydata.model_elements
s1,s2,st1
26Using the API (2)
Set up the XML file and write all data in
the model container to the file datafile
File.new("AP233_data.xml","w") p28file
REXMLDocument.new mydata.writeP28e2
p28file datafile.puts p28file datafile.close
27AP233 XML (simple P28E2)
28Next steps
- Project 1 exp2ruby
- Support more of EXPRESS
- Generate convenience functions (e.g. Get/Set all
attributes) - Other backends
- Part 21 write should be simple, Part 21 read is
harder - RDF or OWL?
- There is a Ruby wrapper for Redland RDF API
already - Use meta-model of EXPRESS replacing XPath over
XML - Project 2 Support for UML/SysML
- For example, a SysML API that can read/write XMI
2.1 and AP233 P28 E2 XML - Project 3 EXPRESS to Rails Web Framework
integration - Project 4 EXPRESS to C for HDF5
29Conclusions
- Ruby is a nice language
- Initial hurdle to Ruby is far less than C/C,
Java, eclipse or netBeans - This is one small step for the ideas Steve
Jenkins presented last year - Ruby-related technology for AP233, SysML, and
other standard and non-standard SE applications
has benefits - Eurostep will deliver free AP233 ARM Ruby API in
DoD DODAF/CADM/AP233 project - AP233 Working Draft 2 available in a couple of
weeks