The Activity Editor provides the function blocks in Table 81 to manage child object instances that belong to a parent in an identity relationship.
Table 81. Function blocks for Managing Child Instances
Function block | Description |
---|---|
General/APIs/Identity Relationship/Add My Children | Adds child relationship instances to parent/child relationship tables |
General/APIs/Identity Relationship/Delete My Children | Deletes child relationship instances to parent/child relationship tables |
General/APIs/Identity Relationship/Update My Children | Deletes or adds child relationship instances from parent/child relationship tables. |
The function blocks in Table 81 assume that the parent business object being passed is an after-image; that is, the image of the business object after the verb operation has taken place. For example, if a business object has an Update verb with the update caused by the addition of new child objects, these new child objects already exist in the business object. Similarly, if a business object has an Update verb with the update caused by the deletion of child objects, the business object already has these child objects deleted.
This section provides the following information about how to manage child instances:
A parent/child relationship is a 1-to-many relationship between parent (1) and child (many) business objects. A parent/child relationship involves the following participants:
The relationship tables for a parent/child relationship enable the function blocks in Table 81 to track the child business objects associated with a particular parent business object.
To create a relationship definition for a parent/child relationship, perform the following steps in Relationship Designer Express:
Expand the parent business object and select the key attribute.
Expand the child business object (not the child attribute with the parent object), and select the key attribute from this child object.
For more information, see "Defining identity relationships"..
This section provides the following steps to ensure that child objects that participate in a composite identity relationship are correctly managed during an Update:
The Update My Children function block updates the relationship tables for a parent/child relationship. A parent/child relationship is needed to help determine whether child objects have been added to or deleted from a parent business object.
For a given parent business object, this method makes sure that the following images of the business object match:
For the map to detect that a child business object has been deleted, it must determine how many instances of the child object of this type that the parent business object had before the Update (the before-image) and compare that to what the parent object presently has (the after-image). The map can use the Update My Children function block to make this comparison and find out what has been deleted or added.
When Update My Children compares the before- and after-images, it can determine whether to remove the associated relationship instances from the relationship tables for any child object that is not present in the parent business object. The method removes relationship instances from the following relationship tables:
When you use the Update My Children function block to maintain relationship tables for a child object involved in a composite identity relationship, keep the following tips in mind:
You do not need to use the Update My Children function block to track child objects involved in a simple identity relationship. For more information, see "Coding a child-level simple identity relationship".
In other words, the method cannot handle the case where the grandchild object's composite key depends on values in its grandparent objects. For example, if A is the top-level business object, B is the child of A, and C is the child of B, the two methods will not support the participant definitions for the child object C that are as follows:
key attribute of A: ID key attribute of B: B[0].ID key attribute of C: B[0].C[0].ID
key attribute of A: ID key attribute of C: B[0].C[0].ID
To access a grandchild object, these methods only support the participant definitions that are as follows:
key attribute of B: ID key attribute of C: C[0].ID
key attribute of B: ID first key attribute of C: C[0].ID1 second key attribute of C: C[0].ID2
Execution of the Update My Children function block with a calling context of SERVICE_CALL_REQUEST or ACCESS_RESPONSE does not produce any changes to these relationship tables.