IFS 后台调用背景任务工作可由Transaction_SYS.Deferred_Call实现,它是IFS对于处理时间较长的过程通过前台将任务添加到延迟调用的JOB队列中,这种处理任务列在"概要/背景工作"中
PROCEDURE Create_Report_Line( report_id_ IN VARCHAR2)
IS
job_id_ NUMBER;
online_flag_ VARCHAR2(5);
CURSOR cs_chk_job IS
SELECT id job_id
FROM transaction_sys_local_tab m
WHERE m.procedure_name = 'Dj_Purch_Inv_Sales_Line_API.Report_Job'
AND m.state IN ('Posted','Executing')
AND m.arguments_string = report_id_;
BEGIN
General_SYS.Init_Method(lu_name_, 'DJ_PURCH_INV_SALES_LINE_API', 'Create_Report_Line');
OPEN cs_chk_job;
FETCH cs_chk_job INTO job_id_;
CLOSE cs_chk_job;
IF job_id_ IS NOT NULL THEN
Error_Sys.Record_General(lu_name_, 'DJ_SCMJOBEXEC: Report Id :P1 Exits Job Id :P2 Dj Purch Inv Sales !',
report_id_, job_id_ );
END IF;
--
online_flag_ := Dj_Purch_Inv_Sales_Api.Get_Online_Flag(report_id_);
IF nvl(online_flag_,'FALSE') = 'TRUE' THEN
Dj_Purch_Inv_Sales_Line_Api.Report_Job(report_id_);
ELSE
Transaction_SYS.Deferred_Call('Dj_Purch_Inv_Sales_Line_Api.Report_Job', report_id_,
Language_SYS.Translate_Constant(lu_name_, 'DJ_BATCHSCM: Dj Purch Inv Sales') );
END IF;
END Create_Report_Line;
另外也可以利用IFS的JOB机制也,例如 Batch_SYS.New_Job(job_id_, 'Reserve_Customer_Order_API.Make_Pick_Plan__(''''' || attr_ || ''''')',
'WEEKLY ON ' || on_days_ || ' AT ' || at_time_);可以动态创建JOB,指定执行时间,系统有不少这样的例子;