Constructing the policy Condition if statements
This section breaks down each of the if-then statements from the previous section into the Condition (also known as if) component of the policy document. To really understand what is going on in this section, you must be familiar with the content of the "How to write a complete XML policy using PMAC" tutorial (see Resources).
The customer reward if statement
As you did in the "How to write a complete XML policy using PMAC" tutorial (see Resources), you first need to reword the if statement in the previous section to resemble an equation. In the case of the "if the customer spent more than $4000 in the last six months, and more than $10000 last year" statement, you could rewrite it as such:
Listing 3. Rewriting customer reward statement
if (the customer's orders over last 6 months > $400) and (the customer's orders for last year > $10,000) |
That's pretty simple, right? Try to write the same sort of statement for the "if the customer spent over $4000 in the last six months, but less than $10,000 last year" condition. Check your answer by looking at the customer_if_answer.txt file from the sample code zip file that you can download from this tutorial.
The server provisioning if statement
Let's create a statement that resembles an equation for the server provisioning if statement in the previous section. The "if there are currently ten or less servers online, and there are currently more than 3000 active connections" statement could be rewritten as:
Listing 4. Rewriting server provisioning statement
if (the number of servers <= 10) and (the number of active connections > 3000) |




