Symptom
While performing UPSERT operation on SuccessFactors OData v2 adapter, the link fields are not updated correctly when multiple entities are present.
Reproducing the Issue
Perform an UPSERT with payload having similar structure to the below example. Refer the highlighted <link> tags in the below sample XML, notice they have different IDs and entities for each user. In the example you will see three users with distinct links.
- User(userId=50000409) [link {manager(userId=NO_MANAGER)}{matrixManager(userId=100)}
- User(userId=50000411) [link {manager(userId=200)}
- User(userId=50000447) [link {manager(userId=300)}
<?xml version="1.0" encoding="UTF-8"?> <User> <User> <link> <manager> <User> <userId>NO_MANAGER</userId> </User> </manager> <matrixManager> <User> <userId>100</userId> </User> </matrixManager> </link> <status>active</status> <userId>50000409</userId> <username>DFGDFGADFS</username> <firstName>robinmanager</firstName> <department /> </User> <User> <link> <manager> <User> <userId>200</userId> </User> </manager> </link> <status>active</status> <userId>50000411</userId> <username>SANDERPROSI</username> <firstName>Sander</firstName> <department /> </User> <User> <link> <manager> <User> <userId>300</userId> </User> </manager> </link> <status>active</status> <userId>50000447</userId> <username>RTITI</username> <firstName>frambach</firstName> </User> </User> |
Cause
The present implementation does not provide a mechanism to correlate different links value with multiple entries. In Upsert operation, you can link every entity to the same navigation entity with the same key parameters, using <link> tag. But you cannot link to different navigation entity.
Resolution
Option 1: Use SuccessFactors OData V2 adapter version 1.17 or above.
Option 2: If you are using older version of SuccessFactors OData V2 adapter.
Successfactors OData V2 adapters provides UPSERT in Batch. Below example outlines the expected batch request payload for the prior example. Kindly note each user entry is placed in a separate <batchChangeSet>. Using a model wizard you can generate the XSD for the below XML scheme. For more information on modeling operation, see Modeling Operation.
<?xml version="1.0" encoding="UTF-8"?> <batchParts> <batchChangeSet> <batchChangeSetPart> <method>UPSERT</method> <User> <User> <userId>50000409</userId> <firstName>robinmanager</firstName> <status>active</status> <username>DFGDFGADFS</username> <link> <matrixManager> <User> <userId>100</userId> </User> </matrixManager> <manager> <User> <userId>NO_MANAGER</userId> </User> </manager> </link> </User> </User> </batchChangeSetPart> </batchChangeSet> <batchChangeSet> <batchChangeSetPart> <method>UPSERT</method> <User> <User> <userId>50000411</userId> <firstName>Sander</firstName> <status>active</status> <username>SANDERPROSI</username> <link> <manager> <User> <userId>200</userId> </User> </manager> </link> </User> </User> </batchChangeSetPart> </batchChangeSet> <batchChangeSet> <batchChangeSetPart> <method>UPSERT</method> <User> <User> <userId>50000447</userId> <firstName>frambach</firstName> <status>active</status> <username>RTITI</username> <link> <manager> <User> <userId>300</userId> </User> </manager> </link> </User> </User> </batchChangeSetPart> </batchChangeSet> </batchParts> |
Keywords
SAP, CPI, HCI, Upsert, OData V2, Navigation Link, SuccessFactors , KBA , LOD-HCI-PI-GB , Generation & Build Framework , Problem