You can use mediation policies to control message flows between service requesters and service providers. This tutorial shows you how to load an SCA module (and associated mediation policies) into WebSphere® Service Registry and Repository (WSRR); also, how to attach a mediation policy to your SCA module.
Mediation policies are associated with SCA modules, and let you control the dynamic properties of mediations.
When you use WebSphere Integration Developer to create SCA modules that contain mediation flows, any module property that you choose to promote (make visible to the run time) is also a dynamic property. Dynamic properties can be overridden, at run time, using mediation policies in a registry.
When you export your SCA module, WebSphere Integration Developer generates a default mediation policy for each property group in your SCA module. The default mediation policies represent the values given to all dynamic properties, at development time. Although WebSphere Integration Developer generates default mediation policies it does not attach them to the SCA module.
Generally, you should use default mediation policies without any associated conditions, and create your own mediation policies if you want to have conditional mediation policies.
Integration Developers.
Administrators.
Mediation policy control is achieved at the level of the SCA module. This module shows you how to load an SCA module into WSRR, so you can attach a mediation policy to it.
Load an SCA module, in an EAR file, from the local file system. If the EAR file contains mediation policies, these are also loaded.
WSRR also loads any default mediation policies that were generated by WebSphere Integration Developer. If you want to provide a dynamic override for every dynamic property in your module, you can simply attach all the default (system-generated) mediation policies to your SCA module.
When you load an SCA integration module into WSRR, any system-generated (default) mediation policies are loaded along with the SCA module. This module shows you how to view mediation policies in general, and how to identify the default mediation policies.
View the default mediation policies, generated for your SCA module.
A mediation policy has a namespace, which is made up of the property's group name appended to: http://www.ibm.com/wbi/mediation/200812/. The integration developer can specify the property group and the administrative console displays module properties in their property groups. The namespace is displayed by WSRR as an additional property of the mediation policy document, called xmlns_sibx.
You can now see the contents of the mediation policy document. For default mediation policies, each assertion relates to a dynamic property. When a mediation policy is made use of, at run time, its assertion values override any dynamic properties in the mediation flow.
If you want to do more than override all the dynamic properties of an SCA module, you can create your own mediation policies, in WSRR. This module shows you how to create a mediation policy.
Create your own mediation policy.
WSRR creates a mediation policy that contains the property overrides you specified. Before the overrides can be used, you must attach the mediation policy to your SCA module.
In order to use mediation policies, they must be attached to an SCA module. This module shows you how to attach a mediation policy to an SCA module.
Attach a mediation policy to an SCA module.
You can create gate conditions for your own mediation policies, in WSRR. This module shows you how to create a gate condition on a mediation policy attachment (a mediation policy attachment attaches a mediation policy to an SCA module).
Create a gate condition for your mediation policy. The gate condition is created on the mediation policy attachment, in WSRR.
You create gate conditions by adding user properties to the mediation policy attachment. The run time interprets some of the user properties as necessary conditions (gate conditions): the conditions must be met before the mediation policy can be used. Only user properties that begin with the string medGate_ are used as gate conditions for mediation policies.
Generally, you should only create gate conditions on mediation policies that you create yourself, not on system-generated mediation policies.
In the mediation policy processing model, mediation policies with gate conditions have the highest precedence. Therefore, property values defined by these mediation policies have the highest precedence. Mediation policies without gate conditions have a lower precedence. Therefore, property values defined by these mediation policies have a lower precedence. Administrative console values are used if there is no suitable property in a mediation policy.
Using WSRR classification systems (including life cycle classifications), you can filter the visibility of mediation policies. This module shows you how to govern mediation policies by using WSRR life cycle classifications.
In order for a mediation policy to be visible at run time, any classifications you define at integration time must match classifications on the mediation policy at run time. You must use the classification URIs, shown in WSRR, when developing your SCA module.
If you make your policy document governed, in WSRR, you can take advantage of the governance capabilities of WSRR. For example, when you make a policy document governed, the governance state is percolated to any associated policies. In addition to using classifications for WSRR governance, you might want to use other types of WSRR classifications, in which case you can add classifications directly to the relevant WSRR policies (rather than to the policy documents).
In WSRR, you must find the URI of any classification that you want to use. Then, in WebSphere Integration Developer, you must create a Policy Resolution Classification property using that URI.
In WSRR, you can find the URI of a classification in a number of ways. The following steps show you one way.
If you want to use WSRR governance, you have to make your policy document governed and then move it from state to state.
The mediation policy tutorial shows you how to create WSRR documents for SCA modules and mediation policies. In addition, it shows you how to create gate conditions for your mediation policies.
If you have not yet configured your runtime environment you should do so now. For example, ensure that you have a suitable WSRR definition for your SCA module.
After you have configured your runtime environment and completed this tutorial, you should be able to run the application associated with your SCA module. Depending on the message being processed, and on any gate conditions and classifications, the mediation flow can be adjusted by mediation policies.