JobAutomation Job Scheduling J S OB CHEDULER API Documentation March2015 Software-undOrganisations-ServiceGmbH Giesebrechtstr.15 10629BerlinGermany Telephone+4930864790-0 JobScheduler:API 2 Contact Information Software-andOrganisations-ServiceGmbH Giesebrechtstr.15 D-10629Berlin Telephone+49(30)864790-0 Telefax+49(30)8613335 [email protected] Webwww.sos-berlin.com Software-andOrganisations-ServiceGmbH March2015 JobScheduler:API 3 Table of Contents 1Overview....................................................................................................24 2JavaAPI.................................................................................................... 26 2.1Error.....................................................................................................26 2.1.1code.................................................................................................26 2.1.2is_error..............................................................................................26 2.1.3text..................................................................................................26 2.2Job......................................................................................................26 2.2.1clear_delay_after_error..............................................................................26 2.2.2clear_when_directory_changed......................................................................26 2.2.3configuration_directory...............................................................................27 2.2.4delay_after_error.................................................................................... 27 2.2.5delay_order_after_setback...........................................................................28 2.2.6folder_path..........................................................................................29 2.2.7include_path.........................................................................................29 2.2.8max_order_setbacks.................................................................................29 2.2.9name................................................................................................29 2.2.10order_queue....................................................................................... 30 2.2.11process_class......................................................................................30 2.2.12remove.............................................................................................30 2.2.13start................................................................................................31 2.2.14start_when_directory_changed..................................................................... 31 2.2.15state_text.......................................................................................... 32 2.2.16title.................................................................................................32 2.2.17wake...............................................................................................32 2.3Job_chain-jobchainsfororderprocessing ..............................................................33 2.3.1add_end_state.......................................................................................33 2.3.2add_job............................................................................................. 33 2.3.3add_or_replace_order............................................................................... 34 2.3.4add_order...........................................................................................34 2.3.5name................................................................................................34 2.3.6node................................................................................................ 35 2.3.7order_count......................................................................................... 35 2.3.8order_queue.........................................................................................35 2.3.9orders_recoverable..................................................................................35 2.3.10remove.............................................................................................35 2.3.11title.................................................................................................36 2.4Job_chain_node.........................................................................................36 2.4.1action............................................................................................... 36 2.4.2error_node.......................................................................................... 37 2.4.3error_state...........................................................................................37 2.4.4job.................................................................................................. 37 2.4.5next_node...........................................................................................38 2.4.6next_state...........................................................................................38 2.4.7state.................................................................................................38 2.5Job_impl-SuperClassforaJobortheJobSchedulerScript .............................................38 2.5.1spooler..............................................................................................39 2.5.2spooler_close........................................................................................39 2.5.3spooler_exit......................................................................................... 39 2.5.4spooler_init..........................................................................................40 2.5.5spooler_job..........................................................................................40 2.5.6spooler_log..........................................................................................40 2.5.7spooler_on_error.................................................................................... 41 Software-andOrganisations-ServiceGmbH March2015 JobScheduler:API 4 2.5.8spooler_on_success.................................................................................41 2.5.9spooler_open........................................................................................41 2.5.10spooler_process....................................................................................41 2.5.11spooler_task........................................................................................42 2.6Lock.....................................................................................................42 2.6.1max_non_exclusive..................................................................................42 2.6.2name................................................................................................42 2.6.3remove..............................................................................................43 2.7Locks....................................................................................................43 2.7.1add_lock............................................................................................ 43 2.7.2create_lock..........................................................................................43 2.7.3lock................................................................................................. 43 2.7.4lock_or_null......................................................................................... 44 2.8Log-Logging ...........................................................................................44 2.8.1debug...............................................................................................44 2.8.2debug1..............................................................................................45 2.8.3debug2..............................................................................................45 2.8.4debug3..............................................................................................45 2.8.5debug4..............................................................................................45 2.8.6debug5..............................................................................................45 2.8.7debug6..............................................................................................45 2.8.8debug7..............................................................................................46 2.8.9debug8..............................................................................................46 2.8.10debug9.............................................................................................46 2.8.11error................................................................................................46 2.8.12filename............................................................................................46 2.8.13info.................................................................................................46 2.8.14last.................................................................................................47 2.8.15last_error_line......................................................................................47 2.8.16level................................................................................................47 2.8.17log.................................................................................................48 2.8.18log_file.............................................................................................48 2.8.19mail................................................................................................48 2.8.20mail_it..............................................................................................48 2.8.21mail_on_error...................................................................................... 49 2.8.22mail_on_process...................................................................................49 2.8.23mail_on_success...................................................................................49 2.8.24mail_on_warning...................................................................................50 2.8.25new_filename...................................................................................... 50 2.8.26start_new_file...................................................................................... 50 2.8.27warn............................................................................................... 51 2.9Mail-e-maildispatch ....................................................................................51 2.9.1add_file..............................................................................................51 2.9.2add_header_field....................................................................................51 2.9.3bcc..................................................................................................51 2.9.4body.................................................................................................52 2.9.5cc...................................................................................................52 2.9.6dequeue.............................................................................................53 2.9.7dequeue_log........................................................................................ 53 2.9.8from.................................................................................................53 2.9.9queue_dir........................................................................................... 54 2.9.10smtp............................................................................................... 54 2.9.11subject............................................................................................. 55 2.9.12to.................................................................................................. 55 2.9.13xslt_stylesheet..................................................................................... 56 2.9.14xslt_stylesheet_path................................................................................56 Software-andOrganisations-ServiceGmbH March2015 JobScheduler:API 5 2.10Monitor_impl-UsingSuperClassesforStartScriptsorJobs ............................................57 2.10.1spooler.............................................................................................57 2.10.2spooler_job.........................................................................................57 2.10.3spooler_log.........................................................................................58 2.10.4spooler_process_after..............................................................................58 2.10.5spooler_process_before............................................................................58 2.10.6spooler_task....................................................................................... 59 2.10.7spooler_task_after..................................................................................59 2.10.8spooler_task_before................................................................................60 2.11Order-Order .......................................................................................... 60 2.11.1at.................................................................................................. 61 2.11.2end_state.......................................................................................... 62 2.11.3id...................................................................................................62 2.11.4job_chain...........................................................................................62 2.11.5job_chain_node.................................................................................... 63 2.11.6log................................................................................................. 63 2.11.7params.............................................................................................63 2.11.8payload............................................................................................ 63 2.11.9payload_is_type....................................................................................64 2.11.10priority............................................................................................ 64 2.11.11remove_from_job_chain...........................................................................64 2.11.12run_time.......................................................................................... 65 2.11.13setback........................................................................................... 65 2.11.14setback_count.....................................................................................65 2.11.15state.............................................................................................. 65 2.11.16state_text......................................................................................... 66 2.11.17string_next_start_time.............................................................................66 2.11.18suspended........................................................................................66 2.11.19title................................................................................................67 2.11.20web_service.......................................................................................67 2.11.21web_service_operation............................................................................67 2.11.22web_service_operation_or_null....................................................................68 2.11.23web_service_or_null...............................................................................69 2.11.24xml................................................................................................69 2.11.25xml_payload...................................................................................... 69 2.12Order_queue-Theorderqueueforanordercontrolledjob ..............................................69 2.12.1length..............................................................................................70 2.13Process_class..........................................................................................70 2.13.1max_processes.................................................................................... 70 2.13.2name...............................................................................................70 2.13.3remote_scheduler..................................................................................70 2.13.4remove.............................................................................................71 2.14Process_classes....................................................................................... 71 2.14.1add_process_class.................................................................................71 2.14.2create_process_class.............................................................................. 72 2.14.3process_class......................................................................................72 2.14.4process_class_or_null..............................................................................72 2.15Run_time-ManagingTimeSlotsandStartingTimes.................................................... 72 2.15.1schedule...........................................................................................73 2.15.2xml.................................................................................................73 2.16Schedule-Runtime.....................................................................................73 2.16.1xml.................................................................................................73 2.17Spooler.................................................................................................74 2.17.1abort_immediately..................................................................................74 2.17.2abort_immediately_and_restart.....................................................................74 2.17.3add_job_chain......................................................................................74 Software-andOrganisations-ServiceGmbH March2015 JobScheduler:API 6 2.17.4configuration_directory............................................................................. 75 2.17.5create_job_chain...................................................................................75 2.17.6create_order....................................................................................... 75 2.17.7create_variable_set.................................................................................75 2.17.8create_xslt_stylesheet..............................................................................75 2.17.9db_history_table_name.............................................................................76 2.17.10db_name..........................................................................................76 2.17.11db_order_history_table_name..................................................................... 76 2.17.12db_orders_table_name............................................................................77 2.17.13db_tasks_table_name.............................................................................77 2.17.14db_variables_table_name.........................................................................77 2.17.15directory.......................................................................................... 78 2.17.16execute_xml...................................................................................... 78 2.17.17hostname.........................................................................................78 2.17.18id.................................................................................................79 2.17.19include_path......................................................................................79 2.17.20ini_path...........................................................................................79 2.17.21is_service.........................................................................................80 2.17.22job................................................................................................80 2.17.23job_chain......................................................................................... 80 2.17.24job_chain_exists.................................................................................. 80 2.17.25let_run_terminate_and_restart.....................................................................81 2.17.26locks..............................................................................................81 2.17.27log................................................................................................81 2.17.28log_dir............................................................................................81 2.17.29param.............................................................................................82 2.17.30process_classes.................................................................................. 82 2.17.31schedule..........................................................................................82 2.17.32supervisor_client..................................................................................82 2.17.33tcp_port...........................................................................................83 2.17.34terminate..........................................................................................83 2.17.35terminate_and_restart.............................................................................84 2.17.36udp_port..........................................................................................84 2.17.37var................................................................................................84 2.17.38variables..........................................................................................85 2.18Spooler_program-DebuggingJobsinJava ............................................................ 85 2.19Subprocess............................................................................................ 85 2.19.1close...............................................................................................86 2.19.2env.................................................................................................87 2.19.3environment........................................................................................87 2.19.4exit_code...........................................................................................87 2.19.5ignore_error........................................................................................88 2.19.6ignore_signal.......................................................................................88 2.19.7kill..................................................................................................88 2.19.8own_process_group................................................................................88 2.19.9pid.................................................................................................89 2.19.10priority............................................................................................89 2.19.11priority_class......................................................................................89 2.19.12start...............................................................................................90 2.19.13terminated........................................................................................ 90 2.19.14termination_signal.................................................................................91 2.19.15timeout............................................................................................91 2.19.16wait_for_termination...............................................................................91 2.20Supervisor_client.......................................................................................91 2.20.1hostname.......................................................................................... 92 2.20.2tcp_port............................................................................................92 Software-andOrganisations-ServiceGmbH March2015 JobScheduler:API 7 2.21Task....................................................................................................92 2.21.1add_pid............................................................................................92 2.21.2call_me_again_when_locks_available...............................................................93 2.21.3changed_directories................................................................................93 2.21.4create_subprocess.................................................................................93 2.21.5delay_spooler_process.............................................................................93 2.21.6end................................................................................................ 94 2.21.7error............................................................................................... 94 2.21.8exit_code...........................................................................................94 2.21.9history_field........................................................................................95 2.21.10id.................................................................................................95 2.21.11job................................................................................................95 2.21.12order..............................................................................................95 2.21.13params........................................................................................... 96 2.21.14priority............................................................................................96 2.21.15priority_class......................................................................................97 2.21.16remove_pid.......................................................................................97 2.21.17repeat.............................................................................................98 2.21.18stderr_path........................................................................................98 2.21.19stderr_text........................................................................................ 98 2.21.20stdout_path.......................................................................................99 2.21.21stdout_text........................................................................................99 2.21.22trigger_files....................................................................................... 99 2.21.23try_hold_lock.................................................................................... 100 2.21.24try_hold_lock_non_exclusive.....................................................................100 2.21.25web_service.....................................................................................101 2.21.26web_service_or_null.............................................................................101 2.22Variable_set-AVariable_setmaybeusedtopassparameters ........................................ 101 2.22.1count............................................................................................. 102 2.22.2merge.............................................................................................102 2.22.3names............................................................................................102 2.22.4substitute......................................................................................... 102 2.22.5value..............................................................................................103 2.22.6var................................................................................................103 2.22.7xml............................................................................................... 104 2.23Web_service..........................................................................................104 2.23.1forward_xslt_stylesheet_path......................................................................104 2.23.2name............................................................................................. 105 2.23.3params........................................................................................... 105 2.24Web_service_operation............................................................................... 105 2.24.1peer_hostname................................................................................... 105 2.24.2peer_ip........................................................................................... 105 2.24.3request........................................................................................... 106 2.24.4response..........................................................................................106 2.24.5web_service...................................................................................... 106 2.25Web_service_request................................................................................. 106 2.25.1binary_content....................................................................................106 2.25.2charset_name.....................................................................................107 2.25.3content_type......................................................................................107 2.25.4header............................................................................................107 2.25.5string_content.....................................................................................108 2.25.6url................................................................................................ 108 2.26Web_service_response................................................................................108 2.26.1charset_name.....................................................................................108 2.26.2content_type......................................................................................109 2.26.3header............................................................................................109 Software-andOrganisations-ServiceGmbH March2015 JobScheduler:API 8 2.26.4send..............................................................................................109 2.26.5status_code.......................................................................................109 2.26.6string_content.....................................................................................110 2.27Xslt_stylesheet........................................................................................110 2.27.1apply_xml.........................................................................................110 2.27.2close..............................................................................................110 2.27.3load_file...........................................................................................110 2.27.4load_xml.......................................................................................... 111 3JavascriptAPI.............................................................................................112 3.1Error................................................................................................... 112 3.1.1code............................................................................................... 112 3.1.2is_error.............................................................................................112 3.1.3text.................................................................................................112 3.2Job.....................................................................................................112 3.2.1clear_delay_after_error.............................................................................112 3.2.2clear_when_directory_changed.....................................................................112 3.2.3configuration_directory..............................................................................113 3.2.4delay_after_error................................................................................... 113 3.2.5delay_order_after_setback..........................................................................114 3.2.6folder_path.........................................................................................115 3.2.7include_path........................................................................................115 3.2.8max_order_setbacks............................................................................... 115 3.2.9name...............................................................................................115 3.2.10order_queue...................................................................................... 116 3.2.11process_class.....................................................................................116 3.2.12remove............................................................................................116 3.2.13start...............................................................................................117 3.2.14start_when_directory_changed.................................................................... 117 3.2.15state_text......................................................................................... 118 3.2.16title................................................................................................118 3.2.17wake..............................................................................................118 3.3Job_chain-jobchainsfororderprocessing .............................................................119 3.3.1add_end_state..................................................................................... 119 3.3.2add_job............................................................................................ 119 3.3.3add_or_replace_order.............................................................................. 119 3.3.4add_order..........................................................................................120 3.3.5name...............................................................................................120 3.3.6node...............................................................................................120 3.3.7order_count........................................................................................121 3.3.8order_queue....................................................................................... 121 3.3.9orders_recoverable.................................................................................121 3.3.10remove........................................................................................... 121 3.3.11title................................................................................................122 3.4Job_chain_node........................................................................................122 3.4.1action..............................................................................................122 3.4.2error_node.........................................................................................123 3.4.3error_state......................................................................................... 123 3.4.4job.................................................................................................123 3.4.5next_node..........................................................................................124 3.4.6next_state..........................................................................................124 3.4.7state............................................................................................... 124 3.5Job_impl-SuperClassforaJobortheJobSchedulerScript ............................................124 3.5.1spooler.............................................................................................125 3.5.2spooler_close...................................................................................... 125 3.5.3spooler_exit........................................................................................125 3.5.4spooler_init.........................................................................................126 Software-andOrganisations-ServiceGmbH March2015 JobScheduler:API 9 3.5.5spooler_job.........................................................................................126 3.5.6spooler_log.........................................................................................126 3.5.7spooler_on_error...................................................................................126 3.5.8spooler_on_success................................................................................127 3.5.9spooler_open.......................................................................................127 3.5.10spooler_process.................................................................................. 127 3.5.11spooler_task...................................................................................... 127 3.6Lock....................................................................................................128 3.6.1max_non_exclusive................................................................................ 128 3.6.2name...............................................................................................128 3.6.3remove.............................................................................................129 3.7Locks.................................................................................................. 129 3.7.1add_lock...........................................................................................129 3.7.2create_lock.........................................................................................129 3.7.3lock................................................................................................129 3.7.4lock_or_null........................................................................................130 3.8Log-Logging ..........................................................................................130 3.8.1debug..............................................................................................130 3.8.2debug1.............................................................................................131 3.8.3debug2.............................................................................................131 3.8.4debug3.............................................................................................131 3.8.5debug4.............................................................................................131 3.8.6debug5.............................................................................................131 3.8.7debug6.............................................................................................131 3.8.8debug7.............................................................................................131 3.8.9debug8.............................................................................................132 3.8.10debug9........................................................................................... 132 3.8.11error.............................................................................................. 132 3.8.12filename.......................................................................................... 132 3.8.13info............................................................................................... 132 3.8.14last............................................................................................... 132 3.8.15last_error_line.....................................................................................133 3.8.16level.............................................................................................. 133 3.8.17log................................................................................................134 3.8.18log_file............................................................................................134 3.8.19mail...............................................................................................134 3.8.20mail_it............................................................................................ 134 3.8.21mail_on_error.....................................................................................135 3.8.22mail_on_process..................................................................................135 3.8.23mail_on_success..................................................................................135 3.8.24mail_on_warning..................................................................................136 3.8.25new_filename.....................................................................................136 3.8.26start_new_file.....................................................................................136 3.8.27warn..............................................................................................136 3.9Mail-e-maildispatch .................................................................................. 137 3.9.1add_file............................................................................................ 137 3.9.2add_header_field...................................................................................137 3.9.3bcc.................................................................................................137 3.9.4body............................................................................................... 138 3.9.5cc..................................................................................................138 3.9.6dequeue........................................................................................... 139 3.9.7dequeue_log.......................................................................................139 3.9.8from................................................................................................139 3.9.9queue_dir..........................................................................................140 3.9.10smtp..............................................................................................140 3.9.11subject............................................................................................141 Software-andOrganisations-ServiceGmbH March2015 JobScheduler:API 10 3.9.12to.................................................................................................141 3.9.13xslt_stylesheet....................................................................................142 3.9.14xslt_stylesheet_path...............................................................................142 3.10Monitor_impl-UsingSuperClassesforStartScriptsorJobs .......................................... 142 3.10.1spooler............................................................................................143 3.10.2spooler_job....................................................................................... 143 3.10.3spooler_log....................................................................................... 143 3.10.4spooler_process_after.............................................................................144 3.10.5spooler_process_before...........................................................................144 3.10.6spooler_task......................................................................................145 3.10.7spooler_task_after................................................................................ 145 3.10.8spooler_task_before...............................................................................146 3.11Order-Order .........................................................................................146 3.11.1at................................................................................................. 147 3.11.2end_state......................................................................................... 148 3.11.3id................................................................................................. 148 3.11.4job_chain......................................................................................... 148 3.11.5job_chain_node................................................................................... 149 3.11.6log................................................................................................149 3.11.7params............................................................................................149 3.11.8payload........................................................................................... 149 3.11.9payload_is_type...................................................................................150 3.11.10priority...........................................................................................150 3.11.11remove_from_job_chain..........................................................................150 3.11.12run_time.........................................................................................151 3.11.13setback..........................................................................................151 3.11.14setback_count................................................................................... 151 3.11.15state.............................................................................................151 3.11.16state_text........................................................................................152 3.11.17string_next_start_time............................................................................152 3.11.18suspended.......................................................................................152 3.11.19title.............................................................................................. 153 3.11.20web_service..................................................................................... 153 3.11.21web_service_operation...........................................................................153 3.11.22web_service_operation_or_null...................................................................154 3.11.23web_service_or_null............................................................................. 155 3.11.24xml.............................................................................................. 155 3.11.25xml_payload..................................................................................... 155 3.12Order_queue-Theorderqueueforanordercontrolledjob ............................................ 155 3.12.1length.............................................................................................156 3.13Process_class.........................................................................................156 3.13.1max_processes...................................................................................156 3.13.2name............................................................................................. 156 3.13.3remote_scheduler.................................................................................156 3.13.4remove........................................................................................... 157 3.14Process_classes......................................................................................157 3.14.1add_process_class................................................................................157 3.14.2create_process_class.............................................................................158 3.14.3process_class.....................................................................................158 3.14.4process_class_or_null.............................................................................158 3.15Run_time-ManagingTimeSlotsandStartingTimes...................................................158 3.15.1schedule..........................................................................................159 3.15.2xml............................................................................................... 159 3.16Schedule-Runtime................................................................................... 159 3.16.1xml............................................................................................... 159 3.17Spooler............................................................................................... 160 Software-andOrganisations-ServiceGmbH March2015
Description: