BizTalk Server General - Repeating Dynamic Schema Elements

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > December 2004 > Repeating Dynamic Schema Elements





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Repeating Dynamic Schema Elements
Steve Murphy

2004-12-22, 2:46 am

Hi,

I'm a bit of a newbie to BizTalk so please bare with me as I ask this
question.

We are currently investigating utilizing BizTalk 2004 to handle order
provisioning for our enterprise. The process obviously involves receiving an
order schema/message, and processing the individual line items within the
order to provision each product ordered (presumably each product type has its
own schema). My problem is that depending on the product ordered, the
attributes will differ. I need to find a way to get biztalk to access
properties dynamically so I can access them from inside an orchestration and
make business decisions on them individually.

Do we need to promote elements of a schema even if they may not exist in a
given message, or can we promote dyamically (after determining the sub-schema
type), or do we need to write XPath queries to extract data manually.

Can this be done? or am I on the wrong track completely? Any help or links
to related examples would be greatly appreciated.

see below for my first attempt at the XSD schema we will need to process:

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://OrderGateway.Order"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://OrderGateway.Order"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Order">
<xs:complexType>
<xs:sequence>
<xs:element name="Customer">
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="1" maxOccurs="1">
<xs:element name="Existing">
<xs:complexType>
<xs:sequence>
<xs:element name="Username">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Password">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="New">
<xs:complexType>
<xs:sequence>
<xs:element name="Firstname">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Lastname">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Email">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Phone">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:positiveInteger" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Fax">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:positiveInteger" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Mobile">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:positiveInteger" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="StreetAddress">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Suburb">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="State">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Postcode">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Country">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Item">
<xs:complexType>
<xs:sequence>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:choice minOccurs="1">
<xs:element name="DomainRegistration">
<xs:complexType>
<xs:sequence>
<xs:element name="Domain">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="SupportingRule"
nillable="true">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:choice minOccurs="0">
<xs:element name="Company">
<xs:complexType>
<xs:sequence>
<xs:element name="CompanyName">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="ABN">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="ACN">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="RegisteredBusiness">
<xs:complexType>
<xs:sequence>
<xs:element name="BusinessName">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="State">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="RBN">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Proprietor">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
<xs:element name="BillingPeriod">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:positiveInteger" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Hosting">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" name="Platform">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element minOccurs="1" name="Size">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:positiveInteger" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element minOccurs="1" name="BillingPeriod">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:positiveInteger" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

Thanks.
Matt Meleski

2004-12-22, 5:52 pm

Steve,

I would use xpath to access your xml elements/attributes
in your orchestration. There are a number of blog examples of using xpath
inside of
orchestrations in Alan Smith's bloggers guide to Biztalk :

http://geekswithblogs.com/asmith/ar...2/12/17341.aspx

Additionally, you could pass your XML instances to a .Net helper component
inside of your Orchestrations. These helper components would have the
necessary code in them to dynamically access data inside of your xml and
return
the necessary information back to your orchestration.

for example a .net helper class method would look like this:

public string getDynamicInformation(System.Xml.XmlDocument myOrchDocument)
{
// code here to access the document


}


Matt.

"Steve Murphy" wrote:

> Hi,
>
> I'm a bit of a newbie to BizTalk so please bare with me as I ask this
> question.
>
> We are currently investigating utilizing BizTalk 2004 to handle order
> provisioning for our enterprise. The process obviously involves receiving an
> order schema/message, and processing the individual line items within the
> order to provision each product ordered (presumably each product type has its
> own schema). My problem is that depending on the product ordered, the
> attributes will differ. I need to find a way to get biztalk to access
> properties dynamically so I can access them from inside an orchestration and
> make business decisions on them individually.
>
> Do we need to promote elements of a schema even if they may not exist in a
> given message, or can we promote dyamically (after determining the sub-schema
> type), or do we need to write XPath queries to extract data manually.
>
> Can this be done? or am I on the wrong track completely? Any help or links
> to related examples would be greatly appreciated.
>
> see below for my first attempt at the XSD schema we will need to process:
>
> <?xml version="1.0" encoding="utf-16"?>
> <xs:schema xmlns="http://OrderGateway.Order"
> xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
> targetNamespace="http://OrderGateway.Order"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:element name="Order">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="Customer">
> <xs:complexType>
> <xs:sequence>
> <xs:choice minOccurs="1" maxOccurs="1">
> <xs:element name="Existing">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="Username">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:string" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> <xs:element name="Password">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:string" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="New">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="Firstname">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:string" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> <xs:element name="Lastname">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:string" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> <xs:element name="Email">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:string" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> <xs:element name="Phone">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:positiveInteger" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> <xs:element name="Fax">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:positiveInteger" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> <xs:element name="Mobile">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:positiveInteger" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> <xs:element name="StreetAddress">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:string" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> <xs:element name="Suburb">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:string" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> <xs:element name="State">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:string" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> <xs:element name="Postcode">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:string" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> <xs:element name="Country">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:string" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:choice>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="Item">
> <xs:complexType>
> <xs:sequence>
> <xs:sequence minOccurs="1" maxOccurs="unbounded">
> <xs:choice minOccurs="1">
> <xs:element name="DomainRegistration">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="Domain">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:string" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> <xs:element minOccurs="0" name="SupportingRule"
> nillable="true">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:string" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> <xs:choice minOccurs="0">
> <xs:element name="Company">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="CompanyName">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:string" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> <xs:element name="ABN">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:string" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> <xs:element name="ACN">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:string" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="RegisteredBusiness">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="BusinessName">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:string" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> <xs:element name="State">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:string" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> <xs:element name="RBN">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:string" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> <xs:element name="Proprietor">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:string" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:choice>
> <xs:element name="BillingPeriod">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:positiveInteger" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="Hosting">
> <xs:complexType>
> <xs:sequence>
> <xs:element minOccurs="1" name="Platform">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:string" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> <xs:element minOccurs="1" name="Size">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:positiveInteger" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> <xs:element minOccurs="1" name="BillingPeriod">
> <xs:complexType>
> <xs:simpleContent>
> <xs:extension base="xs:positiveInteger" />
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:choice>
> </xs:sequence>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
>
> Thanks.

Steve Murphy

2004-12-23, 2:46 am

Thanks Mat,

From you reply I assume that I'm at least headed in the right direction (in
terms of what I expect biztalk to do).

Being still in a proof of concept phase of the project I'll investigate both
of your suggested methods and try to post back some info on which we ended up
running with.

Steve.

"Matt Meleski" wrote:
[vbcol=seagreen]
> Steve,
>
> I would use xpath to access your xml elements/attributes
> in your orchestration. There are a number of blog examples of using xpath
> inside of
> orchestrations in Alan Smith's bloggers guide to Biztalk :
>
> http://geekswithblogs.com/asmith/ar...2/12/17341.aspx
>
> Additionally, you could pass your XML instances to a .Net helper component
> inside of your Orchestrations. These helper components would have the
> necessary code in them to dynamically access data inside of your xml and
> return
> the necessary information back to your orchestration.
>
> for example a .net helper class method would look like this:
>
> public string getDynamicInformation(System.Xml.XmlDocument myOrchDocument)
> {
> // code here to access the document
>
>
> }
>
>
> Matt.
>
> "Steve Murphy" wrote:
>
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com