Example - Refreshing a Document with Hierarchical Mixed Lists of Values

The document contains hierarchical LOVs where each level of the hierarchy contains specific columns count and types.

First call: "GET"

The first call without any <path> entry gets the first hierarchical level, as if there were no hierarchy, except for the hierarchical="true" tag. final="false" means the value is a node of the hierarchy, whereas final="true" or no tag at all means value is a leaf.

GET <webiURL>/documents/{documentId}/parameters

The response returns the prompts at the first level in the hierarchy:

<parameters>
    <parameter optional="false" type="prompt" dpId="DP0">
        <id>0</id>
        <technicalName>Enter one or more Invoice Date values</technicalName>
        <name>Enter one or more Invoice Date values</name>
        <answer constrained="false" type="DateTime">
            <info cardinality="Multiple">
                <lov hierarchical="true" partial="false" refreshable="true">
                    <id>UNIVERSELOV_DS0.DO119</id>
                    <intervals>
                        <interval id="0">
                            <value final="false">FY1992</value>
                            <value final="false">FY1995</value>
                        </interval>
                    </intervals>
                    <values>
                        <value final="false">FY1992</value>
                        <value final="false">FY1993</value>
                        <value final="false">FY1994</value>
                        <value final="false">FY1995</value>
                    </values>
                    <columns mappingId="0">
                        <column id="0" type="String">Year</column>
                    </columns>
                </lov>
            </info>
        </answer>
    </parameter>
</parameters>   

There is only one column for the first level, of type String.

Send second call giving known first level values

A second call with any of the known first-level values will get the corresponding second level values:

PUT <webiURL>/documents/9586/parameters

Request body:

<parameters>
    <parameter>
        <id>0</id>
        <answer>
            <info>
                <lov>
                    <query>
                        <path>
                            <value>FY1993</value>
                        </path>
                    </query>
                </lov>
            </info>
        </answer>
    </parameter>
</parameters>

The response returns the prompts at the next level in the hierarchy:

<parameters>
    <parameter optional="false" type="prompt" dpId="DP0">
        <id>0</id>
        <technicalName>Enter one or more Invoice Date values</technicalName>
        <name>Enter one or more Invoice Date values</name>
        <answer constrained="false" type="DateTime">
            <info cardinality="Multiple">
                <lov hierarchical="true" partial="false" refreshable="true">
                    <id>UNIVERSELOV_DS0.DO119</id>
                    <intervals>
                        <interval id="0">
                            <cvalue final="false">
                                <column id="0">Q1</column>
                                <column id="1">FY1993</column>
                            </cvalue>
                            <cvalue final="false">
                                <column id="0">Q4</column>
                                <column id="1">FY1993</column>
                            </cvalue>
                        </interval>
                    </intervals>
                    <cvalues>
                        <cvalue final="false">
                            <column id="0">Q1</column>
                            <column id="1">FY1993</column>
                        </cvalue>
                        <cvalue final="false">
                            <column id="0">Q2</column>
                            <column id="1">FY1993</column>
                        </cvalue>
                        <cvalue final="false">
                            <column id="0">Q3</column>
                            <column id="1">FY1993</column>
                        </cvalue>
                        <cvalue final="false">
                            <column id="0">Q4</column>
                            <column id="1">FY1993</column>
                        </cvalue>
                    </cvalues>
                    <columns mappingId="0">
                        <column id="0" type="String">Quarter</column>
                        <column id="1" type="String">Year</column>
                    </columns>
                </lov>
            </info>
        </answer>
    </parameter>
</parameters>

Here the second level gets two columns, both of type String, and where the selection one is the first (mappingId="0").

The calls are repeated

Until the last level of the hierarchy:

PUT <webiURL>/documents/9586/parameters

Request body:

<parameters>
    <parameter>
        <id>0</id>
        <answer>
            <info>
                <lov>
                    <query>
                        <path>
                            <value>FY1993</value>
                            <value>Q2</value>
                            <value>06</value>
                            <value>25</value>
                        </path>
                    </query>
                </lov>
            </info>
        </answer>
    </parameter>
</parameters>

Response:

<parameters>
    <parameter optional="false" type="prompt" dpId="DP0">
        <id>0</id>
        <technicalName>Enter one or more Invoice Date values</technicalName>
        <name>Enter one or more Invoice Date values</name>
        <answer constrained="false" type="DateTime">
            <info cardinality="Multiple">
                <lov hierarchical="true" partial="false" refreshable="true">
                    <id>UNIVERSELOV_DS0.DO119</id>
                    <intervals>
                        . . .
                    </intervals>
                    <cvalues>
                        <cvalue>
                            <column id="0">1993-06-19T02:00:00.000+02:00</column>
                            <column id="1">06</column>
                            <column id="2">FY1993</column>
                        </cvalue>
                        . . .
                        <cvalue>
                            <column id="0">1995-06-24T02:00:00.000+02:00</column>
                            <column id="1">06</column>
                            <column id="2">FY1995</column>
                        </cvalue>
                    </cvalues>
                    <columns mappingId="0">
                        <column id="0" type="DateTime">Invoice Date</column>
                        <column id="1" type="String">Month</column>
                        <column id="2" type="String">Year</column>
                    </columns>
                </lov>
            </info>
        </answer>
    </parameter>
</parameters>

There is no more final="false" tag: the last level of the hierarchy is reached, and it contains three columns where the selection one is the first (mappingId="0"), of type DateTime.

Finally, refresh the document

The document can now be refreshed as usual, providing a <value>. <path> is not mandatory any more as the values are now known.

PUT <webiURL>/documents/9586/parameters

Request body:

<parameters>
    <parameter>
        <id>0</id>
        <answer>
            <values>
                <value>1995-06-19T02:00:00.000+02:00</value>
            </values>
        </answer>
    </parameter>
</parameters>

Response:

<success>
    <message>The resource of type 'Document' with identifier '9586' has been successfully updated.</message>
    <id>9586</id>
</success>