Visual Builder

Get Involved. Join the Conversation.

Topic

    Ahmet Bölük
    Batch Operations With Nested Objects
    Topic posted April 10, 2019 by Ahmet Bölük, tagged Business Objects, Custom Code, REST, Services 
    59 Views, 1 Comment
    Title:
    Batch Operations With Nested Objects
    Summary:
    Batch operations with nested objects
    Content:

    Hi everyone,

    I want to batch operations on business object in VBCS. 

    1)I should use nested objects for batch operation. Is there another way to create nested objects manually?

    2)How can I rollback when crud operations with failure?


    Simple Nested Object

    {
        "parts": [{
            "id": "part1",
            "path": "/Employee/101",
            "operation": "update",
            "payload": {
                "Salary": 10000,
                "id" : 1001,
                "email": "jack@dev.com",
                "personalInfo": {
                    "name": "Jack",
                    "address": {
                        "line1": "westwish st",
                        "line2": "washmasher",
                        "city":  "wallas",
                        "state": "WX"
                    }
                }
            }
        }, {
            "id": "part2",
            "path": "/Employee/102",
            "operation": "update",
            "payload": {
                "Salary": 20000,
                "id" : 1002,
                "email": "alex@dev.com",
                "personalInfo": {
                    "name": "Alex",
                    "address": {
                        "line1": "westwish st",
                        "line2": "washmasher",
                        "city":  "wallasx",
                        "state": "USA"
                    }
                }
            }
        }]
    }

    Related Links

    https://www.youtube.com/watch?v=jqqB5Cq00H8&t=1s
    https://docs.oracle.com/en/cloud/paas/app-builder-cloud/consume-rest/advanced-tasks.html#GUID-3F3F2D10-CF68-46D1-AF83-A52988CF817B 

     

     

     

    Comment

     

    • Steve Muench

      Is the structure of your payload the same structure as what you receive when you perform a REST GET of the /Employee/101 record?

      You don't have to worry about rolling back the transaction, the business objects runtime ensures that automatically in the case of any failure. All parts of the batch either succeed or fail together.