Changes for page SpEL Expressions
Last modified by Martijn Woudstra on 2023/04/13 15:33
From version 29.1
edited by Martijn Woudstra
on 2022/10/03 11:25
on 2022/10/03 11:25
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -42,17 +42,17 @@ 42 42 43 43 A message in eMagiz has two main parts, as you well know. One part is the payload, and the other part is the headers. Both are accessible via a SpEL expression. 44 44 45 -To retrieve data from a payload you can use the following notation in SpEL: {{code}}#xpath(payload,'//\*:uniqueIdentifier'){{/code}}. For more information on using SpEL as an XPath expression please see this [[microlearning>>doc:Main.eMagiz Academy.Microlearnings.Advanced Level.Create your transformations.advanced-create-your-transformations-xpath-advanced .WebHome||target="blank"]].45 +To retrieve data from a payload you can use the following notation in SpEL: {{code}}#xpath(payload,'//\*:uniqueIdentifier'){{/code}}. For more information on using SpEL as an XPath expression please see this [[microlearning>>doc:Main.eMagiz Academy.Microlearnings.Advanced Level.Create your transformations.advanced-create-your-transformations-xpath-advanced||target="blank"]]. 46 46 47 47 To retrieve data from a header, you can use one of the following notations: 48 48 49 -* headers.nameOfHeader 50 -* headers['nameOfHeader'] 49 +* {{code language="spel"}}headers.nameOfHeader{{/code}} 50 +* {{code language="spel"}}headers['nameOfHeader']{{/code}} 51 51 52 52 Below we describe the difference between both options: 53 53 54 -* When it is required that the header is present, you can use "headers.nameOfHeader "(this will fail if the header is missing)55 -* When the header might be missing, you should use ""headers[' 'nameOfHeader'']""(and then correctly handle ""null"" values)54 +* When it is required that the header is present, you can use {{code language="spel"}}headers.nameOfHeader{{/code}} (this will fail if the header is missing) 55 +* When the header might be missing, you should use {{code language="spel"}}headers['nameOfHeader]{{/code}} (and then correctly handle ""null"" values) 56 56 57 57 === 3.2 Logical Operation === 58 58 ... ... @@ -62,7 +62,7 @@ 62 62 63 63 === 3.3 Payload in Header === 64 64 65 -A standard header enricher gives you the option to add information on top of the payload. In this example, a new header is added with the name "backup" and the value of the header is the complete payload of the current message, value = ''payload''. Take notice that ''Type'' is a SpEL expression. This expression is filled in on the tab ''Advanced''.65 +A standard header enricher gives you the option to add information on top of the payload. In this example, a new header is added with the name "backup" and the value of the header is the complete payload of the current message, {{code language="spel"}}value = payload{{/code}}. Take notice that ''Type'' is a SpEL expression. This expression is filled in on the tab ''Advanced''. 66 66 67 67 [[image:Main.Images.Microlearning.WebHome@advanced-data-handling-spel-expressions--payload-in-header.png]] 68 68 ... ... @@ -122,8 +122,8 @@ 122 122 123 123 If you are interested in this topic and want more information on it, please read the release notes provided by eMagiz when implementing SpEL expressions, and please check out the following links: 124 124 125 -* https://www.baeldung.com/spring-expression-language (greatexplanation on SpEL and its various applications)126 -* https://docs.spring.io/spring/docs/4.3.10.RELEASE/spring-framework-reference/html/expressions.html (more in-depth explanation of how SpEL expressions relate to the Spring framework)125 +* [[SpEL explained>>https://www.baeldung.com/spring-expression-language||target="blank"]] 126 +* [[SpEL in the Spring framework>>https://docs.spring.io/spring/docs/4.3.10.RELEASE/spring-framework-reference/html/expressions.html||target="blank"]] 127 127 128 128 == 7. Silent demonstration video == 129 129