PublicInterfacesPublicInterfaces103PublicInterfacesOverviewIntheFoundation1developmentenvironmentthereareseveralpublicinterfacestocomponentswhichmakelifeeasierwhendevelopingbusinessapplications.IntheBusinessLogiclayertheseinterfacesconsistofpublicmethodsinsystemservicesandpubliclogicalunits.Intheclientframeworktheinterfacesaremadeupfrompublicmessagesandmethods.Themethodscanbeeitherinternalfunctionsormemberfunctionsofclassesandserviceobjects.Thesepublicinterfacesdescribedbelow,aretheonlyinterfacessupportedbetweendifferentreleasesofFoundation1,hencethedescriptionsbelowdonotincludeobsoleteinterfaces.SystemServicesBatch_SYSThispackageprovidesservicesrelatedtobatchprocessing.Tobeabletousethispackage,theDBMS_JOBserviceintheOracleenvironmentmustbeinstalledandsomeprocessesmustbeinitializedthroughINIT.ORAparameters.Exist_Batch_ScheduleExist_Batch_Schedule(schedule_name_)RETURNNUMBERSchedule_name_INVARCHAR2NameofthebatchschedulePurposeThisfunctioncheckswhetherascheduledbackgroundjobwiththespecificnameexistsandreturnsthenumberofsuchscheduledbackgroundjobs.ParameterDescriptionSchedule_name_Theuniquenameofascheduledbackgroundjob.ReturnsPublicInterfacesPublicInterfaces104Thefunctionreturnsthenumberofscheduledbackgroundjobswiththisuniquename.PragmaNoneCommentsExampleIF(Batch_SYS.Exist_Batch_Schedule(‘ANALYZE_SCHEMA’)0)THEN--Atleastonebatchschedulewiththisnameexists!ELSE--Nobatchscheduleswiththisnameexists!ENDIF;Exist_JobExist_Job(job_id_)RETURNBOOLEANjob_id_INNUMBERidentityofabatchjobPurposeThisfunctioncheckswhetherabatchjobexistornotinthecurrentFoundation1instance(applicationowner).ParameterDescriptionjob_id_Theidentity(number)ofthebatchjob.ReturnsThefunctionreturnsthebooleanvaluewhetherthebatchjobexistornot.PragmaWNDS,WNPSCommentsThefunctionchecksdirectlyfromtheviewSYS.DBA_JOBSbutdoesalsocheckifthecurrentuserisassociatedwiththejobornot.ExampleIF(Batch_SYS.Exist_Job(142))THEN--Thejob142isfound!ELSE--Thejob142isnotfound!ENDIF;New_Batch_ScheduleNew_Batch_Schedule(schedule_id_,next_execution_date_,schedule_name_,method_,parameters_,active_,execution_plan_,single_execution_)schedule_id_OUTNUMBERidentityofascheduledbackgroundjobnext_execution_date_INOUTDATEnextdateandtimethisschedulewillbeexecutedPublicInterfacesPublicInterfaces105schedule_name_INVARCHAR2nameofthescheduledjobmethod_INVARCHAR2procedurenametobescheduledparameters_INVARCHAR2parameterstobeusedbythescheduledprocedureactive_INVARCHAR2Indicateswhetherascheduledbackgroundjobisactiveornot.‘TRUE’or‘FALSE’.execution_plan_INVARCHAR2specificationfortheexecutionplansingle_execution_INVARCHAR2tellswhetherascheduledjobisallowedtoschedulemorethanonce.‘TRUE’or‘FALSE’.PurposeThisprocedurecreatesanewscheduledbackgroundjob.ParameterDescriptionschedule_id_Thegeneratedidentity(number)ofthescheduledbackgroundjob.next_execution_date_Dateandtimeusedtoknowwhenitstimetoexecutethisscheduledbackgroundjobagain.schedule_name_Nameofthescheduledbackgroundjob,shouldbeuniquewithineachFoundation1instance.method_PL/SQLmethodtobescheduled.parameters_Paramterstobeusedbythescheduledbackgrundjobpackedasanattributestring.Aactive_Indicateswhetherascheduledjobisactiveornot.Inactivejobsarenotexecuted.execution_plan_Theplanfortheserverprocess.Examplesare‘NOW’,‘ASAP’,‘TOMORROWATXX:YY’orcombinationswithAND-statements.PleaserefertotheFoundation1ReferenceManualfortheavailableoptions.single_execution_Tellswhetherascheduledjobisallowedtoschedulemorethanonce.Singleexecutionsetto‘TRUE’willbedeniediftherealreadyexistsascheduledbackgroundjob.ReturnsTheprocedurereturnsthebackgroundscheduleidentityintheoutparameter.Italsoreturnsthenextexecutiondateifapplicable.PragmaNoneCommentsScheduledbackgroundprocesswillpostthoseactivescheduledbackgroundjobswithnextexecutiondateolderthansysdateintotobackgroundqueues.ExamplePublicInterfacesPublicInterfaces106schedule_id_NUMBER;next_execution_date_DATE;..Batch_SYS.New_Batch_Schedule(schedule_id_,next_execution_date_,'‘Foundation1Monitoring’,Fnd_Monitor_Entry_API.Perform_Monitoring__',null,‘TRUE’,‘EVERY01:00’,‘TRUE’);..New_JobNew_Job(job_id_,action_,execution_plan_)job_id_OUTNUMBERidentityofaserverprocessaction_INVARCHAR2procedurenameexecution_plan_INVARCHAR2specificationfortheexecutionplanPurposeThisprocedurecreatesanewserverprocessinthecurrentFoundation1instance.ParameterDescriptionjob_id_Thegeneratedidentity(number)oftheserverprocess.action_ThePL/SQLcalltobeexecutedinbatch.Anyprocedureintheformpackage.methodcanbeused.OptionalparametermustbeoftypeINanddeclaredasconstants.execution_plan_Theplanfortheserverprocess.Examplesare‘NOW’,‘ASAP’,‘TOMORROWATXX:YY’orcombinationswithAND-statements.PleaserefertotheFoundation1ReferenceManualfortheavailableoptions.ReturnsTheprocedurereturnsthejobidentityintheoutparameter.PragmaNoneCommentsDuetoOracleproblemsinDBMS_JOB,thisprocedurewillrunseparatelogicfor7.1and7.2/7.3/8.0ofOracle.TheOracleserviceDBMS_JOB.SUBMITwillbeused.ThedifferencesdonotaffecteitherthepublicinterfacesortheuseofpackageBatch_SYS.Thefollowingexecutionplansarehandled:'NOW'or