X12 EDI Connector in Mule 4
Let's look at how to install X12 EDI Connector in Mule 4 and see real-world examples.
Join the DZone community and get the full member experience.Join For Free
What Is X12?
EDI or Electronic Data Interchange permits two exchanging accomplices to trade electronic business records utilizing a typical organization. One of the generally acknowledged configurations is EDI X12. Created by the American National Standards Institute (ANSI) Accredited Standards Committee X12 (ASC X12), EDI_X12 or X12 appeared in 1979. It has since been embraced by different ventures.
There are various kinds of EDI reports. Every one compares to a "genuine world" business record, similar to receipt, value/deals inventory, human services guarantee, buy request, air shipment data, vehicle shipping request, business credit report, shipment data, and numerous others.
In the X12 EDI standard, these archives are allowed 3-digit numbers like 810 for a receipt, 832 for value/deals list, 837 for human services guarantee, 850 for buy request, etc.
You may also like:
X12 EDI Connector in MuleSoft
The Connector is utilized to change over X12 messages to and from Data Weave-perfect portrayals utilizing records and maps. These are the accessible X12 variants 003010, 003020, 003030, 003040, 003050, 003060, 003070, 004010, 004020, 004030, 004040, 004050, 004060, 005010, 005020, 005030, 005040, 005050, and 006020 are bolstered with provided pattern definitions for all standard exchange sets. Numerous HIPAA record forms are likewise bolstered, as recorded independently in the Connector HIPAA reference page.
Parts of an X12 Document
An ordinary X12 record comprises of a few fragments, which are thus made out of components. Portions consistently start with a 2-3 letter code like ST or ISA. A few sections are required, while some are definitely not. The compulsory portions of X12 are:
- ISA — the trade header. This contains data about the sender and beneficiary.
- GS — the practical gathering header fragment of a lot of X12 archives of a similar record type (exchange set). Here you'll discover data about the useful gathering, for example, codes for the sender, beneficiary, and date/time of readiness.
- ST — the exchange set header portion of an X12 archive. This denotes the beginning of an exchange set in a trade.
- SE — the Transaction set trailer fragment of an X12 record. This denotes the finish of an exchange set.
- GE — the utilitarian gathering trailer portion of a lot of X12 records of a similar exchange set. It reveals to you the number of useful gatherings and the benchmark group number. It additionally denotes the finish of a gathering of exchange sets.
- IEA — this denotes the finish of the trade. It contains data about the number of utilitarian gatherings and the trade control reference number.
How to Install Edi Connector in Mule 4
In Anypoint Studio, click the Search tab in the palette and type the X12 EDI.
Click the below link i.e Try looking for it in Exchange in the studio.
Click and log in your any-point platform account it will redirect to exchange.
Select your module and install it.
Peruse the prompts and install the connector.
The below snapshot is described as how to install X12_edi in mule4.
Example for X12 EDI in Mule 4
Utilizing X12 EDI connector and taking JSON as a piece of information and changed over into X12 design any of the formats lists.
Please follow the below steps:
Create a New Mule Project Namely as X12_EDI.
Intuitive an HTTP listener Connector to get a solicitation for your servers and give the host and port numbers. Here, the host is set to localhost and port to 8081 and test your association with check if the port is being used or not and test it effectively.
Set the path as /X12Edi.
Drag the Transform Message Component (or Dataweave part) to change our JSON contribution to the X12 Schema group.
Example for X12 Schema
In this record, a portion of the fields having a compulsory choice so we have to map that fields dependent on the sort.
Including JSON as a meta-information in DW, and guide that information into yield schema position dependent on what kind of pattern design you are selected in X12, you will comprehend that in further advances obviously.
Drag the X12 EDI Write connector from the mule palette After we need to allow the proper pattern in the worth segment from the different schemas in X12 container which is accessible in the project explorer.
We have to design these things, In X12 Connector
After fulfillment, we get some yield information in Dataweave, then we have to map our input JSON data to output schema data.
After culmination, you have to show the payload as a sort of plain/text arrangement utilizing data weave segment.
Run the Project
Open the postman and hit your service URL request as shown.
Input JSON File:
Our Output Payload as
Now, we look about the entire flow of a mule project i.e X12 EDI
Sample Code for x12 in Mule 4:
Mule 4 accompanies bunches of upgrades and improvements. X12 Connector in Mule 3 was at that point amazing. In Mule 4, it has been rearranged for developers, and in this way, it is simple to execute and give some additional highlights.
Opinions expressed by DZone contributors are their own.