To unpack the AwareIM example a little, consider this
For example, consider the following process consisting of two rules:
Rule 1: FIND Account WHERE Account.Balance < 100
Rule 2: Account.State = 'CLOSED
Suppose we change Rule 1 to read ' FIND Account WHERE Account.Balance < 100 IN BATCHES OF 100
Lets suppose there are 1000 transaction in the find
The first rule runs a query that finds all accounts with balances less than 100 and where the account is open,. The second rule changes the state of found accounts to 'CLOSED' . If the number of accounts found by the query is larger than the batch size the query will initially return only the first batch and the second rule will change the states only of the first batch. After the second rule finishes processing the first batch the transaction is committed (so the changes to the first batch are not rolled back if an error occurs when processing any subsequent batches).
After committing the first batch the rule 1 is executed again and the query returns the second batch. This process continues until the query returns the last batch. So in this scenario, the FIND will be run 10 times
THERE MAY BE TIMES -when for safety and security of data, you want to commit the transaction after each change, but really, IN BATCHES of 1 is only going to slow the whole process down because the FIND is going to be run 1000 times.
When you are calling a sub process - 'in batches of ' doesn't matter because items only get sent to the sub-process one at a time anyway, (try doing a THIS and THAT experiment - there will never be a THAT in context so the judgement call is whether you want the whole process to roll back (all 1000 items) if there is an error condition encountered or whether you want to slow down the process for maximum security and commit the transactions to the database after every transaction has been processed (IN BATCHES OF 1)
When to use sub processes
The example above doesn't need a sub process simply because you are applying the change to ALL items in the FIND, but if you want to do further process ing you would then call a sub process (because the first process passes its results to the sub process one at a time
So Main Process would be
FIND Account WHERE Account.Balance < 100
DoSubProcess2
SubProcess2 COULD BE something like
IF AGE(Account. OpenDate) > 10 THEN (close the account)
ELSE
(contact the customer in some way and ask them what they want to do)