packaging
The packaging section of the document supports several extended functionalities by providing specific commands that define where and how the contained packaging data is added to the underlying data source.
Currently supported commands are:
-
pack -
unpack -
repack -
info
Sample XML telegram
This document describes the packaging section of XML telegrams used in Part Traceability.
Click to unfold sample XML telegram
<?xml version="1.0" encoding="UTF-8"?>
<documents contentType="QualityData">
<document>
<basicInfo/>
<packaging command="[pack]/[unpack]/[repack]/[info]">
<packages>
<package>
<results>
<result id="201006290000000003" state="0" childPartId="aa0000000002" childPackageId="" type="0" resultDate="2010-07-19T15:30:02.0391409+02:00"/>
<result id="201006290000000003" state="0" childPartId="aa0000000001" childPackageId="" type="0" resultDate="2010-07-19T15:30:02.0391409+02:00"/>
</results>
<infos>
<info id="201006290000000003" state="0" name="Location" value="Stuttgart" type="0" resultDate="2010-07-19T15:30:02.0391409+02:00"/>
<info id="201006290000000003" state="0" name="DeliveryNoteNo" value="47110815" type="3" resultDate="2010-07-19T15:30:02.0391409+02:00"/>
<info id="201006290000000003" state="0" name="ChargeIndex" value="1039S07119" type="0" resultDate="2010-07-19T15:30:02.0391409+02:00"/>
<info id="201006290000000003" state="0" name="CustomerPartNo" value="1123D87119" type="0" resultDate="2010-07-19T15:30:02.0391409+02:00"/>
</infos>
</package>
</packages>
</packaging>
</document>
</documents>
|
The |
XSD file
A packaging XSD file is available for download.
Click to unfold packaging XSD
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://opcon.dc.modules.qualitydata/dtos/pack"
xmlns="http://opcon.dc.modules.qualitydata/dtos/pack"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<!-- ===== Text primitives ===== -->
<!-- Allowed: Unicode letters/digits + space . _ = / + % & # * ; - and {} (for template IDs) -->
<xs:simpleType name="AllowedUnicodePlus">
<xs:restriction base="xs:string">
<xs:pattern value="[\p{L}\p{N} ._=/+%&#*;\-{}]+"/>
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Str80">
<xs:restriction base="AllowedUnicodePlus">
<xs:maxLength value="80"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Str160">
<xs:restriction base="AllowedUnicodePlus">
<xs:maxLength value="160"/>
</xs:restriction>
</xs:simpleType>
<!-- For attributes where empty string is explicitly allowed (ChildPartId/ChildPackageId) -->
<xs:simpleType name="EmptyOrStr80">
<xs:union memberTypes="Str80">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="0"/>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
<!-- ===== DateTime (ISO 8601 with timezone, optional fractional seconds) ===== -->
<xs:simpleType name="DateTimeWithTZ">
<xs:restriction base="xs:string">
<xs:pattern value="\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+\-]\d{2}:\d{2})"/>
</xs:restriction>
</xs:simpleType>
<!-- ===== Numerics / flags ===== -->
<!-- Id: integer up to 10 digits (0..9,999,999,999) -->
<xs:simpleType name="UIntDigits10">
<xs:restriction base="xs:nonNegativeInteger">
<xs:totalDigits value="10"/>
</xs:restriction>
</xs:simpleType>
<!-- State: number(2,0) => 0..99 (adjust if you have a fixed set) -->
<xs:simpleType name="StateEnumPrecision2">
<xs:restriction base="xs:integer">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="99"/>
</xs:restriction>
</xs:simpleType>
<!-- State: number(3,0) => 0..999 (adjust if you have a fixed set) -->
<xs:simpleType name="StateEnumPrecision3">
<xs:restriction base="xs:integer">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="999"/>
</xs:restriction>
</xs:simpleType>
<!-- PackageType: 0 (Box) or 1 (Pallet) -->
<xs:simpleType name="PackageTypeEnum">
<xs:restriction base="xs:integer">
<xs:enumeration value="0"/> <!-- Box -->
<xs:enumeration value="1"/> <!-- Pallet -->
</xs:restriction>
</xs:simpleType>
<!-- Invalid: 0/1 or true/false -->
<xs:simpleType name="Bool01OrBoolean">
<xs:union>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="0"/>
<xs:enumeration value="1"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="xs:boolean"/>
</xs:simpleType>
</xs:union>
</xs:simpleType>
<!-- ===== Records ===== -->
<!-- Result row (your field table) -->
<xs:complexType name="ResultRecord">
<!-- Id -->
<xs:attribute name="recId" type="UIntDigits10" use="optional"/>
<!-- PackageId (maps to XML @id) -->
<xs:attribute name="id" type="Str80" use="required"/> <!-- Unique identifier of the packaging unit to which the information is assigned or removed. -->
<!-- State -->
<xs:attribute name="state" type="StateEnumPrecision2" use="required"/> <!-- See initialization parameter. -->
<!-- ChildPartId / ChildPackageId (empty allowed) -->
<xs:attribute name="childPartId" type="EmptyOrStr80" use="optional"/> <!-- Identifier of the part that is assigned to or removed from the packaging unit. -->
<xs:attribute name="childPackageId" type="EmptyOrStr80" use="optional"/> <!-- Identifier of the sub-packaging unit that is assigned to or removed from the packaging unit. -->
<!-- PackageType -->
<xs:attribute name="type" type="PackageTypeEnum" use="optional"/> <!-- Type of packaging unit: 0=Box, 1=Pallet -->
<!-- ResultDate -->
<xs:attribute name="resultDate" type="DateTimeWithTZ" use="optional"/> <!-- Date and time with timezone offset when a packaging unit was created or a part/sub-packaging unit was assigned or removed. -->
<!-- Path -->
<xs:attribute name="path" type="Str80" use="optional"/>
<!-- Invalid -->
<xs:attribute name="invalid" type="Bool01OrBoolean" use="optional"/>
<!-- TimeStamp -->
<xs:attribute name="timeStamp" type="DateTimeWithTZ" use="optional"/>
<!-- Archive -->
<xs:attribute name="archive" type="UIntDigits10" use="optional"/>
</xs:complexType>
<xs:complexType name="Results">
<xs:sequence>
<xs:element name="result" type="ResultRecord" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!-- Info rows (kept simple to match your samples) -->
<xs:complexType name="InfoRecord">
<xs:attribute name="id" type="Str80" use="required"/> <!-- Unique identifier of the packaging unit to which the information is assigned or removed. -->
<xs:attribute name="state" type="StateEnumPrecision2" use="required"/> <!-- See initialization parameter. -->
<xs:attribute name="name" type="Str160" use="required"/> <!-- Name of the information that is assigned or removed -->
<xs:attribute name="value" type="Str160" use="required"/> <!-- Value of the information that is assigned or removed -->
<xs:attribute name="type" type="StateEnumPrecision3" use="required"/> <!-- Type of the packing information that is assigned or removed -->
<xs:attribute name="resultDate" type="DateTimeWithTZ" use="required"/> <!-- Date and time with timezone offset when a packaging unit was created or a part/sub-packaging unit was assigned or removed. -->
</xs:complexType>
<xs:complexType name="Infos">
<xs:sequence>
<xs:element name="info" type="InfoRecord" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Package">
<xs:sequence>
<xs:element name="results" type="Results"/>
<xs:element name="infos" type="Infos" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Packages">
<xs:sequence>
<xs:element name="package" type="Package" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!-- packaging root -->
<xs:simpleType name="CommandEnum">
<xs:restriction base="xs:string">
<xs:enumeration value="pack"/>
<xs:enumeration value="repack"/>
<xs:enumeration value="unpack"/>
<xs:enumeration value="info"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="PackagingType">
<xs:sequence>
<xs:element name="packages" type="Packages"/>
</xs:sequence>
<xs:attribute name="command" type="CommandEnum" use="required"/>
<xs:attribute name="version" type="xs:integer" use="required"/>
<xs:attribute name="archive" type="UIntDigits10" use="optional"/>
</xs:complexType>
<!-- Declare <packaging> as the global root for snippet validation -->
<xs:element name="packaging" type="PackagingType"/>
</xs:schema>