IBM BPM, V8.0.1, All platforms > Programming IBM BPM > Enterprise Service Bus programming
Routing Messages Within a Mediation Flow
Within WebSphere ESB, there are several mediation primitives that can be used for routing messages in a mediation flow.
Most mediation primitives have one input terminal (in), one fail terminal (fail), and one or more output (out) terminals, as shown in Figure 1. The in terminal is wired to accept a message and the other terminals are wired to distribute messages. If a failure occurs, the fail terminal distributes the original message, together with any failure information.
Figure 1. Mediation primitive
Figure 1.shows that a mediation primitive with two out terminals and one fail terminal. A mediation primitive can be wired within mediation flows to specify the potential paths to which a message can be distributed. The actual path for a message is dependent on the mediation primitive. There are different paths a message can take within a mediation primitive:
- Messages might leave an out terminal one or more times.
- Messages might leave the fail terminal once.
- Messages might not leave any of the terminals.
Flow branching
Figure 2. Branched mediation primitive
Figure 2.shows how a mediation primitive can have multiple wires from one output terminal branching to several services. You cannot specify the order in which messages will leave the terminal. If you need to send the message through a specific wire first, then use multiple output terminals each with a single wire. You can also select a mediation primitive that will allow you to control the order in which output terminals are invoked (for example see Figure 3).
- Example scenarios
This section describes example scenarios that a fictitious company want to implement. It then goes on to discuss the different mediation primitive options that can be used in the implementation.
Enterprise Service Bus programming