camv rules validation engine for xml david webber, information architect, oracle public sector...

Download CAMV rules validation engine for XML David Webber, Information Architect, Oracle Public Sector XMLValidationFramework

If you can't read please download the document

Upload: joel-booth

Post on 23-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

  • Slide 1
  • CAMV rules validation engine for XML David Webber, Information Architect, Oracle Public Sector XMLValidationFramework
  • Slide 2
  • The following is intended to outline Oracle general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracles products remains at the sole discretion of Oracle. Disclaimer Notice Slide 2
  • Slide 3
  • 2012 Oracle Corporation All Rights Reserved3 Agenda Concepts and Technology Rules Primer with XPath Advanced Rules Techniques Code table and SQL lookups Apache ANT test suite automation tool Test, Evaluation, And Measurement (TEAM) Summary and Resources
  • Slide 4
  • CONCEPTS AND TECHNOLOGY Concepts and Overview Running CAMV interactively CAMV batch test suites Use Cases
  • Slide 5
  • Conceptual Overview Conceptual Overview XML Validation Framework Visual Editor SQL Browser Dictionaries Drag and Drop Generate Data Validate Data Send Data CAMV Web Services FMW / BPM DesignTestDeploy DB Web CAMV CAM Editor Device Browser Server Data Delivery SQL / XML Application FMW CAMV RULES
  • Slide 6
  • 2012 Oracle Corporation All Rights Reserved6 XML Validation Framework Benefits CAMV component designed to deliver flexible and context aware XML validation services Accelerates information sharing adoption and deployment (compatible with the NIEM approach) Supports extended communities and XML diversity Allows reference / conformance test suite development Uses XML configuration templates + code-less methods Integrates into Oracle Fusion Middleware foundation Uses OASIS Content Assembly Mechanism (CAM) open public standard for validation templates and rules
  • Slide 7
  • CAM Validation Components CAMV XML instance Template (compiled) Database Lookup (optional) Results XML Java Handler Errors and Warnings StructureRulesCode Lists SQL Query
  • Slide 8
  • 2012 Oracle Corporation All Rights Reserved8 CAMV Validation Engine Standalone XML validator using XPath rules Context aware and declarative rules approach External and local parameter definitions Integrated with CAM editor menus for interactive testing External code list and SQL table lookup support Configurable error levels error, warning Java error results object returned Embedded validation results attributes in XML results Can use XSLT for post-validation result handling Callable via Spring framework or Java API
  • Slide 9
  • Information Exchange CAMV Template Controlled Processing Application Services Valid XML CAMV Process Agile Deploy Control template contains information of the exchange structure design and rules of data handling and value ranges Template Structure Rules Annotations Parameters Configuration Input XML
  • Slide 10
  • 2012 Oracle Corporation All Rights Reserved10 Running Validation Rules Tests Fault tolerant validation engine allows testing of XML instances against actual exchange rules. Critical to ensure that the exchange validates actual live production example scenarios correctly Allows deployed solution to directly match documented exchange details (e.g. NIEM IEPD) no coding delta Errors can be reviewed interactively in exchange visual interface Post-processing of validation results allows unit regression tests to be created with reporting of errors, warnings and information level notes
  • Slide 11
  • Information Exchange Editor Interactive Rule Validation Interactive Validation CAM Editor Validation Results 1 2 3 Content Rules Application Template and XML Sample
  • Slide 12
  • CAM Editor / CAMV Environment CAM Editor CAMV XSLT Reports CAM template XML Test Instance XML Validation Result
  • Slide 13
  • Reviewing Validation Results HTML Results of XSLT error script applied to sample validation output
  • Slide 14
  • CAMV Batch Run Example Quick guide and jump start kit available for ANT processing
  • Slide 15
  • XPATH RULES TECHNIQUES Quick Syntax Primer Controlling Scope, Context, Evaluation Dynamic Structure Components CAM Editor Rule Wizards
  • Slide 16
  • 2012 Oracle Corporation All Rights Reserved16 XPath Syntax Primer XPath is a simple assertion language where expressions reference components hierarchically within an XML instance structure e.g. /animals/canines/domestic/dogs/poodle[1] /animals/canines/domestic/* /animals/canines/domestic/ancestor::breed/@type CAMV uses the XPath v2.0 Java library In CAM templates XPath is used to express usage rules and content details of the XML structure and its components (e.g. optional, repeatable, date, number, Boolean, decimal and so on)
  • Slide 17
  • XPath Functions XPath Function samplerlogical concat(string,string,) substring(string,start,len) string-length(string) normalize-space(string) upper-case(string) contains(string1,string2)Yes starts-with(string1,string2)Yes not(arg) or(arg) and(arg)Yes exists(item,item,...)Yes count((item,item,...)) /bookstore/book[price>35]/title
  • Slide 18
  • CAM XPath Extensions (most used) Structure FunctionsContent Functions makeOptional(xpath)setNumberMask(xpath,arg) makeRepeatable(xpath)setStringMask(xpath,arg) makeMandatory(xpath)restrictValues(xpath,args) excludeTree(xpath)setDateMask(xpath,arg) makeNillable(xpath)datatype(xpath,arg) setChoice(xpath)setLength(xpath,arg) setLimit(xpath)lookup(xpath,args) setValue(xpath,arg) printMessage(xpath,arg)setNumberRange(xpath,args) setDefault (xpath,arg)
  • Slide 19
  • 2012 Oracle Corporation All Rights Reserved19 CAM templates and XPath expressions Within a CAM template XPath expressions are found in the section of the template.
  • Slide 20
  • Default Structure Handling By default all structure components are required and string content Content Masks Structure control
  • Slide 21
  • Controlling Scope and Context Condition controls if and when the content rule action applies Condition can control structure as well; optional, mandatory, exclude Condition can reference different component(s) for contextual rule actions
  • Slide 22 Using XPath axis referencing (when things are not adjacent in hierarchy): * Excerpted from Michael Sorens DEVX CAM article examples -http://www.devx.com/xml/Article/41150">
  • Expressing Business Rules Examples Business Rule: Items with color attributes don't need a tray numberthe color is sufficient for picking the item: Business Rule: If order weight exceeds 25 kg, purchase order must specify a freight carrier: 25" action="makeMandatory(//Item/FreightHandler)"> Using XPath axis referencing (when things are not adjacent in hierarchy): * Excerpted from Michael Sorens DEVX CAM article examples -http://www.devx.com/xml/Article/41150
  • Slide 23 Business Rule: Business Rule: Providing warning if PurgeDate is earlier than PurgeReviewDate Example of advanced rule Business Rule: Business Rule: Location must contain an address or a highway or coordinate set">
  • Example Cross Component Rules Business Rule: Business Rule: Providing warning if PurgeDate is earlier than PurgeReviewDate Example of advanced rule Business Rule: Business Rule: Location must contain an address or a highway or coordinate set
  • Slide 24
  • CAM Editor rule XPath entry wizard 1 2 restrictValues() XPath reference Allowed values
  • Slide 25
  • CAM Editor New Rule XPath entry wizard Allowed values entry XPath rule scope check boxes
  • Slide 26
  • CODE LISTS AND SQL LOOKUP Introduction to CAM code lists Advantages Tools and Hints
  • Slide 27
  • 2012 Oracle Corporation All Rights Reserved27 Code lists CAM lookup() function allows referencing to external XML lists of values Can replace use of restrictValues() static lists CAM lookup() function can reference SQL table for dynamic value checking Where to get code lists? 1.Import XSD enumeration schema into CAM lookup lists 2.Convert UBL Genericode into CAM lookup lists 3.Dump from database into lookup list XML format (cool use for SQL to XML feature of CAM database designer)
  • Slide 28
  • CAM Code list XML format Textual value Code value Code list name
  • Slide 29
  • 2012 Oracle Corporation All Rights Reserved29 Code lists examples Load lookup list XML into CAM editor Assign lookup() rule to XML component For SQL lookups need to define connectivity to database and the SQL query to perform (example SQL lookup available from http://www.cameditor.org)
  • Slide 30
  • 2012 Oracle Corporation All Rights Reserved30 Combining Rules and Code lists Real power of code lists and CAM ability to select code list values based on XPath rule criteria to handle different partner configurations, versioning and cross-table validations e.g. Ford / Mustang | Chevy / Corvette Message version id = 1.6 use code list XYZ-1-6
  • Slide 31
  • 2012 Oracle Corporation All Rights Reserved31 Code Lists Summary Lookups can be to external XML file instances Simple XML format for optimized performance and readability Dynamic runtime control via XPath rules to select lists to be applied Lookup can reference SQL statement for database content checking e.g. part numbers, customer id, order number
  • Slide 32
  • CAMV SUMMARY CAMV Java Validation Engine (OneJar) Java API and Spring API support Integration with JAX-WS Templates provide flexible rule validation Codelists and SQL lookups ANT batch test suites
  • Slide 33
  • CAM Project Resource Site # SNAPSHOT OF PROJECT ACTIVITIES 50,000 CAMeditor.org page visits in one year 130+ countries have downloaded tools; 30% of visitors are from U.S. 450+ downloads weekly 20,000 yearly downloads 1,000 Macintosh 1,000 Linux 100 student views of online video training resources weekly 6 languages now available www.cameditor.org