Magement Deep Dive: A Basic Transformer
Data sent from one application to another needs to be made compatible to be accepted. The exchange protocol and file types can be different (SOAP, REST), but so can the specific required information (ex. filter out unneeded information or add a new required field), the way values are described (ex. "red"/"blue"/"green" versus "R"/"B"/"G" versus 0/1/2) and other similar - but critical - details.
Magement calls this transforming data, and the building block for that a transformer. A transformer is a reusable building block, and the parts that make up a transformer are reusable and precreated Magement users. It is the most powerful and flexible part of Magement that provides non-programmers a quick start to create a reliable solution to connect applications.
Suppose you are using Magement to transfer orders from your ecommerce website to a Warehouse Management System (WMS), so that products can be shipped and your customer is satisfied. What you may find, when you ask your online shop for the latest orders, that it gives a list of orders paid as well as those not yet paid. Surely, the customer should pay before receiving items!
A simplified list of orders, provided by the ecommerce website:
When the state is "processing", then it should be provided to the WMS, otherwise it should be skipped until it is paid.
Magement can apply a transformer to this list. Such a transformer can look like this:
Magement contains a transformer tester to see how it behaves when provided with actual data:
In the image above you can see how the second item of the list was removed and the other two items were kept. It works as expected and can be implemented in a Magement installation of the client needing this solution.
In a follow-up post we will discuss the different kinds of transformers available in Magement. Already shown here is filtering. Others kinds are: changing data, mapping data from one set onto another, moving nodes, copying nodes, transforming on conditions, and chaining multiple transformations together. Make sure to subscribe so you don't miss it!