The following code presents variations on the input of the OrderProcessing sample's Order Ruletest.

Hierarchical JSON Input—This example shows the input in its hierarchical structure using the default metadata tags. There are two orders shipping year after year with the same items, restated in each order. Here is how that looks in Studio:


The hierarchical request in JSON format with default metadata looks like this:
{
    "__metadataRoot": {"#locale": ""},
    "Objects": [
        {
            "item": [
                {
                    "product": "Ball",
                    "quantity": 20,
                    "price": 10,
                    "__metadata": {
                        "#type": "Item",
                        "#id": "Item_id_7"
                    }
                },
                {
                    "product": "Racket",
                    "quantity": 1,
                    "price": 20,
                    "__metadata": {
                        "#type": "Item",
                        "#id": "Item_id_8"
                    }
                }
            ],
            "dueDate": "1/1/2018",
            "__metadata": {
                "#type": "Order",
                "#id": "Order_id_1"
            }
        },
        {
            "item": [
                {
                    "product": "Ball",
                    "quantity": 20,
                    "price": 10,
                    "__metadata": {
                        "#type": "Item",
                        "#id": "Item_id_13"
                    }
                },
                {
                    "product": "Racket",
                    "quantity": 1,
                    "price": 20,
                    "__metadata": {
                        "#type": "Item",
                        "#id": "Item_id_14"
                    }
                }
            ],
            "dueDate": "1/1/2019",
            "__metadata": {
                "#type": "Order",
                "#id": "Order_id_2"
            }
        }
    ]
}
Hierarchical JSON Output—This example shows the output in its hierarchical structure. Here is how that looks in Studio:


The hierarchical JSON output of only Objects (no Rule Statements) looks like this:
{
    "__metadataRoot": {"#locale": ""},

    "Objects": [
        {
            "note": "This Order was shipped late",
            "total": 220,
            "item": [
                {
                    "product": "Ball",
                    "quantity": 20,
                    "price": 10,
                    "subtotal": 200,
                    "__metadata": {
                        "#type": "Item",
                        "#id": "Item_id_7"
                    }
                },
                {
                    "product": "Racket",
                    "quantity": 1,
                    "price": 20,
                    "subtotal": 20,
                    "__metadata": {
                        "#type": "Item",
                        "#id": "Item_id_8"
                    }
                }
            ],
            "shipped": true,
            "dueDate": "1/1/2018",
            "__metadata": {
                "#type": "Order",
                "#id": "Order_id_1"
            },
            "shippedOn": "12/1/2018"
        },
        {
            "note": "This Order was shipped on time",
            "total": 220,
            "item": [
                {
                    "product": "Ball",
                    "quantity": 20,
                    "price": 10,
                    "subtotal": 200,
                    "__metadata": {
                        "#type": "Item",
                        "#id": "Item_id_13"
                    }
                },
                {
                    "product": "Racket",
                    "quantity": 1,
                    "price": 20,
                    "subtotal": 20,
                    "__metadata": {
                        "#type": "Item",
                        "#id": "Item_id_14"
                    }
                }
            ],
            "shipped": true,
            "dueDate": "1/1/2019",
            "__metadata": {
                "#type": "Order",
                "#id": "Order_id_2"
            },
            "shippedOn": "12/1/2018"
        }
    ]
}