This section contains the following information on how to set the verb of a business object participating in a map:
Usually, you just set the destination verb to the value of the source verb by defining a Move transformation. (For more information on this action, see "Setting the destination business object verb".) However, sometimes the source application sets the business object verb in an unusual manner; for example, the verb is set to Update even though the event is new. As another example, the verb is always set to Retrieve. In the situations like these, the map must resets the destination verb to the one that corresponds to the actual event.
If the source business object's key participates in a relationship, the
map can perform a
static lookup in the
relationship table to determine if the source business object exists.
The map can then set the destination verb to either Update or
Create based on whether the corresponding entry is found in the table.
You perform this static lookup in much the same way as accessing a lookup
relationship. Table 82 shows the function block to use for each kind of static
lookup.
Table 82. Checking for Existence of the source business object
Type of source business object | Map type | Function block |
---|---|---|
Application-specific | Inbound |
General/APIs/Relationship/
Retrieve Instances |
Generic | Outbound |
General/APIs/Relationship/
Retrieve Participants |
Here is an example of how an inbound map can conditionally set the destination verb based on the result of a lookup:
Figure 114. Identifying the number of instances in the relationship participant
You can use similar steps in the outbound map to perform a static lookup based on the primary key of the generic object. To do that, you need to replace the function block General/APIs Relationship/Retrieve Instances with the function block General/APIs Relationship/Retrieve Participants. Here are the steps:
Figure 117. Identifying the number of participants in the relationship
When a parent source business object has child business objects, the value
of the source child verb is usually the same as that of the parent
verb. Therefore, you set the source child object's verb by defining
a Move transformation from the parent verb to the child verb. However,
if the parent object's verb is Update, the update could be a result of any
of the modifications shown in Table 83.
Table 83. Updating a parent business object
Update task | Verb in child object |
---|---|
Modifying some non-child attribute i the parent object | Update |
Modifying some attribute in a child object | Update |
Adding more child objects | Create |
Deleting existing child objects | Delete |
All of the modifications Table 83 are represented by a verb of Update in the parent object. However, not all of these modifications represent an Update to the child object. The value of the source child verb depends on what action was taken on the parent verb. When the child object's key participates in an identity relationship (composite or simple), the source child verb value depends not just on the parent verb but also on the calling context. In such cases, use the Maintain Child Verb function block to handle the setting of the verb of the source child object.
This section provides the following information about using the Maintain Child Verb function block to maintain a source child object verb:
The Maintain Child Verb function block must ensure that the verb settings of the child objects in the source business object are appropriate given the verb in the parent source object and the calling context. The actions that this method takes are based on the verb in the parent source object and the calling context.
When the calling context is EVENT_DELIVERY or
ACCESS_REQUEST, the map is being called is an inbound map;
that is, it transforms an application-specific business object to a generic
business object. The inbound map receives an application-specific
business object as input and returns a generic business object as
output. For EVENT_DELIEVERY (or ACCESS_REQUEST),
there are no special cases to handle when setting the child verbs.
Therefore, the maintainChildVerb() method just copies the parent
verb to the child verb for all verb values, as Table 84 shows.
Table 84. Actions for the EVENT_DELIVERY and ACCESS_REQUEST calling contexts
When the calling context is SERVICE_CALL_REQUEST, the map is
being called is an outbound map; that is, it transforms a generic
business object to an application-specific business object. The
outbound map receives a generic business object as input and returns an
application-specific business object as output. For
SERVICE_CALL_REQUEST, the Java code generated by the Maintain Child
Verb function block handles the special case for an Update verb: If the
change to the parent object is the creation of new child objects, the Maintain
Child Verb function block changes the verb to Create for any child objects
that do not currently exist in the relationship tables, as Table 85 shows.
Table 85. Actions for SERVICE_CALL_REQUEST calling context
When the calling context is SERVICE_CALL_RESPONSE, the map is being called is an inbound map; that is it transforms an application-specific business object to a generic business object. The inbound map receives an application-specific business object as input and returns a generic business object as output.
The behavior of the Maintain Child Verb function block is determined by the
second-to-last parameter of the method. This parameter is the boolean
to_Retrieve flag, whose value indicates whether the
application resets or preserves child objects' verbs when processing a
collaboration request, as Table 86 shows.
Value of to_Retrieve flag | Connector behavior |
---|---|
true | Connector sets child object verbs to different value from what they had
coming into the application.
For example, if a business object comes to the connector with a parent verb of Update and a child verb of Create, the connector might reset all child object verbs to their parent value after the application completes the operation. In this case, the child verb would be changed to Update. |
false | Connector preserves child object verbs.
For example, if a business object comes to the connector with a parent verb of Update and a child verb of Create, the connector preserves all child object verbs. In this case, the child verb would still be Create. |
If the to_Retrieve argument is true, the
Maintain Child Verb function block performs the tasks in Table 87..
Table 87. Actions for the SERVICE_CALL_RESPONSE calling context
The Maintain Child Verb function block maintains the verb of the child objects in the source business object. It can handle child objects that are part of a simple or a composite identity relationship. This function block must ensure that the verb settings are appropriate given the verb in the parent source object and the calling context.
Keep the following tips in mind when using the Maintain Child Verb function block:
For more information on how to set the to_Retrieve flag, see "SERVICE_CALL_RESPONSE calling context".
The key attribute of a child business object can participate in either of the following kinds of identity relationship:
Set the value of the is_Composite flag to false.
Set the value of the is_Composite flag to true.
For multiple-cardinality child objects, use the Maintain Child Verb function block right before the start of the for loop. The method iterates through the child objects to set the child verbs correctly.