int scanId = 0;
if (recordScan != null) {
scanId = recordScan.getScanId();
}
RecordAlert recordAlert = tableAlert.write(scanId, alert.getPluginId(),
alert.getAlert(), alert.getRisk(), alert.getReliability(),
alert.getDescription(), alert.getUri(), alert.getParam(),
alert.getOtherInfo(), alert.getSolution(),
alert.getReference(), ref.getHistoryId(),
alert.getSourceHistoryId());
alert.setAlertId(recordAlert.getAlertId());
}