Contents

Popular

Configuring rules help in defining conditions based on which whether a policy has to be executed or not is determined at runtime.

For example, an XML to JSON Policy can be applied only if the Accept Header is set as application/json.

While configuring policies, you can find an Add/Edit Rule button at the lower-right part of each Policy Configuration page. This allows the API author to set additional rules on top of a policy before the message is passed to a policy.

Below is a sample snapshot of IP based Filter Policy Configuration page.


Figure 1: A sample Policy Configuration page with Add/Edit Rule button

Adding Rule

Click the Add/Edit Rule button to start configuring rule.


Figure 2: Add/Edit Rule dialog box to configure rule

Adding a statement

In the Add/Edit Rule dialog box, click Add Element button and then click Add new statement option to add a statement to the Configure Rule section in 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 rule

PropertyDescription
Identifier Type

Specify the Message Part Identifier type; specify from which part of the message, policy need to check the condition or criteria. Options available are as below:

Variable NameSelect the flow variable from the list of options available in the drop-down.
Operator

Choose the operator from the options below to form a condition in contrast with the value (explained below):

  • Equals
  • Like
  • Not Like
ValueProvide the value that is expected from the condition specified.

Adding more statements

To add another conditional statement with the existing statement, click Add Element button and then click Add Conjunction option; select And or Or as per requirement and configure the properties again. The elements can be rearranged or nested using a drag-drop approach in the Configure rule canvas.


Figure 4: Add Conjunction option to enable adding a linked condition using operator 'and'/'or'

Preview

The preview option provides the user the possibility to cross verify if the rule is defined as intended.


Adaptavist ThemeBuilder EngineAtlassian Confluence