Use the Policy Resolution mediation primitive to dynamically configure a mediation flow, using mediation policies. Mediation policy information is obtained from WebSphere® Service Registry and Repository (WSRR).
You can use the Policy Resolution mediation primitive to retrieve mediation policies from a WSRR registry, and control mediation primitives that come later in the flow. The registry can be local or remote.
The Policy Resolution primitive lets you retrieve a mediation policy for the current Service Component Architecture (SCA) module. If valid mediation policies are found in the registry, their contents can be used to override the dynamic properties of subsequent mediation primitives. Any property that you promote from a mediation primitive in the top-level request, response, or fault flow is also a dynamic property. Mediation policies contain the equivalent of promoted properties (groups, names, and values) and must conform to the Web Services Policy Framework (WS-Policy).
If you add a Policy Resolution primitive to your mediation flow, when the Policy Resolution mediation primitive receives a message it sends search queries to the registry. If there are mediation policies attached to the current module, they are analyzed according to the mediation policy processing model. The resulting property information is copied to the SMO at location /context/dynamicProperty. For each property, the /context/dynamicProperty location stores the group, name, and value. The property group and name are compared to dynamic properties in later mediation primitives. When a match occurs, the value of the dynamic property is overridden.
For example, suppose you create a module that contains one mediation flow component, and the component contains two mediation primitives: a Policy Resolution primitive followed by an XSL Transformation primitive. If you promote the XSL Transformation property, Mapping file, you can override its value at run time, using mediation policies in your registry.
Before you use the Policy Resolution mediation primitive you might need to add SCA modules, mediation policies, and mediation policy attachment documents to your WSRR registry.
If you want to use the Policy Resolution mediation primitive, the details of your SCA module must exist in the appropriate registry. In addition, you must attach at least one mediation policy to your SCA module.
When you export an SCA module containing a Policy Resolution mediation primitive, WebSphere Integration Developer generates a default mediation policy for each property group in your SCA module. For example, if your SCA module contains three property groups, WebSphere Integration Developer generates three default mediation policies each containing all the dynamic properties belonging to one group. 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; you must decide how to use the default mediation policies.
If you load an EAR file containing your SCA module into WSRR, the registry creates an SCA module document and loads any default mediation policies. In addition, you can create your own mediation policies in WSRR but they must refer to the group and alias names of your dynamic properties, and provide property values.
When you have the mediation policies you need, in WSRR, you can attach them to your SCA module. If you want to specify gate conditions on a mediation policy, you must specify them on both the Policy Resolution primitive and on the policy attachment in WSRR.
If you want to use WSRR governance you must make your WSRR policy document governed. Then you can move the policy document, and any associated policies, through the life cycle classifications. If you want to use classifications that are not related to governance, you must add classifications to the WSRR policy, not the policy document. In WSRR, there is a default governance life cycle, but you can define your own. If you want to filter mediation policies according to particular WSRR classifications, including life cycle classifications, you must also define the classifications on the Policy Resolution primitive.
Using mediation policies, you can develop new service interactions that achieve greater levels of flexibility and administrative control. In addition, you can get new value out of existing systems by adjusting message flows according to the context in which they occur.
When you design your mediation flow, any mediation primitive that occurs after the Policy Resolution primitive can have its dynamic properties overridden (using values from mediation policies). Therefore, to dynamically configure the whole mediation flow, you would put a Policy Resolution primitive at the start of the flow.
WSRR has many classification systems, including life cycle classifications, and you can select mediation policies based on their WSRR classification. This allows you to impose governance on your policies, or create your own classification systems.
At run time, any Classification you specify in WebSphere Integration Developer must be found on a suitable mediation policy in WSRR. WSRR has many classification systems, including life cycle classifications that can be used for governance.
If you specify one classification in the Policy Resolution primitive and two classifications in WSRR, then the mediation policy can be returned, assuming the names match. For example, if the Policy Resolution primitive specified a classification of Test and the WSRR policy object specified classifications of Test and Managed, then the mediation policy would match the query. However, if the Policy Resolution primitive specified classifications of Test and Managed but the WSRR policy object only specified a classification of Managed, then the mediation policy would not match the query.
WSRR defines classification systems using the Web Ontology Language (OWL), in which each classifier is a class and has a URI. OWL implements a simple hierarchical system. For example, a bank account could start with the following details:
Specifying a classification of Address matches any object classified as Address, First line of address or Second line of address.
Property | Valid Values | Default |
---|---|---|
Registry name | String | The default registry |
Policy condition name | String | |
XPath | XPath | |
Comment | String | |
Propagate mediation policy to response flow | Boolean: true or false | false |
Classification | List of URIs |
Consider the following when you using the Policy Resolution mediation primitive: