4.1.4. Extra processings
Why extra processings ?
By default, the execution of every message in Babelway will consist of executing sequentially, in this order, the 5 main steps, as defined in the channel configuration.
- Gateway In : the input message is received.
- Message definition In : the input message is analyzed and checked.
- Transformation : the input message is converted to the output message.
- Message definition out : the output message is checked and generated in the expected format.
- Gateway out : the output message is delivered.
But in many cases, these 5 main steps are not enough, and some additional processings should be done.
A few examples :
- The message In that you want to process is an xml, but your receive this xml inside a zip file. The file should be extracted first.
- You receive many invoices in the same file, but want to process them separately. The file should be split first.
- You want to extract very soon in the process some information from inside the file, for example to be able to make a routing, based on the type of document (invoice, order, ...), or based on the sender, or the receiver.
- You want to make a few fixes in the document received from your partner, because you know that it is invalid and would prevent the parsing or the validation, but your partner can't fix it. So, you make the fix before it is parsed.
- ...
In Babelway, many of such processings are available, and are called extra-processings.
Extra processings belong to elements
All extra-processings are linked to one of the 5 main elements of the channel (GW In, MD In, transformation, MD out or GW out). They really belong to them. If you share for example a MessageDefinition with some extra-processings, they will be applied in all the channels that execute this MessageDefinition.
So, for example, the definition of a MessageDefinition In can become "This is an xml with the defined fields and validation. But first, this xml has to be extracted from a zip file, and must be fixed by removing the first line.". IN all cases, these extra instructions fully belong to the definition of the file format.
More message steps
The processing of a message remains a completely linear process, where every requested step is executed in a predefined order. You can't change this order.
Extra processings are doing that the execution of the message can execute much more steps than the original main elements.
In the detail of the execution of a message, you will see the exact result of every such step on the message. For example, on the below screenshot, the received message was first modified by an extra processing (using a replacement based on a regular expression).
How to define extra processings
You can define extra processings by going to the details of any main element (gateway, message definition or transformation), and clicking on the tab Extra processings. There, you will be able to configure any extra processing available for this type of element.
The same way, it can be done directly from the ChannelDetail screen, but you need first to click on More details on the element.
Available extra processings
You can find the list about all available extra processings in the sections relative to their main elements :