WID 6012.9 Mediation Flow How to
WID V6.0.1.2, Interim Fix 009
Table of Contents
How to add a Custom Mediation Primitive
How to add a Mediation Flow Component
How to create a Mediation Module
How to create custom mediation primitives
How to develop mediation flows using mediation primitives
How to implement a Java component in a Mediation Module
How to implement a Mediation Flow Component
Related links
How to develop mediation flows using mediation primitives
Related links | Mediation Flow editor Mediation primitives Creating mediation flows Implementing the mediation flow Mediation services overview |
Pre-requisites | |
How to create custom mediation primitives
Related links | Custom Mediation primitive Using wizards to define a custom mediation primitive Implementing a custom mediation primitive |
How to create a Mediation Module
Related links | |
Create a mediation module
Right-click in the Business Integration view and select New > Mediation Module | |
Set up New Mediation Module Properties
Setup the following properties:
| |
Select the required Libraries
Select the required Libraries if any and click Finish. | |
New Mediation module is created
A new mediation module is created (i.e NewMediationModule). In addition, an empty mediation flow component (Mediation1) is also created (because you selected Create mediation flow component in the new mediation module properties setup above).
|
How to add a Mediation Flow Component
1-Open the Assembly Diagram
Double-click the assembly diagram icon in the Business Integration view to open the Assembly Diagram.
Notice that a mediation flow component (Mediation1) is automatically created. You can rename this component as required.
Note: You can only have one mediation flow component in a mediation module. In other words, a mediation module can only have one mediation flow component.
| |
2-Add additional Components/Node
In addition to one Mediation Flow component, you can also add the following components (Nodes) in the Assembly Diagram (see Figure at right).
Right-click inside the Assembly Diagram and select Add Node > ???.
|
How to implement a Mediation Flow Component
In the Assembly Diagram, right-click on the mediation flow component that you want to implement and select Generate Implementation. | |
Select the folder where the Mediation Flow implementation will be generated.
Select the default folder or New Folder and click OK. | |
The Mediation Flow Editor opens.
In the Operation connections section, the following are setup:
In the Mediation flow section, the following are setup:
| |
Connect the source operation (CCambil_DateTime_I) to the target operation (CCambil_DateTime_IPartner) if required.
| |
After connecting the source operation to the target operation, notice that a Callout node (Invoke) is created.
Callout node An end point in the request flow, derived from the target operations. It sends the processed message to the target operation. There is one callout node for each target operation.
you are now ready to build the mediation flow itself. |
How to implement a Java component in a Mediation Module
In the Assembly Diagram, right-click on the Java component that you want to implement and select Generate Implementation. | |
Select the package where the Java implementation will be generated.
You can select the default package or New Package.
Click OK. | |
If you selected New Package, enter Package name and click OK. | |
A new package is created (ccambil.java).
Select the package (ccambil.java) and click OK. | |
This is the generated Java source code.
Notice that you have to implement the public DataObject getTimeOfDay(DataObject input1) method. | package ccambil.java; import commonj.sdo.DataObject; public class CCambil_JavaComponent1Impl { /** /** } |
How to add a Custom Mediation Primitive
The completed etc. | |
| |
In the module assembly diagram, right-click on the CustomMediationFlow component and choose Generate Implementation. | |
Click OK. | |
An initial mediation flow implementation is generated and the Mediation Flow Editor is automatically opened.
In the Operation Connections section, the source and the target operations are shown.
In the Mediation Flow section, the input and input response nodes are shown.
Input Node: Request - getQuote : StockQuoteService The input node is the starting point for the request flow. It sends the message from the source operation into the request flow.
Input Response Node: Immediate Response The input response node is an end point in the request and response flows. It returns the processed message as a response to the source operation.
| |
In the Operation connections section, wire StockQuoteService interface's getQuote operation to StockQuoteServicePartner interface's getQuote operation. | |
After wiring the source to the target operation, a callout node appears.
Callout Node: Invoke - getQuote : StockQuoteServicePartner A callout node is an end point in the request flow. It sends the processed message to the target operation. | |
Add the PreferenceInformation business object to the correlation context of Request - getQuote : StockQuoteService. This will allow the property isPreferred to persist in the message flow.
| |
Select PreferenceInformation under matching data types, and double click. | |
{http://CustomMediation} PreferenceInformation now appears in the Correlation Context field. | |
This mediation primitive allows the use of an existing SCA component operation within the mediation flow. | |
| |
In the Define Custom Mediation panel, leave the default selection to Create a new interface with implementation.
Click Next. | |
The Specify Message Types panel shows the input message type and output message type that will be used to create the new interface. Notice that the PreferenceInformation business object set in the correlation context is also shown in the Defined Contexts section.
| |
In the Create a new interface panel, change the Name field to NewCustomInterface.
Click Next. | |
In the Define Custom Mediation panel, leave the default selection to Generate a default Java implementation class and define it using the embedded visual snippet editor.
Click Finish. | |
Notice that a new reference NewCustomInterfacePartner has been created in the operation connections section | |
To add the Java code, do the following:
// Get the symbol from the body of the message // If symbol is on the user's preferred list, set the isPreferred flag in the correlation context to 'true' // Create the preferenceInformation business object and set the isPreferred flag to true // Set the business object in the correlation context }
| |
Synchronize interfaces and references and merge the java implementation in the assembly editor to create and wire the java component associated with the custom mediation.
| |
A Merge Implementation dialog is launched to show that the NewCustomInterfacePartner reference will be added using the interface NewCustomInterface. In addition, a corresponding Java™ component will be created.
Click OK. | |
Layout the contents by right-clicking inside the Assembly Diagram and selecting Layout Contents from the context menu. | |
No comments:
Post a Comment