Wiki source code of Exercises

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

Show last authors
1 {{container}}{{container layoutStyle="columns"}}(((
2 In this microlearning, we will educate you on what we mean when we talk about message definitions.
3
4 Should you have any questions, please contact [[academy@emagiz.com>>mailto:academy@emagiz.com]].
5
6 == 1. Prerequisites ==
7
8 * Basic knowledge of the eMagiz platform
9
10 == 2. Key concepts ==
11
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
15
16 == 3. CDM, CDM & system message, message mapping ==
17 By following the steps below, you should gain a better understanding of the differences between CDM, CDM messages, and system messages.
18
19 * Creating a CDM
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.
21 * Creating a CDM message
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.
24 * Creating a system message
25 ** 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.
26 * Creating a CDM message
27 ** Select CreateOrder as root entity and add all other entities and attributes to your system definition.
28 * Complete message 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
38
39 The solutions to these exercises can be found [[here>>doc:Main.eMagiz Academy.Use Cases.Data modeling in Design.Exercises.Solutions.WebHome||target="blank"]].
40
41 == 4. Code for xsd files ==
42 === 4.1 Code for Order.xsd ===
43 {{code language="xml"}}
44 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
45 xmlns="http://www.mappingexercises.com/ns/capetms/cdm/1.0/"
46 attributeFormDefault="unqualified"
47 elementFormDefault="qualified"
48 targetNamespace="http://www.mappingexercises.com/ns/capetms/cdm/1.0/">
49 <xs:complexType name="Order">
50 <xs:sequence>
51 <xs:element name="Date" type="xs:dateTime"/>
52 <xs:element name="OrderId" type="nonEmptyString"/>
53 <xs:element name="Customer" type="Customer"/>
54 <xs:element name="PickupAddress" type="PickupAddress"/>
55 <xs:element name="DeliveryAddress" type="DeliveryAddress"/>
56 <xs:element maxOccurs="unbounded" name="OrderLine" type="OrderLine"/>
57 </xs:sequence>
58 </xs:complexType>
59 <xs:complexType name="Customer">
60 <xs:sequence>
61 <xs:element name="Name" type="nonEmptyString"/>
62 <xs:element name="Email" type="nonEmptyString"/>
63 </xs:sequence>
64 </xs:complexType>
65 <xs:complexType name="PickupAddress">
66 <xs:sequence>
67 <xs:element name="Name" type="nonEmptyString"/>
68 <xs:element name="Street" type="nonEmptyString"/>
69 <xs:element name="StreetNumber" type="nonEmptyString"/>
70 <xs:element name="PostalCode" type="nonEmptyString"/>
71 <xs:element name="City" type="nonEmptyString"/>
72 <xs:element name="Country" type="nonEmptyString"/>
73 </xs:sequence>
74 </xs:complexType>
75 <xs:complexType name="DeliveryAddress">
76 <xs:sequence>
77 <xs:element name="Name" type="nonEmptyString"/>
78 <xs:element name="Street" type="nonEmptyString"/>
79 <xs:element name="StreetNumber" type="nonEmptyString"/>
80 <xs:element name="PostalCode" type="nonEmptyString"/>
81 <xs:element name="City" type="nonEmptyString"/>
82 <xs:element name="Country" type="nonEmptyString"/>
83 </xs:sequence>
84 </xs:complexType>
85 <xs:complexType name="OrderLine">
86 <xs:sequence>
87 <xs:element name="PackageUnit" type="nonEmptyString"/>
88 <xs:element name="Quantity" type="xs:long"/>
89 <xs:element name="Description" type="nonEmptyString"/>
90 <xs:element name="Weight" type="xs:decimal"/>
91 </xs:sequence>
92 </xs:complexType>
93 <xs:simpleType name="nonEmptyString">
94 <xs:restriction base="xs:string">
95 <xs:minLength value="1"/>
96 </xs:restriction>
97 </xs:simpleType>
98 <xs:element name="Order" type="Order"/>
99 </xs:schema>
100 {{/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}}
240 == 5. Key takeaways ==
241
242 * The CDM holds all entities and attributes that are relevant within the context of your complete integration landscape.
243 * The CDM message is tailor-made for a specific piece of data and only holds the entities and attributes relevant for that piece of data.
244 * A system message is specific to a system.
245
246
247 == 6. Suggested Additional Readings ==
248
249 If you are interested in this topic and want more information on it please read the help text provided by eMagiz.
250
251
252
253 )))((({{toc/}}))){{/container}}{{/container}}