Changes for page Exercises
Last modified by Carlijn Kokkeler on 2022/10/20 14:28
From version 4.1
edited by Carlijn Kokkeler
on 2022/10/19 15:18
on 2022/10/19 15:18
Change comment:
There is no comment for this version
To version 2.1
edited by Carlijn Kokkeler
on 2022/10/19 13:55
on 2022/10/19 13:55
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -6,27 +6,235 @@ 6 6 == 1. Prerequisites == 7 7 8 8 * Basic knowledge of the eMagiz platform 9 -* Completion of the [[exercises>>doc:Main.eMagiz Academy.Use Cases.Data modeling in Design.Exercises.WebHome||target="blank"]] from the Data modeling in Design use case. 10 10 11 11 == 2. Key concepts == 12 12 13 13 This microlearning centers around understanding the concept of transformations. Please note that these are follow-up exercises from the Data modeling in Design exercises, which can be found [[here>>doc:Main.eMagiz Academy.Use Cases.Data modeling in Design.Exercises.WebHome||target="blank"]]. 14 14 15 -== 3. Transformationsin Create ==16 -By following the steps below, you should gain a better understanding of tr ansformations.14 +== 3. CDM, CDM & system message, message mapping == 15 +By following the steps below, you should gain a better understanding of the differences between CDM, CDM messages, and system messages. 17 17 18 -* Enumeration value mapping 19 -** CDM message uses an ISO-3 standard for country code. Add an enumeration for the attribute Country according to this standard. 20 -** System message uses an ISO-2 standard for country code. Add an enumeration for the attribute Country according to this standard. 21 -* Boolean value mapping TBD 22 -* Fixed value 23 -** Add a fixed value to the attribute 'Type' from the entity 'Address'. Please carefully look at the desired value(s). 24 -* If exists 25 - ** Make sure that a Description attribute is only generated if a description exists. 26 -* XPath TBD 17 +* Creating a CDM 18 + ** Please import the file Order.xsd in your CDM. The code for this file can be found in section 4. Code for xsd files. 19 +* Creating a CDM message 20 + ** Now, go to your CDM message and select Order as root entity. 21 + ** Add all other entities and attributes from Order.xsd, which were imported into the CDM, to your CDM message definition. 22 +* Creating a system message 23 + ** In one of your System messages, import the file TransportOrder.xsd. The code for this file can be found in section 4. Code for xsd files. 24 +* Creating a CDM message 25 + ** Select CreateOrder as root entity and add all other entities and attributes to your system definition. 26 +* Complete message mapping 27 + ** Now that you have completed these steps, go to Message mapping and complete the mapping. Please add the following to the Design mapping 28 + *** Ensure to properly map the address type 29 + *** Ensure to properly document mappings where required 30 +* Update the CDM and CDM message and remove the housenumber attribute 31 + ** Update the mapping accordingly 32 +* Update the System and CDM message to set the country attributes as enumerations 33 + ** System message uses an ISO-2 standard for country code 34 + ** CDM message uses an ISO-3 standard for country code 35 + 27 27 28 -The solutions to these exercises can be found [[here>>doc:Main.eMagiz Academy.Use Cases. Transformations.Exercises.Solutions.WebHome||target="blank"]].37 +The solutions to these exercises can be found [[here>>doc:Main.eMagiz Academy.Use Cases.Data modeling in Design.Exercises.Solutions.WebHome||target="blank"]]. 29 29 39 +== 4. Code for xsd files == 40 +=== 4.1 Code for Order.xsd === 41 +{{code language="xml"}} 42 +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 43 + xmlns="http://www.mappingexercises.com/ns/capetms/cdm/1.0/" 44 + attributeFormDefault="unqualified" 45 + elementFormDefault="qualified" 46 + targetNamespace="http://www.mappingexercises.com/ns/capetms/cdm/1.0/"> 47 + <xs:complexType name="Order"> 48 + <xs:sequence> 49 + <xs:element name="Date" type="xs:dateTime"/> 50 + <xs:element name="OrderId" type="nonEmptyString"/> 51 + <xs:element name="Customer" type="Customer"/> 52 + <xs:element name="PickupAddress" type="PickupAddress"/> 53 + <xs:element name="DeliveryAddress" type="DeliveryAddress"/> 54 + <xs:element maxOccurs="unbounded" name="OrderLine" type="OrderLine"/> 55 + </xs:sequence> 56 + </xs:complexType> 57 + <xs:complexType name="Customer"> 58 + <xs:sequence> 59 + <xs:element name="Name" type="nonEmptyString"/> 60 + <xs:element name="Email" type="nonEmptyString"/> 61 + </xs:sequence> 62 + </xs:complexType> 63 + <xs:complexType name="PickupAddress"> 64 + <xs:sequence> 65 + <xs:element name="Name" type="nonEmptyString"/> 66 + <xs:element name="Street" type="nonEmptyString"/> 67 + <xs:element name="StreetNumber" type="nonEmptyString"/> 68 + <xs:element name="PostalCode" type="nonEmptyString"/> 69 + <xs:element name="City" type="nonEmptyString"/> 70 + <xs:element name="Country" type="nonEmptyString"/> 71 + </xs:sequence> 72 + </xs:complexType> 73 + <xs:complexType name="DeliveryAddress"> 74 + <xs:sequence> 75 + <xs:element name="Name" type="nonEmptyString"/> 76 + <xs:element name="Street" type="nonEmptyString"/> 77 + <xs:element name="StreetNumber" type="nonEmptyString"/> 78 + <xs:element name="PostalCode" type="nonEmptyString"/> 79 + <xs:element name="City" type="nonEmptyString"/> 80 + <xs:element name="Country" type="nonEmptyString"/> 81 + </xs:sequence> 82 + </xs:complexType> 83 + <xs:complexType name="OrderLine"> 84 + <xs:sequence> 85 + <xs:element name="PackageUnit" type="nonEmptyString"/> 86 + <xs:element name="Quantity" type="xs:long"/> 87 + <xs:element name="Description" type="nonEmptyString"/> 88 + <xs:element name="Weight" type="xs:decimal"/> 89 + </xs:sequence> 90 + </xs:complexType> 91 + <xs:simpleType name="nonEmptyString"> 92 + <xs:restriction base="xs:string"> 93 + <xs:minLength value="1"/> 94 + </xs:restriction> 95 + </xs:simpleType> 96 + <xs:element name="Order" type="Order"/> 97 +</xs:schema> 98 +{{/code}} 99 + 100 +=== 4.2 Code for TransportOrder.xsd === 101 +{{code language="xml"}} 102 +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 103 + xmlns="https://transportinc.nl/ns/tms/1.0/" 104 + attributeFormDefault="unqualified" 105 + elementFormDefault="unqualified" 106 + targetNamespace="https://transportinc.nl/ns/tms/1.0/"> 107 + <xs:complexType name="CreateOrder"> 108 + <xs:sequence> 109 + <xs:element name="Order" type="Order"/> 110 + </xs:sequence> 111 + </xs:complexType> 112 + <xs:complexType name="Order"> 113 + <xs:sequence> 114 + <xs:element name="OrderID"> 115 + <xs:simpleType> 116 + <xs:restriction base="xs:string"> 117 + <xs:maxLength value="200"/> 118 + </xs:restriction> 119 + </xs:simpleType> 120 + </xs:element> 121 + <xs:element name="OrderDate" type="xs:dateTime"/> 122 + <xs:element minOccurs="0" name="Order_Customer" type="Order_Customer"/> 123 + <xs:element name="Address" type="Address"/> 124 + <xs:element name="PartnerInfo_Order" type="PartnerInfo_Order"/> 125 + <xs:element name="OrderLine_Order" type="OrderLine_Order"/> 126 + </xs:sequence> 127 + </xs:complexType> 128 + <xs:complexType name="Order_Customer"> 129 + <xs:sequence> 130 + <xs:element minOccurs="0" name="Customer" type="Customer"/> 131 + </xs:sequence> 132 + </xs:complexType> 133 + <xs:complexType name="Customer"> 134 + <xs:sequence> 135 + <xs:element name="Name"> 136 + <xs:simpleType> 137 + <xs:restriction base="xs:string"> 138 + <xs:maxLength value="200"/> 139 + </xs:restriction> 140 + </xs:simpleType> 141 + </xs:element> 142 + <xs:element minOccurs="0" name="Contact_Customer" type="Contact_Customer"/> 143 + </xs:sequence> 144 + </xs:complexType> 145 + <xs:complexType name="Contact_Customer"> 146 + <xs:sequence> 147 + <xs:element maxOccurs="unbounded" 148 + minOccurs="0" 149 + name="Contact" 150 + type="Contact"/> 151 + </xs:sequence> 152 + </xs:complexType> 153 + <xs:complexType name="Contact"> 154 + <xs:sequence> 155 + <xs:element name="eMail"> 156 + <xs:simpleType> 157 + <xs:restriction base="xs:string"> 158 + <xs:maxLength value="200"/> 159 + </xs:restriction> 160 + </xs:simpleType> 161 + </xs:element> 162 + <xs:element minOccurs="0" name="Name"> 163 + <xs:simpleType> 164 + <xs:restriction base="xs:string"> 165 + <xs:maxLength value="200"/> 166 + </xs:restriction> 167 + </xs:simpleType> 168 + </xs:element> 169 + </xs:sequence> 170 + </xs:complexType> 171 + <xs:complexType name="Address"> 172 + <xs:sequence> 173 + <xs:element name="Type" type="nonEmptyString"/> 174 + <xs:element name="Name" type="nonEmptyString"/> 175 + <xs:element name="Street" type="nonEmptyString"/> 176 + <xs:element name="PostalCode" type="nonEmptyString"/> 177 + <xs:element name="City" type="nonEmptyString"/> 178 + <xs:element name="Country" type="nonEmptyString"/> 179 + </xs:sequence> 180 + </xs:complexType> 181 + <xs:complexType name="PartnerInfo_Order"> 182 + <xs:sequence> 183 + <xs:element maxOccurs="unbounded" 184 + minOccurs="0" 185 + name="PartnerInfo" 186 + type="PartnerInfo"/> 187 + </xs:sequence> 188 + </xs:complexType> 189 + <xs:complexType name="PartnerInfo"> 190 + <xs:sequence> 191 + <xs:element name="UUID"> 192 + <xs:simpleType> 193 + <xs:restriction base="xs:string"> 194 + <xs:maxLength value="64"/> 195 + </xs:restriction> 196 + </xs:simpleType> 197 + </xs:element> 198 + </xs:sequence> 199 + </xs:complexType> 200 + <xs:complexType name="OrderLine_Order"> 201 + <xs:sequence> 202 + <xs:element maxOccurs="unbounded" 203 + minOccurs="0" 204 + name="OrderLine" 205 + type="OrderLine"/> 206 + </xs:sequence> 207 + </xs:complexType> 208 + <xs:complexType name="OrderLine"> 209 + <xs:sequence> 210 + <xs:element name="Description"> 211 + <xs:simpleType> 212 + <xs:restriction base="xs:string"> 213 + <xs:maxLength value="200"/> 214 + </xs:restriction> 215 + </xs:simpleType> 216 + </xs:element> 217 + <xs:element name="Quantity" type="xs:long"/> 218 + <xs:element name="Unit" type="Enum"/> 219 + <xs:element minOccurs="0" name="Weight" type="xs:double"/> 220 + </xs:sequence> 221 + </xs:complexType> 222 + <xs:simpleType name="nonEmptyString"> 223 + <xs:restriction base="xs:string"> 224 + <xs:minLength value="1"/> 225 + </xs:restriction> 226 + </xs:simpleType> 227 + <xs:simpleType name="Enum"> 228 + <xs:restriction base="xs:string"> 229 + <xs:enumeration value="COLLI"/> 230 + <xs:enumeration value="EURO"/> 231 + <xs:enumeration value="BOX"/> 232 + <xs:enumeration value="SACK"/> 233 + </xs:restriction> 234 + </xs:simpleType> 235 + <xs:element name="CreateOrder" type="CreateOrder"/> 236 +</xs:schema> 237 +{{/code}} 30 30 == 5. Key takeaways == 31 31 32 32 * The CDM holds all entities and attributes that are relevant within the context of your complete integration landscape.