<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:ns1="leaf.application.action" xmlns:s="leaf.plugin.script" xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" trace="true">
    <a:init-procedure>
        <a:model-query defaultWhereClause="t1.enabled_flag=&apos;Y&apos;" fetchAll="true" model="layout.server_doc_layout_tab_query" rootPath="rootpath_table_name"/>
        <a:model-query defaultWhereClause="t1.enabled_flag=&apos;Y&apos;" fetchAll="true" model="layout.server_doc_query_field" rootPath="rootpath_query_field"/>
        <a:model-query fetchAll="true" model="layout.server_layout_base_query_order_by" rootPath="rootpath_order_by_fields"/>
        <p:set field="@dynamic_base_table" value="${/model/rootpath_table_name/record/@query_source}"/>
        <p:set field="@query_tab_code" value="${/model/rootpath_table_name/record/@query_tab_code}"/>
        <p:set field="@dynamic_parent_table" value="${/model/rootpath_table_name/record/@parent_table}"/>
        <p:set field="@dynamic_tab_type" value="${/model/rootpath_table_name/record/@tab_type}"/>
        <p:set field="@tab_code" value="${/model/rootpath_table_name/record/@tab_code}"/>
        <p:set field="@query_bp_category" value="${/model/rootpath_table_name/record/@query_bp_category}"/>
        <p:switch test="/model/rootpath_table_name/record/@fetchall">
            <p:case value="false">
                <a:model-query autoCount="true" fetchAll="false" model="layout.server_layout_common" rootPath="result"/>
            </p:case>
            <p:case value="*">
                <a:model-query autoCount="true" fetchAll="true" model="layout.server_layout_common" rootPath="result"/>
            </p:case>
        </p:switch>
    </a:init-procedure>
    <a:service-output output="/model/result"/>
</a:service>