Learn about mediation policies

Using mediation policies you can dynamically control service interactions, using contextual information. Learn how modules, target services, and mediation policies interrelate.

Mediation policies

Using mediation policies you can dynamically configure service interactions, by overriding the values of module properties. The module properties that you can override are defined in a mediation flow. You define the override values in a mediation policy.

Mediation policies are stored in WebSphere® Service Registry and Repository (WSRR), but you can create them using the Mediation Policy Administration widget.
This diagram shows two orders. If more than one item is ordered, the mediation policy condition results in a different mediation policy being applied.

Creating modules that can use mediation policies

You use IBM Integration Designer to create modules with a mediation flow. The mediation flow must include a Policy Resolution mediation primitive, which can access mediation policies in WSRR. You define whether the Policy Resolution mediation primitive retrieves mediation policies associated with the module, a target service, or both.

When you create the mediation flow you must include other mediation primitives, that have properties you want to override.
  1. Use IBM Integration Designer to create a module containing a Policy Resolution mediation primitive. The Policy Resolution primitive must be placed before any primitives that have properties you want to modify.
  2. Configure the Policy Resolution primitive.
    1. Specify the WSRR definition to use, or take the default definition.
    2. Define whether to retrieve mediation policies associated with the module, a target service, or both.
    3. If you want to use a gate condition, create a Policy condition name that matches the gate condition on the policy. Specify where the condition value is found in the message, by providing an XPath expression. For example, you could create a Policy condition name of Age and an XPath expression of /body/priceChecker/request/Age. When service requests are processed, the value of condition Age is set from /body/priceChecker/request/Age.
  3. If you want to associate mediation policies with a target service rather than a module, add an Endpoint Lookup mediation primitive before the Policy Resolution mediation primitive.
  4. Add other mediation primitives.
  5. Promote any properties that you want to override dynamically. Only promoted properties can be overridden by mediation policies.

Configuring IBM Business Process Server

The application server must contain your module and be aware of the correct WSRR.
  1. Deploy your module to IBM Business Process Server.
  2. Ensure that IBM Business Process Server has a suitable WSRR definition for your module.

Configuring WSRR

When the Policy Resolution mediation primitive processes service requests, it queries WSRR. Therefore, WSRR must contain the relevant information about your modules and services.
  1. Load the EAR file, containing your SCA module, into WSRR.
  2. If necessary, load the WSDL for the target services that you want to use.

Using the Mediation Policy Administration widget

You can use the Mediation Policy Administration widget to create mediation policies and associate them with either modules or target services. In addition, the widget creates policy attachments that associate mediation policies with modules or target services. The mediation policies and policy attachments are created in WSRR.

For every property that you want to override, you add an assertion. The widget refers to the properties that you want to override as assertions. In WSRR, the property overrides are assertions on the policy. If you want to create a conditional mediation policy, add a gate condition. In WSRR, the gate conditions are user properties on the policy attachment.
  • When you create a policy attachment using the Mediation Policy Administration widget, the widget creates a single policy attachment and one mediation policy for each group that has an assertion.
  • When you delete a policy attachment using the Mediation Policy Administration widget, the widget deletes the policy attachment and any of the mediation policies it attached, unless the policies are being used by a different attachment.
When you use the Mediation Policy Administration widget to attach mediation policies to target services, you can attach the policies at the following levels:
  • Service
  • Endpoint
  • Operation