<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="insert">
            <bm:parameters>
                <bm:parameter name="batch_id" output="true" outputPath="/parameter/@batch_id"/>
            </bm:parameters>
            <bm:update-sql><![CDATA[
                BEGIN
                    select hn_base_rate_set_itfc_hd_s.nextval into ${@batch_id} from dual;
                END;
            ]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
        	begin
        	fnd251_save_pkg.hn_base_rate_itfc_ln(p_base_rate_set =>${@base_rate_set},
                                 p_batch_id      =>${../../@batch_id},
                                 p_user_id       =>${/session/@user_id});
        	end;
        	]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="execute">
            <bm:update-sql><![CDATA[
        	begin
        	fnd251_save_pkg.hn_rate_set_batch_submit(p_batch_id   =>${/parameter/@batch_id},
                                     p_company_id =>${/session/@company_id},
                                     p_user_id    =>${/session/@user_id});
        	end;
        	]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
        		select ln.record_id,
       ln.batch_id,
       ln.base_rate_set,
       (select fbrs.description
          from fnd_base_rate_set fbrs
         where fbrs.base_rate_set = ln.base_rate_set) description,
       (select fbrs.currency
          from fnd_base_rate_set fbrs
         where fbrs.base_rate_set = ln.base_rate_set) currency,
       (select fbrs.valid_from
          from fnd_base_rate_set fbrs
         where fbrs.base_rate_set = ln.base_rate_set) valid_from,
       (select fbrs.valid_to
          from fnd_base_rate_set fbrs
         where fbrs.base_rate_set = ln.base_rate_set) valid_to,
       ln.base_rate_type
  from hn_base_rate_set_itfc_ln ln
  where ln.batch_id=${@batch_id}
        	]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
