Date: Thu, 28 Mar 2024 21:52:47 +0000 (UTC) Message-ID: <1723757059.12021.1711662767943@change.sos-berlin.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_12020_1562450689.1711662767943" ------=_Part_12020_1562450689.1711662767943 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
./config/live/issues
&=
nbsp;of your JobScheduler installation.parallel_job_=
instances.
query
job..prepare
job is used to dynamically calculate=
the number of parallel instances of the query
job. This job c=
reates an order parameter parallel_executions=3D5
for use with=
the subsequent generate
job.generate
job implements the solution by creating the n=
umber of orders specified by the parallel_executions
parameter=
.
number_of_orders
: a copy of the parallel_executions<=
/code> parameter.
order_sequence
: the sequence number of the order created. =
The sequence starts from 1 up to the value of the parallel_executions=
parameter.synchronize_required_orders
: the number of orders that the=
synchronize
job waits for. This includes the value of th=
e parallel_executions
parameter incremented by 1 for=
the main order. The prefix synchronize
of the parameter name =
reflects the state that the synchronize
job node is assigned i=
n the job chain.query
job, i.e. the orders will be executed sta=
rting with that state.synchronize
job.query
job is configured for a maximum number of 3 para=
llel tasks via the attribute <job tasks=3D"3">
. It could=
be configured for any number of parallel tasks. For the sake of this sampl=
e the limitation shows the behavior of the job to wait for processes to bec=
ome free that could be assigned to subsequent orders for the same job.synchronize
is used to synchronize splitted o=
rders and is provided by the Sync JITL Job with the Java class com.so=
s.jitl.sync.JobSchedulerSynchronizeJobChainsJSAdapterClass
.
generate
job you can
<include>
element for individual=
job scripts.
<?xml version=3D"1.0" encoding=3D"ISO-8859-1"?> <job order=3D"yes" stop_on_error=3D"no" title=3D"Generate orders for pa= rallel processing" name=3D"generate"> <params > <param name=3D"sync_state_name" value=3D"synchronize"/> </params> <script language=3D"java:javascript"> <![CDATA[ function spooler_process(){ =20 var currentJobChain =3D spooler_task.order.job_chain; var currentJobChainName =3D spooler_task.order.job_chain.name; params =3D spooler.create_variable_set(); params.merge( spooler_task.params ); params.merge( spooler_task.order.params ); var numOfOrders =3D params.value("parallel_executions"); spooler_log.info(" creating " + numOfOrders + " orders"); =20 var syncParameterName =3D currentJobChainName + "_required_orders"; var numOfRequiredOrders =3D parseInt( numOfOrders )+1; params.set_var( syncParameterName, numOfRequiredOrders ); =20 for (var i =3D 1; i <=3D numOfOrders; i++) {=20 var subOrder =3D spooler.create_order() var subParams =3D spooler.create_variable_set(); subParams.set_var( "number_of_orders", numOfOrders ); subParams.set_var( "order_sequence", i ); subParams.set_var( syncParameterName, numOfRequiredOrders ); subOrder.params =3D subParams; subOrder.state =3D spooler_task.order.job_chain_node.next_state; subOrder.end_state =3D params.value( "sync_state_name" ); currentJobChain.add_order( subOrder ); spooler_log.info( "order has been added: " + i ); } spooler_task.order.params.set_var( syncParameterName, numOfRequiredOrders= ); spooler_task.order.state =3D params.value( "sync_state_name" ); return true; } ]]> </script> <run_time /> </job>
parallel_execution
by use o=
f JOC.synchronize
job node.query
job will arriv=
e in the synchronize
job node and will wait for all orders to =
be completed. With all splitted orders being completed the processing will =
continue with the job do_something
.