Version 1.1 by Erik Bakker on 2022/06/09 10:08

Show last authors
1 {{container}}
2 {{container layoutStyle="columns"}}
3 (((
4 In this microlearning, we will focus on XSLT parameters. With the help of this microlearning, you will learn what XSLT parameters are and how you can use them within the eMagiz platform to successfully transform data.
5
6 Should you have any questions, please contact academy@emagiz.com.
7
8 * Last update: May 6th, 2021
9 * Required reading time: 6 minutes
10
11 == 1. Prerequisites ==
12
13 * Basic knowledge of the eMagiz platform
14
15 == 2. Key concepts ==
16
17 This microlearning centers around XSLT parameters
18 By XSLT parameters we mean: A functionality within the XSLT language with which you can inject a static (i.e. property) or dynamic (i.e. message header) value into the output message
19
20 XSLT parameters need to be:
21
22 * Defined on transformation level
23 * Defined as static input (or part of an XPath) in the transformation
24 * Filled with a static or dynamic value
25
26
27
28 == 3. XSLT Parameters ==
29
30 In this microlearning, we will focus on XSLT parameters. With the help of this microlearning, you will learn what XSLT parameters are and how you can use them within the eMagiz platform to successfully transform data.
31
32 XSLT parameters need to be:
33
34 * Defined on transformation level
35 * Defined as static input (or part of an XPath) in the transformation
36 * Filled with a static or dynamic value
37
38 With the help of such an XSLT parameter, you can inject a static or dynamic value. These values can be supplied with the help of properties or with the help of headers. In this case, we want to fill the attribute Sender in the output message with a static value that differs per environment. To do so we opt for a property as we can specify the value for it on a per-environment basis.
39
40 To correctly set up the logic to inject an XSLT parameter into your transformation you need to do three things in the Create phase. Before we delve into the specifics let us first navigate to the Create phase, open a flow and enter "Start Editing" mode.
41
42 After you have done so please navigate to the Transformation view in Create. Here you first need to define the parameter in terms of name and datatype. To do so select the wrench icon and press New. You will see the following pop-up on your screen
43
44 [[image:Main.Images.Microlearning.WebHome@novice-create-your-transformations-xslt-parameters--parameter-pop-up.png]]
45
46 In this pop-up, you can enter the name and the datatype. In this case, we will call the parameter Sender with a nonEmptyString as a datatype. After you have pressed Save you should end up with the following result.
47
48 [[image:Main.Images.Microlearning.WebHome@novice-create-your-transformations-xslt-parameters--parameter-config-result.png]]
49
50 Now that we have defined the parameter we need to use it to fill the output for the element called Sender. In this case, we use a static input as input. You can also use parameters as part of an XPath or an XSLT snippet. When you select the option static input you can choose the option called Parameter. Here you can select the parameter you have just defined. The result should be something similar to this.
51
52 [[image:Main.Images.Microlearning.WebHome@novice-create-your-transformations-xslt-parameters--parameter-static-input-config.png]]
53
54 After we have finished configuring the transformation we need to ensure that we fill the actual parameter with a value. This we do on the component level in the flow itself. Open the transformation component and navigate to the Advanced tab.
55
56 [[image:Main.Images.Microlearning.WebHome@novice-create-your-transformations-xslt-parameters--parameter-advanced-tab-empty.png]]
57
58 As you can see this Advanced tab houses a section for your XSLT parameters. Here you can define the name of the XSLT parameter and the corresponding value. If you want to use a static value use the Value option in the pop-up. If you want to use a dynamic value use the Expression option in the pop-up. In our case, you should fill in something like below. When you are satisfied press Save.
59
60 [[image:Main.Images.Microlearning.WebHome@novice-create-your-transformations-xslt-parameters--parameter-advanced-tab-xslt-param-pop-up-filled-in.png]]
61
62 After this press Save on the component itself and you are good to go. You have successfully managed to configure the flow to use an XSLT parameter while transforming data. Note that in this example you still need to define the property and assign it a value for the flow to work.
63
64 == 4. Assignment ==
65
66 Create a transformation while using an XSLT parameter to fill in something in the output message. Ensure that you have a working solution by running a unit test.
67 This assignment can be completed with the help of the (Academy) project that you have created/used in the previous assignment.
68
69 == 5. Key takeaways ==
70
71 * For a working solution, you need to execute three steps
72
73 * Define the parameter on the transformation level
74 * Defined as static input (or part of an XPath) in the transformation
75 * Define on component level how the parameter should be filled
76
77 * A parameter can be filled with the help of a static (i.e. property) or dynamic (i.e. message header) value
78
79
80
81 == 6. Suggested Additional Readings ==
82
83 If you are interested in this topic and want more information on it please read the help text provided by eMagiz.
84
85 == 7. Silent demonstration video ==
86
87 This video demonstrates how you could have handled the assignment and gives you some context on what you have just learned.
88
89 {{video attachment="novice-create-your-transformations-xslt-parameters.mp4" reference="Main.Videos.Microlearning.WebHome"/}})))
90
91 ((({{toc/}}))){{/container}}
92 {{/container}}