You can translate the question and the replies:

How to get "Result" values from jobs in Scheduler

We are trying to get the history detail for each job using the scheduler API. We are able to get the start time using the JobReport.getStartTime p.e. However, we are not able to get the "Result" values (COMPLETE, ERROR etc) for each execution in the report. Please indicate the necessary java classes/methods in order to do it.
user
18-11-2019 10:57:55 -0500
code

6 Answers

Hi, Please, take a look at this past question as I think it might help you do exactly what you are looking for and avoid some problems on the way. [Return code from Denodo Scheduler after job completion](https://community.denodo.com/answers/question/details?questionId=9060g000000g0JHAAY&title=Return+code+from+Denodo+Scheduler+after+job+completion.) Hope this helps!
Denodo Team
19-11-2019 10:18:23 -0500
code
Hi, I saw this answer, but my problem is different. What I want to retrieve is the "result" values from the job historical report, I mean, if I have Job "A" with several executions, I can retrieve the last Result using "getLastResult()" method but, how can I get the previous ones? For example, if three executions ago the job failed, but the last one went fine, I can just retrieve "COMPLETE" using the SchedulerAPI, but I need to get all the other previous values too. Thanks!
user
19-11-2019 10:27:06 -0500
Hi, In case I wanted to get the whole history of executions I would use the interface [JobReport](https://community.denodo.com/docs/html/browse/7.0/scheduler/javadoc/com/denodo/scheduler/client/job/report/JobReport.html). I would get the whole [chunk](https://community.denodo.com/docs/html/browse/7.0/scheduler/javadoc/com/denodo/scheduler/client/job/report/JobReportChunk.html) of reports by using the [method from the interface SchedulerManager](https://community.denodo.com/docs/html/browse/7.0/scheduler/javadoc/com/denodo/scheduler/client/SchedulerManager.html#getJobReports-int-int-int-int-): `getJobReports(int projectID,int jobID,int startIndex,int count)` Then from this [chunk](https://community.denodo.com/docs/html/browse/7.0/scheduler/javadoc/com/denodo/scheduler/client/job/report/JobReportChunk.html) I would extract each JobReport. In the JobReport interface there is no method to access the result per se as in JobData but there are other methods such as *hasErrors()* that would serve the same purpose. I would take a look in more detail how all these methods work in [the API](https://community.denodo.com/docs/html/browse/7.0/scheduler/javadoc/overview-summary.html). Hope this helps!
Denodo Team
26-11-2019 14:07:50 -0500
code
Hi Denodo Team, thanks for confirming that "result" values at report level needs to be calculated and could not be retrieved directly from any Java method :) I will use hasErrors() and hasWarnings() methods to check if everything went fine. On the other hand, I would like to get also the info regarding the Extraction. If I print in java Console the jobReport instance, I get several rows like these ones: Extracted Docs: 3 Extractor Errors: [] Extractor Warnings: [] Exported Docs: {} Exporter Errors: {} Exporter Warnings: {} Exporters with unknown exported tuples: [] But, when I tried to get this information from each jobReport, it is not available. Should I bear in mind any other classes? How can I get the number of rows processed on each execution? Thanks in advance.
user
27-11-2019 09:57:45 -0500
Hi, In order to get the information about the extraction phase I would use the [ExtractionJobReport](https://community.denodo.com/docs/html/browse/7.0/scheduler/javadoc/com/denodo/scheduler/client/job/report/ExtractionJobReport.html) class casting to it from JobReport. Then I could use [getExportedDocs()](https://community.denodo.com/docs/html/browse/7.0/scheduler/javadoc/com/denodo/scheduler/client/job/report/ExtractionJobReport.html#getExportedDocs--) to access the number of exported tuples. Hope this helps!
Denodo Team
04-12-2019 11:42:40 -0500
code
It works, thanks a lot!
user
04-12-2019 12:20:49 -0500
You must sign in to add an answer. If you do not have an account, you can register here