The structure of the order message of the reseller’s ERP system has to be mapped to the purchase message that is expected by the ERP system of the producer. Mule does this in a so-called service component.
The Message Mapper allows the creation of the business logic that implements the mapping for this business component.
Start the Message Mapper
To create a mapping that matches your current service component simply select it. As soon as the component is selected its properties will be shown in the property panels in the lower right of the screen.
Click the "..." button to create a new Mapping. |
This opens the following wizard that helps you create a mapping.
The table “Source Channels” contains information about the inbound channels of the mapping. Those information comprise the name of the inbound message channel, the path to the message structure template that is used by this channel and the name of the endpoint from which the messages are sent to this channel.
There is also a checkbox that can be marked if a channel has to be triggered by the business logic. This will not be the case in our example, so this box remains unchecked.
The table “Destination Channels” contains the channel information for the outbound messages of the business logic. The difference to the inbound channels is that no outbound endpoint has to be specified as Mule bases the decision concerning which endpoint an outbound message will be directed on the outbound routers that are applied to the service.
As the wizard is already pre-filled we only have to set the template "Purchase" on the outbound channel as this can not be read from the configuration file.
Select the template "Purchase" for the outgoing channel "PurchaseSystemProvider". |
We will now rename the channels to have nicer names in the mapping code later.
|
To open the new mapping simply double click the business logic file named "MapOrderToPurchase" in the subtree of the mapping.
Open the mapping's business logic by double clicking "MapOrderToPurchase" |
< Prev | Next > |
---|