web stats
Mirth Community - View Single Post - Use of Inbound and Outbound templates in transformer
View Single Post
Old 05-06-2009, 10:28 AM
geraldb geraldb is offline
Mirth Employee
Join Date: Aug 2006
Location: Irvine, CA
Posts: 314
geraldb is an unknown quantity at this point

Hi Dheeraj,

Mirth Connect helps you create message mappings and transforms "by example". The inbound template represents the incoming message. When you paste in a sample message, and drag the segments over from the tree to create mapping steps, you're essentially telling Mirth Connect that you are expecting to receive a message that looks like the inbound template (that is, has the same segments). Since the inbound template is just an "example", none of the data from the template is used, just the mappings that were created. You would use an inbound template when you want to extract segments or modify an incoming message.

The outbound template is used to specify the outgoing message format. By providing an outbound template, you are telling Mirth Connect that you want your outgoing message to look different from your incoming message. In this case, the content of the outbound template is exactly what is going to be sent, so you'll want to make sure that you clear out any data that you wouldn't want to be sent with every message. Once you've pasted in an outbound template, you can use the Message Builder step type to modify the message however you want. The most common way to do this is to paste in both an inbound and an oubound template, and then drag-and-drop from a segment in the inbound to a segment in the outbound. This will create a new step that takes the data from the incoming message and inserts it into the outgoing message.

In your case, since you're using XML, just paste your original structure into the inbound template and the desired structure into the outbound template. Then, drag-and-drop the desired segments from the inbound to the outbound. When the channel is deployed and receiving XML messages, it will create a new outbound message (based on the template), replace all of the segments with the incoming data (based on your mapping), and send it out to your destinations.

Hope this helps.
Gerald Bortis | Chief Information Officer | Mirth Corporation
Reply With Quote