Date: Thu, 28 Mar 2024 10:40:06 +0000 (UTC) Message-ID: <2028363137.11367.1711622406024@change.sos-berlin.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_11366_192459631.1711622406023" ------=_Part_11366_192459631.1711622406023 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
page under construction
The following scenario is given:
If the column value of scenario1.Status =3D =E2=80=9CGO
=E2=80=9D then
Y
For the connection to the Oracle=E2=84=A2 DBMS we use the pl/sql script plsql_script.txt which is executed by the Java adapter class
The pl/sql script is defined as:
declare =09status =09=09=09varchar2(64); =09sourcefilepath =09varchar2(2048); =09sourcefilename =09varchar2(2048); =09targetfilepath =09varchar2(2048); =09targetfilename =09varchar2(2048); =09encryptedyn =09varchar2(16); begin=20 =09select STATUS, SOURCEFILEPATH, SOURCEFILENAME, TARGETFILEPATH, TARGETFIL= ENAME, ENCRYPTEDYN =09into status, sourcefilepath, sourcefilename, targetfilepath, targetfil= ename, encryptedyn =09from scenario1; =09 =09dbms_output.put_line('status=3D' || status); =09dbms_output.put_line('sourcefilepath=3D' || sourcefilepath); =09dbms_output.put_line('sourcefilename=3D' || sourcefilename); =09dbms_output.put_line('targetfilepath=3D' || targetfilepath); =09dbms_output.put_line('targetfilename=3D' || targetfilename); =09dbms_output.put_line('encryptedyn=3D' || encryptedyn); end;
The parameters used by the adapter class are
For the interpretation of the column value of scenario1.Status =
being "GO
" some post-processing routine is used (here programm=
ed in javax.script:rhino)
function = spooler_process_after(spooler_process_result) { var params =3D spooler_task.order().params(); var status =3D params.value("status"); =09=09=09=09=09 if ( status =3D=3D "GO" ) =09{ =09spooler_log.info("Table status is \"GO\", continue!"); =09} else =09{ =09spooler_log.info("Waiting until table status is \"GO\" ..."); =09spooler_task.order().set_state("WAITING"); =09} return spooler_process_result; }
The value of the parameter encryptedyn decides whether the file= is to be encrypted or not. The encryption is done for a local copy of the = file, therefore different steps of the job chain are used. The functions ar= e part of the job checkEncrypted programmed in javax.script:rh= ino.
function= spooler_process() { =09spooler_log.info("------- " + spooler_job.name() + " -------"); =09=09=09=09 =09var encryptedyn =3D spooler_task.order().params().value("encryptedyn"); =09=09=09=09 =09if ( "Y" =3D=3D encryptedyn ) =09{ =09=09spooler_log.info("Encryption required"); =09=09spooler_task.order().set_state("transportSourceToLocal"); =09} =09else if ( "N" =3D=3D encryptedyn ) =09{ =09=09spooler_log.info("No encryption required"); =09=09spooler_task.order().set_state("transportSourceToTarget"); =09} =09else =09{ =09=09spooler_log.error("encryptedyn =3D \"" + encryptedyn + "\" (must be Y= or N)"); =09=09return false; =09} =09return true; }
In case of encryption we use the following steps:
Without encryption only one transfer is used to copy the file from sourc= e to target in step
The transport steps are using the JITL job sos.scheduler.jade.JadeJo= b.
The following parameters are required as per step:
In our example the encryption is only simulated. An own routine may be u= sed here.
A mail is generated to send the YADE history file as an example for a re= port. External report features may be used here. The JITL job sos.s= cheduler.managed.JobSchedulerManagedMailJob is used here to manage= the mail.