Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
themeEmacs
titleExamples 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
languagexml
themeEmacs
titleExamples 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>