Presentation is loading. Please wait.

Presentation is loading. Please wait.

CAMV rules validation engine for XML

Similar presentations


Presentation on theme: "CAMV rules validation engine for XML"— Presentation transcript:

1 CAMV rules validation engine for XML
Framework CAMV rules validation engine for XML David Webber, Information Architect, Oracle Public Sector

2 Disclaimer Notice 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 Oracle’s products remains at the sole discretion of Oracle. Safe Harbor Statement 2

3 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

4 Concepts AND Technology
Concepts and Overview Running CAMV interactively CAMV batch test suites Use Cases Concepts AND Technology

5 Conceptual Overview XML Validation Framework
Design Test Deploy Data Delivery CAMV CAM Editor Application DB XML XML SQL / XML FMW CAMV Web RULES Device Browser Server Visual Editor SQL Browser Dictionaries Drag and Drop Generate Data Validate Data Send Data CAMV Web Services FMW / BPM 5

6 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

7 CAM Validation Components
Structure Rules Code Lists SQL Query CAMV XML instance Template (compiled) Database Lookup (optional) Results XML Java Handler Errors and Warnings

8 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

9 CAMV – Template Controlled Processing
Information Exchange Application Services Control template contains information of the exchange structure design and rules of data handling and value ranges Input XML Template Agile Deploy Structure CAMV Rules Configuration Share PMIX data Load to State databases Perform data cleansing Endeca Information Discover Server Analyze results in Case Management Annotations Parameters Process Valid XML

10 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

11 Application Template and XML Sample
Editor Interactive Rule Validation Information Exchange Application Template and XML Sample CAM Editor 3 1 Content Rules Interactive Validation Step 1 – Load CAM template into editor Step 2 – Run CAMV template validation engine Review results interactively in structure viewer Refine / adjust rules, re-validate, compare Validation Results 2

12 CAM Editor / CAMV Environment
XML Test Instance Reports XSLT XML Validation Result CAM Editor CAMV CAM template CAM Editor

13 Reviewing Validation Results HTML
Results of XSLT error script applied to sample validation output

14 Quick guide and jump start kit available for ANT processing
CAMV Batch Run Example Quick guide and jump start kit available for ANT processing

15 XPath Rules Techniques
Quick Syntax Primer Controlling Scope, Context, Evaluation Dynamic Structure Components CAM Editor Rule Wizards XPath Rules Techniques

16 CAMV uses the XPath v2.0 Java library
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/* 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)

17 XPath Functions XPath Function sampler logical concat(string,string,…)
substring(string,start,len) string-length(string) normalize-space(string) upper-case(string) contains(string1,string2) Yes starts-with(string1,string2) not(arg) or(arg) and(arg) exists(item,item,...) count((item,item,...)) /bookstore/book[price>35]/title

18 CAM XPath Extensions (most used)
Structure Functions Content 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)

19 CAM templates and XPath expressions
Within a CAM template XPath expressions are found in the <as:BusinessUseContext> section of the template.

20 Default Structure Handling
By default all structure components are required and string content Content Masks Structure control

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

22 Expressing Business Rules Examples
Business Rule: Items with color attributes don't need a tray number—the color is sufficient for picking the item: <as:constraint action="makeOptional(//Item/TrayNumber)" /> Business Rule: If order weight exceeds 25 kg, purchase order must specify a freight carrier: <as:constraint > 25" action="makeMandatory(//Item/FreightHandler)"> Using XPath axis referencing (when things are not adjacent in hierarchy): <as:constraint action="makeOptional(//Item/TrayNumber)" /> * Excerpted from Michael Sorens DEVX CAM article examples -

23 Example Cross Component Rules
Business Rule: Providing warning if PurgeDate is earlier than PurgeReviewDate <as:constraint condition="//sbl:PrivacyDetails/sbl:PrivacyPurgeDate < //sbl:PrivacyDetails/sbl:PrivacyPurgeReviewDate" action="printMessage(//sbl:PrivacyDetails/sbl:PrivacyPurgeReviewDate,Warning: Review date not before purge date)"> <as:annotation/> </as:constraint> Business Rule: Location must contain an address or a highway or coordinate set <as:constraint condition="not(./nc:LocationAddress) and(not(./nc:LocationHighway)) and(not(./nc:LocationTwoDimensionalGeographicCoordinate))" action="printMessage(//j:TargetLocation/sbl:Location,Missing Location information)"> <as:annotation> <as:documentation type="documentation">Example of advanced rule</as:documentation> </as:annotation> </as:constraint>

24 CAM Editor rule XPath entry wizard
1 restrictValues() XPath reference 2 Allowed values

25 CAM Editor New Rule XPath entry wizard
XPath rule scope check boxes Allowed values entry

26 Code lists and sql lookup
Introduction to CAM code lists Advantages Tools and Hints Code lists and sql lookup

27 Can replace use of restrictValues() static lists
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? Import XSD enumeration schema into CAM lookup lists Convert UBL Genericode into CAM lookup lists Dump from database into lookup list XML format (cool use for SQL to XML feature of CAM database designer)

28 CAM Code list XML format
Code list name Code value Textual value

29 Load lookup list XML into CAM editor
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

30 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

31 Lookups can be to external XML file instances
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

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 CAMV Summary

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 ‹#›


Download ppt "CAMV rules validation engine for XML"

Similar presentations


Ads by Google