Boomi: mapping of complex ASN structures: part II – creating an intermediate XML structure

Part I

As it was described in the previous article, I’m going to use an intermediate XML structure which “imitates” the target one so I’ll be able to use simple links. In Boomi I will need to create an XML profile, and so I need to use XSD.

If you know XSD – good, if you do not know it – not a problem, I’ll show you how to do that.

So, my structure will look like this:

  • Message (root)
    • ShipmentID (element)
    • ShipmentDate (element)
    • ShipmentTime (element)
    • PurchaseOrder (element)
    • Package (repeatable structure)
      • Label (element)
      • Product (repeatable structure)
        • BuyerID (element)
        • Quantity (element)
        • UoM (element)

As you can see this structure contains either structures (XML element which contains other XML elements) or elements which contain data. Structures might be repeatable or not. This is enough to build the XSD schema for Boomi.

Let’s start with the basic template with only one root element – Message:

<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<xsd:element name="Message">
		<xsd:complexType>
			<xsd:sequence>
				<!-- place for all the child structures-->
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
</xsd:schema>

Now we need to fill it with the structures and elements. To add a non repeatable structure you need to use this construction:

<xsd:element name="StructureName" minOccurs="0">
	<xsd:complexType>
		<xsd:sequence>
			<!-- place for other structures and/or elements -->
		</xsd:sequence>
	</xsd:complexType>
</xsd:element>

to add a repeatable structure you need to use this:

<xsd:element name="StructureName" minOccurs="0" maxOccurs="unbounded">
	<xsd:complexType>
		<xsd:sequence>
			<!-- place for other structures and/or elements -->
		</xsd:sequence>
	</xsd:complexType>
</xsd:element>

To add an XML element you need to use this:

<xsd:element name="ElementName" minOccurs="0" />

The final XSD should look like this:

<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <xsd:element name="Message">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="ShipmentID" minOccurs="0" />
        <xsd:element name="ShipmentDate" minOccurs="0" />
        <xsd:element name="ShipmentTime" minOccurs="0" />
        <xsd:element name="PurchaseOrder" minOccurs="0" />
        <xsd:element name="Package" minOccurs="0" maxOccurs="unbounded">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="Label" minOccurs="0" />

              <xsd:element name="Product" minOccurs="0" maxOccurs="unbounded">
                <xsd:complexType>
                  <xsd:sequence>
                    <xsd:element name="BuyerID" minOccurs="0" />
                    <xsd:element name="Quantity" minOccurs="0" />
                    <xsd:element name="UoM" minOccurs="0" />
                  </xsd:sequence>
                </xsd:complexType>
              </xsd:element>
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>

Save this as a file. I used “001 intermediate ASN.xml” name.

Now create an XML profile in Boomi:

next:

If everything is correct, you will see the following screen, select Message:

it will create an XML profile. Add a meaningful name (I used “intermediate ASN”):

That’s it, the next step will be creating an XSLT which converts the IDoc data into this intermediate XML.

Next lesson

Gennady Kim