Talal,
Yeah, going over 1) sample apps and 2) documentation is the recommended way of trying to figure out how Aware works.
You do have what you need though it seems in your post. Here is an example of how you can do (below are actions for the processes):
First of all you need to create the actual CustomerStats instance:
CREATE CustomerStats with CustomerStats.Identifier='1'
Second you need a process that updates and optionally opens the instance:
FIND CustomerStats WHERE CustomerStats.Identifier='1'
CustomerStats.AllCustomers = COUNT Customer
CustomerStats.MaleCustomers = COUNT Customer WHERE (Customer.Gender='Male')
CustomerStats.FemaleCustomers = COUNT Customer WHERE (Customer.Gender='Female')
VIEW CustomerStats
You can also divide these 2 things into 2 processes if you want to update the CustomerStats automatically:
Auto update:
FIND CustomerStats WHERE CustomerStats.Identifier='1'
CustomerStats.AllCustomers = COUNT Customer
CustomerStats.MaleCustomers = COUNT Customer WHERE (Customer.Gender='Male')
CustomerStats.FemaleCustomers = COUNT Customer WHERE (Customer.Gender='Female')
Find and view:
FIND CustomerStats WHERE CustomerStats.Identifier='1'
VIEW CustomerStats