<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: wushuang  
    $Date: 2011-11-24 下午1:55:05  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                        select * from (
					select g.program_id,
					       g.request_info_id,
					       p.parameter_id,
					       p.parameter_name,
					       p.description,
					       p.parameter_type,
					       p.edit_type,
					       decode(p.required_flag, 'Y', 'true', 'false') as required_flag,
					       p.bm,
					       p.seq,
					       p.valuefiled_from,
					       p.valuefiled_to,
					       p.displayfiled_from,
					       p.displayfiled_to
					  from fnd_program_parameters p, fnd_request_program g
					 where p.program_id = g.program_id
					 order by p.seq asc)
            #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
        <bm:operation name="execute">
            <bm:update-sql><![CDATA[
                BEGIN
                  fnd_request_pkg.insert_request_parameters(p_request_id => ${/parameter/@request_id},
				                                            p_parameter_id => ${@parameter_id},
				                                            p_parameter_name => ${@parameter_name},
				                                            p_parameter_value => ${@parameter_value},
				                                            p_parameter_type  => ${@parameter_type},
				                                            p_seq => ${@seq},
				                                            p_user_id => ${/session/@user_id});
                END;
            ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field name="request_info_id" queryExpression="request_info_id = ${@request_info_id}"/>
    </bm:query-fields>
</bm:model>
