Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 11 Business Object Model Mappings to XML Schema : Export Mappings

Export Mappings
Exporting Business Object Models to XML Schema or WSDL Files describes how Business Object Models can be exported to XML Schema (XSD) files. This appendix describes the XML schema constructs that result from the original Business Object Model constructs.
There will be differences in the exact nature of the export transformation depending on the origin of the Business Object Model i.e. whether it:
If it originated from an XML Schema import, the exported Business Object Model will create XML schema logically equivalent to the original imported schema, using the information stored as stereotypes in an internal UML profile. However, this is dependent on the user not having changed the Business Object Model after the import, in which case the profile information will have been discarded.
The examples described in this section are for user-defined Business Object Models only.
Primitive Type
Business Object Model primitive types are translated to XSD simple types. The simple types’ base restriction is set to the xsd data type corresponding to the original Business Object Model data type. These mappings are defined in Data Type Mappings.
For example:
Transforms to: 
<xsd:simpleType id="_5_yrABpLEeChWL2te4gBZg" name="PrimitiveType1">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="50"/>
</xsd:restriction>
</xsd:simpleType>
Class
Complex Type
A Business Object Model Class is transformed into an XSD ComplexType.
For example:
Transforms to:
<xsd:complexType id="_Q8fQQBpMEeChWL2te4gBZg" name="Class1"/>
Complex Type - Class with Attributes
Business Object Model attributes contained within a Class are transformed into XSD elements within a sequence contained within the ComplexType created to represent the Class.
For example:
Transforms to:
<xsd:complexType id="_oyUc8BpMEeChWL2te4gBZg" name="Class2">
<xsd:sequence>
<xsd:element id="_pSM24BpMEeChWL2te4gBZg" maxOccurs="1" minOccurs="0" name="attribute1">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="50"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element id="_ppTIQBpMEeChWL2te4gBZg" default="false" maxOccurs="1" minOccurs="0"
name="attribute2">
<xsd:simpleType>
<xsd:restriction base="xsd:boolean"/>
</xsd:simpleType>
</xsd:element>
<xsd:element id="_sVEK8BpMEeChWL2te4gBZg" maxOccurs="1" minOccurs="0" name="attribute3">
<xsd:simpleType>
<xsd:restriction base="xsd:int">
<xsd:totalDigits value="10"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
Enumeration
A Business Object Model Enumeration is transformed into an XSD SimpleType.
For example:
Transforms to:
<xsd:simpleType id="_-xfC8BpMEeChWL2te4gBZg" name="COLORS">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="RED"/>
<xsd:enumeration value="GREEN"/>
<xsd:enumeration value="BLUE"/>
</xsd:restriction>
Model
The name of the UML Model construct (which forms the base package of the Business Object Model), is used to define the target namespace of the exported XML schema, and the name of the XML schema file.
For example a file called example.Business Object Model:
Transforms to file com.example.businessobjectmodel1.xsd with the following namespace information:
<xsd:schema
xmlns="http://example.com/businessobjectmodel1" xmlns:tns1="http://example.com/businessobjectmodel1"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.com/businessobjectmodel1">
<xsd:annotation>
<xsd:documentation>BOMORIGIN::/p1/Business Objects/BusinessObjectModel1.bom</xsd:documentation>
</xsd:annotation>
</xsd:schema>
Package
For each Business Object Model Package encountered during the export transformation, a new separate XSD file will be created. Similar to the UML Construct, the Package name is used to define the XSD filename and target namespace.
If the following package exists in the above model com.example.businessobjectmodel1:
Then two schema files will be generated:
com.example.businessobjectmodel1.comexamplewwwstockcheck.xsd
with the following namespace information:
<xsd:schema
 xmlns="http://example.com/businessobjectmodel1/comexamplewwwstockcheck"
  xmlns:tns1="http://example.com/businessobjectmodel1/comexamplewwwstockcheck"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  targetNamespace="http://example.com/businessobjectmodel1/comexamplewwwstockcheck">
 <xsd:annotation>
  <xsd:documentation>BOMORIGIN::/p1/Business Objects/BusinessObjectModel1.bom</xsd:documentation>
  </xsd:annotation>
</xsd:schema>
Furthermore, the com.example.businessobjectmodel1.xsd schema will contain an <import> construct referencing com.example.businessobjectmodel1.comexamplewwwstockcheck.xsd
that is:
<xsd:schema xmlns="http://example.com/businessobjectmodel1"
  xmlns:tns2="http://example.com/businessobjectmodel1"
 xmlns:tns1="http://example.com/businessobjectmodel1/comexamplewwwstockcheck"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.com/businessobjectmodel1">
  <xsd:annotation>
  <xsd:documentation>BOMORIGIN::/p1/Business
 Objects/BusinessObjectModel1.bom</xsd:documentation>
  </xsd:annotation>
  <xsd:import
 namespace="http://example.com/businessobjectmodel1/comexamplewwwstockcheck"
 schemaLocation="com.example.businessobjectmodel1.comexamplewwwstockcheck.xsd" />
</xsd:schema>
Relationships
Currently, only two Business Object Model relationships are supported for XML schema export, namely Generalizations and Compositions.
Generalization
A Class may generalize another Class:
Transforms to:
<xsd:complexType id="_sJ1ZEBpREeChWL2te4gBZg" name="Customer">
<xsd:complexContent>
<xsd:extension base="tns1:Person"/>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType id="_so-MIBpREeChWL2te4gBZg" name="Person"/>
A Primitive Type may generalize another Primitive Type.
Transforms to:
<xsd:simpleType id="_Gf-mYBpSEeChWL2te4gBZg" name="BaseType">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="50"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType id="_GpqG0BpSEeChWL2te4gBZg" name="ExtendedType">
<xsd:restriction base="tns1:BaseType">
<xsd:maxLength value="50"/>
</xsd:restriction>
</xsd:simpleType>
Composition
The following composition construct:
Transforms to:
<xsd:complexType id="_7-Eb8BpTEeChWL2te4gBZg" name="Customer">
<xsd:sequence>
<xsd:element id="_DkCHxBpUEeChWL2te4gBZg" maxOccurs="1" minOccurs="1" name="address"
type="Address"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType id="_8PfjIBpTEeChWL2te4gBZg" name="Address"/>

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved