Consider a business scenario where account is the child containment entity of global we have an attribute business name in global as we collect business information at global level one business can have many accounts so global to account is 1:M now once these accounts are created I want to automatically name them such as if there are three accounts and business name is R and R Capitals so the three accounts should be named as
R and R Capitals 1 (1st instance created for account)
R and R Capitals 2 (2nd instance created for account)
R and R Capitals 3 (3rd instance created for account)
is there a way to achieve this using rules in OPM.
There is no real way of doing this by rules. OPA does not have a concept of when an entity is added (ie there is no way of asserting in the rules which entity was added first).
This should be done by whatever is adding the accounts, or it could be done via custom code using an entity inference listener.