swiftinitpvtltd wroteThanks.
I am trying to understand below from rules guide-
Overview of the Rule Engine Framework
Most rule collections in Aware IM are un-ordered, such as rule collections attached to
business objects and notifications as well as processes that have the “Maintain rule
order” flag turned off. From the name of the rule collection it is clear that the order of
rules in the collection does not matter. So how does the rule engine in Aware IM decide
which rules to evaluate first, second and so on?
if we have a process and process has 20 steps(rules) in it are those getting executed 1 to 20?(from top to bottom)
Rules are a series of operations and functions that are applied to Business Objects and entered on the Update Rules and Deletion Rules tabs of the Business Object. There is no set order that they execute in.
Processes always execute in the order that they are written. Process steps are not Rules (capital R). It would be impossible to write code that you had no expectation of the order that it is executed.
If you have a Business Object in context and then call a sub process (that uses the BO as an input) then that BO will drop to the sub Process. If you have 20 BOs in context and then call a sub Process then that sub Process is called 20 times, once for each instance of the BO.
Therefore if you have a process to FIND all your Contacts where they live in the USA and then want to do one thing if they are in NY and another if they are in CA and then once you've finished set them all to processed it would look like this:
FIND Contact WHERE Contact.Country='USA'
ProcessStates
Contact.Compeleted=Yes
Where ProcessStates has INPUT Contact and does this:
If Contact.State='NY' THEN DoSomething ELSE
IF Contact.State='CA' THEN DoADifferentThing
This will FIND all the Contacts in USA then go through the list of the Contacts that it has found and pass them one at a time into the ProcessStates sub Process. Once it has completed the ProcessStates for every Contact it has found it will set Contact.Completed to Yes for all of the Contacts at once.
It will execute in this order always.
** This is an example and not the most efficient way, you would probably want to have an IF statement on the ProcessStates to make sure you didn't needlessly run the ProcessStates for Contacts in the other 48 states.