Conditional constructs are common building blocks of discovery signatures and compliance rules.
Conditional constructs organize multiple conditions (basic conditions or even loops) in an if-then-else logical sequence, creating complex expressions for evaluation.
A conditional construct always begins with one if-then block, which pairs two conditions together. The second condition in this pair is evaluated for TRUE/FALSE outcome only if the condition that preceded it returned a TRUE value.
After the initial if-then block, you can insert any number of optional elseif-then blocks. Again, each elseif-then block pairs two conditions, and the second condition in each pair is evaluated only if the condition that preceded it returned a TRUE value.
Finally, before the end of the full conditional construct, you can insert one last optional else statement, with a condition to be evaluated if all preceding if and elseif conditions returned FALSE values.
A conditional construct can be combined with basic conditions or nested within a loop. A conditional construct can also be enclosed within another conditional construct.
Double-click the then line and repeat steps b and c for the condition or loop that depends on the TRUE/FALSE outcome of the preceding condition or loop.
Note
A noteworthy example of a useful then statement is a Command configuration object in the LHS operand along with the remediate operator (and no RHS operand). This combination enables you to execute a shell command as a remediation action at the end of compliance analysis.