Changes for page Exercises

Last modified by Carlijn Kokkeler on 2022/10/19 13:32

From version 15.1
edited by Carlijn Kokkeler
on 2022/10/19 12:29
Change comment: There is no comment for this version
To version 19.1
edited by eMagiz
on 2022/10/19 12:51
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.CarlijnKokkeler
1 +XWiki.eMagiz
Content
... ... @@ -9,28 +9,38 @@
9 9  
10 10  == 2. Key concepts ==
11 11  
12 -This microlearning centers around understanding the concept data modeling in design.
12 +This microlearning centers around understanding the concept data modeling in design. Please note the following items for completing this exercise
13 +* Ensure to make a small Capture phase that draws the system CAPE and a message type "TransportOrder"
14 +* The system CAPE provides messages as JSON
13 13  
14 14  == 3. CDM, CDM & system message, message mapping ==
15 15  By following the steps below, you should gain a better understanding of the differences between CDM, CDM messages, and system messages.
16 16  
17 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.
20 + ** 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 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 + ** Now, go to your CDM message and select Order as root entity.
23 + ** Add all other entities and attributes from Order.xsd, which were imported into the CDM, to your CDM message definition.
22 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 at the bottom of this page.
25 + ** In one of your System messages, import the file TransportOrder.xsd. The code for this file can be found at the bottom of this page.
24 24  * Creating a CDM message
25 - Select CreateOrder as root entity and add all other entities and attributes to your system definition.
27 + ** Select CreateOrder as root entity and add all other entities and attributes to your system definition.
26 26  * Complete message mapping
27 - Now that you have completed these steps, go to Message mapping and complete the mapping.
29 + ** Now that you have completed these steps, go to Message mapping and complete the mapping. Please add the following to the Design mapping
30 + *** Ensure to properly map the address type
31 + *** Ensure to properly document mappings where required
32 +* Update the CDM and CDM message and remove the housenumber attribute
33 + ** Update the mapping accordingly
34 +* Update the System and CDM message to set the country attributes as enumerations
35 + ** System message uses an ISO-2 standard for country code
36 + ** CDM message uses an ISO-3 standard for country code
37 +
28 28  
29 29  The solutions to these exercises can be found [[here>>doc:Main.eMagiz Academy.Use Cases.Data modeling in Design.Exercises.Solutions.WebHome||target="blank"]].
30 30  
31 31  == 4. Code for xsd files ==
32 -Order.xsd:
33 - {{code language="xsd"}}
42 +=== 4.1 Code for Order.xsd ===
43 +{{code language="xml"}}
34 34  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
35 35   xmlns="http://www.carlijnsplatform.com/ns/capetms/cdm/1.0/"
36 36   attributeFormDefault="unqualified"
... ... @@ -88,6 +88,145 @@
88 88   <xs:element name="Order" type="Order"/>
89 89  </xs:schema>
90 90  {{/code}}
101 +
102 +=== 4.2 Code for TransportOrder.xsd ===
103 +{{code language="xml"}}
104 +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
105 + xmlns="https://transportinc.nl/ns/tms/1.0/"
106 + attributeFormDefault="unqualified"
107 + elementFormDefault="unqualified"
108 + targetNamespace="https://transportinc.nl/ns/tms/1.0/">
109 + <xs:complexType name="CreateOrder">
110 + <xs:sequence>
111 + <xs:element name="Order" type="Order"/>
112 + </xs:sequence>
113 + </xs:complexType>
114 + <xs:complexType name="Order">
115 + <xs:sequence>
116 + <xs:element name="OrderID">
117 + <xs:simpleType>
118 + <xs:restriction base="xs:string">
119 + <xs:maxLength value="200"/>
120 + </xs:restriction>
121 + </xs:simpleType>
122 + </xs:element>
123 + <xs:element name="OrderDate" type="xs:dateTime"/>
124 + <xs:element minOccurs="0" name="Order_Customer" type="Order_Customer"/>
125 + <xs:element name="Address" type="Address"/>
126 + <xs:element name="PartnerInfo_Order" type="PartnerInfo_Order"/>
127 + <xs:element name="OrderLine_Order" type="OrderLine_Order"/>
128 + </xs:sequence>
129 + </xs:complexType>
130 + <xs:complexType name="Order_Customer">
131 + <xs:sequence>
132 + <xs:element minOccurs="0" name="Customer" type="Customer"/>
133 + </xs:sequence>
134 + </xs:complexType>
135 + <xs:complexType name="Customer">
136 + <xs:sequence>
137 + <xs:element name="Name">
138 + <xs:simpleType>
139 + <xs:restriction base="xs:string">
140 + <xs:maxLength value="200"/>
141 + </xs:restriction>
142 + </xs:simpleType>
143 + </xs:element>
144 + <xs:element minOccurs="0" name="Contact_Customer" type="Contact_Customer"/>
145 + </xs:sequence>
146 + </xs:complexType>
147 + <xs:complexType name="Contact_Customer">
148 + <xs:sequence>
149 + <xs:element maxOccurs="unbounded"
150 + minOccurs="0"
151 + name="Contact"
152 + type="Contact"/>
153 + </xs:sequence>
154 + </xs:complexType>
155 + <xs:complexType name="Contact">
156 + <xs:sequence>
157 + <xs:element name="eMail">
158 + <xs:simpleType>
159 + <xs:restriction base="xs:string">
160 + <xs:maxLength value="200"/>
161 + </xs:restriction>
162 + </xs:simpleType>
163 + </xs:element>
164 + <xs:element minOccurs="0" name="Name">
165 + <xs:simpleType>
166 + <xs:restriction base="xs:string">
167 + <xs:maxLength value="200"/>
168 + </xs:restriction>
169 + </xs:simpleType>
170 + </xs:element>
171 + </xs:sequence>
172 + </xs:complexType>
173 + <xs:complexType name="Address">
174 + <xs:sequence>
175 + <xs:element name="Type" type="nonEmptyString"/>
176 + <xs:element name="Name" type="nonEmptyString"/>
177 + <xs:element name="Street" type="nonEmptyString"/>
178 + <xs:element name="PostalCode" type="nonEmptyString"/>
179 + <xs:element name="City" type="nonEmptyString"/>
180 + <xs:element name="Country" type="nonEmptyString"/>
181 + </xs:sequence>
182 + </xs:complexType>
183 + <xs:complexType name="PartnerInfo_Order">
184 + <xs:sequence>
185 + <xs:element maxOccurs="unbounded"
186 + minOccurs="0"
187 + name="PartnerInfo"
188 + type="PartnerInfo"/>
189 + </xs:sequence>
190 + </xs:complexType>
191 + <xs:complexType name="PartnerInfo">
192 + <xs:sequence>
193 + <xs:element name="UUID">
194 + <xs:simpleType>
195 + <xs:restriction base="xs:string">
196 + <xs:maxLength value="64"/>
197 + </xs:restriction>
198 + </xs:simpleType>
199 + </xs:element>
200 + </xs:sequence>
201 + </xs:complexType>
202 + <xs:complexType name="OrderLine_Order">
203 + <xs:sequence>
204 + <xs:element maxOccurs="unbounded"
205 + minOccurs="0"
206 + name="OrderLine"
207 + type="OrderLine"/>
208 + </xs:sequence>
209 + </xs:complexType>
210 + <xs:complexType name="OrderLine">
211 + <xs:sequence>
212 + <xs:element name="Description">
213 + <xs:simpleType>
214 + <xs:restriction base="xs:string">
215 + <xs:maxLength value="200"/>
216 + </xs:restriction>
217 + </xs:simpleType>
218 + </xs:element>
219 + <xs:element name="Quantity" type="xs:long"/>
220 + <xs:element name="Unit" type="Enum"/>
221 + <xs:element minOccurs="0" name="Weight" type="xs:double"/>
222 + </xs:sequence>
223 + </xs:complexType>
224 + <xs:simpleType name="nonEmptyString">
225 + <xs:restriction base="xs:string">
226 + <xs:minLength value="1"/>
227 + </xs:restriction>
228 + </xs:simpleType>
229 + <xs:simpleType name="Enum">
230 + <xs:restriction base="xs:string">
231 + <xs:enumeration value="COLLI"/>
232 + <xs:enumeration value="EURO"/>
233 + <xs:enumeration value="BOX"/>
234 + <xs:enumeration value="SACK"/>
235 + </xs:restriction>
236 + </xs:simpleType>
237 + <xs:element name="CreateOrder" type="CreateOrder"/>
238 +</xs:schema>
239 +{{/code}}
91 91  == 5. Key takeaways ==
92 92  
93 93  * The CDM holds all entities and attributes that are relevant within the context of your complete integration landscape.