# Presentation: 312688

## Parsing Solutions & OASIS Content Assembly Mechanism (CAM) XMLWG 2004, Wash DC, Jan 21st.

**David RR Webber**
*Chair OASIS CAM TC*
- _[http://drrw.net](http://drrw.net/)_
- david@drrw.net

## eBusiness XML parsing needs today

- Interoperability
- Opening up business integration rules
- Handling local context drivers
- Validating content
- How does W3C XSD schema help?
- What does OASIS CAM provide?

## W3C Schema in a nutshell

- XML formatted syntax that describes the structure layout of a given XML instance
- Is a 90% solution – cannot describe every well formed XML instance perfectly _[(e.g. interleaved process and content – ](http://drrw.net/visualscripts/SMIL/SomersetSpring.html)__[xhtml](http://drrw.net/visualscripts/SMIL/SomersetSpring.html)__[ + SMIL)](http://drrw.net/visualscripts/SMIL/SomersetSpring.html)_
- Designed for use by programmers
- Has mechanisms for datatyping and content checking
- Has a model for creating objects of content and using object techniques

## OASIS CAM in a nutshell

*CAM syntax* - tool for business users to express the information exchange semantics and context of their business process steps as XML-based templates.
*library of CAM templates* – provides discovery and re-use of common transaction details and sharing of domain context along with consistent referencing to shared nouns and verbs.
*CAM processing engine* – component to provide consistent information exchanges at three levels – pre-checking content, runtime content assembly, post-receipt integration.

## Agenda

-  Problem Understanding
-  What are we trying to solve and for whom?
-  What does XSD schema offer?
-  How does CAM augment schema?
-  Using CAM
-  Approach
-  Building templates
-  Leveraging schema
-  Next Steps
-  Roadmap for 2004

## What are we trying to solve and for whom?

***Understanding the Problem***

## Define business ideas and needs
Capture steps and workflow
Then describe the business processing
Top layer – rules and context
Middle layer – industry/application integration
Implementation layer – physical application systems and content delivery / exchange
Consistent information integration mechanisms for use in Service Oriented Architecture (SOA)

- Capture steps and workflow
- Then describe the business processing
- Top layer – rules and context
- Middle layer – industry/application integration
- Implementation layer – physical application systems and content delivery / exchange
- Consistent information integration mechanisms for use in Service Oriented Architecture (SOA)

**Building e-Business Orchestration**

## Reduce complexity of managing large numbers of transaction formats - document the differences
Want to speed adoption by formalizing business rules
Want context-driven transaction generation
Empowers business users to build interchange details
Need to define in a neutral format: works with variety of structures, not just XML
Augment current standards and industry specifications 
Provide multi-step process support

- Want to speed adoption by formalizing business rules
- Want context-driven transaction generation
- Empowers business users to build interchange details
- Need to define in a neutral format: works with variety of structures, not just XML
- Augment current standards and industry specifications
- Provide multi-step process support

**Business Layers - Objectives**

## Business Challenges for XML

- Totally static transaction formats do not work – need configurable structures
- How to apply business context assertions to a information structure?
- How to derive a consistent way of specifying the interchange parameters to a partner?
- How to enable business domain users to implement the exchanges?

- Key: Context is Everywhere
- The ability to create re-usable information components is driven by the ability to enable context

## XML, by itself, does not solve interoperability problems yet it is an important tool for doing so.
XML does not provide instant semantics.
XML by itself is not the magic bullet.
What we need are clear policies and vision of how electronic information enables interoperability

- XML does not provide instant semantics.
- XML by itself is not the magic bullet.
- What we need are clear policies and vision of how electronic information enables interoperability

**XML by itself is not enough**

## XML Schema?

- Why not just use XML Schema?
- OAGI did this for BODs V8.0 – but required supplementing schema with XSLT and XPath to capture business rules
- Had to make all elements optional
- No ability to enable business context of combinations of use – i.e. use patterns { if (condition) required | optional | optional }
- Limited constructs of structure – example no “interleave” of child elements

## Lessons learned: Which XML Method(s)?

- We need business collaboration on elements syntax:
- Global complexType definition?
- Global element definition?
- Create industry dictionaries?
- Reuse
- Reference global element in external namespace?
- Define local element as substitutionGroup of global element (bring into  local namespace)?
- Define local element using external Namespace complexType (bring into local namespace)?
- Derive by extension, local element can have additional sub-elements added to it?

## XML Schema - SWOT

| Strengths | Weaknesses |
| --- | --- |
| Widely implemented in major XML parsers
Defines structural layouts for XML content
Graphical editors available
Small footprint works well for embedded applications (web browser)
Basic set of data types work well
Tools can inspect schema and generate rendering for given XML content
Integration with XSLT
Schema instance self-contained
Supports familiar “bottom-up” implementation | Cannot define all possible structural combinations (e.g. scripts - SMIL)
Syntax about syntax (legal Latin v legal English)
Editing tools / parsers not necessarily compatible
Complex syntax, difficult to hand-code
Business context mechanism support
Only works for XML structures
Versioning of elements and attributes
Including structural components
External type library support
Metadata registry referencing
Validation to external code-lists
Compliance level and specification support  |
| Opportunities | Threats |
| Replace column mechanisms in DBMS tables
Support simple validation in data entry systems
Work well with programmer IDE environments | Initial momentum in marketplace stagnates as e-business requirements expose weaknesses
Reduced to role in embedded local point systems |

## Leveraging XSD and CAM

- Can build default CAM components from XSD
- Can build XML examples from XSD
- Can use CAM functionality to fill in the gaps in XSD

## How does CAM augment schema?

- Can have multiple structure instances selected by context
- Can include structure from sub-assembly of components
- Enhanced element semantics beyond simply datatyping
- Full code lists functionality beyond NMTOKEN
- Ability to leverage semantics at attribute level consistently with elements
- Ability to version content model components
- Link to industry dictionaries
- Link to web service components for external checks
- Ability to assemble transaction instances
- Can handle non-XML formats

## Technology Positioning

- We can use W3C Schema to show basic typing and structural permutations for XML transaction content models.
- To provide automation of the business logic at-point-of-use requires OASIS CAM to supplement the Schema.
- Use models –
- simple one-off structures – XSD schema is adequate
- significant information exchange for e-Business – CAM required
- available open source CAM processor
- Need - leverage today’s in-place XML technology; provide enhanced  functionality for next generation.

## Using CAM

***Anatomy and Approach***

## Basic Components of CAM

**Basic Components of CAM**

***XML***
***instance***
***structure(s)***

***+***

***Business context rules***

***+***

***Content Reference rules***

***+***

***Data Validation rules***

***+***

***External Mapping rules***

*can have more than one structure layout*

*can add inline rules directly into structure*

- makeOptional()
- excludeTree()

- item type="noun" name="Agency/@AgencyID" UIDReference="ukt000910"

- <conditional      expression="'//SupplierID' and            lookup(value,'SGIRWSDL:supplierID_check')"

- <MapRule output="type" input="Sales/Company/Year/Qtr/Product@type"/>

**Simple Declarative Statements**

**Combined **
**with**

## How Context is applied

***given ***
***context and***
***action***

***Context ***
***Statements***

**How Context is applied**

***CAM ***
***Template***

***+***

***CAM gets passed context from***
***business use***

***Generates ***
***actual XML***
***instance***
***definition ***
***to be used***

***XML ***
***transaction***
***content***

***process ***
***and ***
***compare***

**1**

**2**

**3**

**4**

**5**

## Integrating CAM into eBusiness stack

*Business agreement*

*Drives document*
*exchanges*

## Business Context Mechanism

*Link between messaging layer, business process layer and assembly layer.*

**<ebContext UIDref='SDIR03400' interchangeID='123456789' BPMref='ABC123456:01‘**
**           ****CPAref='ABC012345‘**
**           ****xmlns:as="http://www.oasis-open.org/committees/cam****"****>**
** ****<header>**
**   ****<description>An example context instance</description>**
**   ****<version>1.0</version>**
**   ****<language refcode='eng' codelist='ISO639-2' name='English'/>**
**   ****<usage>CAM</usage>**
**   ****<usage>BPM</usage>**
** ****</header>**
** ****<conditions>**
**   ****<condition name="Country" ****	****value="USA" as:member="USA,CA,MX"/>**
**   ****<condition name="Catalogue" value="A2003-Q1" as:setLength="8"  **
**              ****as:setMask="XNNNN-QN" as:UIDreference="SGIR:030451"/>**
**   ****<condition name="itemType" ****	****value="nonperishable" label="Item type:“**
**              ****as:member="nonperishable,perishable,refridgerated,fragile"/>**
** ****</conditions>**
**</ebContext>**

## CAM template XML structure

- A,B,C,D,E!
- Assembly Structure
- Business Context Rules
- Content Referencing
- Data Validations
- External Application Mapping
- Many examples available from _[http://cam.swiki.net](http://cam.swiki.net/)__ _

**<CAM>**
**<Header>****<ContextStatements>**
**	****<AssemblyStructure/>**
**   ****	****<BusinessUseContext/>**
**   ****	****<ContentReference/>**
**	****   ****<DataValidations/>**
**   ****<ExternalMapping/>**
**</CAM>**

***Example***

## Technology Foundation

- Simple XML V1.0
- XPath
- Neutral approach to structure content
- Assertion predicates

**excludeAttribute()**
**excludeElement()**
**excludeTree()**
**makeOptional()**
**makeMandatory()**
**makeRepeatable()**
**setRequired()**
**setChoice()**
**setId()**
**setLength()**
**setLimit()**
**setMask()**
**setValue()**
**restrictValues()**
**restrictValuesByUID()**
**useAttribute()**
**useChoice()**
**useElement()**
**useTree()**
**useAttributeByID()**
**useChoiceByID()**
**useElementByID()**
**useTreeByID()**
**lookup()**
**startBlock(), endBlock()**

## Integration with Registry Dictionary

**Structure**
**Choices**

**Context**
**Values**

**Required**
**Content**
**Structure**

- Process
- Engine

**Content**
**References**

- 1

**Payload / **
**Rendering**

- 2

**CAM Assembly**
**Structure**

- Payload Assembly

- 3

**Application**
**Database**

**Registry**
**Components**

_**Conceptual**_

_**Logical**_

_**Physical**_

**Integration with Registry Dictionary**

- Vocabulary nouns,
- and
-  Industry Dictionaries

- Re-usable
- Business Information components

## External Mapping and Merge Feature

**<ExternalMapping>**
** ****<ContentAssociation>**
**  ****<Description>Product List</Description>**
**  ****<InputSource/>**
**  ****<OutputStore type=”SQL” location=”product_table”/>**
**  ****<RulesSet>**
**   ****<MapRule output="Products_List" input="@STARTGRP()"/>**
**   ****<MapRule output="type" input="Sales/Company/Year/Qtr/Product@type"/>**
**   ****<MapRule output="name" **
**        ****input="@trim(Sales/Company/Year/Qtr/Product/Item@name)"/>**
**   ****<MapRule output="manufacturer"**
**        ****input="Sales/Company/Year/Qtr/Product/Item@manufacturer"/>**
**   ****<MapRule output="value"**
**        ****input="Sales/Company/Year/Qtr/Product/Item@value"/>**
**   ****<MapRule output="sold"**
**        ****input="Sales/Company/Year/Qtr/Product/Item@sold"/>**
**   ****<MapRule output="Products_List" input="@ENDGRP()"/>**
**  ****</RulesSet>**
** ****</ContentAssociation>**
**</ExternalMapping>**

## Available Components

- Specifications and examples from the SWIKI
- _[http://cam.swiki.net](http://cam.swiki.net/)_
- jCAM component
- _[http://jcam.org.uk](http://jcam.org.uk/)_
- VisualScript editor for CAM templates
- _[http://www.visualscript.com](http://www.visualscript.com/)_
- OASIS CAM TC
- _[http://www.oasis-open.org](http://www.oasis-open.org/)_

## Next Steps

- Work in progress:
- Completion of Specification
- Enhancement of CAM processor
- Library of CAM templates by industry
- Integration with OASIS Registry assembly

## Summary: The Holy Grail of e-Business

- Automatic information integration has been the Holy Grail of e-Business systems since before XML was conceived.
- Lesson learned - three needs are paramount:
- the ability to design transactions consistently,
- the ability to document their usage in a clear way and then
- the ability to drive software that can apply rules and test information content to ensure correct compliance.
- CAM approach provides these three critical abilities:
- documentation of business interchange transactions,
- design-time assembly support with verification,
- and runtime checking of information content.

## Additional Information

- OASIS CAM (assembly) Technical Committee
- http://oasis-open.org/committees/cam/
- OASIS ebXML Registry Technical Committee
- http://oasis-open.org/committees/regrep/
- ebXML.org
- http://www.ebxml.org/
- http:ebxmlbook.com

## OASIS – Content Assembly Mechanism (CAM TC)

**OASIS – Content Assembly Mechanism (CAM TC)**

***January 2004******http://cam.swiki.net***

***Thank You***

*www.oasis-open.org*
*xml.coverpages.org*
*www.xml.org *
*www.ebxml.org*