I am building a BPEL process that takes an itinerary
as input: this is made of an unbounded list of elements and some attributes.
The task of the process is to go over every element of the list "booking" it, assign some value to the attributes, and then return the itinerary
.
Each of those elements is itself made of two elements: some information for the booking process (which works fine) and the specific object, which might be a flight or a hotel. I tried defining that element like so:
<xsd:complexType name="ObjectType" abstract="true">
<xsd:sequence>
<xsd:element name="objType" type="xsd:string"></xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="FlightType">
<xsd:complexContent>
<xsd:extension base="tns:ObjectType">
<xsd:sequence>
<xsd:element name="departureCity" type="xsd:string"></xsd:element>
<xsd:element name="arrivalCity" type="xsd:string"></xsd:element>
<xsd:element name="departureTime" type="xsd:dateTime"></xsd:element>
<xsd:element name="arrivalTime" type="xsd:dateTime"></xsd:element>
<xsd:element name="airline" type="xsd:string"></xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="ItineraryReservationType">
<xsd:sequence>
<xsd:element name="object" type="tns:ObjectType"></xsd:element>
<xsd:element name="reservation" type="tns:ReservationType"></xsd:element>
</xsd:sequence>
</xsd:complexType>
and then using them in a CompositeApplication with this kind of input
<urn:itineraryReservation>
<urn:flight>
<urn:objType>flight</urn:objType>
<urn:departureCity>Ottawa</urn:departureCity>
<urn:arrivalCity>Toronto</urn:arrivalCity>
<urn:departureTime>2007-10-26T08:36:28</urn:departureTime>
<urn:arrivalTime>2004-02-14T19:44:14</urn:arrivalTime>
<urn:airline>Aircanada</urn:airline>
</urn:flight>
<urn:reservation>
<urn:price>3</urn:price>
</urn:reservation>
</urn:itineraryReservation>
but whenever the process reaches the last assign
and tries to copy the itinerary
element to output it I get a Particle not found in the complex type. element={urn:ws.bpelschema}flight, complexType={urn:ws.bpelschema}ItineraryReservationType
.
The obvious alternative is to carry two lists around, one for flights and one for hotels, but I thought things could be better and couldn't find anything on this topic.
Thanks for helping!