Skip to content

Commit

Permalink
Import Status Email to "Extra" config emails: System Error Status
Browse files Browse the repository at this point in the history
When an import gets sub status "System Error", add "With System Error"
to email subject line for the emails sent to the "Extra" configured
emails.
This makes it easier to spot the imports failing with System Error.
  • Loading branch information
danjasuw committed Jun 20, 2019
1 parent 6ebf259 commit 8434437
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
//import org.slf4j.Logger;

import org.yeastrc.xlink.base.file_import_proxl_xml_scans.dto.ProxlXMLFileImportTrackingRunDTO;
import org.yeastrc.xlink.base.file_import_proxl_xml_scans.enum_classes.ProxlXMLFileImportRunSubStatus;
import org.yeastrc.xlink.base.file_import_proxl_xml_scans.enum_classes.ProxlXMLFileImportStatus;

/**
Expand Down Expand Up @@ -54,6 +55,13 @@ public ProxlXMLFileImportTrackingRunDTO populateResultObject(ResultSet rs) throw
returnItem.setProxlXmlFileImportTrackingId( rs.getInt( "proxl_xml_file_import_tracking_id" ) );

returnItem.setRunStatus( ProxlXMLFileImportStatus.fromValue( rs.getInt( "status_id" ) ) );

{
int importer_sub_status_id = rs.getInt( "importer_sub_status_id" );
if ( ! rs.wasNull() ) {
returnItem.setRunSubStatus( ProxlXMLFileImportRunSubStatus.fromValue( importer_sub_status_id ) );
}
}

int insertedSearchId = rs.getInt( "inserted_search_id" );
if ( ! rs.wasNull() ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.yeastrc.xlink.base.config_system_table_common_access.ConfigSystemsKeysSharedConstants;
import org.yeastrc.xlink.base.file_import_proxl_xml_scans.dto.ProxlXMLFileImportTrackingDTO;
import org.yeastrc.xlink.base.file_import_proxl_xml_scans.dto.ProxlXMLFileImportTrackingRunDTO;
import org.yeastrc.xlink.base.file_import_proxl_xml_scans.enum_classes.ProxlXMLFileImportRunSubStatus;
import org.yeastrc.xlink.base.file_import_proxl_xml_scans.enum_classes.ProxlXMLFileImportStatus;
import org.yeastrc.xlink.www.config_system_table.ConfigSystemCaching;
import org.yeastrc.xlink.www.constants.ConfigSystemsKeysConstants;
Expand Down Expand Up @@ -155,6 +156,15 @@ private SendEmailDTO createMailMessageToSend(
+ " tracking status : " + status.toString() );
return null; // EARLY RETURN
}

if ( email_Contents_Control == Email_Contents_Control.FOR_OTHER
&& status == ProxlXMLFileImportStatus.FAILED ) {
ProxlXMLFileImportRunSubStatus proxlXMLFileImportRunSubStatus = proxlXMLFileImportTrackingRunDTO.getRunSubStatus();
if ( proxlXMLFileImportRunSubStatus == ProxlXMLFileImportRunSubStatus.SYSTEM_ERROR ) {
statusText = "failed with System Error";
}
}

String searchPathWithLabel = "";
if ( StringUtils.isNotEmpty( proxlXMLFileImportTrackingDTO.getSearchPath() ) ) {
searchPathWithLabel = "\n\n"
Expand Down

0 comments on commit 8434437

Please sign in to comment.