Thursday, April 27, 2017

Logic Apps and EDI (III)

This post continues the Logic Apps and EDI series of post, that I began last week:
In this post I go to explain how to modify our Agreement, to allow receive from CompanyA, messages of type INVOICE_99B_D.

In the first post, we have added an Agreement between our MyCompany and CompanyA. 

MyCompany is the Host Partner:

"The host partner represents the organization that configures the agreement."

And CompanyA is the Guest Partner:

"The guest partner represents the organization that's doing business with the host partner."

If we want to allow messages of type INVOICE_99B_D, he have to add that schema to our Integration Account. I took the schema from a BizTalk development environment with EDI and in my Integration Account:
  1. Go to Schemas
  2. Click on Add
  3. Enter a custom name, for example INVOICE_D_99B and select the XSD in Schema.
  4. Click on Ok

Now I have the schema for that type of messages on my Integration Account.

Next step is modify the Agreement to allow that MyCompany receive messages from CompanyA of type INVOICE_D_99B:
  1. Go to Agreements.
  2. Select our Agreement, ReceiveFromCompanyA and click Edit.
  3. Click on Receive Settings.
At this moment, we see all the properties that we can configure when MyCompany receive messages from CompanyA.

We only want to allow INVOICE_D_99B messages, then:
  1. Got to Schemas section
  2. In UNH2.1 (TYPE) column select INVOIC.
  3. In UNH2.2 (VERSION) column write D
  4. In UNH2.3 (RELEASE) column write 99B
  5. In the column SCHEMA, select the schema that we added previously.

    Now we can modify our Logic App, to include the Decode EDIFACT message component:

    If we test this Logic App with an INVOICE_D_99B message, we get this execution:

    If we test this Logic App with an message with type different to INVOICE_D_99B, we get this execution:

    After the Decode EDIFACT message component, we get two important values: goodMessages and badMessages.

    In the next post, we will see how get the correct messages and the incorrect messages and send the equivalent XML through an email.

    To be continued...

    No comments: