Matching One Parent Entity to Several Child Entities

In Mapping to Multiple Target Entities , a group of target entities were created in which the child and parent entities were related to each other. In some cases, it is necessary to create only one parent entity for the whole case. All subsequent child entities are related to the same parent entity. An example of how to do this is shown below.

1 <target-entities>
2   <target-entity name="HholdMealsGroup" type="parent" 
      attachment="case" id="MealGroup">
3     <set-attribute name="groupName" value="sample"/>
4   </target-entity>
5            
6   <target-entity name="MealGroupMember" type="child" 
      id="MealGroupMember">
7   </target-entity>
8 </target-entities>

In this example, a HholdMealsGroup and a MealGroupMember is created the first time the rule is executed. Each subsequent time the rule is executed, only a MealGroupMember is created and is associated with the same HholdMealsGroup entity.