srufini wroteProbably this is the wrong way to do it. I am trying to create two list BO. One of families and one og groups. Each group is related to a family only. Many group can belong to a family.
This list is fixed and I want to be created by a process when I populate my database at the beginning.
There must be a better way to do it (reccomandation well accepted!) but I want to get to the bottom of this approach as lesson.
I am working in a process.
My first rule creates all the families, each line a family.
My second rule would like to create the groups.
What I found is, no matter what I use, IF, FIND,, the context within this process will always be locked on the first family that is created in the first rule. If I use "That" will be recalled the second one.
Accoridn got the manual, the function IF should do the trick, but not the function FIND, but neither seems to work...
If you do a search which returns multiple Families then any action that works on individual Business Objects (BO) will only work on the first BO that is in context.
If you return 10 families from your FIND then execute a CREATE the CREATE will work only with Family1
To deal with each Family to CREATE their Group you will need to create two processes FindFamilies and GroupCreation
FindFamilies
FIND Families WHERE Families.Attibute=XYZ
GroupCreation
GroupCreation
CREATE Group with ....
GroupCreation has Families as an input (the input is in the top right hand window of the process editor)
When you call a sub process it will receive only one of the instances of each of the input BOs allowing unitary actions to execute with just one BO in context. Once it has completed the first instance of Families it will then run for the next in context until the list of BO instances in context is exhausted. The process will then move onto the next step in the original process (FindFamilies in your case).
Bear in mind that things you create in downstream processes (Groups in this case) are no longer in context once that sub process has ended, if you need them all later you'd need to do another FIND.