Rev 1586 | Rev 1830 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1586 | Rev 1629 | ||
---|---|---|---|
Line 50... | Line 50... | ||
50 | public QuestionarioReportFileGroupImpl runJobGenerate(long reportGroupId,1.5.0/docs/api/java/lang/String.html">String title,boolean active, UserSession session) throws NotAuthorizedException, 1.5.0/docs/api/java/lang/ClassNotFoundException.html">ClassNotFoundException { |
50 | public QuestionarioReportFileGroupImpl runJobGenerate(long reportGroupId,1.5.0/docs/api/java/lang/String.html">String title,boolean active, UserSession session) throws NotAuthorizedException, 1.5.0/docs/api/java/lang/ClassNotFoundException.html">ClassNotFoundException { |
51 | 51 | ||
52 | QuestionarioReportFileGroupImpl reportGroup = (QuestionarioReportFileGroupImpl) DaoFactory.getQuestionarioReportFileGroupDaoImpl().load(reportGroupId); |
52 | QuestionarioReportFileGroupImpl reportGroup = (QuestionarioReportFileGroupImpl) DaoFactory.getQuestionarioReportFileGroupDaoImpl().load(reportGroupId); |
53 | reportGroup.setTitle(title); |
53 | reportGroup.setTitle(title); |
54 | reportGroup.setActive(active); |
54 | reportGroup.setActive(active); |
- | 55 | ||
- | 56 | if(reportGroup.getReportGenerationTaskId() > 0) |
|
- | 57 | { |
|
- | 58 | JobServiceTask serviceTask = DaoFactory.getJobServiceTaskDaoImpl().load(reportGroup.getReportGenerationTaskId()); |
|
- | 59 | if(!serviceTask.isExecuted()) |
|
- | 60 | { |
|
- | 61 | //test 5 minutes |
|
- | 62 | logger.info("Tarefa já em execução"); |
|
- | 63 | if(1.5.0/docs/api/java/lang/System.html">System.currentTimeMillis() - serviceTask.getUpdateDate().getTime() < (60000*5)) |
|
- | 64 | return reportGroup; |
|
- | 65 | } |
|
- | 66 | } |
|
55 | Set<JobServiceTaskParameter> paramsJob = new HashSet<JobServiceTaskParameter>(); |
67 | Set<JobServiceTaskParameter> paramsJob = new HashSet<JobServiceTaskParameter>(); |
56 | 68 | ||
57 | JobServiceTaskParameterImpl paramJob = DomainObjectFactory.createJobServiceTaskParameterImpl(); |
69 | JobServiceTaskParameterImpl paramJob = DomainObjectFactory.createJobServiceTaskParameterImpl(); |
58 | paramJob.setName(ServiceJob.JOB_questionario_report_id_KEY); |
70 | paramJob.setName(ServiceJob.JOB_questionario_report_id_KEY); |
59 | paramJob.setDescription("ID do Report Group"); |
71 | paramJob.setDescription("ID do Report Group"); |