Sidebar

Are there any example scenarios for when using a template is beneficial?

0 votes
247 views
asked Aug 1, 2022 by william-g-1659 (140 points)
Curious as to what advantages using a template has over mapping directly from the source node into the output mesage?

1 Answer

0 votes

There are examples of using QIE's built-in 'Evaluate Template' function with inline templates, a 'System Variable' as the template, and QIE's standard getNode() and setNode() functions on the Online Sandbox for many messages types like XML, JSON, HL7, and CSV.

answered Aug 1, 2022 by gary-t-8719 (14,860 points)
commented Aug 1, 2022 by william-g-1659 (140 points)
I'm looking more for examples where the Template would be more beneficial than a direct mapping, using both I dont see much use in the templates but I only have limited examples.
commented Aug 1, 2022 by brandon-w-8204 (33,270 points)
Using templates vs mapping is really a preference of who is creating the interface. Using a mapping will let you move the template to a system variable and if you need to make changes you can do that without changing the code in the channel. It also allows you to visually see what your message will look like vs a mapping function that just is code.

I do not have specific examples of when a template is used vs a mapping as far as specific interfaces. It is more based on the person that is creating the interface and what they would like to use. One example is if you have someone that knows your message but does not know the code. You can use a template that they can update in the system variables and not have to modify the channel.

One other use is if you use the same template for multiple interfaces. You can reference the same system variable from 2 or more channels and if you need ot update something you can update it and all the channels will pick up the changes vs mapping in the channel and updating all the channels.
...