Adds and
deletes
child instances in a specified
parent/child relationship of an
identity relationship as necessary.
Syntax
void updateMyChildren(String parentChildRelDefName,
String parentParticpntDef, BusObj parentBusObj,
String childParticpntDef, String childAttrName,
String childIdentityRelDefName,
String childIdentityParticpntDefName,
CxExecutionContext map_ctx)
Parameters
- parentChildRelDefName
- The name of the parent/child relationship definition.
- parentParticpntDefName
- The name of the participant definition that represents the parent business
object in the parent/child relationship.
- parentBusObj
- The variable that contains the parent business object.
- childParticpntDefName
- The name of the participant definition that represents the child business
object in the parent/child relationship.
- childAttrName
- The name of the attribute in the parent business object whose type is the
child object name that participates in the parent/child relationship.
For example, in a customer-address relationship, if the parent object contains
an Address1 attribute, which is a child business object of type
Address, the childAttrName attribute name is
Address1.
- childIdentityRelDefName
- The name of the identity relationship in which the child business object
participates.
- childIdentityParticpntDefName
- The name of the participant definition that represents the child business
object in the identity relationship.
- map_ctx
- The map execution context. To pass the map execution context, use
the
cwExecCtx variable, which Map Designer Express defines for every
map.
Return values
None.
Exceptions
- RelationshipRuntimeException
- see the Notes section for more information on when this exception is
thrown
Notes
The updateMyChildren() method updates the child instances in the
relationship tables of the parentChildRelDefName and
childIdentityRelDefName relationship definitions.
This method is useful in an identity relationship when a parent business
object has been updated as a result of the addition or removal of child
objects. Use updateMyChildren() to compare the after-image
(in parentBusObj) with the before-image (information in
the relationship tables) to determine which child objects in the after-image
are new or deleted.
- Note:
- The updateMyChildren() method cannot handle the case
where the child's composite key depends on its grandparents. For
more information, see "Tips on using Update My Children".
The updateMyChildren() method performs the following validations
on arguments that are passed in:
- Validate the name of the parentChildrelDefName
relationship definition (first argument).
- Make sure that the parentChildRelDefName
relationship is a parent/child relationship and that the
parentParticpntDefName and
childParticpntDefName are part of the
parentChildRefDefName relationship definition.
- Make sure that the childIdentityRelDefName
relationship is an identity relationship. In addition, the participant
definition in childIdentityRelDefName that represents
the generic business object must be defined as IBM WebSphere InterChange
Server Express- managed. For more information on how to specify
these settings, see "Defining identity relationships".
- Make sure that the childIdentityParticpntDefName is
part of the childIdentityRefDefName relationship
definition
If any of these validations fails, updateMyChildren() throws the
RelationshipRuntimeException exception.
Once the arguments are validated, the updateMyChildren() method
adds children or deletes children from the list of child business objects that
belong to the specified parent business object as appropriate. This
method performs one of the following tasks to the relationship tables for the
parent and child participants (parentParticpntDefName
and childParticpntDefName, respectively):
- For each new child object, updateMyChildren() adds a child
instance.
This method does not add to the child's relationship table
because all the business objects that are currently associated with the parent
object have already been maintained when
maintainCompositeRelationship() was called.
- For each deleted child object, updateMyChildren() removes the
corresponding child instance.
This method removes from the child's cross-reference table in addition
to the parent/child relationship table.
The updateMyChildren() method requires that a parent/child
relationship is defined with Relationship Designer Express. For
information on how to create this kind of relationship, see "Creating the parent/child relationship definition".
- Note:
- If the child business object has a unique key, the child participant's
attribute is the unique key of the child object. If the child object
does not have a unique key, the child participant's attribute is this
nonunique key.
Examples
For an example involving updateMyChildren() in conjunction with
the maintainCompositeRelationship() method, see the Examples
section of maintainCompositeRelationship().
For more examples involving updateMyChildren(), see "Customizing map rules for a composite identity relationship".
See also
addMyChildren(), deleteMyChildren(), maintainCompositeRelationship(), maintainSimpleIdentityRelationship()
"Handling updates to the parent business object"
