@Override protected void onGrdHistorySelectionChanged() throws PresentationLogicException { showDetailsAndTraceTabs(); form.lyrDetails().showtabDetails(); form.lyrDetails().tabDetails().txtDetails().setValue(form.grdHistory().getSelectedRow() != null ? (form.grdHistory().getSelectedRow().getValue() != null ? form.grdHistory().getSelectedRow().getValue().getMessage() : null) : null); form.lyrDetails().tabTrace().grdTrace().getRows().clear(); ConfiguredJobExecutionSummaryVo item = form.grdHistory().getValue(); if(item != null && item.getTraces() != null) { ConfiguredJobExecutionTraceVoCollection list = item.getTraces(); for(int x = 0; x < list.size(); x++) { addTraceItem(list.get(x)); } } if (form.btnRefresh().isVisible()) { form.lyrDetails().showtabTrace(); form.lyrDetails().tabTrace().grdTrace().setValue(form.lyrDetails().tabTrace().grdTrace().getRows().get(form.lyrDetails().tabTrace().grdTrace().getRows().size()-1).getValue()); } }
public void saveExecutionSummaryAndTrace(IConfiguredScheduledJob job, SchedulerJobExecutionSummary summary, SchedulerJobExecutionTrace trace) { ConfiguredJobExecutionSummaryVo record = new ConfiguredJobExecutionSummaryVo(); record.setConfiguredJob(getConfiguredScheduledJobVo(job.getConfiguredScheduledJobID())); record.setStartDateTime(summary.getStartDateTime()); record.setEndDateTime(summary.getEndDateTime()); record.setMessage(summary.getMessage()); record.setStatus(summary.getStatus().getId()); ConfiguredJobExecutionTraceVoCollection traces = new ConfiguredJobExecutionTraceVoCollection(); if(trace != null) { for(int x = 0; x < trace.getTrace().size(); x++) { ITraceRecord traceRecord = trace.getTrace().get(x); ConfiguredJobExecutionTraceVo item = new ConfiguredJobExecutionTraceVo(); item.setDateTime(traceRecord.getDateTime()); item.setMessage(traceRecord.getMessage()); traces.add(item); } } record.setTraces(traces); String[] errors = record.validate(); if(errors != null && errors.length > 0) { throw new RuntimeException("Unable to save the scheduled job execution summary due to validation errors"); } DomainFactory factory = getDomainFactory(); try { factory.save(ConfiguredJobExecutionSummaryVoAssembler.extractConfiguredJobExecutionSummary(factory, record)); } catch (StaleObjectException e) { e.printStackTrace(); } }
@Override protected void onGrdHistorySelectionChanged() throws PresentationLogicException { showDetailsAndTraceTabs(); form.lyrDetails().showtabDetails(); form.lyrDetails().tabDetails().txtDetails().setValue(form.grdHistory().getSelectedRow() != null ? (form.grdHistory().getSelectedRow().getValue() != null ? form.grdHistory().getSelectedRow().getValue().getMessage() : null) : null); form.lyrDetails().tabTrace().grdTrace().getRows().clear(); ConfiguredJobExecutionSummaryVo item = form.grdHistory().getValue(); if(item != null && item.getTraces() != null) { ConfiguredJobExecutionTraceVoCollection list = item.getTraces(); for(int x = 0; x < list.size(); x++) { addTraceItem(list.get(x)); } } if (form.btnRefresh().isVisible()) { form.lyrDetails().showtabTrace(); if (form.lyrDetails().tabTrace().grdTrace().getRows().size() > 0) //WDEV-17838 { form.lyrDetails().tabTrace().grdTrace().setValue(form.lyrDetails().tabTrace().grdTrace().getRows().get(form.lyrDetails().tabTrace().grdTrace().getRows().size()-1).getValue()); } } }
private void loadData() { form.btnRefresh().setVisible(false); form.grdHistory().getRows().clear(); ISchedulerServlet servletInstance = getTaskSchedulerServlet(); ConfiguredJobVo currentJobConfiguration = form.getGlobalContext().Admin.getCurrentJobConfiguration(); ISchedulerJob instance = servletInstance.getJob(currentJobConfiguration.getID_ConfiguredJob()); if (instance != null) { form.btnRefresh().setVisible(true); ConfiguredJobExecutionSummaryVo executionSummary = new ConfiguredJobExecutionSummaryVo(); executionSummary.setMessage("Scheduled job is running."); executionSummary.setStartDateTime(instance.getJobStartDateTime()); if (instance.getExecutionTrace() != null) { List<ITraceRecord> traces = instance.getExecutionTrace().getTrace(); ConfiguredJobExecutionTraceVoCollection coll = new ConfiguredJobExecutionTraceVoCollection(); for (int i = 0; i < traces.size(); i++) { ConfiguredJobExecutionTraceVo vo = new ConfiguredJobExecutionTraceVo(); vo.setMessage(traces.get(i).getMessage()); vo.setDateTime(traces.get(i).getDateTime()); coll.add(vo); } executionSummary.setTraces(coll); } grdHistoryRow row = form.grdHistory().getRows().newRow(); row.setValue(executionSummary); row.setColImage(form.getImages().Core.Time); row.setColStartDateTime(executionSummary.getStartDateTime() == null ? "Unknown" : executionSummary.getStartDateTime().toString()); row.setColEndDateTime(null); row.setColStatus("In Progress"); row.setColMessage(executionSummary.getMessage() == null ? "No details." : executionSummary.getMessage()); } ConfiguredJobExecutionSummaryVoCollection list = domain.getHistory(form.getGlobalContext().Admin.getCurrentJobConfiguration()); for(int x = 0; x < list.size(); x++) { addItem(list.get(x)); } }