This topic will guide you through retrieving .EDI files using an FTP / SFTP connection.
And more importantly, how to parse and deserialize this data.
Create a new incoming configuration and select “Filesystem: file subscriber” as Subscriber.
Select the Filesystem you’d like to work with and configure a pattern to the location of your .edi files. For example “/home/Alumio/EDI/X12/*.edi”.
Select Binary as your Parser.
At this point you are able to get your .EDI files into Alumio.
Now you’ll need a way to make the data usable within Alumio.
For this, the data will need to be deserialized.
This entity transformer will handle the deserialization of the parsed binary data.
If this sounds complicated, don’t worry and follow the steps.
Create a new transformer and start with “Chain multiple entity transformers”.
Add a key under Keys with ‘encoding’ as value.
‘encoding’ is an object within your data.
And finally add the condition “Equals” with the Value being a string and ‘base64’.
This transformer will remove the task if the value of ‘encoding’ does not equal ‘base64’.
Because if this the case, the data probably is not what we expect.
If ‘encoding’ does equal ‘base64’ we can decode the base64 data.
Then add a “Mapper” and select “String: Base64 decode”.
Make your second entity transformer the “Alumio -EDI- Deserialize” transformer.
The “Formats” needs to be “EDIFACT”
The “Source” needs to be “Get from the data”.
The “Path to data” needs to be ‘data’.
‘data’ is an object within your data.
As “Destination” you can configure any object name you’d like.
In this case we put the deserialized data in ‘data_deserialized’.
Generally you can leave the Request parameters alone.
It’s up to you where you place this new entity transformer.
I’d recommend using it in the incoming configuration you’ve created.
When this is done and you’ve used the incoming within a route, the contents of your .EDI files should become visible in your tasks.
Here are some pictures to help you out.
Example output in a task: