Changes for page Command Queue
Last modified by Erik Bakker on 2024/02/22 13:38
From version 2.2
edited by Erik Bakker
on 2022/06/13 09:26
on 2022/06/13 09:26
Change comment:
Update document after refactoring.
To version 14.1
edited by Erik Bakker
on 2022/07/28 10:27
on 2022/07/28 10:27
Change comment:
There is no comment for this version
Summary
-
Page properties (3 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 - advanced-create-your-transformations-xpath-advanced1 +Command Queue - Default language
-
... ... @@ -1,0 +1,1 @@ 1 +en - Content
-
... ... @@ -1,101 +1,44 @@ 1 1 {{container}}{{container layoutStyle="columns"}}((( 2 - =XPathAdvanced=2 +Within the platform of eMagiz, sometimes you need to send a particular command from the eMagiz portal to retrieve information or execute a specific action. These commands can happen from the Deploy and the Manage phase. The two most noteworthy examples of the triggered command queue are the runtime dashboard functionalities and the message redelivery actions. 3 3 4 -Within the crash course, we already explained XPath conceptually. In that same microlearning, we also looked at some more uncomplicated cases of using XPath within your transformation. If you need to brush up on that knowledge, please check out this [microlearning](crashcourse-platform-create-transformation-xpath-basic.md). In the intermediate microlearning on this subject, we built upon that knowledge. Please check out this [microlearning](intermediate-create-your-transformations-xpath-intermediate.md) if you need a refresher on that. In this microlearning, we will build upon that knowledge and look at some concrete, practical examples that could be useful in your project. 5 - 6 6 Should you have any questions, please get in touch with [[academy@emagiz.com>>mailto:academy@emagiz.com]]. 7 7 8 -* Last update: October 25th, 2021 9 -* Required reading time: 6 minutes 10 - 11 11 == 1. Prerequisites == 12 12 13 -* Advanced knowledge of the eMagiz platform 14 -* [XPath Basic](crashcourse-platform-create-transformation-xpath-basic.md) 15 -* [XPath Intermediate](intermediate-create-your-transformations-xpath-intermediate.md) 8 +* Expert knowledge of the eMagiz platform 16 16 17 -crashcourse-platform-create-transformation-xpath-basic 18 -crashcourse-platform-create-transformation-XPath-basic 19 - 20 20 == 2. Key concepts == 21 21 22 -This microlearning focuses on more complexXPathoperations.12 +This microlearning focuses on the command queue. The command queue communicates between the eMagiz portal and an eMagiz runtime. 23 23 24 -With XPath Advanced, we mean learning that XPath options are complex but could benefit you in your daily work. 14 +* Commands towards a runtime, for example, to retrieve runtime information in the runtime dashboard, are sent via the command queue 15 +* You can monitor the command queue the same way as any other queue within your model 16 +* The command queue is prominently used when accessing the [[Runtime Dashboard>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.Crash Course Platform.crashcourse-platform-deploy-runtime-dashboard.WebHome||target="blank"]] and when using [[Message Redelivery>>doc:Main.eMagiz Academy.Microlearnings.Intermediate Level.Message Redelivery.WebHome||target="blank"]] 25 25 26 - Someofthe more complex XPath optionsare:18 +== 3. Command queue == 27 27 28 -* dateTime calculation 29 -* Filter list 30 -* XPath on JSON 31 -* SpEL notation for XPath 20 +Within the platform of eMagiz, sometimes you need to send a particular command from the eMagiz portal to retrieve information or execute a specific action. These commands can happen from the Deploy and the Manage phase. The two most noteworthy examples of the triggered command queue are the runtime dashboard functionalities and the message redelivery actions. 32 32 22 +For example, when you navigate the Runtime Dashboard and click on a runtime, the eMagiz portal will send a command to the runtime via the command queue to retrieve the runtime state. So, for example, the same logic applies when you select a flow and stop it. 33 33 24 +For Message redelivery, the command queue retrieves all messages in the dead letter queue and resends messages via the command queue. 34 34 35 - ==3.XPathAdvanced==26 +{{info}}When all commands sent from the eMagiz portal are not working across models, something is probably broken in the backend of the eMagiz platform. In these cases, please contact us at [[support@emagiz.com>>mailto:support@emagiz.com]]{{/info}} 36 36 37 -Within the crash course, we already explained XPath conceptually. In that same microlearning, we also looked at some more uncomplicated cases of using XPath within your transformation. If you need to brush up on that knowledge, please check out this [microlearning](crashcourse-platform-create-transformation-xpath-basic.md). In the intermediate microlearning on this subject, we built upon that knowledge. Please check out this [microlearning](intermediate-create-your-transformations-xpath-intermediate.md) if you need a refresher on that. In this microlearning, we will build upon that knowledge and look at some concrete, practical examples that could be useful in your project. 38 - 39 -Some of the more complex XPath options are: 40 - 41 -* dateTime calculation 42 -* Filter list 43 -* XPath on JSON 44 -* SpEL notation for XPath 45 - 46 -=== 3.1 dateTime calculation === 47 - 48 -Sometimes we see that a dateTime calculation is needed within a transformation to determine a specific action. As these calculations are not natively supported within the eMagiz platform, you need to use XPath's functionality to calculate the new valid date (or dateTime). 49 - 50 -The XPath standard offers several functions to calculate with dateTime values. The two most used options are dayTimeDuration and yearMonthDuration. With the help of the dayTimeDuration, you can add, subtract, multiple, or divide seconds, minutes, hours, and days regarding the original value. The yearMonthDuration works similarly but then for months and years. An example of such an XPath is: <xsl:value-of xmlns:xs="http://www.w3.org/2001/XMLSchema" select="CDM:StartDate + xs:dayTimeDuration('P1D') * xs:yearMonthDuration('P1M')"/>. In this example, XPath adds one day and subtracts one month from the input date. Note that making this work requires the additional namespace to be defined. Therefore you need a custom snippet within your transformation or a custom transformation to make this work. Furthermore, note that the P1D and P1M could also be filled with the help of parameters to make them dynamic in nature. 51 - 52 -Some examples that we saw during the years: 53 - 54 -* https://my.emagiz.com/p/question/172825635700358186 55 -* https://my.emagiz.com/p/question/172825635700352588 56 - 57 -=== 3.2 Filter list === 58 - 59 -Sometimes you have a large message which contains a certain list within it. However, logic dictates that you can only send the message if at least one entry in the list for which attribute A is filled and attribute B equals type C. To make that happen in XPath, we first need to navigate to the list within the message. As we previously learned, there are two options to do so. One is to use // to navigate to the entity somewhere in the tree directly. The other is to start at the root and walk the tree from there. In this example, we use the latter. That results in the following XPath example: /root/list[attributeB = 'type C']/attributeA !=''. With this XPath, you filter the list on the specified check and subsequently check whether one of those entries that remains has an attributeA which is filled in. 60 - 61 -=== 3.3 XPath on JSON === 62 - 63 -With the release of build number .50, we expanded our offering on JSON messages to resemble much of the functionality we previously offered for XML messages. As a result, you can use XPath expressions on JSON messages within the following components (related to XPath): 64 - 65 -* XPath header enricher 66 -* XPath transformer 67 -* XPath router 68 - 69 -To activate the functionality, simply link the JSON source factory support object to one of these components to achieve the desired result. For more information, check out: https://emagiz.github.io/docs/release-notes/build50. 70 - 71 -=== 3.4 SpEL notation for XPath === 72 - 73 -Sometimes you want to perform an XPath operation but store the header via a standard message header enricher component. As a result, you need a valid SpEL expression to help you in this cause. To do so, you need to know the correct notation for an XPath expression when using the SpEL language. An example of the correct notation is: #xpath(payload,'/root/entity/attribute') 74 - 75 - 76 - 77 77 == 4. Assignment == 78 78 79 -Check out which of the XPaths we have discussed today can be found within your project. 80 -This assignment can be completed within the (Academy) project you created/used in the previous assignment. 30 +There is no assignment for this microlearning. 81 81 82 82 == 5. Key takeaways == 83 83 84 -Some of the more complex XPath options are: 34 +* Commands towards a runtime, for example, to retrieve runtime information in the runtime dashboard, are sent via the command queue 35 +* You can monitor the command queue the same way as any other queue within your model 36 +* The command queue is prominently used when accessing the [[Runtime Dashboard>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.Crash Course Platform.crashcourse-platform-deploy-runtime-dashboard.WebHome||target="blank"]] and when using [[Message Redelivery>>doc:Main.eMagiz Academy.Microlearnings.Intermediate Level.Message Redelivery.WebHome||target="blank"]] 85 85 86 -* dateTime calculation 87 -* Filter list 88 -* XPath on JSON 89 -* SpEL notation for XPath 90 - 91 - 92 - 93 93 == 6. Suggested Additional Readings == 94 94 95 - If you areinterestedin this topicand want moreinformationon it, pleasereadthehelp text providedby eMagiz andreadmoreinformationon thefollowinglink:40 +There are no suggested additional readings. 96 96 97 -* https://www.w3schools.com/xml/xpath_intro.asp 98 - 99 99 == 7. Silent demonstration video == 100 100 101 101 As this is more of theoretical microlearning, there is no video accompanying the microlearning.)))((({{toc/}}))){{/container}}{{/container}}