<?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="execute">
            <bm:update-sql><![CDATA[
            	DECLARE
            		v_job_type NUMBER;
                BEGIN
                	--将前台执行的JOB类型转换为后台需要的格式
                	IF ${/parameter/@type} = 'RUN' THEN
                		v_job_type := fnd_request_pkg.g_job_type_is_run;
                	ELSIF ${/parameter/@type} = 'DELETE' THEN
                		v_job_type := fnd_request_pkg.g_job_type_is_delete;
                	ELSIF ${/parameter/@type} = 'SLEEP' THEN
                		v_job_type := fnd_request_pkg.g_job_type_is_sleep;
                	ELSIF ${/parameter/@type} = 'WAKE' THEN
                		v_job_type := fnd_request_pkg.g_job_type_is_wake;
                	END IF;
                	
	                fnd_request_pkg.job_handle(p_request_id => ${@request_id},
	                                           p_user_id 	=> ${/session/@user_id},
	                                           p_job_type	=> v_job_type);
                END;
            ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
