Inbound / outbound maps in Logic Apps!

BizTalk Server offers a great feature that both inbound (receive ports) and outbound maps (send ports) can be executed in dynamic fashion, depending on the message type of the message.  This message type is defined as rootNodeNamespace#rootNodeName.  Below, you can find an example of a receive port configured with several inbound maps.

Maps1

When migrating parts of BizTalk solutions to Azure Logic Apps, it’s really handy to reuse this pattern.  This blog post explains how you can do this.

Configure the Integration Account

In this step, we will prepare the prerequisites to build this functionality.

  • Create an integration account.
  • Upload the required XSLT maps:

Maps2

  • Link your Logic App to the Integration Account, via the Workflow Settings:

Map3

Create the Logic App

It’s time to create a Logic App that uses this functionality.  In this blog, I’ve opted for a request/response pattern, which allows easy testing through Postman.

Map4

  • The first action initializes an Array variable.  The variable contains a list of all expected message types and their corresponding transformation that must be executed.

Map5

  • The second action filter the array.  It selects the object that matches the message type of the incoming message.  The message type is determined through the following expression:
    xpath(xml(body(‘Transform_XML’)), ‘concat(namespace-uri(/*), ”#”, local-name(/*))’)

Map6

  • The last action executes the mapping, of which the name is determined at runtime via this expression:
    body(‘Select_inbound_map’)[0].Transform

Map7

Test the Logic App

Let’s use Postman to test the Logic App and verify that the correct mapping is executed in a dynamic way.

Map8

Conclusion

If you combine the right Logic App actions, you can quite easily give your workflows some dynamic behaviour.  In case you would like to externalize the configuration, that links message types and transforms, you could leverage for example Azure Blob Storage.

Advertisements

One thought on “Inbound / outbound maps in Logic Apps!

  1. Pingback: Microsoft Integration Weekly Update: Jan 15, 2018 | Hooking Stuffs Together

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s