Configuring rules help in defining define conditions based on which it is possible to determine whether a policy has to be executed or not is determined at runtime.
For example, an XML to JSON Policy policy can be applied only if the Accept Header is set as application/json.
While configuring policies, you can find an The Add/Edit Rule button at the lower-right part of each Policy Configuration page . This allows the API author to set add additional rules on top of rules to a policy before the a message is passed to a policy.
Below is a A sample snapshot of the IP based Filter Policy Configuration page is provide below.
Figure 1: A sample Policy Configuration page with the Add/Edit Rule button
Adding Rule
...
Figure 2: Add/Edit Rule dialog box to configure rulerules
Adding a statement
In the Add/Edit Rule dialog box, click the Add Element button and then click the Add new statement option to add a statement to the Configure Rule section in within the dialog box. This rule can be edited by changing the properties present at the bottom of the dialog box. Each property is explained in the table below.
Figure 3: "Add new statement" option enabling to start with adding ruleto add more rules
Property | Description |
---|---|
Identifier Type | Specify the Message Part Identifier type; specify from which . Specify the part of the message , from where the policy need needs to check and validate the condition or criteria specified. Options available are as below:
|
Variable Name | Select the flow variable from the list of options available in the drop-down list. |
Operator | Choose the operator from the options below to form a condition in contrast with the value (explained below):
|
Value | Provide the value that is expected from the condition specified. |
...
To add another conditional statement with to the existing statement, click click the Add Element button and then click click the Add Conjunction option; select And or Or as per requirement and configure the properties again. The elements Elements can be rearranged or nested using a drag-drop approach in within the Configure rule canvas.
Figure 4: "Add Conjunction" option to enable adding a linked condition using operator the 'and'/'or' operator
Preview
The preview option provides the user the possibility to cross verify if enables cross verification to determine whether or not the rule is defined as intended.
...