...
Syntax Notes
Reserved keywords
- The boolean expression is evaluated for determining the path to take for execution.
- If the boolean expression yields true, control is transferred to the first embedded statement. When and if control reaches the end point of that statement, control is transferred to the end point of the if statement.
- If the boolean expression yields false and if an else part if present, control is transferred to the second embedded statement. When and if control reaches the end point of that statement, control is transferred to the end point of the if statement.
- If the boolean expression yields false and if an else part if not present, control is transferred to the end point of the if statement.
- if statements can be nested.
...
Code Block |
---|
language | xml |
---|
theme | Emacs |
---|
title | Examples of IF Statements |
---|
|
<!-- Combining number comparsion with non number comparison -->
<!-- Note here: count is a XPath function. This menthod essentially find number of Result Elements -->
<!-- Note that CPUUtilization and MemoryUtilitzation must return boolean -->
<If condition="[:/boolean('[:$LocalData.EventResponseMonitorData.Find/count(Result) ne 0:]'
and ('[:$ProcessData.CPUUtilization:]'
lt '[:$ProcessData.MemoryUtilization:]')):]">
<Then>
</Then>
</If> |
Comparing Numbers from Context Data;
Code Block |
---|
language | xml |
---|
theme | Emacs |
---|
title | Examples of IF Statements |
---|
|
<Query>
<SetContextData Key="AMB" Value="90"/>
<If Condition="[:/[:$ContextData.AMB:] lt 100:]">
<Then>
<SetResponseData>
<Key>Message.Value.AMBResult</Key>
<Value>Less than 100</Value>
</SetResponseData>
</Then>
<Else>
<SetResponseData>
<Key>Message.Value.AMBResult</Key>
<Value>Greater than 100</Value>
</SetResponseData>
</Else>
</If>
</Query> |