This topic will guide you through retrieving .EDI files using an FTP / SFTP connection.
And more importantly, how to parse and deserialize this data.
Incoming configuration
When following this guide you should be familiar with the basics of Alumio, and have set-up a working ‘Filesystem’.
And that you are on the latest version of Alumio.
Step 1:
Create a new incoming configuration and select “Filesystem: file subscriber” as Subscriber.
Step 2:
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”.
Step 3:
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.
Entity transformer
This entity transformer will handle the deserialization of the parsed binary data.
If this sounds complicated, don’t worry and follow the steps.
Step 1:
Create a new transformer and start with “Chain multiple entity transformers”.
Step 2:
Make your first entity transformer the “Data, transform using mappers and conditions”.
Then add a filter and select “Value condition” and “Key accessor” as Accessor.
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.
To do this add a “Data transformer” and select “Value mapper”.
Use “Key accessor” as accessor and add a key with ‘data’ as value.
‘data’ is an object within your data.
Then add a “Mapper” and select “String: Base64 decode”.
Step 3:
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.
Finalize
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.
Incoming configuration:
Entity transformer:
Example output in a task: