User relation context#

When adding a user, multiple services are often added at the same time. For example, multiple phones with multiple lines.

During the “Add” operation, the AddSubscriberNew workflow therefore iterates (loops) over these added services and makes the data for each instance available in a context variable.

Consider for example the following workflow input context for adding a simple user:

{
    "input": {
        "userid": "TestUserX77",
        "firstName": "Test",
        "lastName": "UserX77",
        "mailid": "testuserx77@mail.com",
        "Phone": [
            {
                "name": "SEP111222333444",
                "product": "Cisco Unified Client Services Framework",
                "protocol": "SIP",
                "lines": {
                    "line": [
                        {
                            "dirn": {
                                "pattern": "82007",
                                "routePartitionName": "Cu1-DirNum-PT"
                            }
                        }
                    ]
                }
            },
            {
                "name": "SEP000222333444",
                "product": "Cisco Unified Client Services Framework",
                "protocol": "SIP",
                "lines": {
                    "line": [
                        {
                            "dirn": {
                                "pattern": "82008",
                                "routePartitionName": "Cu1-DirNum-PT"
                            }
                        }
                    ]
                }
            }
        ]
    }
}

The input context shows there are two phones, each with one line. The AddSubscriberNew workflow loops over the phones and put the entire contents of each instance in a context macro called {{ input.PhoneX }}.

Therefore, when it iterates over the first phone, {{ input.PhoneX }} will be equal to:

{
    "name": "SEP111222333444",
    "product": "Cisco Unified Client Services Framework",
    "protocol": "SIP",
    "lines": {
        "line": [
            {
                "dirn": {
                    "pattern": "82007",
                    "routePartitionName": "Cu1-DirNum-PT"
                }
            }
        ]
    }
}

In particular, the input context variable {{ input.PhoneX.name }} will be equal to SEP111222333444. During the second iteration, {{ input.PhoneX.name }} will be equal to SEP000222333444.