Monday, November 9, 2020

#806 OIC - A Generic Invoke for Scheduled Jobs

 Good Morning to you all on this November 9th.


The customer requirement is as follows - I need to run reports in ERP - format of the call is reportName and dateLastRun.

This information - reportName and dateLast Run - is stored in a DB table on Oracle ATP.

Do I need to have 1 OIC scheduled job for each report?

No - here is a simple example of implementing such.

Here is the generic job executor - all it does is write to FTP 















Granted, doesn't look like much, but this is where you would leverage the ERP adapter to kick off the execution of the report.

The scheduled job parameters - 









Ok, now to the client - this will read from the DB, get the report name and date last run values.

It will then use the OIC REST api to submit the AA-Generic-Scheduler discussed above, passing the appropriate parameter values. 

OIC REST connection definition - 




The Integration itself - 








Assign Vars - 









Note, I have included the report/dateLastRun as well as the target Scheduled Job ID.

I added the WHILE loop just to mimic processing the rows from the ATP DB table, containing the name of the report to be submitted, dateLastRun value etc. The loop will execute 4 times, based on the condition v_count less then 5

Only action is to Invoke the REST API to submit the scheduled job - here is the configuration of the REST connection for this action -

















Mapping - 










I set action to NOW

param1 - p_report / concat(v_report, v_count)

param1 - p_dateLastRunt / concat(v_dateLastRun, v_count)

I then update the counter - and loop again.


Testing

Now to testing -




















No comments:

Post a Comment