if allows conditional execution of nested interceptors.
if:
test: method == 'POST'
language: SpEL
flow:
- log: {} # nested plugins here
else:
- return: {}
if:
test: method == 'POST'
language: SpEL
flow:
- log: {} # nested plugins here
else:
- return: {}
Syntax
if:
test: <string> # required
'$ref': <string>
else:
- <flow>
flow:
- <flow>
language: groovy
xmlConfig: {}
if:
test: <string> # required
'$ref': <string>
else:
- <flow>
flow:
- <flow>
language: groovy
xmlConfig: {}
Attributes
| Name | Required | Default | Description | Examples |
|---|---|---|---|---|
| $ref | false | - | Reference a component defined under components. | - |
| language | false | SpEL | Language of the 'test' condition | SpEL, groovy, jsonpath, xpath |
| test | true | - | Condition to be tested |
|
Child Structure
| Element | Cardinality | Description |
|---|---|---|
| flow | 0..* | |
| flow | 0..* | Sets the flow of plugins that will be executed. |
| xmlConfig | 0..1 |