Example: Complex Types

This example illustrates how the BPM OData Service translates a complex type defined in the XSD into an own entity type in its Entity Data Model (EDM).

Sample XSD

<complexType name="customer"> 
 <sequence> 
	<element name="name" type="string"></element> 
	<element name="address" type="tns:address"></element> 
 </sequence> 
</complexType> 

<complexType name="address" > 
 <sequence> 
	<element name="street" type="string"></element> 
	<element name="city" type="string"></element> 
	<element name="zip" type="string"></element> 
	<element name="country" type="string"></element> 
 </sequence> 
</complexType>

Resulting EDM

<EntityType Name="customer"> 
	<Key><PropertyRef Name="EDM_Key"/></Key> 
	<Property Name="EDM_Key" Type="Edm.String" Nullable="false"/> 
	<Property Name="name" Type="Edm.String" Nullable="true"/> 
	<NavigationProperty Name="address" Relationship="BPMTaskData.customer_address" FromRole="customer" ToRole="address"/> 
</EntityType>

<!-- address --> 
<EntityType Name="address"> 
	<Key><PropertyRef Name="EDM_Key"/></Key> 
	<Property Name="EDM_Key" Type="Edm.String" Nullable="false"/> 
	<Property Name="street" Type="Edm.String" Nullable="true"/> 
	<Property Name="city" Type="Edm.String" Nullable="true"/> 
	<Property Name="zip" Type="Edm.String" Nullable="true"/> 
	<Property Name="country" Type="Edm.String" Nullable="true"/> 
</EntityType> 

<Association Name="customer_address"> 
	<End Type="BPMTaskData.customer" Multiplicity="1" Role="customer"/>
	<End Type="BPMTaskData.address" Multiplicity="1" Role="address"/> 
</Association>

Resulting Task Input Data

In the following, the task input data is simplified and shown in JavaScript Object Notation (JSON).

"customer": {
   "__metadata": {"type": "BPMTaskData.customer"},
   "EDM_Key": "540ac92ff9b311e2a810000000288732_I_1",
   "name": "John Doe",
   "address": {
     "__metadata": {"type": "BPMTaskData.address"},
     "EDM_Key": "540ac92ff9b311e2a810000000288732_I_1_1",
     "street": "Main St",
     "city": "Springfield",
     "zip": "19064",
     "country": "US"
  }
}