<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.posti.com/wms/postiwmsxml/InWorkOrder/2020/1" targetNamespace="http://www.posti.com/wms/postiwmsxml/InWorkOrder/2020/1" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xsd:element name="WorkOrder" type="WorkOrderXSDType"/>
	<xsd:complexType name="WorkOrderXSDType">
		<xsd:all>
			<xsd:element name="MetaData" type="ctMetaDataType" minOccurs="1" maxOccurs="1"/>
			<xsd:element ref="Extn" minOccurs="0" maxOccurs="1"/>				
			<xsd:element ref="WorkOrderComponents" minOccurs="0" maxOccurs="1"/>
			<xsd:element ref="WorkOrderActivities" minOccurs="0" maxOccurs="1"/>		
		</xsd:all>
		<xsd:attribute name="FinishNoLaterThan" type="xsd:dateTime" use="optional">
			<xsd:annotation>
				<xsd:documentation>
					<div>Pass through fields to be stamped on each task.</div>
				</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="InvUpdateActivityCode" type="stStringMaxLength40Type" use="optional">
			<xsd:annotation>
				<xsd:documentation>The activity code against which inventory needs to be updated.</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="ItemID" type="stStringMaxLength40Type" use="optional">
			<xsd:annotation>
				<xsd:documentation>
					<div>ItemID for the work order is being created.</div>
				</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="NodeKey" type="stStringMaxLength24Type" use="optional">
			<xsd:annotation>
				<xsd:documentation>
					<div>Node, where work order would be executed.</div>
				</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="ProductClass" type="stStringMaxLength10Type" use="optional">
			<xsd:annotation>
				<xsd:documentation>The product class of an item.</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="Purpose" type="EnumPurpose2" use="optional">
			<xsd:annotation>
				<xsd:documentation>This field indicates the purpose for the work order.</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="QuantityRequested" type="Capacity" use="optional">
			<xsd:annotation>
				<xsd:documentation>The quantity for which the work order is created.</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="AutoRelease" type="stStringMaxLength1YNType" use="optional">
			<xsd:annotation>
				<xsd:documentation>AutoRelease.</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="Segment" type="stStringMaxLength40Type" use="optional">
			<xsd:annotation>
				<xsd:documentation>The segment to which the inventory involved in the work order belongs.</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="SegmentType" type="stStringMaxLength40Type" use="optional">
			<xsd:annotation>
				<xsd:documentation>This field indicates the segment type. Valid values are: - MTO : Made To Order - MTC : Made To Customer.</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="ServiceItemGroupCode" type="EnumServiceItemGroupCode" use="optional">
			<xsd:annotation>
				<xsd:documentation>
					<div>The type of service. The values will be defaulted based on the service lines. If there is at least one service line of type "PS" then ServiceItemGroupCode will be set to "PS". If there are only "DS" service lines then ServiceItemGroupCode will be set to "DS".
						<div class="innerpanel" width="30%">
							<table border="0" cellpadding="0" cellspacing="0" class="table">
								<thead>
									<tr>
										<td class="tablecolumnheader">ServiceItemGroupCode</td>
										<td class="tablecolumnheader">Meaning</td>
									</tr>
								</thead>
								<tbody>
									<tr>
										<td class="tablecolumn">KIT</td>
										<td class="tablecolumn">Kitting</td>
									</tr>
									<tr>
										<td class="tablecolumn">DKIT</td>
										<td class="tablecolumn">De-kitting</td>
									</tr>
									<tr>
										<td class="tablecolumn">COMPL</td>
										<td class="tablecolumn">Inventory Compliance</td>
									</tr>
									<tr>
										<td class="tablecolumn">INVC</td>
										<td class="tablecolumn">Inventory Change</td>
									</tr>
									<tr>
										<td class="tablecolumn">PS</td>
										<td class="tablecolumn">Provided Service / Field Service</td>
									</tr>
									<tr>
										<td class="tablecolumn">DS</td>
										<td class="tablecolumn">Delivery Service</td>
									</tr>
								</tbody>
							</table>
						</div>
					</div>
				</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="ServiceItemID" type="stStringMaxLength40Type" use="optional">
			<xsd:annotation>
				<xsd:documentation>The identifier for the service item on this work order.</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="StartNoEarlierThan" type="xsd:dateTime" use="optional">
			<xsd:annotation>
				<xsd:documentation>The date a task should not start earlier than. Pass through fields to be stamped on each task.</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="Uom" type="stStringMaxLength40Type" use="optional">
			<xsd:annotation>
				<xsd:documentation>The unit of measure for the item.</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="WorkOrderNo" type="stStringMaxLength40Type" use="optional">
			<xsd:annotation>
				<xsd:documentation>The work order number. Identifies a work order within the context of a node and enterprise.</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="Action" type="stStringMaxLength10Type" use="optional">
			<xsd:annotation>
				<xsd:documentation>Action</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
	</xsd:complexType>
	<xsd:complexType name="ctMetaDataType">
		<xsd:annotation>
			<xsd:documentation>Contains information about message.</xsd:documentation>
		</xsd:annotation>
		<xsd:attribute name="SourceOrganizationId" type="stStringMaxLength40Type" use="required">
			<xsd:annotation>
				<xsd:documentation>Code for the organization that sends the item master message, provided by Posti (principal identifier).</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="Language" type="stStringMaxLength2Type" use="optional">
			<xsd:annotation>
				<xsd:documentation>Language code of the item master in two-letter ISO 639-1 format, e.g. FI.</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="ExternalUserId" type="stStringMaxLength40Type" use="optional">
			<xsd:annotation>
				<xsd:documentation>Identifier of the principal in external system (OVT code, EDI sender ID).</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="DocumentType" type="stStringMaxLength40Type" use="required">
			<xsd:annotation>
				<xsd:documentation>Name of the document. This should be InItemMaster.</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="CreationDateTime" type="xsd:dateTime" use="optional">
			<xsd:annotation>
				<xsd:documentation>Date and time of item master creation.</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="MessageIdentifier" type="stStringMaxLength40Type" use="optional">
			<xsd:annotation>
				<xsd:documentation>Identifier of the message which is unique at least in the scope of message sender.</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
	</xsd:complexType>
	<xsd:element name="Extn">
		<xsd:complexType>
			<xsd:attribute name="ExtnCustomerPOLineNo" type="stStringMaxLength40Type" use="optional">
				<xsd:annotation>
					<xsd:documentation>Purchase order number line associated with this work order.</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="ExtnCustomerPONo" type="stStringMaxLength40Type" use="optional">
				<xsd:annotation>
					<xsd:documentation>
						<div>Purchase order number associated with this work order.</div>
					</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="WorkOrderComponents">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref="WorkOrderComponent" minOccurs="0" maxOccurs="unbounded"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="WorkOrderComponent">
		<xsd:annotation>
			<xsd:documentation>
				<div>
			This table stores information about all the components required by the work order.<br/>Components are not mandatory for work orders created for the <code>KITTING</code> service item group code.
			</div>
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:all>
				<xsd:element ref="WorkOrderComponentTag" minOccurs="0" maxOccurs="1"/>
			</xsd:all>
			<xsd:attribute name="ComponentQuantity" type="Quantity" use="optional">
				<xsd:annotation>
					<xsd:documentation>The component quantity per work order item quantity.</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="ItemID" type="stStringMaxLength40Type" use="optional">
				<xsd:annotation>
					<xsd:documentation>The unique identifier for the item associated with this work order component.</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="ProductClass" type="stStringMaxLength10Type" use="optional">
				<xsd:annotation>
					<xsd:documentation>The product class of an item.</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="Segment" type="stStringMaxLength100Type" use="optional">
				<xsd:annotation>
					<xsd:documentation>The segment to which the inventory involved in the work order belongs.</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="SegmentType" type="stStringMaxLength40Type" use="optional">
				<xsd:annotation>
					<xsd:documentation>This field indicates the segment type. Valid values are: - MTO : Made To Order - MTC : Made To Customer.</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="Uom" type="stStringMaxLength40Type" use="optional">
				<xsd:annotation>
					<xsd:documentation>The unit of measure for the item.</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="WorkOrderComponentTag">
		<xsd:annotation>
			<xsd:documentation>
				<div>
					Stores details of the inventory tag attributes for work order components that are tag tracked. Tag information is stored only if the <code>Node</code> tracks tag information in inventory.	
					</div>
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:attribute name="LotNumber" type="stStringMaxLength40Type" use="optional">
				<xsd:annotation>
					<xsd:documentation>Lot Number.</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="WorkOrderActivities">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref="WorkOrderActivity" minOccurs="0" maxOccurs="unbounded"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="WorkOrderActivity">
		<xsd:annotation>
			<xsd:documentation>This table stores the list of activities to be performed to complete the work order.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:all>
				<xsd:element ref="WorkOrderActivityDtls" minOccurs="0" maxOccurs="1"/>
			</xsd:all>
			<xsd:attribute name="ActivityCode" type="stStringMaxLength40Type" use="optional">
				<xsd:annotation>
					<xsd:documentation>Activity Code.</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="WorkOrderActivityDtls">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref="WorkOrderActivityDtl" minOccurs="1" maxOccurs="unbounded"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="WorkOrderActivityDtl">
		<xsd:annotation>
			<xsd:documentation>This table stores details on where and to what extent an activity is confirmed.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:attribute name="ActivityCode" type="stStringMaxLength40Type" use="optional">
				<xsd:annotation>
					<xsd:documentation>Activity Code.</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="ActivityLocationId" type="stStringMaxLength40Type" use="optional">
				<xsd:annotation>
					<xsd:documentation>
						<div>Activity Location.</div>
					</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name="QuantityRequested" type="Quantity" use="optional">
				<xsd:annotation>
					<xsd:documentation>Quantity Requested.</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
		</xsd:complexType>
	</xsd:element>
	<xsd:simpleType name="stStringMaxLength10Type">
		<xsd:annotation>
			<xsd:documentation>String with maximum length of 10 characters.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:maxLength value="10"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="stStringMaxLength2Type">
		<xsd:annotation>
			<xsd:documentation>String with maximum length of 2 characters.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:maxLength value="2"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="stStringMaxLength24Type">
		<xsd:annotation>
			<xsd:documentation>String with maximum length of 24 characters.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:maxLength value="24"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="stStringMaxLength40Type">
		<xsd:annotation>
			<xsd:documentation>String with maximum length of 40 characters.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:maxLength value="40"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="stStringMaxLength100Type">
		<xsd:annotation>
			<xsd:documentation>String with maximum length of 100 characters.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:maxLength value="100"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="stStringMaxLength1YNType">
		<xsd:annotation>
			<xsd:documentation>String with maximun length of 1 character and possible values Y or N.</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:maxLength value="1"/>
			<xsd:pattern value="[YN]"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="Quantity">
		<xsd:restriction base="xsd:decimal">
			<xsd:minInclusive value="0"/>
			<xsd:fractionDigits value="4"/>
			<xsd:totalDigits value="14"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="EnumServiceItemGroupCode">
		<xsd:restriction base="xsd:string">
			<xsd:maxLength value="40"/>
			<xsd:enumeration value="KIT"/>
			<xsd:enumeration value="DKIT"/>
			<xsd:enumeration value="COMPL"/>
			<xsd:enumeration value="INVC"/>
			<xsd:enumeration value="PS"/>
			<xsd:enumeration value="DS"/>
			<xsd:enumeration value=""/>
			<xsd:enumeration value=" "/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="Capacity">
		<xsd:restriction base="xsd:decimal">
			<xsd:minInclusive value="0"/>
			<xsd:fractionDigits value="4"/>
			<xsd:totalDigits value="14"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="EnumPurpose2">
		<xsd:restriction base="xsd:string">
			<xsd:maxLength value="40"/>
			<xsd:enumeration value="ORDER"/>
			<xsd:enumeration value="STOCK"/>
			<xsd:enumeration value="SHIP"/>
			<xsd:enumeration value=""/>
			<xsd:enumeration value=" "/>
		</xsd:restriction>
	</xsd:simpleType>
</xsd:schema>