...
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.MonitorData.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> |