Build the request flow
Build the request flow for the getQuote operation: create
the mediation primitives, set their properties, and wire the flow.
About this task

To build the request flow, complete the following steps:
Procedure
- When the mediation flow opens, you see a tip that explains how to start a service. Since you already added a callout to the target service by using the Service Integration template, you can close the tip.
- Click Tracing to expand the group.
- Click Trace primitive and drop it onto the request flow canvas,
and rename the primitive Trace.

- Select a Mapping primitive from the Transformation folder in the palette, drop it onto the request flow canvas, and name it Lookup.
- Select a Message Filter primitive from the Routing folder, drop it onto the request flow canvas, and name it Filter.
- Select a Mapping primitive from the Transformation folder, drop it onto the request flow canvas, and name it TransformToDelayed.
- Select another Mapping primitive, drop it onto the request flow canvas, and name it TransformToRealtime.
- Select a Message Element Setter primitive from the Transformation folder, drop it onto the request flow canvas, and name it SetCustomerType.
- Before you proceed to wire the primitives, right click the canvas and make sure that the Automatic Layout option is on.
- In the request flow canvas, wire the primitives:
- The output terminal of getQuote : StockQuoteService to the input terminal of Trace
- The output terminal of Trace to the input terminal of Lookup
- The output terminal of Lookup to the input terminal of Filter
- The default terminal of Filter to the input terminal of SetCustomerType
- The match1 terminal of Filter to the input terminal of TransformToRealtime
- The output terminal of SetCustomerType to the input terminal of TransformToDelayed
- The output terminal of TransformToRealtime to the input terminal of getQuote : RealtimeServicePortTypePartner
- Select Filter. In the Properties, select Terminal. Right-click the Output terminal and select Add output terminal. In the New Dynamic Terminal window, take the defaults of Terminal type match and change the Terminal name delayedTime. Select OK.
- Wire the delayedTime output terminal of Filter to the input terminal of TransformToDelayed.
The following diagram illustrates the wired request flow:
- You now add the business object that was created earlier to the correlation context of
the input node getQuote : StockQuoteService, which enables the property
subscriptionLevel to persist in the message flow. Click getQuote :
StockQuoteService input node and switch to the Details tab in the Properties view. In
the Correlation context field, click Browse. Select
SubscriptionInformation under matching data types, and click OK. The URL
{http://Resources}SubscriptionInformation now appears in
Correlation context text box.

- Click Trace in the request flow canvas to see the primitive's
properties in the Properties view. Click Details to view the properties. Send
the trace output to the Server Logs view. Mark sure that these properties are set:
Table 1. Trace properties Property Value Description Destination Local Server Log Outputs messages to the Server Logs view. Message {0}, {1}, {2}, {3}, {4}, {5} It includes the following information in the output: - {0} - the timestamps when the Trace primitive was invoked.
- {1} - the message ID from the SMO.
- {2} - the name of the Trace mediation primitive instance that generated the trace message.
- {3} - t name of the module, containing the Trace mediation primitive instance that generated the trace message.
- {4} - the part of the SMO, as specified by the Root property XPath.
- {5} - the version of the SMO.
Root path / The scope of the message and SMO to be inserted into the trace message at insert {4}. 
- Select Lookup in the request flow canvas, hover over it and select
. Select the out message and set its type to StockQuoteService:getQuote:getQuoteRequestMsg.

- Double-click Lookup. In the New XML Map wizard, click
Next. Make sure that the MessageRoot is "/" and then click
Finish.

- In the map, wire the source body getQuote to the target body getQuote.
- Fully expand the source getQuote. On the target, expand context > correlation. Wire the source customerID to the target subscriptionLevel. Change the transform to the Lookup transform. In the Lookup engine field, select Comma Separated Value File Lookup. For CSV file, browse and select CustomerType.csv from the Resources library. Click Save and then close the map.
- Click Filter in the request flow
canvas. Select the Terminal view:
- Click match1 in the Output terminal list. The properties of the match1 terminal appear on the right.
- In the Terminal name field, change the name to realtime.
- By default, the message is sent to the TransformToDelayed primitive. You need to set the
pattern for mapping to TransformToRealtime. Select Details. In the Filter
table, click Add and enter the following values:
Table 2. Filter table properties Column Value Pattern /context/correlation/subscriptionLevel = 'premium' Terminal name realtime Pattern /context/correlation/subscriptionLevel = 'regular' Terminal name delayedTime 
- An administrator can change the promoted property at run time. The pattern property can
be changed at run time to change the quality of service. Follow these steps to promote the pattern
property:
- Click Promotable Properties.
- Click the promoted checkbox of the realtime [Pattern] property.
- Click the alias Filter.realtime. Type PREMIUM_SERVICE to rename the alias.

- Select SetCustomerType. Go to Properties >
Details and select Add. Set the value regular into the
correlation subscriptionLevel and then click
Save.

- Set the properties for the Mapping primitive TransformToDelayed:
- Select the TransformToDelayed primitive in the request flow canvas and double-click it.
- Click Next to see the root, input, and output message types that are mapped. Click Finish to accept the defaults to start the map editor.
- On the left side, the Input object side, expand body
> getQuote > request. In the Output object side, the right
side, expand body. Click symbol on the left
side and drag it to symbol on the right side to wire them together
and create the mapping.

- Save your changes and close the map editor.
The mapping file is displayed in the Details tab of the Properties view.

- Similarly, set the properties for the Mapping primitive TransformToRealtime:
- Select the TransformToRealtime primitive in the request flow canvas and double-click it.
- The New XML Mapping wizard opens. Click Next to see the root, input, and output message types that are mapped. Click Finish to accept the defaults. This action opens the map editor.
- On the left side, expand body > getQuote > request. On the right side, expand body. Click symbol on the left side and drag it to symbol on the right side to create the mapping.
- Save your changes and close the map editor.
The mapping file is displayed in the Details tab of the Properties view.

- Save the request flow.

This topic only applies to BAW, and is located in the BAW repository. Last updated on 2025-03-13 12:15